@zavudev/sdk 0.16.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/client.d.mts +11 -5
- package/client.d.mts.map +1 -1
- package/client.d.ts +11 -5
- package/client.d.ts.map +1 -1
- package/client.js +7 -1
- package/client.js.map +1 -1
- package/client.mjs +7 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/addresses.d.mts +104 -0
- package/resources/addresses.d.mts.map +1 -0
- package/resources/addresses.d.ts +104 -0
- package/resources/addresses.d.ts.map +1 -0
- package/resources/addresses.js +72 -0
- package/resources/addresses.js.map +1 -0
- package/resources/addresses.mjs +68 -0
- package/resources/addresses.mjs.map +1 -0
- package/resources/broadcasts/broadcasts.d.mts +27 -5
- package/resources/broadcasts/broadcasts.d.mts.map +1 -1
- package/resources/broadcasts/broadcasts.d.ts +27 -5
- package/resources/broadcasts/broadcasts.d.ts.map +1 -1
- package/resources/broadcasts/broadcasts.js +15 -0
- package/resources/broadcasts/broadcasts.js.map +1 -1
- package/resources/broadcasts/broadcasts.mjs +15 -0
- package/resources/broadcasts/broadcasts.mjs.map +1 -1
- package/resources/broadcasts/index.d.mts +1 -1
- package/resources/broadcasts/index.d.mts.map +1 -1
- package/resources/broadcasts/index.d.ts +1 -1
- package/resources/broadcasts/index.d.ts.map +1 -1
- package/resources/broadcasts/index.js.map +1 -1
- package/resources/broadcasts/index.mjs.map +1 -1
- package/resources/index.d.mts +5 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +5 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +6 -2
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -1
- package/resources/index.mjs.map +1 -1
- package/resources/phone-numbers.d.mts +67 -1
- package/resources/phone-numbers.d.mts.map +1 -1
- package/resources/phone-numbers.d.ts +67 -1
- package/resources/phone-numbers.d.ts.map +1 -1
- package/resources/phone-numbers.js +15 -0
- package/resources/phone-numbers.js.map +1 -1
- package/resources/phone-numbers.mjs +15 -0
- package/resources/phone-numbers.mjs.map +1 -1
- package/resources/regulatory-documents.d.mts +114 -0
- package/resources/regulatory-documents.d.mts.map +1 -0
- package/resources/regulatory-documents.d.ts +114 -0
- package/resources/regulatory-documents.d.ts.map +1 -0
- package/resources/regulatory-documents.js +84 -0
- package/resources/regulatory-documents.js.map +1 -0
- package/resources/regulatory-documents.mjs +80 -0
- package/resources/regulatory-documents.mjs.map +1 -0
- package/resources/senders/agent/agent.d.mts +230 -0
- package/resources/senders/agent/agent.d.mts.map +1 -0
- package/resources/senders/agent/agent.d.ts +230 -0
- package/resources/senders/agent/agent.d.ts.map +1 -0
- package/resources/senders/agent/agent.js +105 -0
- package/resources/senders/agent/agent.js.map +1 -0
- package/resources/senders/agent/agent.mjs +100 -0
- package/resources/senders/agent/agent.mjs.map +1 -0
- package/resources/senders/agent/executions.d.mts +32 -0
- package/resources/senders/agent/executions.d.mts.map +1 -0
- package/resources/senders/agent/executions.d.ts +32 -0
- package/resources/senders/agent/executions.d.ts.map +1 -0
- package/resources/senders/agent/executions.js +27 -0
- package/resources/senders/agent/executions.js.map +1 -0
- package/resources/senders/agent/executions.mjs +23 -0
- package/resources/senders/agent/executions.mjs.map +1 -0
- package/resources/senders/agent/flows.d.mts +301 -0
- package/resources/senders/agent/flows.d.mts.map +1 -0
- package/resources/senders/agent/flows.d.ts +301 -0
- package/resources/senders/agent/flows.d.ts.map +1 -0
- package/resources/senders/agent/flows.js +135 -0
- package/resources/senders/agent/flows.js.map +1 -0
- package/resources/senders/agent/flows.mjs +131 -0
- package/resources/senders/agent/flows.mjs.map +1 -0
- package/resources/senders/agent/index.d.mts +6 -0
- package/resources/senders/agent/index.d.mts.map +1 -0
- package/resources/senders/agent/index.d.ts +6 -0
- package/resources/senders/agent/index.d.ts.map +1 -0
- package/resources/senders/agent/index.js +15 -0
- package/resources/senders/agent/index.js.map +1 -0
- package/resources/senders/agent/index.mjs +7 -0
- package/resources/senders/agent/index.mjs.map +1 -0
- package/resources/senders/agent/knowledge-bases/documents.d.mts +86 -0
- package/resources/senders/agent/knowledge-bases/documents.d.mts.map +1 -0
- package/resources/senders/agent/knowledge-bases/documents.d.ts +86 -0
- package/resources/senders/agent/knowledge-bases/documents.d.ts.map +1 -0
- package/resources/senders/agent/knowledge-bases/documents.js +70 -0
- package/resources/senders/agent/knowledge-bases/documents.js.map +1 -0
- package/resources/senders/agent/knowledge-bases/documents.mjs +66 -0
- package/resources/senders/agent/knowledge-bases/documents.mjs.map +1 -0
- package/resources/senders/agent/knowledge-bases/index.d.mts +3 -0
- package/resources/senders/agent/knowledge-bases/index.d.mts.map +1 -0
- package/resources/senders/agent/knowledge-bases/index.d.ts +3 -0
- package/resources/senders/agent/knowledge-bases/index.d.ts.map +1 -0
- package/resources/senders/agent/knowledge-bases/index.js +9 -0
- package/resources/senders/agent/knowledge-bases/index.js.map +1 -0
- package/resources/senders/agent/knowledge-bases/index.mjs +4 -0
- package/resources/senders/agent/knowledge-bases/index.mjs.map +1 -0
- package/resources/senders/agent/knowledge-bases/knowledge-bases.d.mts +147 -0
- package/resources/senders/agent/knowledge-bases/knowledge-bases.d.mts.map +1 -0
- package/resources/senders/agent/knowledge-bases/knowledge-bases.d.ts +147 -0
- package/resources/senders/agent/knowledge-bases/knowledge-bases.d.ts.map +1 -0
- package/resources/senders/agent/knowledge-bases/knowledge-bases.js +106 -0
- package/resources/senders/agent/knowledge-bases/knowledge-bases.js.map +1 -0
- package/resources/senders/agent/knowledge-bases/knowledge-bases.mjs +101 -0
- package/resources/senders/agent/knowledge-bases/knowledge-bases.mjs.map +1 -0
- package/resources/senders/agent/knowledge-bases.d.mts +2 -0
- package/resources/senders/agent/knowledge-bases.d.mts.map +1 -0
- package/resources/senders/agent/knowledge-bases.d.ts +2 -0
- package/resources/senders/agent/knowledge-bases.d.ts.map +1 -0
- package/resources/senders/agent/knowledge-bases.js +6 -0
- package/resources/senders/agent/knowledge-bases.js.map +1 -0
- package/resources/senders/agent/knowledge-bases.mjs +3 -0
- package/resources/senders/agent/knowledge-bases.mjs.map +1 -0
- package/resources/senders/agent/tools.d.mts +242 -0
- package/resources/senders/agent/tools.d.mts.map +1 -0
- package/resources/senders/agent/tools.d.ts +242 -0
- package/resources/senders/agent/tools.d.ts.map +1 -0
- package/resources/senders/agent/tools.js +126 -0
- package/resources/senders/agent/tools.js.map +1 -0
- package/resources/senders/agent/tools.mjs +122 -0
- package/resources/senders/agent/tools.mjs.map +1 -0
- package/resources/senders/agent.d.mts +2 -0
- package/resources/senders/agent.d.mts.map +1 -0
- package/resources/senders/agent.d.ts +2 -0
- package/resources/senders/agent.d.ts.map +1 -0
- package/resources/senders/agent.js +6 -0
- package/resources/senders/agent.js.map +1 -0
- package/resources/senders/agent.mjs +3 -0
- package/resources/senders/agent.mjs.map +1 -0
- package/resources/senders/index.d.mts +3 -0
- package/resources/senders/index.d.mts.map +1 -0
- package/resources/senders/index.d.ts +3 -0
- package/resources/senders/index.d.ts.map +1 -0
- package/resources/senders/index.js +9 -0
- package/resources/senders/index.js.map +1 -0
- package/resources/senders/index.mjs +4 -0
- package/resources/senders/index.mjs.map +1 -0
- package/resources/senders/senders.d.mts +342 -0
- package/resources/senders/senders.d.mts.map +1 -0
- package/resources/senders/senders.d.ts +342 -0
- package/resources/senders/senders.d.ts.map +1 -0
- package/resources/senders/senders.js +150 -0
- package/resources/senders/senders.js.map +1 -0
- package/resources/senders/senders.mjs +145 -0
- package/resources/senders/senders.mjs.map +1 -0
- package/resources/senders.d.mts +1 -337
- package/resources/senders.d.mts.map +1 -1
- package/resources/senders.d.ts +1 -337
- package/resources/senders.d.ts.map +1 -1
- package/resources/senders.js +2 -138
- package/resources/senders.js.map +1 -1
- package/resources/senders.mjs +1 -136
- package/resources/senders.mjs.map +1 -1
- package/src/client.ts +79 -17
- package/src/resources/addresses.ts +160 -0
- package/src/resources/broadcasts/broadcasts.ts +37 -4
- package/src/resources/broadcasts/index.ts +2 -0
- package/src/resources/index.ts +29 -1
- package/src/resources/phone-numbers.ts +97 -0
- package/src/resources/regulatory-documents.ts +184 -0
- package/src/resources/senders/agent/agent.ts +417 -0
- package/src/resources/senders/agent/executions.ts +48 -0
- package/src/resources/senders/agent/flows.ts +409 -0
- package/src/resources/senders/agent/index.ts +60 -0
- package/src/resources/senders/agent/knowledge-bases/documents.ts +133 -0
- package/src/resources/senders/agent/knowledge-bases/index.ts +24 -0
- package/src/resources/senders/agent/knowledge-bases/knowledge-bases.ts +251 -0
- package/src/resources/senders/agent/knowledge-bases.ts +3 -0
- package/src/resources/senders/agent/tools.ts +334 -0
- package/src/resources/senders/agent.ts +3 -0
- package/src/resources/senders/index.ts +32 -0
- package/src/resources/senders/senders.ts +506 -0
- package/src/resources/senders.ts +1 -476
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { APIResource } from "../../../../core/resource.js";
|
|
2
|
+
import * as DocumentsAPI from "./documents.js";
|
|
3
|
+
import { DocumentCreateParams, DocumentCreateResponse, DocumentDeleteParams, DocumentListParams, Documents } from "./documents.js";
|
|
4
|
+
import { APIPromise } from "../../../../core/api-promise.js";
|
|
5
|
+
import { Cursor, type CursorParams, PagePromise } from "../../../../core/pagination.js";
|
|
6
|
+
import { RequestOptions } from "../../../../internal/request-options.js";
|
|
7
|
+
export declare class KnowledgeBases extends APIResource {
|
|
8
|
+
documents: DocumentsAPI.Documents;
|
|
9
|
+
/**
|
|
10
|
+
* Create a new knowledge base for an agent.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const knowledgeBase =
|
|
15
|
+
* await client.senders.agent.knowledgeBases.create(
|
|
16
|
+
* 'senderId',
|
|
17
|
+
* {
|
|
18
|
+
* name: 'Product FAQ',
|
|
19
|
+
* description:
|
|
20
|
+
* 'Frequently asked questions about our products',
|
|
21
|
+
* },
|
|
22
|
+
* );
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
create(senderID: string, body: KnowledgeBaseCreateParams, options?: RequestOptions): APIPromise<KnowledgeBaseCreateResponse>;
|
|
26
|
+
/**
|
|
27
|
+
* Get a specific knowledge base.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const knowledgeBase =
|
|
32
|
+
* await client.senders.agent.knowledgeBases.retrieve(
|
|
33
|
+
* 'kbId',
|
|
34
|
+
* { senderId: 'senderId' },
|
|
35
|
+
* );
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
retrieve(kbID: string, params: KnowledgeBaseRetrieveParams, options?: RequestOptions): APIPromise<KnowledgeBaseRetrieveResponse>;
|
|
39
|
+
/**
|
|
40
|
+
* Update a knowledge base.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const knowledgeBase =
|
|
45
|
+
* await client.senders.agent.knowledgeBases.update('kbId', {
|
|
46
|
+
* senderId: 'senderId',
|
|
47
|
+
* });
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
update(kbID: string, params: KnowledgeBaseUpdateParams, options?: RequestOptions): APIPromise<KnowledgeBaseUpdateResponse>;
|
|
51
|
+
/**
|
|
52
|
+
* List knowledge bases for an agent.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* // Automatically fetches more pages as needed.
|
|
57
|
+
* for await (const agentKnowledgeBase of client.senders.agent.knowledgeBases.list(
|
|
58
|
+
* 'senderId',
|
|
59
|
+
* )) {
|
|
60
|
+
* // ...
|
|
61
|
+
* }
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
list(senderID: string, query?: KnowledgeBaseListParams | null | undefined, options?: RequestOptions): PagePromise<AgentKnowledgeBasesCursor, AgentKnowledgeBase>;
|
|
65
|
+
/**
|
|
66
|
+
* Delete a knowledge base and all its documents.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```ts
|
|
70
|
+
* await client.senders.agent.knowledgeBases.delete('kbId', {
|
|
71
|
+
* senderId: 'senderId',
|
|
72
|
+
* });
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
delete(kbID: string, params: KnowledgeBaseDeleteParams, options?: RequestOptions): APIPromise<void>;
|
|
76
|
+
}
|
|
77
|
+
export type AgentKnowledgeBasesCursor = Cursor<AgentKnowledgeBase>;
|
|
78
|
+
export type AgentDocumentsCursor = Cursor<AgentDocument>;
|
|
79
|
+
export interface AgentDocument {
|
|
80
|
+
id: string;
|
|
81
|
+
/**
|
|
82
|
+
* Number of chunks created from this document.
|
|
83
|
+
*/
|
|
84
|
+
chunkCount: number;
|
|
85
|
+
/**
|
|
86
|
+
* Length of the document content in characters.
|
|
87
|
+
*/
|
|
88
|
+
contentLength: number;
|
|
89
|
+
createdAt: string;
|
|
90
|
+
/**
|
|
91
|
+
* Whether the document has been processed for RAG.
|
|
92
|
+
*/
|
|
93
|
+
isProcessed: boolean;
|
|
94
|
+
knowledgeBaseId: string;
|
|
95
|
+
title: string;
|
|
96
|
+
updatedAt: string;
|
|
97
|
+
}
|
|
98
|
+
export interface AgentKnowledgeBase {
|
|
99
|
+
id: string;
|
|
100
|
+
agentId: string;
|
|
101
|
+
createdAt: string;
|
|
102
|
+
documentCount: number;
|
|
103
|
+
name: string;
|
|
104
|
+
totalChunks: number;
|
|
105
|
+
updatedAt: string;
|
|
106
|
+
description?: string | null;
|
|
107
|
+
}
|
|
108
|
+
export interface KnowledgeBaseCreateResponse {
|
|
109
|
+
knowledgeBase: AgentKnowledgeBase;
|
|
110
|
+
}
|
|
111
|
+
export interface KnowledgeBaseRetrieveResponse {
|
|
112
|
+
knowledgeBase: AgentKnowledgeBase;
|
|
113
|
+
}
|
|
114
|
+
export interface KnowledgeBaseUpdateResponse {
|
|
115
|
+
knowledgeBase: AgentKnowledgeBase;
|
|
116
|
+
}
|
|
117
|
+
export interface KnowledgeBaseCreateParams {
|
|
118
|
+
name: string;
|
|
119
|
+
description?: string;
|
|
120
|
+
}
|
|
121
|
+
export interface KnowledgeBaseRetrieveParams {
|
|
122
|
+
senderId: string;
|
|
123
|
+
}
|
|
124
|
+
export interface KnowledgeBaseUpdateParams {
|
|
125
|
+
/**
|
|
126
|
+
* Path param:
|
|
127
|
+
*/
|
|
128
|
+
senderId: string;
|
|
129
|
+
/**
|
|
130
|
+
* Body param:
|
|
131
|
+
*/
|
|
132
|
+
description?: string | null;
|
|
133
|
+
/**
|
|
134
|
+
* Body param:
|
|
135
|
+
*/
|
|
136
|
+
name?: string;
|
|
137
|
+
}
|
|
138
|
+
export interface KnowledgeBaseListParams extends CursorParams {
|
|
139
|
+
}
|
|
140
|
+
export interface KnowledgeBaseDeleteParams {
|
|
141
|
+
senderId: string;
|
|
142
|
+
}
|
|
143
|
+
export declare namespace KnowledgeBases {
|
|
144
|
+
export { type AgentDocument as AgentDocument, type AgentKnowledgeBase as AgentKnowledgeBase, type KnowledgeBaseCreateResponse as KnowledgeBaseCreateResponse, type KnowledgeBaseRetrieveResponse as KnowledgeBaseRetrieveResponse, type KnowledgeBaseUpdateResponse as KnowledgeBaseUpdateResponse, type AgentKnowledgeBasesCursor as AgentKnowledgeBasesCursor, type KnowledgeBaseCreateParams as KnowledgeBaseCreateParams, type KnowledgeBaseRetrieveParams as KnowledgeBaseRetrieveParams, type KnowledgeBaseUpdateParams as KnowledgeBaseUpdateParams, type KnowledgeBaseListParams as KnowledgeBaseListParams, type KnowledgeBaseDeleteParams as KnowledgeBaseDeleteParams, };
|
|
145
|
+
export { Documents as Documents, type DocumentCreateResponse as DocumentCreateResponse, type DocumentCreateParams as DocumentCreateParams, type DocumentListParams as DocumentListParams, type DocumentDeleteParams as DocumentDeleteParams, };
|
|
146
|
+
}
|
|
147
|
+
//# sourceMappingURL=knowledge-bases.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge-bases.d.ts","sourceRoot":"","sources":["../../../../src/resources/senders/agent/knowledge-bases/knowledge-bases.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,YAAY;OACjB,EACL,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,SAAS,EACV;OACM,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE;OAE1C,EAAE,cAAc,EAAE;AAGzB,qBAAa,cAAe,SAAQ,WAAW;IAC7C,SAAS,EAAE,YAAY,CAAC,SAAS,CAA4C;IAE7E;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CACJ,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,yBAAyB,EAC/B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,2BAA2B,CAAC;IAI1C;;;;;;;;;;;OAWG;IACH,QAAQ,CACN,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,2BAA2B,EACnC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,6BAA6B,CAAC;IAK5C;;;;;;;;;;OAUG;IACH,MAAM,CACJ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,yBAAyB,EACjC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,2BAA2B,CAAC;IAQ1C;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,QAAQ,EAAE,MAAM,EAChB,KAAK,GAAE,uBAAuB,GAAG,IAAI,GAAG,SAAc,EACtD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,yBAAyB,EAAE,kBAAkB,CAAC;IAQ7D;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,yBAAyB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAOpG;AAED,MAAM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AI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,uBAAwB,SAAQ,YAAY;CAAG;AAEhE,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAID,MAAM,CAAC,OAAO,WAAW,cAAc,CAAC;IACtC,OAAO,EACL,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,yBAAyB,IAAI,yBAAyB,GAC5D,CAAC;IAEF,OAAO,EACL,SAAS,IAAI,SAAS,EACtB,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.KnowledgeBases = void 0;
|
|
5
|
+
const tslib_1 = require("../../../../internal/tslib.js");
|
|
6
|
+
const resource_1 = require("../../../../core/resource.js");
|
|
7
|
+
const DocumentsAPI = tslib_1.__importStar(require("./documents.js"));
|
|
8
|
+
const documents_1 = require("./documents.js");
|
|
9
|
+
const pagination_1 = require("../../../../core/pagination.js");
|
|
10
|
+
const headers_1 = require("../../../../internal/headers.js");
|
|
11
|
+
const path_1 = require("../../../../internal/utils/path.js");
|
|
12
|
+
class KnowledgeBases extends resource_1.APIResource {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.documents = new DocumentsAPI.Documents(this._client);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Create a new knowledge base for an agent.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* const knowledgeBase =
|
|
23
|
+
* await client.senders.agent.knowledgeBases.create(
|
|
24
|
+
* 'senderId',
|
|
25
|
+
* {
|
|
26
|
+
* name: 'Product FAQ',
|
|
27
|
+
* description:
|
|
28
|
+
* 'Frequently asked questions about our products',
|
|
29
|
+
* },
|
|
30
|
+
* );
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
create(senderID, body, options) {
|
|
34
|
+
return this._client.post((0, path_1.path) `/v1/senders/${senderID}/agent/knowledge-bases`, { body, ...options });
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Get a specific knowledge base.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const knowledgeBase =
|
|
42
|
+
* await client.senders.agent.knowledgeBases.retrieve(
|
|
43
|
+
* 'kbId',
|
|
44
|
+
* { senderId: 'senderId' },
|
|
45
|
+
* );
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
retrieve(kbID, params, options) {
|
|
49
|
+
const { senderId } = params;
|
|
50
|
+
return this._client.get((0, path_1.path) `/v1/senders/${senderId}/agent/knowledge-bases/${kbID}`, options);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Update a knowledge base.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* const knowledgeBase =
|
|
58
|
+
* await client.senders.agent.knowledgeBases.update('kbId', {
|
|
59
|
+
* senderId: 'senderId',
|
|
60
|
+
* });
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
update(kbID, params, options) {
|
|
64
|
+
const { senderId, ...body } = params;
|
|
65
|
+
return this._client.patch((0, path_1.path) `/v1/senders/${senderId}/agent/knowledge-bases/${kbID}`, {
|
|
66
|
+
body,
|
|
67
|
+
...options,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* List knowledge bases for an agent.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* // Automatically fetches more pages as needed.
|
|
76
|
+
* for await (const agentKnowledgeBase of client.senders.agent.knowledgeBases.list(
|
|
77
|
+
* 'senderId',
|
|
78
|
+
* )) {
|
|
79
|
+
* // ...
|
|
80
|
+
* }
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
list(senderID, query = {}, options) {
|
|
84
|
+
return this._client.getAPIList((0, path_1.path) `/v1/senders/${senderID}/agent/knowledge-bases`, (pagination_1.Cursor), { query, ...options });
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Delete a knowledge base and all its documents.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```ts
|
|
91
|
+
* await client.senders.agent.knowledgeBases.delete('kbId', {
|
|
92
|
+
* senderId: 'senderId',
|
|
93
|
+
* });
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
delete(kbID, params, options) {
|
|
97
|
+
const { senderId } = params;
|
|
98
|
+
return this._client.delete((0, path_1.path) `/v1/senders/${senderId}/agent/knowledge-bases/${kbID}`, {
|
|
99
|
+
...options,
|
|
100
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
exports.KnowledgeBases = KnowledgeBases;
|
|
105
|
+
KnowledgeBases.Documents = documents_1.Documents;
|
|
106
|
+
//# sourceMappingURL=knowledge-bases.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":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,CAAC,UAAU,CAC5B,IAAA,WAAI,EAAA,eAAe,QAAQ,wBAAwB,EACnD,CAAA,mBAA0B,CAAA,EAC1B,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAY,EAAE,MAAiC,EAAE,OAAwB;QAC9E,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,eAAe,QAAQ,0BAA0B,IAAI,EAAE,EAAE;YACtF,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF;AAjHD,wCAiHC;AAgGD,cAAc,CAAC,SAAS,GAAG,qBAAS,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../../../core/resource.mjs";
|
|
3
|
+
import * as DocumentsAPI from "./documents.mjs";
|
|
4
|
+
import { Documents, } from "./documents.mjs";
|
|
5
|
+
import { Cursor } from "../../../../core/pagination.mjs";
|
|
6
|
+
import { buildHeaders } from "../../../../internal/headers.mjs";
|
|
7
|
+
import { path } from "../../../../internal/utils/path.mjs";
|
|
8
|
+
export class KnowledgeBases extends APIResource {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.documents = new DocumentsAPI.Documents(this._client);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Create a new knowledge base for an agent.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const knowledgeBase =
|
|
19
|
+
* await client.senders.agent.knowledgeBases.create(
|
|
20
|
+
* 'senderId',
|
|
21
|
+
* {
|
|
22
|
+
* name: 'Product FAQ',
|
|
23
|
+
* description:
|
|
24
|
+
* 'Frequently asked questions about our products',
|
|
25
|
+
* },
|
|
26
|
+
* );
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
create(senderID, body, options) {
|
|
30
|
+
return this._client.post(path `/v1/senders/${senderID}/agent/knowledge-bases`, { body, ...options });
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get a specific knowledge base.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* const knowledgeBase =
|
|
38
|
+
* await client.senders.agent.knowledgeBases.retrieve(
|
|
39
|
+
* 'kbId',
|
|
40
|
+
* { senderId: 'senderId' },
|
|
41
|
+
* );
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
retrieve(kbID, params, options) {
|
|
45
|
+
const { senderId } = params;
|
|
46
|
+
return this._client.get(path `/v1/senders/${senderId}/agent/knowledge-bases/${kbID}`, options);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Update a knowledge base.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* const knowledgeBase =
|
|
54
|
+
* await client.senders.agent.knowledgeBases.update('kbId', {
|
|
55
|
+
* senderId: 'senderId',
|
|
56
|
+
* });
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
update(kbID, params, options) {
|
|
60
|
+
const { senderId, ...body } = params;
|
|
61
|
+
return this._client.patch(path `/v1/senders/${senderId}/agent/knowledge-bases/${kbID}`, {
|
|
62
|
+
body,
|
|
63
|
+
...options,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* List knowledge bases for an agent.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* // Automatically fetches more pages as needed.
|
|
72
|
+
* for await (const agentKnowledgeBase of client.senders.agent.knowledgeBases.list(
|
|
73
|
+
* 'senderId',
|
|
74
|
+
* )) {
|
|
75
|
+
* // ...
|
|
76
|
+
* }
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
list(senderID, query = {}, options) {
|
|
80
|
+
return this._client.getAPIList(path `/v1/senders/${senderID}/agent/knowledge-bases`, (Cursor), { query, ...options });
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Delete a knowledge base and all its documents.
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```ts
|
|
87
|
+
* await client.senders.agent.knowledgeBases.delete('kbId', {
|
|
88
|
+
* senderId: 'senderId',
|
|
89
|
+
* });
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
delete(kbID, params, options) {
|
|
93
|
+
const { senderId } = params;
|
|
94
|
+
return this._client.delete(path `/v1/senders/${senderId}/agent/knowledge-bases/${kbID}`, {
|
|
95
|
+
...options,
|
|
96
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
KnowledgeBases.Documents = Documents;
|
|
101
|
+
//# sourceMappingURL=knowledge-bases.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge-bases.mjs","sourceRoot":"","sources":["../../../../src/resources/senders/agent/knowledge-bases/knowledge-bases.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,YAAY;OACjB,EAKL,SAAS,GACV;OAEM,EAAE,MAAM,EAAkC;OAC1C,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,cAAe,SAAQ,WAAW;IAA/C;;QACE,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAgH/E,CAAC;IA9GC;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CACJ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AAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF;AAgGD,cAAc,CAAC,SAAS,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge-bases.d.mts","sourceRoot":"","sources":["../../../src/resources/senders/agent/knowledge-bases.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge-bases.d.ts","sourceRoot":"","sources":["../../../src/resources/senders/agent/knowledge-bases.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const tslib_1 = require("../../../internal/tslib.js");
|
|
5
|
+
tslib_1.__exportStar(require("./knowledge-bases/index.js"), exports);
|
|
6
|
+
//# sourceMappingURL=knowledge-bases.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge-bases.js","sourceRoot":"","sources":["../../../src/resources/senders/agent/knowledge-bases.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qEAAwC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge-bases.mjs","sourceRoot":"","sources":["../../../src/resources/senders/agent/knowledge-bases.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../../../core/api-promise.mjs";
|
|
3
|
+
import { Cursor, type CursorParams, PagePromise } from "../../../core/pagination.mjs";
|
|
4
|
+
import { RequestOptions } from "../../../internal/request-options.mjs";
|
|
5
|
+
export declare class Tools extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Create a new tool for an agent. Tools allow the agent to call external webhooks.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const tool = await client.senders.agent.tools.create(
|
|
12
|
+
* 'senderId',
|
|
13
|
+
* {
|
|
14
|
+
* description: 'Get the status of a customer order',
|
|
15
|
+
* name: 'get_order_status',
|
|
16
|
+
* parameters: {
|
|
17
|
+
* type: 'object',
|
|
18
|
+
* properties: {
|
|
19
|
+
* order_id: {
|
|
20
|
+
* type: 'string',
|
|
21
|
+
* description: 'The order ID to look up',
|
|
22
|
+
* },
|
|
23
|
+
* },
|
|
24
|
+
* required: ['order_id'],
|
|
25
|
+
* },
|
|
26
|
+
* webhookUrl:
|
|
27
|
+
* 'https://api.example.com/webhooks/order-status',
|
|
28
|
+
* webhookSecret: 'whsec_...',
|
|
29
|
+
* },
|
|
30
|
+
* );
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
create(senderID: string, body: ToolCreateParams, options?: RequestOptions): APIPromise<ToolCreateResponse>;
|
|
34
|
+
/**
|
|
35
|
+
* Get a specific tool.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const tool = await client.senders.agent.tools.retrieve(
|
|
40
|
+
* 'toolId',
|
|
41
|
+
* { senderId: 'senderId' },
|
|
42
|
+
* );
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
retrieve(toolID: string, params: ToolRetrieveParams, options?: RequestOptions): APIPromise<ToolRetrieveResponse>;
|
|
46
|
+
/**
|
|
47
|
+
* Update a tool.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const tool = await client.senders.agent.tools.update(
|
|
52
|
+
* 'toolId',
|
|
53
|
+
* { senderId: 'senderId' },
|
|
54
|
+
* );
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
update(toolID: string, params: ToolUpdateParams, options?: RequestOptions): APIPromise<ToolUpdateResponse>;
|
|
58
|
+
/**
|
|
59
|
+
* List tools for an agent.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* // Automatically fetches more pages as needed.
|
|
64
|
+
* for await (const agentTool of client.senders.agent.tools.list(
|
|
65
|
+
* 'senderId',
|
|
66
|
+
* )) {
|
|
67
|
+
* // ...
|
|
68
|
+
* }
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
list(senderID: string, query?: ToolListParams | null | undefined, options?: RequestOptions): PagePromise<AgentToolsCursor, AgentTool>;
|
|
72
|
+
/**
|
|
73
|
+
* Delete a tool.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* await client.senders.agent.tools.delete('toolId', {
|
|
78
|
+
* senderId: 'senderId',
|
|
79
|
+
* });
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
delete(toolID: string, params: ToolDeleteParams, options?: RequestOptions): APIPromise<void>;
|
|
83
|
+
/**
|
|
84
|
+
* Test a tool by triggering its webhook with test parameters.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* const response = await client.senders.agent.tools.test(
|
|
89
|
+
* 'toolId',
|
|
90
|
+
* {
|
|
91
|
+
* senderId: 'senderId',
|
|
92
|
+
* testParams: { order_id: 'ORD-12345' },
|
|
93
|
+
* },
|
|
94
|
+
* );
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
test(toolID: string, params: ToolTestParams, options?: RequestOptions): APIPromise<ToolTestResponse>;
|
|
98
|
+
}
|
|
99
|
+
export type AgentToolsCursor = Cursor<AgentTool>;
|
|
100
|
+
export interface AgentTool {
|
|
101
|
+
id: string;
|
|
102
|
+
agentId: string;
|
|
103
|
+
createdAt: string;
|
|
104
|
+
/**
|
|
105
|
+
* Description for the LLM to understand when to use this tool.
|
|
106
|
+
*/
|
|
107
|
+
description: string;
|
|
108
|
+
enabled: boolean;
|
|
109
|
+
name: string;
|
|
110
|
+
parameters: AgentTool.Parameters;
|
|
111
|
+
updatedAt: string;
|
|
112
|
+
/**
|
|
113
|
+
* HTTPS URL to call when the tool is executed.
|
|
114
|
+
*/
|
|
115
|
+
webhookUrl: string;
|
|
116
|
+
}
|
|
117
|
+
export declare namespace AgentTool {
|
|
118
|
+
interface Parameters {
|
|
119
|
+
properties: {
|
|
120
|
+
[key: string]: Parameters.Properties;
|
|
121
|
+
};
|
|
122
|
+
required: Array<string>;
|
|
123
|
+
type: 'object';
|
|
124
|
+
}
|
|
125
|
+
namespace Parameters {
|
|
126
|
+
interface Properties {
|
|
127
|
+
description?: string;
|
|
128
|
+
type?: string;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
export interface ToolCreateResponse {
|
|
133
|
+
tool: AgentTool;
|
|
134
|
+
}
|
|
135
|
+
export interface ToolRetrieveResponse {
|
|
136
|
+
tool: AgentTool;
|
|
137
|
+
}
|
|
138
|
+
export interface ToolUpdateResponse {
|
|
139
|
+
tool: AgentTool;
|
|
140
|
+
}
|
|
141
|
+
export interface ToolTestResponse {
|
|
142
|
+
scheduled: boolean;
|
|
143
|
+
}
|
|
144
|
+
export interface ToolCreateParams {
|
|
145
|
+
description: string;
|
|
146
|
+
name: string;
|
|
147
|
+
parameters: ToolCreateParams.Parameters;
|
|
148
|
+
/**
|
|
149
|
+
* Must be HTTPS.
|
|
150
|
+
*/
|
|
151
|
+
webhookUrl: string;
|
|
152
|
+
enabled?: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Optional secret for webhook signature verification.
|
|
155
|
+
*/
|
|
156
|
+
webhookSecret?: string;
|
|
157
|
+
}
|
|
158
|
+
export declare namespace ToolCreateParams {
|
|
159
|
+
interface Parameters {
|
|
160
|
+
properties: {
|
|
161
|
+
[key: string]: Parameters.Properties;
|
|
162
|
+
};
|
|
163
|
+
required: Array<string>;
|
|
164
|
+
type: 'object';
|
|
165
|
+
}
|
|
166
|
+
namespace Parameters {
|
|
167
|
+
interface Properties {
|
|
168
|
+
description?: string;
|
|
169
|
+
type?: string;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
export interface ToolRetrieveParams {
|
|
174
|
+
senderId: string;
|
|
175
|
+
}
|
|
176
|
+
export interface ToolUpdateParams {
|
|
177
|
+
/**
|
|
178
|
+
* Path param:
|
|
179
|
+
*/
|
|
180
|
+
senderId: string;
|
|
181
|
+
/**
|
|
182
|
+
* Body param:
|
|
183
|
+
*/
|
|
184
|
+
description?: string;
|
|
185
|
+
/**
|
|
186
|
+
* Body param:
|
|
187
|
+
*/
|
|
188
|
+
enabled?: boolean;
|
|
189
|
+
/**
|
|
190
|
+
* Body param:
|
|
191
|
+
*/
|
|
192
|
+
name?: string;
|
|
193
|
+
/**
|
|
194
|
+
* Body param:
|
|
195
|
+
*/
|
|
196
|
+
parameters?: ToolUpdateParams.Parameters;
|
|
197
|
+
/**
|
|
198
|
+
* Body param:
|
|
199
|
+
*/
|
|
200
|
+
webhookSecret?: string | null;
|
|
201
|
+
/**
|
|
202
|
+
* Body param:
|
|
203
|
+
*/
|
|
204
|
+
webhookUrl?: string;
|
|
205
|
+
}
|
|
206
|
+
export declare namespace ToolUpdateParams {
|
|
207
|
+
interface Parameters {
|
|
208
|
+
properties: {
|
|
209
|
+
[key: string]: Parameters.Properties;
|
|
210
|
+
};
|
|
211
|
+
required: Array<string>;
|
|
212
|
+
type: 'object';
|
|
213
|
+
}
|
|
214
|
+
namespace Parameters {
|
|
215
|
+
interface Properties {
|
|
216
|
+
description?: string;
|
|
217
|
+
type?: string;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
export interface ToolListParams extends CursorParams {
|
|
222
|
+
enabled?: boolean;
|
|
223
|
+
}
|
|
224
|
+
export interface ToolDeleteParams {
|
|
225
|
+
senderId: string;
|
|
226
|
+
}
|
|
227
|
+
export interface ToolTestParams {
|
|
228
|
+
/**
|
|
229
|
+
* Path param:
|
|
230
|
+
*/
|
|
231
|
+
senderId: string;
|
|
232
|
+
/**
|
|
233
|
+
* Body param: Parameters to pass to the tool for testing.
|
|
234
|
+
*/
|
|
235
|
+
testParams: {
|
|
236
|
+
[key: string]: unknown;
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
export declare namespace Tools {
|
|
240
|
+
export { type AgentTool as AgentTool, type ToolCreateResponse as ToolCreateResponse, type ToolRetrieveResponse as ToolRetrieveResponse, type ToolUpdateResponse as ToolUpdateResponse, type ToolTestResponse as ToolTestResponse, type AgentToolsCursor as AgentToolsCursor, type ToolCreateParams as ToolCreateParams, type ToolRetrieveParams as ToolRetrieveParams, type ToolUpdateParams as ToolUpdateParams, type ToolListParams as ToolListParams, type ToolDeleteParams as ToolDeleteParams, type ToolTestParams as ToolTestParams, };
|
|
241
|
+
}
|
|
242
|
+
//# sourceMappingURL=tools.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.mts","sourceRoot":"","sources":["../../../src/resources/senders/agent/tools.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE;OAE1C,EAAE,cAAc,EAAE;AAGzB,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC;IAI1G;;;;;;;;;;OAUG;IACH,QAAQ,CACN,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,kBAAkB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oBAAoB,CAAC;IAKnC;;;;;;;;;;OAUG;IACH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