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
|
@@ -9,95 +9,6 @@ export type ToolUpdateRequest = {
|
|
|
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":"toolupdaterequest.d.ts","sourceRoot":"","sources":["../../src/models/components/toolupdaterequest.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":"toolupdaterequest.d.ts","sourceRoot":"","sources":["../../src/models/components/toolupdaterequest.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;IAClB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,+BAA+B,EAAE,CAAC,CAAC,OAAO,CACrD,iBAAiB,EACjB,CAAC,CAAC,UAAU,EACZ,OAAO,CAUP,CAAC;AAEH,gBAAgB;AAChB,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,uBAAuB,CAAC;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,gCAAgC,EAAE,CAAC,CAAC,OAAO,CACtD,0BAA0B,EAC1B,CAAC,CAAC,UAAU,EACZ,iBAAiB,CAUjB,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":"toolupdaterequest.js","sourceRoot":"","sources":["../../src/models/components/toolupdaterequest.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"toolupdaterequest.js","sourceRoot":"","sources":["../../src/models/components/toolupdaterequest.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAsFH,0DAMC;AAED,8DAQC;AApGD,uCAAyB;AACzB,2DAA0D;AAC1D,qDAAiD;AAGjD,2DAK6B;AAqB7B,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;IAC5B,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;CACrB,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;AAUH,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;IAC3B,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;CACrB,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"}
|
package/openapi.json
CHANGED
|
@@ -4357,12 +4357,7 @@
|
|
|
4357
4357
|
}
|
|
4358
4358
|
],
|
|
4359
4359
|
"title": "Variables",
|
|
4360
|
-
"description": "Custom context variables for the conversation session.
|
|
4361
|
-
"examples": [
|
|
4362
|
-
{
|
|
4363
|
-
"vars.hospital": "Weill Cornell Medical Center"
|
|
4364
|
-
}
|
|
4365
|
-
]
|
|
4360
|
+
"description": "Custom context variables for the conversation session. Keys should be prefixed with \"vars.\"."
|
|
4366
4361
|
},
|
|
4367
4362
|
"tool_headers": {
|
|
4368
4363
|
"anyOf": [
|
|
@@ -4500,12 +4495,7 @@
|
|
|
4500
4495
|
},
|
|
4501
4496
|
"type": "object",
|
|
4502
4497
|
"title": "Variables",
|
|
4503
|
-
"description": "Custom context variables for the conversation session.
|
|
4504
|
-
"examples": [
|
|
4505
|
-
{
|
|
4506
|
-
"vars.hospital": "Weill Cornell Medical Center"
|
|
4507
|
-
}
|
|
4508
|
-
]
|
|
4498
|
+
"description": "Custom context variables for the conversation session. Keys should be prefixed with \"vars.\"."
|
|
4509
4499
|
},
|
|
4510
4500
|
"tool_headers": {
|
|
4511
4501
|
"anyOf": [
|
|
@@ -4733,12 +4723,7 @@
|
|
|
4733
4723
|
}
|
|
4734
4724
|
],
|
|
4735
4725
|
"title": "Variables",
|
|
4736
|
-
"description": "Custom context variables for the conversation session.
|
|
4737
|
-
"examples": [
|
|
4738
|
-
{
|
|
4739
|
-
"vars.hospital": "Weill Cornell Medical Center"
|
|
4740
|
-
}
|
|
4741
|
-
]
|
|
4726
|
+
"description": "Custom context variables for the conversation session. Keys should be prefixed with \"vars.\"."
|
|
4742
4727
|
},
|
|
4743
4728
|
"tool_headers": {
|
|
4744
4729
|
"anyOf": [
|
|
@@ -5978,18 +5963,7 @@
|
|
|
5978
5963
|
}
|
|
5979
5964
|
],
|
|
5980
5965
|
"title": "Attributes",
|
|
5981
|
-
"description": "Arbitrary additional metadata for the event"
|
|
5982
|
-
"examples": [
|
|
5983
|
-
{
|
|
5984
|
-
"contact_type": "operator",
|
|
5985
|
-
"duration_s": 60,
|
|
5986
|
-
"end_time": "2024-05-20T15:31:00.000+00:00",
|
|
5987
|
-
"name": "Operator",
|
|
5988
|
-
"outcome": "success",
|
|
5989
|
-
"phone": "+18042221111",
|
|
5990
|
-
"start_time": "2024-05-20T15:30:00.000+00:00"
|
|
5991
|
-
}
|
|
5992
|
-
]
|
|
5966
|
+
"description": "Arbitrary additional metadata for the event"
|
|
5993
5967
|
}
|
|
5994
5968
|
},
|
|
5995
5969
|
"type": "object",
|
|
@@ -8050,7 +8024,7 @@
|
|
|
8050
8024
|
"tool"
|
|
8051
8025
|
],
|
|
8052
8026
|
"title": "ToolDefinition",
|
|
8053
|
-
"description": "A tool that can be called from an LLM during the conversation
|
|
8027
|
+
"description": "A tool that can be called from an LLM during the conversation."
|
|
8054
8028
|
},
|
|
8055
8029
|
"ToolDetailResponse": {
|
|
8056
8030
|
"properties": {
|
|
@@ -8383,19 +8357,11 @@
|
|
|
8383
8357
|
},
|
|
8384
8358
|
{
|
|
8385
8359
|
"name": "channels",
|
|
8386
|
-
"description": "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."
|
|
8387
|
-
"externalDocs": {
|
|
8388
|
-
"description": "For more information:",
|
|
8389
|
-
"url": "https://docs.syllable.ai/Resources/Channels"
|
|
8390
|
-
}
|
|
8360
|
+
"description": "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."
|
|
8391
8361
|
},
|
|
8392
8362
|
{
|
|
8393
8363
|
"name": "channels.targets",
|
|
8394
|
-
"description": "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."
|
|
8395
|
-
"externalDocs": {
|
|
8396
|
-
"description": "For more information:",
|
|
8397
|
-
"url": "https://docs.syllable.ai/Resources/Channels"
|
|
8398
|
-
}
|
|
8364
|
+
"description": "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."
|
|
8399
8365
|
},
|
|
8400
8366
|
{
|
|
8401
8367
|
"name": "conversations",
|
|
@@ -8403,11 +8369,7 @@
|
|
|
8403
8369
|
},
|
|
8404
8370
|
{
|
|
8405
8371
|
"name": "custom_messages",
|
|
8406
|
-
"description": "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."
|
|
8407
|
-
"externalDocs": {
|
|
8408
|
-
"description": "For more information:",
|
|
8409
|
-
"url": "https://docs.syllable.ai/Resources/CustomMessages"
|
|
8410
|
-
}
|
|
8372
|
+
"description": "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."
|
|
8411
8373
|
},
|
|
8412
8374
|
{
|
|
8413
8375
|
"name": "dashboards",
|
|
@@ -8423,11 +8385,7 @@
|
|
|
8423
8385
|
},
|
|
8424
8386
|
{
|
|
8425
8387
|
"name": "prompts",
|
|
8426
|
-
"description": "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."
|
|
8427
|
-
"externalDocs": {
|
|
8428
|
-
"description": "For more information:",
|
|
8429
|
-
"url": "https://docs.syllable.ai/Resources/res_WritePrompt"
|
|
8430
|
-
}
|
|
8388
|
+
"description": "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."
|
|
8431
8389
|
},
|
|
8432
8390
|
{
|
|
8433
8391
|
"name": "services",
|
|
@@ -8443,11 +8401,7 @@
|
|
|
8443
8401
|
},
|
|
8444
8402
|
{
|
|
8445
8403
|
"name": "tools",
|
|
8446
|
-
"description": "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."
|
|
8447
|
-
"externalDocs": {
|
|
8448
|
-
"description": "For more information:",
|
|
8449
|
-
"url": "https://docs.syllable.ai/Resources/Tools"
|
|
8450
|
-
}
|
|
8404
|
+
"description": "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."
|
|
8451
8405
|
}
|
|
8452
8406
|
],
|
|
8453
8407
|
"x-speakeasy-name-override": [
|
package/package.json
CHANGED
package/src/lib/config.ts
CHANGED
|
@@ -61,8 +61,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
61
61
|
export const SDK_METADATA = {
|
|
62
62
|
language: "typescript",
|
|
63
63
|
openapiDocVersion: "0.0.2",
|
|
64
|
-
sdkVersion: "0.1.0-alpha.
|
|
64
|
+
sdkVersion: "0.1.0-alpha.32",
|
|
65
65
|
genVersion: "2.493.21",
|
|
66
66
|
userAgent:
|
|
67
|
-
"speakeasy-sdk/typescript 0.1.0-alpha.
|
|
67
|
+
"speakeasy-sdk/typescript 0.1.0-alpha.32 2.493.21 0.0.2 syllable-sdk",
|
|
68
68
|
} as const;
|
|
@@ -54,7 +54,7 @@ export type AgentCreate = {
|
|
|
54
54
|
*/
|
|
55
55
|
languages?: Array<string> | undefined;
|
|
56
56
|
/**
|
|
57
|
-
* Custom context variables for the conversation session.
|
|
57
|
+
* Custom context variables for the conversation session. Keys should be prefixed with "vars.".
|
|
58
58
|
*/
|
|
59
59
|
variables: Variables | null;
|
|
60
60
|
/**
|
|
@@ -77,7 +77,7 @@ export type AgentResponse = {
|
|
|
77
77
|
*/
|
|
78
78
|
languages?: Array<string> | undefined;
|
|
79
79
|
/**
|
|
80
|
-
* Custom context variables for the conversation session.
|
|
80
|
+
* Custom context variables for the conversation session. Keys should be prefixed with "vars.".
|
|
81
81
|
*/
|
|
82
82
|
variables: { [k: string]: string };
|
|
83
83
|
/**
|
|
@@ -54,7 +54,7 @@ export type AgentUpdate = {
|
|
|
54
54
|
*/
|
|
55
55
|
languages?: Array<string> | undefined;
|
|
56
56
|
/**
|
|
57
|
-
* Custom context variables for the conversation session.
|
|
57
|
+
* Custom context variables for the conversation session. Keys should be prefixed with "vars.".
|
|
58
58
|
*/
|
|
59
59
|
variables: AgentUpdateVariables | null;
|
|
60
60
|
/**
|
|
@@ -21,95 +21,6 @@ export type ToolCreateRequest = {
|
|
|
21
21
|
name: string;
|
|
22
22
|
/**
|
|
23
23
|
* A tool that can be called from an LLM during the conversation.
|
|
24
|
-
*
|
|
25
|
-
* @remarks
|
|
26
|
-
*
|
|
27
|
-
* The tool can result in one of the following actions depending on the `type` field:
|
|
28
|
-
* - `action`:
|
|
29
|
-
* A request to perform an action.
|
|
30
|
-
* - `endpoint`:
|
|
31
|
-
* An HTTP API call to an external tool. Requires the `endpoint` field to be set too.
|
|
32
|
-
* - `context`:
|
|
33
|
-
* Sets context variables based on the tool arguments, e.g. to change the session language. Only
|
|
34
|
-
* `language` and `say` context vars are currently supported, but this will be made more generic.
|
|
35
|
-
*
|
|
36
|
-
* For example, to change the current session language:
|
|
37
|
-
* {
|
|
38
|
-
* "type": "context",
|
|
39
|
-
* "tool": {
|
|
40
|
-
* "function": {
|
|
41
|
-
* "name": "set_language",
|
|
42
|
-
* "parameters": {
|
|
43
|
-
* "language": {
|
|
44
|
-
* "type": "string",
|
|
45
|
-
* "description": "The ISO 639 language code to set for the session e.g. 'en-US'."
|
|
46
|
-
* },
|
|
47
|
-
* "message": {
|
|
48
|
-
* "type": "string",
|
|
49
|
-
* "description": "Inform the caller we're now speaking in the new language."
|
|
50
|
-
* }
|
|
51
|
-
* }
|
|
52
|
-
* }
|
|
53
|
-
* }
|
|
54
|
-
* }
|
|
55
|
-
*
|
|
56
|
-
* If `defaults` is provided, it will be used as the default values for the parameters of the
|
|
57
|
-
* tool call, if the LLM doesn't provide them:
|
|
58
|
-
* "defaults": {
|
|
59
|
-
* "hospital": "Queens Hospital"
|
|
60
|
-
* }
|
|
61
|
-
*
|
|
62
|
-
* Some special "transform" handling is supported if the value is a dict with a single `transform`
|
|
63
|
-
* key. The parameter value will be transformed by the given `action` before being used as the
|
|
64
|
-
* default value:
|
|
65
|
-
*
|
|
66
|
-
* Removing an unwanted parameter:
|
|
67
|
-
* "defaults": {
|
|
68
|
-
* "hospital": {
|
|
69
|
-
* "transform": {
|
|
70
|
-
* "action": "remove"
|
|
71
|
-
* }
|
|
72
|
-
* }
|
|
73
|
-
* }
|
|
74
|
-
*
|
|
75
|
-
* Using a value from another parameter and converting it to a dictionary:
|
|
76
|
-
* "defaults": {
|
|
77
|
-
* "tags.hospital": "{vars.hospital}",
|
|
78
|
-
* "tags.foo": "{params.foo}",
|
|
79
|
-
* "foo": {
|
|
80
|
-
* "transform": {
|
|
81
|
-
* "action": "remove"
|
|
82
|
-
* }
|
|
83
|
-
* }
|
|
84
|
-
* }
|
|
85
|
-
*
|
|
86
|
-
* Add custom parameters from other parameters using Python's `format`:
|
|
87
|
-
* "defaults": {
|
|
88
|
-
* "hello": {
|
|
89
|
-
* "transform": {
|
|
90
|
-
* "format": "Hello, {name}!"
|
|
91
|
-
* }
|
|
92
|
-
* }
|
|
93
|
-
* }
|
|
94
|
-
*
|
|
95
|
-
* Modify a value conditionally, e.g. change a `city` parameter with value "Bronx" to "The Bronx":
|
|
96
|
-
* {
|
|
97
|
-
* "defaults": {
|
|
98
|
-
* "city": {
|
|
99
|
-
* "transform": {
|
|
100
|
-
* "when": {"operator": "eq", "key": "city", "value": "Bronx"},
|
|
101
|
-
* "action": "override",
|
|
102
|
-
* "format": "The {city}"
|
|
103
|
-
* }
|
|
104
|
-
* }
|
|
105
|
-
* }
|
|
106
|
-
* }
|
|
107
|
-
*
|
|
108
|
-
* Some common transform actions can be abbreviated using the `@` prefix to support a string syntax:
|
|
109
|
-
* "defaults": {
|
|
110
|
-
* "foo": "@remove",
|
|
111
|
-
* "name": "@override Hello, {name}!"
|
|
112
|
-
* }
|
|
113
24
|
*/
|
|
114
25
|
definition: ToolDefinition;
|
|
115
26
|
/**
|
|
@@ -45,95 +45,6 @@ export type Result = {};
|
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
47
|
* A tool that can be called from an LLM during the conversation.
|
|
48
|
-
*
|
|
49
|
-
* @remarks
|
|
50
|
-
*
|
|
51
|
-
* The tool can result in one of the following actions depending on the `type` field:
|
|
52
|
-
* - `action`:
|
|
53
|
-
* A request to perform an action.
|
|
54
|
-
* - `endpoint`:
|
|
55
|
-
* An HTTP API call to an external tool. Requires the `endpoint` field to be set too.
|
|
56
|
-
* - `context`:
|
|
57
|
-
* Sets context variables based on the tool arguments, e.g. to change the session language. Only
|
|
58
|
-
* `language` and `say` context vars are currently supported, but this will be made more generic.
|
|
59
|
-
*
|
|
60
|
-
* For example, to change the current session language:
|
|
61
|
-
* {
|
|
62
|
-
* "type": "context",
|
|
63
|
-
* "tool": {
|
|
64
|
-
* "function": {
|
|
65
|
-
* "name": "set_language",
|
|
66
|
-
* "parameters": {
|
|
67
|
-
* "language": {
|
|
68
|
-
* "type": "string",
|
|
69
|
-
* "description": "The ISO 639 language code to set for the session e.g. 'en-US'."
|
|
70
|
-
* },
|
|
71
|
-
* "message": {
|
|
72
|
-
* "type": "string",
|
|
73
|
-
* "description": "Inform the caller we're now speaking in the new language."
|
|
74
|
-
* }
|
|
75
|
-
* }
|
|
76
|
-
* }
|
|
77
|
-
* }
|
|
78
|
-
* }
|
|
79
|
-
*
|
|
80
|
-
* If `defaults` is provided, it will be used as the default values for the parameters of the
|
|
81
|
-
* tool call, if the LLM doesn't provide them:
|
|
82
|
-
* "defaults": {
|
|
83
|
-
* "hospital": "Queens Hospital"
|
|
84
|
-
* }
|
|
85
|
-
*
|
|
86
|
-
* Some special "transform" handling is supported if the value is a dict with a single `transform`
|
|
87
|
-
* key. The parameter value will be transformed by the given `action` before being used as the
|
|
88
|
-
* default value:
|
|
89
|
-
*
|
|
90
|
-
* Removing an unwanted parameter:
|
|
91
|
-
* "defaults": {
|
|
92
|
-
* "hospital": {
|
|
93
|
-
* "transform": {
|
|
94
|
-
* "action": "remove"
|
|
95
|
-
* }
|
|
96
|
-
* }
|
|
97
|
-
* }
|
|
98
|
-
*
|
|
99
|
-
* Using a value from another parameter and converting it to a dictionary:
|
|
100
|
-
* "defaults": {
|
|
101
|
-
* "tags.hospital": "{vars.hospital}",
|
|
102
|
-
* "tags.foo": "{params.foo}",
|
|
103
|
-
* "foo": {
|
|
104
|
-
* "transform": {
|
|
105
|
-
* "action": "remove"
|
|
106
|
-
* }
|
|
107
|
-
* }
|
|
108
|
-
* }
|
|
109
|
-
*
|
|
110
|
-
* Add custom parameters from other parameters using Python's `format`:
|
|
111
|
-
* "defaults": {
|
|
112
|
-
* "hello": {
|
|
113
|
-
* "transform": {
|
|
114
|
-
* "format": "Hello, {name}!"
|
|
115
|
-
* }
|
|
116
|
-
* }
|
|
117
|
-
* }
|
|
118
|
-
*
|
|
119
|
-
* Modify a value conditionally, e.g. change a `city` parameter with value "Bronx" to "The Bronx":
|
|
120
|
-
* {
|
|
121
|
-
* "defaults": {
|
|
122
|
-
* "city": {
|
|
123
|
-
* "transform": {
|
|
124
|
-
* "when": {"operator": "eq", "key": "city", "value": "Bronx"},
|
|
125
|
-
* "action": "override",
|
|
126
|
-
* "format": "The {city}"
|
|
127
|
-
* }
|
|
128
|
-
* }
|
|
129
|
-
* }
|
|
130
|
-
* }
|
|
131
|
-
*
|
|
132
|
-
* Some common transform actions can be abbreviated using the `@` prefix to support a string syntax:
|
|
133
|
-
* "defaults": {
|
|
134
|
-
* "foo": "@remove",
|
|
135
|
-
* "name": "@override Hello, {name}!"
|
|
136
|
-
* }
|
|
137
48
|
*/
|
|
138
49
|
export type ToolDefinition = {
|
|
139
50
|
/**
|
|
@@ -28,95 +28,6 @@ export type ToolResponse = {
|
|
|
28
28
|
name: string;
|
|
29
29
|
/**
|
|
30
30
|
* A tool that can be called from an LLM during the conversation.
|
|
31
|
-
*
|
|
32
|
-
* @remarks
|
|
33
|
-
*
|
|
34
|
-
* The tool can result in one of the following actions depending on the `type` field:
|
|
35
|
-
* - `action`:
|
|
36
|
-
* A request to perform an action.
|
|
37
|
-
* - `endpoint`:
|
|
38
|
-
* An HTTP API call to an external tool. Requires the `endpoint` field to be set too.
|
|
39
|
-
* - `context`:
|
|
40
|
-
* Sets context variables based on the tool arguments, e.g. to change the session language. Only
|
|
41
|
-
* `language` and `say` context vars are currently supported, but this will be made more generic.
|
|
42
|
-
*
|
|
43
|
-
* For example, to change the current session language:
|
|
44
|
-
* {
|
|
45
|
-
* "type": "context",
|
|
46
|
-
* "tool": {
|
|
47
|
-
* "function": {
|
|
48
|
-
* "name": "set_language",
|
|
49
|
-
* "parameters": {
|
|
50
|
-
* "language": {
|
|
51
|
-
* "type": "string",
|
|
52
|
-
* "description": "The ISO 639 language code to set for the session e.g. 'en-US'."
|
|
53
|
-
* },
|
|
54
|
-
* "message": {
|
|
55
|
-
* "type": "string",
|
|
56
|
-
* "description": "Inform the caller we're now speaking in the new language."
|
|
57
|
-
* }
|
|
58
|
-
* }
|
|
59
|
-
* }
|
|
60
|
-
* }
|
|
61
|
-
* }
|
|
62
|
-
*
|
|
63
|
-
* If `defaults` is provided, it will be used as the default values for the parameters of the
|
|
64
|
-
* tool call, if the LLM doesn't provide them:
|
|
65
|
-
* "defaults": {
|
|
66
|
-
* "hospital": "Queens Hospital"
|
|
67
|
-
* }
|
|
68
|
-
*
|
|
69
|
-
* Some special "transform" handling is supported if the value is a dict with a single `transform`
|
|
70
|
-
* key. The parameter value will be transformed by the given `action` before being used as the
|
|
71
|
-
* default value:
|
|
72
|
-
*
|
|
73
|
-
* Removing an unwanted parameter:
|
|
74
|
-
* "defaults": {
|
|
75
|
-
* "hospital": {
|
|
76
|
-
* "transform": {
|
|
77
|
-
* "action": "remove"
|
|
78
|
-
* }
|
|
79
|
-
* }
|
|
80
|
-
* }
|
|
81
|
-
*
|
|
82
|
-
* Using a value from another parameter and converting it to a dictionary:
|
|
83
|
-
* "defaults": {
|
|
84
|
-
* "tags.hospital": "{vars.hospital}",
|
|
85
|
-
* "tags.foo": "{params.foo}",
|
|
86
|
-
* "foo": {
|
|
87
|
-
* "transform": {
|
|
88
|
-
* "action": "remove"
|
|
89
|
-
* }
|
|
90
|
-
* }
|
|
91
|
-
* }
|
|
92
|
-
*
|
|
93
|
-
* Add custom parameters from other parameters using Python's `format`:
|
|
94
|
-
* "defaults": {
|
|
95
|
-
* "hello": {
|
|
96
|
-
* "transform": {
|
|
97
|
-
* "format": "Hello, {name}!"
|
|
98
|
-
* }
|
|
99
|
-
* }
|
|
100
|
-
* }
|
|
101
|
-
*
|
|
102
|
-
* Modify a value conditionally, e.g. change a `city` parameter with value "Bronx" to "The Bronx":
|
|
103
|
-
* {
|
|
104
|
-
* "defaults": {
|
|
105
|
-
* "city": {
|
|
106
|
-
* "transform": {
|
|
107
|
-
* "when": {"operator": "eq", "key": "city", "value": "Bronx"},
|
|
108
|
-
* "action": "override",
|
|
109
|
-
* "format": "The {city}"
|
|
110
|
-
* }
|
|
111
|
-
* }
|
|
112
|
-
* }
|
|
113
|
-
* }
|
|
114
|
-
*
|
|
115
|
-
* Some common transform actions can be abbreviated using the `@` prefix to support a string syntax:
|
|
116
|
-
* "defaults": {
|
|
117
|
-
* "foo": "@remove",
|
|
118
|
-
* "name": "@override Hello, {name}!"
|
|
119
|
-
* }
|
|
120
31
|
*/
|
|
121
32
|
definition: ToolDefinition;
|
|
122
33
|
/**
|