-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Feat/add linkup component #15257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
michelle0927
merged 10 commits into
PipedreamHQ:master
from
juliette0704:feat/add_linkup_component
Jan 14, 2025
Merged
Feat/add linkup component #15257
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
810afa8
add linkup component
juliette0704 bcceb56
add pnpm-lock file
juliette0704 6d55d4b
add pnpm-lock file
juliette0704 15b05dc
change methode name
juliette0704 5cf8ed9
Merge branch 'master' into feat/add_linkup_component
juliette0704 5975528
Merge remote-tracking branch 'upstream/master' into feat/add_linkup_c…
michelle0927 7f97ba7
updates
michelle0927 41a04ab
pnpm-lock.yaml
michelle0927 db05386
Merge remote-tracking branch 'upstream/master' into feat/add_linkup_c…
michelle0927 5b3f4c9
pnpm-lock.yaml
michelle0927 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Overview | ||
The Linkup API allows you to access and retrieve high-quality, real-time content from the internet for various use cases, including search, trend analysis, and contextual data gathering. By integrating the Linkup API with Pipedream, you can automate workflows that leverage Linkup's powerful search capabilities, enabling efficient data retrieval, content processing, and integration with other tools and platforms. | ||
|
||
# Example Use Cases | ||
|
||
- **Automated Content Research and Reporting:** Create a workflow that uses the Linkup API to perform automated searches based on specific queries. The results can be processed and stored in Google Sheets or a database for further analysis. This is particularly useful for market research, trend analysis, or competitive intelligence. | ||
|
||
- **Slack Notifications for Trending Topics:** Use Pipedream to set up a workflow that triggers regular searches on trending topics using the Linkup API. The results can then be sent to a Slack channel, keeping your team informed about the latest developments in your industry. | ||
|
||
- **Dynamic Content Generation for Marketing:** Integrate Linkup with a CMS or email marketing platform. Automatically fetch relevant content or insights from the Linkup API and embed them into newsletters, blog posts, or social media updates, ensuring fresh and engaging content for your audience. | ||
|
||
- **Enhanced Customer Support Knowledge Base:** Use the Linkup API to fetch and update relevant, real-time information from trusted sources to enhance your customer support responses or update your knowledge base dynamically. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
import app from "../../linkup.app.mjs"; | ||
|
||
export default { | ||
name: "Linkup Search", | ||
description: "Search and retrieve insights using the Linkup API. [See the documentation](https://docs.linkup.so/pages/api-reference/endpoint/post-search)", | ||
key: "linkup-search", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
app, | ||
query: { | ||
type: "string", | ||
label: "Query", | ||
description: "The search query for Linkup.", | ||
}, | ||
depth: { | ||
type: "string", | ||
label: "Search Depth", | ||
description: "Defines the precision of the search. `standard` returns results quickly; `deep` takes longer but yields more complete results.", | ||
options: [ | ||
"standard", | ||
"deep", | ||
], | ||
}, | ||
outputType: { | ||
type: "string", | ||
label: "Output Type", | ||
description: "The type of output you want to get. Use `structured` for a custom-formatted response defined by `structuredOutputSchema`", | ||
options: [ | ||
{ | ||
value: "sourcedAnswer", | ||
label: "Natural language answer and its sources", | ||
}, | ||
{ | ||
value: "searchResults", | ||
label: "Raw context", | ||
}, | ||
{ | ||
value: "structured", | ||
label: "Json format of the response", | ||
}, | ||
], | ||
reloadProps: true, | ||
}, | ||
structuredOutputSchema: { | ||
type: "string", | ||
label: "Structured Output Schema", | ||
description: "Schema for structured output (only applicable if Output Type is 'structured'). Provide a JSON schema (as a string) representing the desired response format.", | ||
optional: true, | ||
hidden: true, | ||
}, | ||
includeImages: { | ||
type: "boolean", | ||
label: "Include Images", | ||
description: "Defines whether the API should include images in its results", | ||
optional: true, | ||
}, | ||
}, | ||
additionalProps(props) { | ||
if (this.outputType === "structured") { | ||
props.structuredOutputSchema.optional = false; | ||
props.structuredOutputSchema.hidden = false; | ||
props.structuredOutputSchema.default = `{ | ||
"type": "object", | ||
"properties": { | ||
"results": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"type": "string" | ||
}, | ||
"year": { | ||
"type": "number" | ||
} | ||
}, | ||
"required": [ | ||
"name", | ||
"year" | ||
], | ||
"additionalProperties": false | ||
} | ||
} | ||
}, | ||
"required": [ | ||
"results" | ||
], | ||
"additionalProperties": false | ||
}`; | ||
} | ||
return {}; | ||
}, | ||
async run({ $ }) { | ||
try { | ||
const response = await this.app.search({ | ||
query: this.query, | ||
depth: this.depth, | ||
outputType: this.outputType, | ||
structuredOutputSchema: | ||
this.structuredOutputSchema && JSON.parse(this.structuredOutputSchema), | ||
includeImages: this.includeImages, | ||
}); | ||
$.export("$summary", "Successfully completed search query"); | ||
return response; | ||
} catch (error) { | ||
console.error("Error calling Linkup API:", error); | ||
throw new Error(`Failed to fetch data from Linkup API: ${error.message}`); | ||
} | ||
}, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
import { LinkupClient } from "linkup-sdk"; | ||
|
||
export default { | ||
type: "app", | ||
app: "linkup", | ||
propDefinitions: {}, | ||
methods: { | ||
// this.$auth contains connected account data | ||
authKeys() { | ||
console.log(Object.keys(this.$auth)); | ||
_getClient() { | ||
return new LinkupClient({ | ||
apiKey: this.$auth.api_key, | ||
}); | ||
}, | ||
search(params) { | ||
const client = this._getClient(); | ||
return client.search(params); | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
}, | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@pipedream/linkup", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"description": "Pipedream Linkup Components", | ||
"main": "linkup.app.mjs", | ||
"keywords": [ | ||
|
@@ -11,5 +11,8 @@ | |
"author": "Pipedream <[email protected]> (https://pipedream.com/)", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"dependencies": { | ||
"linkup-sdk": "^1.0.3" | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.