Skip to content

add linkup actions #15381

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 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
40 changes: 40 additions & 0 deletions components/linkup/actions/answer/answer.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import app from "../../linkup.app.mjs";

export default {
name: "Linkup Answer",
description: "Get a natural language answer to your natural language question.",
key: "linkup-answer",
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",
],
},
},
async run({ $ }) {
try {
const response = await this.app.search({
query: this.query,
depth: this.depth,
outputType: "sourcedAnswer",
});
$.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}`);
}
},
};
77 changes: 3 additions & 74 deletions components/linkup/actions/search/search.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ 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)",
description: "Retrieve a list of objects relevant to a natural language search query.",
key: "linkup-search",
version: "0.0.1",
version: "0.1.1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Version mismatch detected in answer action component

The version numbers are inconsistent across the Linkup component files:

  • components/linkup/actions/answer/answer.mjs is at version "0.0.1"
  • While package.json and search.mjs are at version "0.1.1"
🔗 Analysis chain

Verify version consistency across files.

The version was updated from "0.0.1" to "0.1.1", skipping "0.1.0". Let's ensure version numbers are consistent across all related files.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check version numbers in component files
echo "Checking version numbers in Linkup component files..."
rg -g '*.{json,mjs}' '"version":\s*"|version:\s*"' components/linkup/

Length of output: 369

type: "action",
props: {
app,
Expand All @@ -22,84 +22,13 @@ export default {
"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,
outputType: "searchResults",
});
$.export("$summary", "Successfully completed search query");
return response;
Expand Down
2 changes: 1 addition & 1 deletion components/linkup/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/linkup",
"version": "0.1.0",
"version": "0.1.1",
"description": "Pipedream Linkup Components",
"main": "linkup.app.mjs",
"keywords": [
Expand Down
Loading