Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions components/linkup/README.md
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.
111 changes: 111 additions & 0 deletions components/linkup/actions/search/search.mjs
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}`);
}
},
};
13 changes: 10 additions & 3 deletions components/linkup/linkup.app.mjs
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);
},
},
};
7 changes: 5 additions & 2 deletions components/linkup/package.json
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": [
Expand All @@ -11,5 +11,8 @@
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
"publishConfig": {
"access": "public"
},
"dependencies": {
"linkup-sdk": "^1.0.3"
}
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"@sentry/node": "^7.7.0",
"@types/node": "^20.17.6",
"crypto": "^1.0.1",
"linkup-sdk": "^1.0.3",
"uuid": "^8.3.2",
"vue": "^2.6.14"
},
Expand Down
62 changes: 50 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading