syllable-sdk 0.1.0-alpha.30 → 0.1.0-alpha.32
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/docs/sdks/channels/README.md +0 -3
- package/docs/sdks/custommessages/README.md +0 -3
- package/docs/sdks/prompts/README.md +0 -3
- package/docs/sdks/targets/README.md +0 -3
- package/docs/sdks/tools/README.md +0 -3
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/mintlify/mint.json +24 -3
- package/models/components/agentcreate.d.ts +1 -1
- package/models/components/agentresponse.d.ts +1 -1
- package/models/components/agentupdate.d.ts +1 -1
- package/models/components/toolcreaterequest.d.ts +0 -89
- package/models/components/toolcreaterequest.d.ts.map +1 -1
- package/models/components/toolcreaterequest.js.map +1 -1
- package/models/components/tooldefinition.d.ts +0 -89
- package/models/components/tooldefinition.d.ts.map +1 -1
- package/models/components/tooldefinition.js.map +1 -1
- package/models/components/toolresponse.d.ts +0 -89
- package/models/components/toolresponse.d.ts.map +1 -1
- package/models/components/toolresponse.js.map +1 -1
- package/models/components/toolupdaterequest.d.ts +0 -89
- package/models/components/toolupdaterequest.d.ts.map +1 -1
- package/models/components/toolupdaterequest.js.map +1 -1
- package/openapi.json +10 -56
- package/package.json +1 -1
- package/src/lib/config.ts +2 -2
- package/src/models/components/agentcreate.ts +1 -1
- package/src/models/components/agentresponse.ts +1 -1
- package/src/models/components/agentupdate.ts +1 -1
- package/src/models/components/toolcreaterequest.ts +0 -89
- package/src/models/components/tooldefinition.ts +0 -89
- package/src/models/components/toolresponse.ts +0 -89
- package/src/models/components/toolupdaterequest.ts +0 -89
|
@@ -5,9 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
Operations related to channel configuration. A channel is an organization-level point of communication, like a phone number or a web chat. A channel can be associated with an agent by creating a channel target linking them.
|
|
7
7
|
|
|
8
|
-
For more information:
|
|
9
|
-
<https://docs.syllable.ai/Resources/Channels>
|
|
10
|
-
|
|
11
8
|
### Available Operations
|
|
12
9
|
|
|
13
10
|
* [list](#list) - Get Channels
|
|
@@ -5,9 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
Operations related to custom message configuration. A custom message is a pre-configured message delivered by an agent as a greeting at the beginning of a conversation. Multiple agents can use the same custom mesasage. A custom message has one or more rules defined, which allow for different messages to be dynamically selected and delivered at runtime based on the current time and either date or day of the week.
|
|
7
7
|
|
|
8
|
-
For more information:
|
|
9
|
-
<https://docs.syllable.ai/Resources/CustomMessages>
|
|
10
|
-
|
|
11
8
|
### Available Operations
|
|
12
9
|
|
|
13
10
|
* [list](#list) - Custom Messages List
|
|
@@ -5,9 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
Operations related to prompts. A prompt defines the behavior of an agent by delivering instructions to the LLM about how the agent should behave. A prompt can be linked to one or more agents. A prompt can also be linked to tools to allow an agent using the prompt to use them.
|
|
7
7
|
|
|
8
|
-
For more information:
|
|
9
|
-
<https://docs.syllable.ai/Resources/res_WritePrompt>
|
|
10
|
-
|
|
11
8
|
### Available Operations
|
|
12
9
|
|
|
13
10
|
* [list](#list) - Prompt List
|
|
@@ -5,9 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
Operations related to channel target configuration. A channel target links a channel to an agent, allowing users to communicate with the agent through that channel.
|
|
7
7
|
|
|
8
|
-
For more information:
|
|
9
|
-
<https://docs.syllable.ai/Resources/Channels>
|
|
10
|
-
|
|
11
8
|
### Available Operations
|
|
12
9
|
|
|
13
10
|
* [availableTargets](#availabletargets) - Available Targets List
|
|
@@ -5,9 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
Operations related to tool configuration. A tool is a function that an agent can call to perform actions like accessing databases, making API calls, or processing data. For an agent to have access to a tool, the prompt associated with that agent should be linked to the tool and include instructions to use it.
|
|
7
7
|
|
|
8
|
-
For more information:
|
|
9
|
-
<https://docs.syllable.ai/Resources/Tools>
|
|
10
|
-
|
|
11
8
|
### Available Operations
|
|
12
9
|
|
|
13
10
|
* [list](#list) - Tool List
|
package/jsr.json
CHANGED
package/lib/config.d.ts
CHANGED
|
@@ -27,8 +27,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
27
27
|
export declare const SDK_METADATA: {
|
|
28
28
|
readonly language: "typescript";
|
|
29
29
|
readonly openapiDocVersion: "0.0.2";
|
|
30
|
-
readonly sdkVersion: "0.1.0-alpha.
|
|
30
|
+
readonly sdkVersion: "0.1.0-alpha.32";
|
|
31
31
|
readonly genVersion: "2.493.21";
|
|
32
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.1.0-alpha.
|
|
32
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.1.0-alpha.32 2.493.21 0.0.2 syllable-sdk";
|
|
33
33
|
};
|
|
34
34
|
//# sourceMappingURL=config.d.ts.map
|
package/lib/config.js
CHANGED
|
@@ -35,8 +35,8 @@ function serverURLFromOptions(options) {
|
|
|
35
35
|
exports.SDK_METADATA = {
|
|
36
36
|
language: "typescript",
|
|
37
37
|
openapiDocVersion: "0.0.2",
|
|
38
|
-
sdkVersion: "0.1.0-alpha.
|
|
38
|
+
sdkVersion: "0.1.0-alpha.32",
|
|
39
39
|
genVersion: "2.493.21",
|
|
40
|
-
userAgent: "speakeasy-sdk/typescript 0.1.0-alpha.
|
|
40
|
+
userAgent: "speakeasy-sdk/typescript 0.1.0-alpha.32 2.493.21 0.0.2 syllable-sdk",
|
|
41
41
|
};
|
|
42
42
|
//# sourceMappingURL=config.js.map
|
package/mintlify/mint.json
CHANGED
|
@@ -111,8 +111,7 @@
|
|
|
111
111
|
"sdk-docs/Tools",
|
|
112
112
|
"sdk-docs/Services",
|
|
113
113
|
"sdk-docs/Channels",
|
|
114
|
-
"sdk-docs/Targets"
|
|
115
|
-
"sdk-docs/Directory"
|
|
114
|
+
"sdk-docs/Targets"
|
|
116
115
|
]
|
|
117
116
|
},
|
|
118
117
|
{
|
|
@@ -139,6 +138,7 @@
|
|
|
139
138
|
"sdk-docs/models/components/agenttooldefaults",
|
|
140
139
|
"sdk-docs/models/components/agenttoolfielddefault",
|
|
141
140
|
"sdk-docs/models/components/agentupdate",
|
|
141
|
+
"sdk-docs/models/components/agentupdatevariables",
|
|
142
142
|
"sdk-docs/models/components/agentvoice",
|
|
143
143
|
"sdk-docs/models/components/agentvoicevarname",
|
|
144
144
|
"sdk-docs/models/components/argumentlocation",
|
|
@@ -152,6 +152,7 @@
|
|
|
152
152
|
"sdk-docs/models/components/channeltarget",
|
|
153
153
|
"sdk-docs/models/components/channeltargetcreaterequest",
|
|
154
154
|
"sdk-docs/models/components/channeltargetproperties",
|
|
155
|
+
"sdk-docs/models/components/channeltargetresponse",
|
|
155
156
|
"sdk-docs/models/components/channeltargetupdaterequest",
|
|
156
157
|
"sdk-docs/models/components/contacttags",
|
|
157
158
|
"sdk-docs/models/components/conversation",
|
|
@@ -160,9 +161,11 @@
|
|
|
160
161
|
"sdk-docs/models/components/custommessagecreaterequest",
|
|
161
162
|
"sdk-docs/models/components/custommessageproperties",
|
|
162
163
|
"sdk-docs/models/components/custommessageresponse",
|
|
164
|
+
"sdk-docs/models/components/custommessagerule",
|
|
163
165
|
"sdk-docs/models/components/custommessageupdaterequest",
|
|
164
166
|
"sdk-docs/models/components/daochanneltargetagent",
|
|
165
167
|
"sdk-docs/models/components/daocustommessagerule",
|
|
168
|
+
"sdk-docs/models/components/dashboard",
|
|
166
169
|
"sdk-docs/models/components/dayofweek",
|
|
167
170
|
"sdk-docs/models/components/defaults",
|
|
168
171
|
"sdk-docs/models/components/definition",
|
|
@@ -176,19 +179,23 @@
|
|
|
176
179
|
"sdk-docs/models/components/filet",
|
|
177
180
|
"sdk-docs/models/components/functiont",
|
|
178
181
|
"sdk-docs/models/components/httpendpoint",
|
|
182
|
+
"sdk-docs/models/components/internaltool",
|
|
179
183
|
"sdk-docs/models/components/listresponseagentresponse",
|
|
180
184
|
"sdk-docs/models/components/listresponseavailabletarget",
|
|
181
185
|
"sdk-docs/models/components/listresponsechannel",
|
|
182
186
|
"sdk-docs/models/components/listresponsechanneltarget",
|
|
187
|
+
"sdk-docs/models/components/listresponsechanneltargetresponse",
|
|
183
188
|
"sdk-docs/models/components/listresponseconversation",
|
|
184
189
|
"sdk-docs/models/components/listresponsecustommessageresponse",
|
|
185
190
|
"sdk-docs/models/components/listresponsedirectorymember",
|
|
186
191
|
"sdk-docs/models/components/listresponseevent",
|
|
187
192
|
"sdk-docs/models/components/listresponseprompt",
|
|
193
|
+
"sdk-docs/models/components/listresponsepromptresponse",
|
|
188
194
|
"sdk-docs/models/components/listresponseservice",
|
|
189
195
|
"sdk-docs/models/components/listresponsesession",
|
|
190
196
|
"sdk-docs/models/components/listresponsesessionlabel",
|
|
191
197
|
"sdk-docs/models/components/listresponsetool",
|
|
198
|
+
"sdk-docs/models/components/listresponsetoolresponse",
|
|
192
199
|
"sdk-docs/models/components/llmconfig",
|
|
193
200
|
"sdk-docs/models/components/loc",
|
|
194
201
|
"sdk-docs/models/components/method",
|
|
@@ -198,9 +205,14 @@
|
|
|
198
205
|
"sdk-docs/models/components/parameterst",
|
|
199
206
|
"sdk-docs/models/components/prompt",
|
|
200
207
|
"sdk-docs/models/components/promptcreate",
|
|
208
|
+
"sdk-docs/models/components/promptcreaterequest",
|
|
201
209
|
"sdk-docs/models/components/prompthistory",
|
|
210
|
+
"sdk-docs/models/components/promptllmconfig",
|
|
211
|
+
"sdk-docs/models/components/promptllmprovider",
|
|
202
212
|
"sdk-docs/models/components/promptproperties",
|
|
213
|
+
"sdk-docs/models/components/promptresponse",
|
|
203
214
|
"sdk-docs/models/components/promptupdate",
|
|
215
|
+
"sdk-docs/models/components/promptupdaterequest",
|
|
204
216
|
"sdk-docs/models/components/provider",
|
|
205
217
|
"sdk-docs/models/components/response",
|
|
206
218
|
"sdk-docs/models/components/result",
|
|
@@ -226,17 +238,26 @@
|
|
|
226
238
|
"sdk-docs/models/components/testmessage",
|
|
227
239
|
"sdk-docs/models/components/testmessageresponse",
|
|
228
240
|
"sdk-docs/models/components/tool",
|
|
241
|
+
"sdk-docs/models/components/toolargumentlocation",
|
|
229
242
|
"sdk-docs/models/components/toolcreate",
|
|
230
243
|
"sdk-docs/models/components/toolcreatedefinition",
|
|
244
|
+
"sdk-docs/models/components/toolcreaterequest",
|
|
245
|
+
"sdk-docs/models/components/tooldefinition",
|
|
231
246
|
"sdk-docs/models/components/tooldetailresponse",
|
|
247
|
+
"sdk-docs/models/components/toolfunction",
|
|
248
|
+
"sdk-docs/models/components/toolhttpendpoint",
|
|
249
|
+
"sdk-docs/models/components/toolhttpmethod",
|
|
232
250
|
"sdk-docs/models/components/toolparameterdefault",
|
|
233
251
|
"sdk-docs/models/components/toolparametertransform",
|
|
234
252
|
"sdk-docs/models/components/toolparametertransformcondition",
|
|
235
253
|
"sdk-docs/models/components/toolproperties",
|
|
254
|
+
"sdk-docs/models/components/toolresponse",
|
|
236
255
|
"sdk-docs/models/components/toolupdate",
|
|
237
256
|
"sdk-docs/models/components/toolupdatedefinition",
|
|
257
|
+
"sdk-docs/models/components/toolupdaterequest",
|
|
238
258
|
"sdk-docs/models/components/type",
|
|
239
|
-
"sdk-docs/models/components/validationerror"
|
|
259
|
+
"sdk-docs/models/components/validationerror",
|
|
260
|
+
"sdk-docs/models/components/variables"
|
|
240
261
|
]
|
|
241
262
|
},
|
|
242
263
|
{
|
|
@@ -41,7 +41,7 @@ export type AgentCreate = {
|
|
|
41
41
|
*/
|
|
42
42
|
languages?: Array<string> | undefined;
|
|
43
43
|
/**
|
|
44
|
-
* Custom context variables for the conversation session.
|
|
44
|
+
* Custom context variables for the conversation session. Keys should be prefixed with "vars.".
|
|
45
45
|
*/
|
|
46
46
|
variables: Variables | null;
|
|
47
47
|
/**
|
|
@@ -50,7 +50,7 @@ export type AgentResponse = {
|
|
|
50
50
|
*/
|
|
51
51
|
languages?: Array<string> | undefined;
|
|
52
52
|
/**
|
|
53
|
-
* Custom context variables for the conversation session.
|
|
53
|
+
* Custom context variables for the conversation session. Keys should be prefixed with "vars.".
|
|
54
54
|
*/
|
|
55
55
|
variables: {
|
|
56
56
|
[k: string]: string;
|
|
@@ -41,7 +41,7 @@ export type AgentUpdate = {
|
|
|
41
41
|
*/
|
|
42
42
|
languages?: Array<string> | undefined;
|
|
43
43
|
/**
|
|
44
|
-
* Custom context variables for the conversation session.
|
|
44
|
+
* Custom context variables for the conversation session. Keys should be prefixed with "vars.".
|
|
45
45
|
*/
|
|
46
46
|
variables: AgentUpdateVariables | null;
|
|
47
47
|
/**
|
|
@@ -9,95 +9,6 @@ export type ToolCreateRequest = {
|
|
|
9
9
|
name: string;
|
|
10
10
|
/**
|
|
11
11
|
* A tool that can be called from an LLM during the conversation.
|
|
12
|
-
*
|
|
13
|
-
* @remarks
|
|
14
|
-
*
|
|
15
|
-
* The tool can result in one of the following actions depending on the `type` field:
|
|
16
|
-
* - `action`:
|
|
17
|
-
* A request to perform an action.
|
|
18
|
-
* - `endpoint`:
|
|
19
|
-
* An HTTP API call to an external tool. Requires the `endpoint` field to be set too.
|
|
20
|
-
* - `context`:
|
|
21
|
-
* Sets context variables based on the tool arguments, e.g. to change the session language. Only
|
|
22
|
-
* `language` and `say` context vars are currently supported, but this will be made more generic.
|
|
23
|
-
*
|
|
24
|
-
* For example, to change the current session language:
|
|
25
|
-
* {
|
|
26
|
-
* "type": "context",
|
|
27
|
-
* "tool": {
|
|
28
|
-
* "function": {
|
|
29
|
-
* "name": "set_language",
|
|
30
|
-
* "parameters": {
|
|
31
|
-
* "language": {
|
|
32
|
-
* "type": "string",
|
|
33
|
-
* "description": "The ISO 639 language code to set for the session e.g. 'en-US'."
|
|
34
|
-
* },
|
|
35
|
-
* "message": {
|
|
36
|
-
* "type": "string",
|
|
37
|
-
* "description": "Inform the caller we're now speaking in the new language."
|
|
38
|
-
* }
|
|
39
|
-
* }
|
|
40
|
-
* }
|
|
41
|
-
* }
|
|
42
|
-
* }
|
|
43
|
-
*
|
|
44
|
-
* If `defaults` is provided, it will be used as the default values for the parameters of the
|
|
45
|
-
* tool call, if the LLM doesn't provide them:
|
|
46
|
-
* "defaults": {
|
|
47
|
-
* "hospital": "Queens Hospital"
|
|
48
|
-
* }
|
|
49
|
-
*
|
|
50
|
-
* Some special "transform" handling is supported if the value is a dict with a single `transform`
|
|
51
|
-
* key. The parameter value will be transformed by the given `action` before being used as the
|
|
52
|
-
* default value:
|
|
53
|
-
*
|
|
54
|
-
* Removing an unwanted parameter:
|
|
55
|
-
* "defaults": {
|
|
56
|
-
* "hospital": {
|
|
57
|
-
* "transform": {
|
|
58
|
-
* "action": "remove"
|
|
59
|
-
* }
|
|
60
|
-
* }
|
|
61
|
-
* }
|
|
62
|
-
*
|
|
63
|
-
* Using a value from another parameter and converting it to a dictionary:
|
|
64
|
-
* "defaults": {
|
|
65
|
-
* "tags.hospital": "{vars.hospital}",
|
|
66
|
-
* "tags.foo": "{params.foo}",
|
|
67
|
-
* "foo": {
|
|
68
|
-
* "transform": {
|
|
69
|
-
* "action": "remove"
|
|
70
|
-
* }
|
|
71
|
-
* }
|
|
72
|
-
* }
|
|
73
|
-
*
|
|
74
|
-
* Add custom parameters from other parameters using Python's `format`:
|
|
75
|
-
* "defaults": {
|
|
76
|
-
* "hello": {
|
|
77
|
-
* "transform": {
|
|
78
|
-
* "format": "Hello, {name}!"
|
|
79
|
-
* }
|
|
80
|
-
* }
|
|
81
|
-
* }
|
|
82
|
-
*
|
|
83
|
-
* Modify a value conditionally, e.g. change a `city` parameter with value "Bronx" to "The Bronx":
|
|
84
|
-
* {
|
|
85
|
-
* "defaults": {
|
|
86
|
-
* "city": {
|
|
87
|
-
* "transform": {
|
|
88
|
-
* "when": {"operator": "eq", "key": "city", "value": "Bronx"},
|
|
89
|
-
* "action": "override",
|
|
90
|
-
* "format": "The {city}"
|
|
91
|
-
* }
|
|
92
|
-
* }
|
|
93
|
-
* }
|
|
94
|
-
* }
|
|
95
|
-
*
|
|
96
|
-
* Some common transform actions can be abbreviated using the `@` prefix to support a string syntax:
|
|
97
|
-
* "defaults": {
|
|
98
|
-
* "foo": "@remove",
|
|
99
|
-
* "name": "@override Hello, {name}!"
|
|
100
|
-
* }
|
|
101
12
|
*/
|
|
102
13
|
definition: ToolDefinition;
|
|
103
14
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolcreaterequest.d.ts","sourceRoot":"","sources":["../../src/models/components/toolcreaterequest.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EACL,cAAc,EAEd,uBAAuB,EAExB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb
|
|
1
|
+
{"version":3,"file":"toolcreaterequest.d.ts","sourceRoot":"","sources":["../../src/models/components/toolcreaterequest.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EACL,cAAc,EAEd,uBAAuB,EAExB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,UAAU,EAAE,cAAc,CAAC;IAC3B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,+BAA+B,EAAE,CAAC,CAAC,OAAO,CACrD,iBAAiB,EACjB,CAAC,CAAC,UAAU,EACZ,OAAO,CASP,CAAC;AAEH,gBAAgB;AAChB,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,uBAAuB,CAAC;IACpC,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,gCAAgC,EAAE,CAAC,CAAC,OAAO,CACtD,0BAA0B,EAC1B,CAAC,CAAC,UAAU,EACZ,iBAAiB,CASjB,CAAC;AAEH;;;GAGG;AACH,yBAAiB,kBAAkB,CAAC;IAClC,iEAAiE;IAC1D,MAAM,aAAa,qDAAkC,CAAC;IAC7D,kEAAkE;IAC3D,MAAM,cAAc,wEAAmC,CAAC;IAC/D,4DAA4D;IAC5D,KAAY,QAAQ,GAAG,0BAA0B,CAAC;CACnD;AAED,wBAAgB,uBAAuB,CACrC,iBAAiB,EAAE,iBAAiB,GACnC,MAAM,CAIR;AAED,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAMxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolcreaterequest.js","sourceRoot":"","sources":["../../src/models/components/toolcreaterequest.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"toolcreaterequest.js","sourceRoot":"","sources":["../../src/models/components/toolcreaterequest.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AA+EH,0DAMC;AAED,8DAQC;AA7FD,uCAAyB;AACzB,2DAA0D;AAC1D,qDAAiD;AAGjD,2DAK6B;AAiB7B,gBAAgB;AACH,QAAA,+BAA+B,GAIxC,CAAC,CAAC,MAAM,CAAC;IACX,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,UAAU,EAAE,gDAA4B;IACxC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;CAC7B,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,IAAA,qBAAM,EAAC,CAAC,EAAE;QACf,YAAY,EAAE,WAAW;KAC1B,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AASH,gBAAgB;AACH,QAAA,gCAAgC,GAIzC,CAAC,CAAC,MAAM,CAAC;IACX,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,UAAU,EAAE,iDAA6B;IACzC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;CAC5B,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,IAAA,qBAAM,EAAC,CAAC,EAAE;QACf,SAAS,EAAE,YAAY;KACxB,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH;;;GAGG;AACH,IAAiB,kBAAkB,CAOlC;AAPD,WAAiB,kBAAkB;IACjC,iEAAiE;IACpD,gCAAa,GAAG,uCAA+B,CAAC;IAC7D,kEAAkE;IACrD,iCAAc,GAAG,wCAAgC,CAAC;AAGjE,CAAC,EAPgB,kBAAkB,kCAAlB,kBAAkB,QAOlC;AAED,SAAgB,uBAAuB,CACrC,iBAAoC;IAEpC,OAAO,IAAI,CAAC,SAAS,CACnB,wCAAgC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAC1D,CAAC;AACJ,CAAC;AAED,SAAgB,yBAAyB,CACvC,UAAkB;IAElB,OAAO,IAAA,sBAAS,EACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,uCAA+B,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAC3D,+CAA+C,CAChD,CAAC;AACJ,CAAC"}
|
|
@@ -22,95 +22,6 @@ export type Defaults = One | {
|
|
|
22
22
|
export type Result = {};
|
|
23
23
|
/**
|
|
24
24
|
* A tool that can be called from an LLM during the conversation.
|
|
25
|
-
*
|
|
26
|
-
* @remarks
|
|
27
|
-
*
|
|
28
|
-
* The tool can result in one of the following actions depending on the `type` field:
|
|
29
|
-
* - `action`:
|
|
30
|
-
* A request to perform an action.
|
|
31
|
-
* - `endpoint`:
|
|
32
|
-
* An HTTP API call to an external tool. Requires the `endpoint` field to be set too.
|
|
33
|
-
* - `context`:
|
|
34
|
-
* Sets context variables based on the tool arguments, e.g. to change the session language. Only
|
|
35
|
-
* `language` and `say` context vars are currently supported, but this will be made more generic.
|
|
36
|
-
*
|
|
37
|
-
* For example, to change the current session language:
|
|
38
|
-
* {
|
|
39
|
-
* "type": "context",
|
|
40
|
-
* "tool": {
|
|
41
|
-
* "function": {
|
|
42
|
-
* "name": "set_language",
|
|
43
|
-
* "parameters": {
|
|
44
|
-
* "language": {
|
|
45
|
-
* "type": "string",
|
|
46
|
-
* "description": "The ISO 639 language code to set for the session e.g. 'en-US'."
|
|
47
|
-
* },
|
|
48
|
-
* "message": {
|
|
49
|
-
* "type": "string",
|
|
50
|
-
* "description": "Inform the caller we're now speaking in the new language."
|
|
51
|
-
* }
|
|
52
|
-
* }
|
|
53
|
-
* }
|
|
54
|
-
* }
|
|
55
|
-
* }
|
|
56
|
-
*
|
|
57
|
-
* If `defaults` is provided, it will be used as the default values for the parameters of the
|
|
58
|
-
* tool call, if the LLM doesn't provide them:
|
|
59
|
-
* "defaults": {
|
|
60
|
-
* "hospital": "Queens Hospital"
|
|
61
|
-
* }
|
|
62
|
-
*
|
|
63
|
-
* Some special "transform" handling is supported if the value is a dict with a single `transform`
|
|
64
|
-
* key. The parameter value will be transformed by the given `action` before being used as the
|
|
65
|
-
* default value:
|
|
66
|
-
*
|
|
67
|
-
* Removing an unwanted parameter:
|
|
68
|
-
* "defaults": {
|
|
69
|
-
* "hospital": {
|
|
70
|
-
* "transform": {
|
|
71
|
-
* "action": "remove"
|
|
72
|
-
* }
|
|
73
|
-
* }
|
|
74
|
-
* }
|
|
75
|
-
*
|
|
76
|
-
* Using a value from another parameter and converting it to a dictionary:
|
|
77
|
-
* "defaults": {
|
|
78
|
-
* "tags.hospital": "{vars.hospital}",
|
|
79
|
-
* "tags.foo": "{params.foo}",
|
|
80
|
-
* "foo": {
|
|
81
|
-
* "transform": {
|
|
82
|
-
* "action": "remove"
|
|
83
|
-
* }
|
|
84
|
-
* }
|
|
85
|
-
* }
|
|
86
|
-
*
|
|
87
|
-
* Add custom parameters from other parameters using Python's `format`:
|
|
88
|
-
* "defaults": {
|
|
89
|
-
* "hello": {
|
|
90
|
-
* "transform": {
|
|
91
|
-
* "format": "Hello, {name}!"
|
|
92
|
-
* }
|
|
93
|
-
* }
|
|
94
|
-
* }
|
|
95
|
-
*
|
|
96
|
-
* Modify a value conditionally, e.g. change a `city` parameter with value "Bronx" to "The Bronx":
|
|
97
|
-
* {
|
|
98
|
-
* "defaults": {
|
|
99
|
-
* "city": {
|
|
100
|
-
* "transform": {
|
|
101
|
-
* "when": {"operator": "eq", "key": "city", "value": "Bronx"},
|
|
102
|
-
* "action": "override",
|
|
103
|
-
* "format": "The {city}"
|
|
104
|
-
* }
|
|
105
|
-
* }
|
|
106
|
-
* }
|
|
107
|
-
* }
|
|
108
|
-
*
|
|
109
|
-
* Some common transform actions can be abbreviated using the `@` prefix to support a string syntax:
|
|
110
|
-
* "defaults": {
|
|
111
|
-
* "foo": "@remove",
|
|
112
|
-
* "name": "@override Hello, {name}!"
|
|
113
|
-
* }
|
|
114
25
|
*/
|
|
115
26
|
export type ToolDefinition = {
|
|
116
27
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooldefinition.d.ts","sourceRoot":"","sources":["../../src/models/components/tooldefinition.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EACL,YAAY,EAEZ,qBAAqB,EAEtB,MAAM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C,CAAC;IAC5D,yDAAyD;IACzD,KAAY,QAAQ,GAAG,uBAAuB,CAAC;CAChD;AAED,wBAAgB,oBAAoB,CAAC,cAAc,EAAE,cAAc,GAAG,MAAM,CAE3E;AAED,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAMrD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooldefinition.js","sourceRoot":"","sources":["../../src/models/components/tooldefinition.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"tooldefinition.js","sourceRoot":"","sources":["../../src/models/components/tooldefinition.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAiHH,8BAEC;AAED,kCAQC;AAwCD,wCAEC;AAED,4CAQC;AA6BD,oCAEC;AAED,wCAQC;AAgED,oDAEC;AAED,wDAQC;AApSD,uCAAyB;AACzB,qDAAiD;AAIjD,uDAK2B;AAC3B,+DAK+B;AAC/B,uEAKmC;AAEtB,QAAA,IAAI,GAAG;IAClB,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;IAClB,GAAG,EAAE,KAAK;CACF,CAAC;AAsCX,gBAAgB;AACH,QAAA,kBAAkB,GAAiC,CAAC,CAAC,UAAU,CAC1E,YAAI,CACL,CAAC;AAEF,gBAAgB;AACH,QAAA,mBAAmB,GAC9B,0BAAkB,CAAC;AAErB;;;GAGG;AACH,IAAiB,KAAK,CAKrB;AALD,WAAiB,KAAK;IACpB,oDAAoD;IACvC,mBAAa,GAAG,0BAAkB,CAAC;IAChD,qDAAqD;IACxC,oBAAc,GAAG,2BAAmB,CAAC;AACpD,CAAC,EALgB,KAAK,qBAAL,KAAK,QAKrB;AAED,gBAAgB;AACH,QAAA,iBAAiB,GAA0C,CAAC;KACtE,MAAM,CAA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;AAED,SAAgB,oBAAoB,CAAC,cAA8B;IACjE,OAAO,IAAI,CAAC,SAAS,CAAC,qCAA6B,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC;AAC7E,CAAC;AAED,SAAgB,sBAAsB,CACpC,UAAkB;IAElB,OAAO,IAAA,sBAAS,EACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,oCAA4B,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACxD,4CAA4C,CAC7C,CAAC;AACJ,CAAC"}
|
|
@@ -16,95 +16,6 @@ export type ToolResponse = {
|
|
|
16
16
|
name: string;
|
|
17
17
|
/**
|
|
18
18
|
* A tool that can be called from an LLM during the conversation.
|
|
19
|
-
*
|
|
20
|
-
* @remarks
|
|
21
|
-
*
|
|
22
|
-
* The tool can result in one of the following actions depending on the `type` field:
|
|
23
|
-
* - `action`:
|
|
24
|
-
* A request to perform an action.
|
|
25
|
-
* - `endpoint`:
|
|
26
|
-
* An HTTP API call to an external tool. Requires the `endpoint` field to be set too.
|
|
27
|
-
* - `context`:
|
|
28
|
-
* Sets context variables based on the tool arguments, e.g. to change the session language. Only
|
|
29
|
-
* `language` and `say` context vars are currently supported, but this will be made more generic.
|
|
30
|
-
*
|
|
31
|
-
* For example, to change the current session language:
|
|
32
|
-
* {
|
|
33
|
-
* "type": "context",
|
|
34
|
-
* "tool": {
|
|
35
|
-
* "function": {
|
|
36
|
-
* "name": "set_language",
|
|
37
|
-
* "parameters": {
|
|
38
|
-
* "language": {
|
|
39
|
-
* "type": "string",
|
|
40
|
-
* "description": "The ISO 639 language code to set for the session e.g. 'en-US'."
|
|
41
|
-
* },
|
|
42
|
-
* "message": {
|
|
43
|
-
* "type": "string",
|
|
44
|
-
* "description": "Inform the caller we're now speaking in the new language."
|
|
45
|
-
* }
|
|
46
|
-
* }
|
|
47
|
-
* }
|
|
48
|
-
* }
|
|
49
|
-
* }
|
|
50
|
-
*
|
|
51
|
-
* If `defaults` is provided, it will be used as the default values for the parameters of the
|
|
52
|
-
* tool call, if the LLM doesn't provide them:
|
|
53
|
-
* "defaults": {
|
|
54
|
-
* "hospital": "Queens Hospital"
|
|
55
|
-
* }
|
|
56
|
-
*
|
|
57
|
-
* Some special "transform" handling is supported if the value is a dict with a single `transform`
|
|
58
|
-
* key. The parameter value will be transformed by the given `action` before being used as the
|
|
59
|
-
* default value:
|
|
60
|
-
*
|
|
61
|
-
* Removing an unwanted parameter:
|
|
62
|
-
* "defaults": {
|
|
63
|
-
* "hospital": {
|
|
64
|
-
* "transform": {
|
|
65
|
-
* "action": "remove"
|
|
66
|
-
* }
|
|
67
|
-
* }
|
|
68
|
-
* }
|
|
69
|
-
*
|
|
70
|
-
* Using a value from another parameter and converting it to a dictionary:
|
|
71
|
-
* "defaults": {
|
|
72
|
-
* "tags.hospital": "{vars.hospital}",
|
|
73
|
-
* "tags.foo": "{params.foo}",
|
|
74
|
-
* "foo": {
|
|
75
|
-
* "transform": {
|
|
76
|
-
* "action": "remove"
|
|
77
|
-
* }
|
|
78
|
-
* }
|
|
79
|
-
* }
|
|
80
|
-
*
|
|
81
|
-
* Add custom parameters from other parameters using Python's `format`:
|
|
82
|
-
* "defaults": {
|
|
83
|
-
* "hello": {
|
|
84
|
-
* "transform": {
|
|
85
|
-
* "format": "Hello, {name}!"
|
|
86
|
-
* }
|
|
87
|
-
* }
|
|
88
|
-
* }
|
|
89
|
-
*
|
|
90
|
-
* Modify a value conditionally, e.g. change a `city` parameter with value "Bronx" to "The Bronx":
|
|
91
|
-
* {
|
|
92
|
-
* "defaults": {
|
|
93
|
-
* "city": {
|
|
94
|
-
* "transform": {
|
|
95
|
-
* "when": {"operator": "eq", "key": "city", "value": "Bronx"},
|
|
96
|
-
* "action": "override",
|
|
97
|
-
* "format": "The {city}"
|
|
98
|
-
* }
|
|
99
|
-
* }
|
|
100
|
-
* }
|
|
101
|
-
* }
|
|
102
|
-
*
|
|
103
|
-
* Some common transform actions can be abbreviated using the `@` prefix to support a string syntax:
|
|
104
|
-
* "defaults": {
|
|
105
|
-
* "foo": "@remove",
|
|
106
|
-
* "name": "@override Hello, {name}!"
|
|
107
|
-
* }
|
|
108
19
|
*/
|
|
109
20
|
definition: ToolDefinition;
|
|
110
21
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolresponse.d.ts","sourceRoot":"","sources":["../../src/models/components/toolresponse.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EACL,cAAc,EAEd,uBAAuB,EAExB,MAAM,qBAAqB,CAAC;AAE7B;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb
|
|
1
|
+
{"version":3,"file":"toolresponse.d.ts","sourceRoot":"","sources":["../../src/models/components/toolresponse.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EACL,cAAc,EAEd,uBAAuB,EAExB,MAAM,qBAAqB,CAAC;AAE7B;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,UAAU,EAAE,cAAc,CAAC;IAC3B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACzC,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,0BAA0B,EAAE,CAAC,CAAC,OAAO,CAChD,YAAY,EACZ,CAAC,CAAC,UAAU,EACZ,OAAO,CAYP,CAAC;AAEH,gBAAgB;AAChB,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,uBAAuB,CAAC;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CAC1C,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,2BAA2B,EAAE,CAAC,CAAC,OAAO,CACjD,qBAAqB,EACrB,CAAC,CAAC,UAAU,EACZ,YAAY,CAYZ,CAAC;AAEH;;;GAGG;AACH,yBAAiB,aAAa,CAAC;IAC7B,4DAA4D;IACrD,MAAM,aAAa,gDAA6B,CAAC;IACxD,6DAA6D;IACtD,MAAM,cAAc,8DAA8B,CAAC;IAC1D,uDAAuD;IACvD,KAAY,QAAQ,GAAG,qBAAqB,CAAC;CAC9C;AAED,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,YAAY,GAAG,MAAM,CAErE;AAED,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,YAAY,EAAE,kBAAkB,CAAC,CAMnD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolresponse.js","sourceRoot":"","sources":["../../src/models/components/toolresponse.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"toolresponse.js","sourceRoot":"","sources":["../../src/models/components/toolresponse.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAsGH,gDAEC;AAED,oDAQC;AAhHD,uCAAyB;AACzB,2DAA0D;AAC1D,qDAAiD;AAGjD,2DAK6B;AAgC7B,gBAAgB;AACH,QAAA,0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