Skip to content

Commit 952648a

Browse files
committed
agentset init
1 parent 0d5fd08 commit 952648a

File tree

7 files changed

+567
-6
lines changed

7 files changed

+567
-6
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import agentset from "../../agentset.app.mjs";
2+
import { axios } from "@pipedream/platform";
3+
4+
export default {
5+
key: "agentset-create-ingest-job",
6+
name: "Create Ingest Job",
7+
description: "Create an ingest job for the authenticated organization. [See the documentation](https://docs.agentset.ai/api-reference/endpoint/ingest-jobs/create)",
8+
version: "0.0.{{ts}}",
9+
type: "action",
10+
props: {
11+
agentset,
12+
namespaceId: {
13+
propDefinition: [
14+
agentset,
15+
"namespaceId",
16+
],
17+
},
18+
payloadType: {
19+
propDefinition: [
20+
agentset,
21+
"payloadType",
22+
],
23+
},
24+
payload: {
25+
propDefinition: [
26+
agentset,
27+
"payload",
28+
],
29+
},
30+
},
31+
async run({ $ }) {
32+
const response = await this.agentset.createIngestJob(this.namespaceId, this.payloadType, this.payload);
33+
$.export("$summary", `Ingest job created successfully: ID ${response.id}`);
34+
return response;
35+
},
36+
};
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
import agentset from "../../agentset.app.mjs";
2+
import { axios } from "@pipedream/platform";
3+
4+
export default {
5+
key: "agentset-create-namespace",
6+
name: "Create Namespace",
7+
description: "Creates a namespace for the authenticated organization. [See the documentation](https://docs.agentset.ai/api-reference/endpoint/namespaces/create)",
8+
version: "0.0.{{ts}}",
9+
type: "action",
10+
props: {
11+
agentset,
12+
name: {
13+
type: "string",
14+
label: "Name",
15+
description: "The name of the namespace to create",
16+
},
17+
slug: {
18+
type: "string",
19+
label: "Slug",
20+
description: "A unique slug for the namespace",
21+
},
22+
embeddingConfigProvider: {
23+
type: "string",
24+
label: "Embedding Config Provider",
25+
description: "Provider for the embedding config",
26+
options: [
27+
"OPENAI",
28+
],
29+
},
30+
embeddingConfigModel: {
31+
type: "string",
32+
label: "Embedding Config Model",
33+
description: "The model for the embedding config",
34+
options: [
35+
"text-embedding-3-small",
36+
"text-embedding-3-large",
37+
],
38+
},
39+
embeddingConfigApiKey: {
40+
type: "string",
41+
label: "Embedding Config API Key",
42+
description: "API key for the embedding config provider",
43+
secret: true,
44+
},
45+
vectorStoreConfigProvider: {
46+
type: "string",
47+
label: "Vector Store Config Provider",
48+
description: "Provider for the vector store config",
49+
options: [
50+
"PINECONE",
51+
],
52+
},
53+
vectorStoreConfigApiKey: {
54+
type: "string",
55+
label: "Vector Store Config API Key",
56+
description: "API key for the vector store",
57+
secret: true,
58+
},
59+
vectorStoreConfigIndexHost: {
60+
type: "string",
61+
label: "Vector Store Config Index Host",
62+
description: "URL of the Pinecone index host",
63+
},
64+
},
65+
async run({ $ }) {
66+
const response = await this.agentset._makeRequest({
67+
method: "POST",
68+
path: "/namespace",
69+
data: {
70+
name: this.name,
71+
slug: this.slug,
72+
embeddingConfig: {
73+
provider: this.embeddingConfigProvider,
74+
model: this.embeddingConfigModel,
75+
apiKey: this.embeddingConfigApiKey,
76+
},
77+
vectorStoreConfig: {
78+
provider: this.vectorStoreConfigProvider,
79+
apiKey: this.vectorStoreConfigApiKey,
80+
indexHost: this.vectorStoreConfigIndexHost,
81+
},
82+
},
83+
});
84+
85+
$.export("$summary", `Successfully created namespace ${response.name}`);
86+
return response;
87+
},
88+
};
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
import agentset from "../../agentset.app.mjs";
2+
import { axios } from "@pipedream/platform";
3+
4+
export default {
5+
key: "agentset-search-namespace",
6+
name: "Agentset Search Namespace",
7+
description: "Complete retrieval pipeline for RAG with semantic search, filtering, and reranking. [See the documentation](https://docs.agentset.ai/api-reference/endpoint/search)",
8+
version: "0.0.{{ts}}",
9+
type: "action",
10+
props: {
11+
agentset,
12+
namespaceId: {
13+
propDefinition: [
14+
agentset,
15+
"namespaceId",
16+
],
17+
},
18+
query: {
19+
type: "string",
20+
label: "Query",
21+
description: "The query for semantic search",
22+
},
23+
topK: {
24+
type: "integer",
25+
label: "Top K",
26+
description: "Number of top documents to return",
27+
optional: true,
28+
},
29+
rerank: {
30+
type: "boolean",
31+
label: "Rerank",
32+
description: "Rerank documents based on query",
33+
optional: true,
34+
},
35+
rerankLimit: {
36+
type: "integer",
37+
label: "Rerank Limit",
38+
description: "Limit for reranking documents",
39+
optional: true,
40+
},
41+
filter: {
42+
type: "string",
43+
label: "Filter",
44+
description: "Filter to apply to search results",
45+
optional: true,
46+
},
47+
minScore: {
48+
type: "number",
49+
label: "Minimum Score",
50+
description: "Minimum score threshold for results",
51+
optional: true,
52+
},
53+
includeRelationship: {
54+
type: "boolean",
55+
label: "Include Relationship",
56+
description: "Include relationship data in results",
57+
optional: true,
58+
},
59+
includeMetadata: {
60+
type: "boolean",
61+
label: "Include Metadata",
62+
description: "Include metadata in results",
63+
optional: true,
64+
},
65+
},
66+
async run({ $ }) {
67+
const response = await this.agentset.searchNamespace(this.namespaceId, this.query, {
68+
topK: this.topK,
69+
rerank: this.rerank,
70+
rerankLimit: this.rerankLimit,
71+
filter: this.filter,
72+
minScore: this.minScore,
73+
includeRelationships: this.includeRelationship,
74+
includeMetadata: this.includeMetadata,
75+
});
76+
77+
$.export("$summary", `Successfully completed the search for query: "${this.query}"`);
78+
return response;
79+
},
80+
};

0 commit comments

Comments
 (0)