syllable-sdk 0.1.0-alpha.27 → 0.1.0-alpha.28
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/tools/README.md +36 -0
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/models/components/channel.d.ts +0 -3
- package/models/components/channel.d.ts.map +1 -1
- package/models/components/channel.js.map +1 -1
- package/models/components/channeltarget.d.ts +16 -16
- package/models/components/channeltarget.d.ts.map +1 -1
- package/models/components/channeltarget.js +16 -16
- package/models/components/channeltarget.js.map +1 -1
- package/models/components/channeltargetcreaterequest.d.ts +12 -12
- package/models/components/channeltargetcreaterequest.d.ts.map +1 -1
- package/models/components/channeltargetcreaterequest.js +12 -12
- package/models/components/channeltargetcreaterequest.js.map +1 -1
- package/models/components/channeltargetupdaterequest.d.ts +12 -12
- package/models/components/channeltargetupdaterequest.d.ts.map +1 -1
- package/models/components/channeltargetupdaterequest.js +12 -12
- package/models/components/channeltargetupdaterequest.js.map +1 -1
- package/models/components/function.d.ts +74 -0
- package/models/components/function.d.ts.map +1 -0
- package/models/components/function.js +86 -0
- package/models/components/function.js.map +1 -0
- package/models/components/httpendpoint.d.ts +114 -0
- package/models/components/httpendpoint.d.ts.map +1 -0
- package/models/components/httpendpoint.js +119 -0
- package/models/components/httpendpoint.js.map +1 -0
- package/models/components/index.d.ts +8 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +8 -0
- package/models/components/index.js.map +1 -1
- package/models/components/llmconfig.d.ts +3 -34
- package/models/components/llmconfig.d.ts.map +1 -1
- package/models/components/llmconfig.js +4 -26
- package/models/components/llmconfig.js.map +1 -1
- package/models/components/prompt.d.ts +0 -3
- package/models/components/prompt.d.ts.map +1 -1
- package/models/components/prompt.js.map +1 -1
- package/models/components/promptcreate.d.ts +0 -3
- package/models/components/promptcreate.d.ts.map +1 -1
- package/models/components/promptcreate.js.map +1 -1
- package/models/components/promptupdate.d.ts +0 -3
- package/models/components/promptupdate.d.ts.map +1 -1
- package/models/components/promptupdate.js.map +1 -1
- package/models/components/provider.d.ts +34 -0
- package/models/components/provider.d.ts.map +1 -0
- package/models/components/provider.js +54 -0
- package/models/components/provider.js.map +1 -0
- package/models/components/sdkinternaltool.d.ts +46 -0
- package/models/components/sdkinternaltool.d.ts.map +1 -0
- package/models/components/sdkinternaltool.js +62 -0
- package/models/components/sdkinternaltool.js.map +1 -0
- package/models/components/sdktooldefinition.d.ts +161 -0
- package/models/components/sdktooldefinition.d.ts.map +1 -0
- package/models/components/sdktooldefinition.js +175 -0
- package/models/components/sdktooldefinition.js.map +1 -0
- package/models/components/target.d.ts +0 -3
- package/models/components/target.d.ts.map +1 -1
- package/models/components/target.js.map +1 -1
- package/models/components/tool.d.ts +3 -29
- package/models/components/tool.d.ts.map +1 -1
- package/models/components/tool.js +4 -26
- package/models/components/tool.js.map +1 -1
- package/models/components/toolcreate.d.ts +3 -29
- package/models/components/toolcreate.d.ts.map +1 -1
- package/models/components/toolcreate.js +4 -26
- package/models/components/toolcreate.js.map +1 -1
- package/models/components/toolparameterdefault.d.ts +36 -0
- package/models/components/toolparameterdefault.d.ts.map +1 -0
- package/models/components/toolparameterdefault.js +60 -0
- package/models/components/toolparameterdefault.js.map +1 -0
- package/models/components/toolparametertransform.d.ts +81 -0
- package/models/components/toolparametertransform.d.ts.map +1 -0
- package/models/components/toolparametertransform.js +88 -0
- package/models/components/toolparametertransform.js.map +1 -0
- package/models/components/toolparametertransformcondition.d.ts +45 -0
- package/models/components/toolparametertransformcondition.d.ts.map +1 -0
- package/models/components/toolparametertransformcondition.js +63 -0
- package/models/components/toolparametertransformcondition.js.map +1 -0
- package/models/components/toolupdate.d.ts +3 -29
- package/models/components/toolupdate.d.ts.map +1 -1
- package/models/components/toolupdate.js +4 -26
- package/models/components/toolupdate.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/config.ts +2 -2
- package/src/models/components/channel.ts +0 -3
- package/src/models/components/channeltarget.ts +32 -32
- package/src/models/components/channeltargetcreaterequest.ts +24 -24
- package/src/models/components/channeltargetupdaterequest.ts +24 -24
- package/src/models/components/function.ts +136 -0
- package/src/models/components/httpendpoint.ts +158 -0
- package/src/models/components/index.ts +8 -0
- package/src/models/components/llmconfig.ts +9 -36
- package/src/models/components/prompt.ts +0 -3
- package/src/models/components/promptcreate.ts +0 -3
- package/src/models/components/promptupdate.ts +0 -3
- package/src/models/components/provider.ts +37 -0
- package/src/models/components/sdkinternaltool.ts +88 -0
- package/src/models/components/sdktooldefinition.ts +298 -0
- package/src/models/components/target.ts +0 -3
- package/src/models/components/tool.ts +10 -56
- package/src/models/components/toolcreate.ts +10 -60
- package/src/models/components/toolparameterdefault.ts +78 -0
- package/src/models/components/toolparametertransform.ts +125 -0
- package/src/models/components/toolparametertransformcondition.ts +88 -0
- package/src/models/components/toolupdate.ts +10 -60
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
HttpEndpoint,
|
|
12
|
+
HttpEndpoint$inboundSchema,
|
|
13
|
+
HttpEndpoint$Outbound,
|
|
14
|
+
HttpEndpoint$outboundSchema,
|
|
15
|
+
} from "./httpendpoint.js";
|
|
16
|
+
import {
|
|
17
|
+
SDKInternalTool,
|
|
18
|
+
SDKInternalTool$inboundSchema,
|
|
19
|
+
SDKInternalTool$Outbound,
|
|
20
|
+
SDKInternalTool$outboundSchema,
|
|
21
|
+
} from "./sdkinternaltool.js";
|
|
22
|
+
import {
|
|
23
|
+
ToolParameterDefault,
|
|
24
|
+
ToolParameterDefault$inboundSchema,
|
|
25
|
+
ToolParameterDefault$Outbound,
|
|
26
|
+
ToolParameterDefault$outboundSchema,
|
|
27
|
+
} from "./toolparameterdefault.js";
|
|
28
|
+
|
|
29
|
+
export const Type = {
|
|
30
|
+
Action: "action",
|
|
31
|
+
Endpoint: "endpoint",
|
|
32
|
+
Context: "context",
|
|
33
|
+
Log: "log",
|
|
34
|
+
} as const;
|
|
35
|
+
export type Type = ClosedEnum<typeof Type>;
|
|
36
|
+
|
|
37
|
+
export type One = {};
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The default values for the parameters of the function/tool call.
|
|
41
|
+
*/
|
|
42
|
+
export type Defaults = One | { [k: string]: ToolParameterDefault };
|
|
43
|
+
|
|
44
|
+
export type Result = {};
|
|
45
|
+
|
|
46
|
+
export type SDKToolDefinition = {
|
|
47
|
+
/**
|
|
48
|
+
* The action to take when GPT calls the tool.
|
|
49
|
+
*/
|
|
50
|
+
type?: Type | null | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* A tool definition to be used by the OpenAI API.
|
|
53
|
+
*/
|
|
54
|
+
tool: SDKInternalTool;
|
|
55
|
+
/**
|
|
56
|
+
* The configuration for an HTTP API call.
|
|
57
|
+
*/
|
|
58
|
+
endpoint?: HttpEndpoint | null | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* The default values for the parameters of the function/tool call.
|
|
61
|
+
*/
|
|
62
|
+
defaults?: One | { [k: string]: ToolParameterDefault } | null | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* The optional result of the tool call. Only used for `context` tools.
|
|
65
|
+
*/
|
|
66
|
+
result?: Result | null | undefined;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/** @internal */
|
|
70
|
+
export const Type$inboundSchema: z.ZodNativeEnum<typeof Type> = z.nativeEnum(
|
|
71
|
+
Type,
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
/** @internal */
|
|
75
|
+
export const Type$outboundSchema: z.ZodNativeEnum<typeof Type> =
|
|
76
|
+
Type$inboundSchema;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* @internal
|
|
80
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
81
|
+
*/
|
|
82
|
+
export namespace Type$ {
|
|
83
|
+
/** @deprecated use `Type$inboundSchema` instead. */
|
|
84
|
+
export const inboundSchema = Type$inboundSchema;
|
|
85
|
+
/** @deprecated use `Type$outboundSchema` instead. */
|
|
86
|
+
export const outboundSchema = Type$outboundSchema;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** @internal */
|
|
90
|
+
export const One$inboundSchema: z.ZodType<One, z.ZodTypeDef, unknown> = z
|
|
91
|
+
.object({});
|
|
92
|
+
|
|
93
|
+
/** @internal */
|
|
94
|
+
export type One$Outbound = {};
|
|
95
|
+
|
|
96
|
+
/** @internal */
|
|
97
|
+
export const One$outboundSchema: z.ZodType<One$Outbound, z.ZodTypeDef, One> = z
|
|
98
|
+
.object({});
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* @internal
|
|
102
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
103
|
+
*/
|
|
104
|
+
export namespace One$ {
|
|
105
|
+
/** @deprecated use `One$inboundSchema` instead. */
|
|
106
|
+
export const inboundSchema = One$inboundSchema;
|
|
107
|
+
/** @deprecated use `One$outboundSchema` instead. */
|
|
108
|
+
export const outboundSchema = One$outboundSchema;
|
|
109
|
+
/** @deprecated use `One$Outbound` instead. */
|
|
110
|
+
export type Outbound = One$Outbound;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function oneToJSON(one: One): string {
|
|
114
|
+
return JSON.stringify(One$outboundSchema.parse(one));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export function oneFromJSON(
|
|
118
|
+
jsonString: string,
|
|
119
|
+
): SafeParseResult<One, SDKValidationError> {
|
|
120
|
+
return safeParse(
|
|
121
|
+
jsonString,
|
|
122
|
+
(x) => One$inboundSchema.parse(JSON.parse(x)),
|
|
123
|
+
`Failed to parse 'One' from JSON`,
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** @internal */
|
|
128
|
+
export const Defaults$inboundSchema: z.ZodType<
|
|
129
|
+
Defaults,
|
|
130
|
+
z.ZodTypeDef,
|
|
131
|
+
unknown
|
|
132
|
+
> = z.union([
|
|
133
|
+
z.lazy(() => One$inboundSchema),
|
|
134
|
+
z.record(ToolParameterDefault$inboundSchema),
|
|
135
|
+
]);
|
|
136
|
+
|
|
137
|
+
/** @internal */
|
|
138
|
+
export type Defaults$Outbound = One$Outbound | {
|
|
139
|
+
[k: string]: ToolParameterDefault$Outbound;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
/** @internal */
|
|
143
|
+
export const Defaults$outboundSchema: z.ZodType<
|
|
144
|
+
Defaults$Outbound,
|
|
145
|
+
z.ZodTypeDef,
|
|
146
|
+
Defaults
|
|
147
|
+
> = z.union([
|
|
148
|
+
z.lazy(() => One$outboundSchema),
|
|
149
|
+
z.record(ToolParameterDefault$outboundSchema),
|
|
150
|
+
]);
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* @internal
|
|
154
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
155
|
+
*/
|
|
156
|
+
export namespace Defaults$ {
|
|
157
|
+
/** @deprecated use `Defaults$inboundSchema` instead. */
|
|
158
|
+
export const inboundSchema = Defaults$inboundSchema;
|
|
159
|
+
/** @deprecated use `Defaults$outboundSchema` instead. */
|
|
160
|
+
export const outboundSchema = Defaults$outboundSchema;
|
|
161
|
+
/** @deprecated use `Defaults$Outbound` instead. */
|
|
162
|
+
export type Outbound = Defaults$Outbound;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export function defaultsToJSON(defaults: Defaults): string {
|
|
166
|
+
return JSON.stringify(Defaults$outboundSchema.parse(defaults));
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export function defaultsFromJSON(
|
|
170
|
+
jsonString: string,
|
|
171
|
+
): SafeParseResult<Defaults, SDKValidationError> {
|
|
172
|
+
return safeParse(
|
|
173
|
+
jsonString,
|
|
174
|
+
(x) => Defaults$inboundSchema.parse(JSON.parse(x)),
|
|
175
|
+
`Failed to parse 'Defaults' from JSON`,
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/** @internal */
|
|
180
|
+
export const Result$inboundSchema: z.ZodType<Result, z.ZodTypeDef, unknown> = z
|
|
181
|
+
.object({});
|
|
182
|
+
|
|
183
|
+
/** @internal */
|
|
184
|
+
export type Result$Outbound = {};
|
|
185
|
+
|
|
186
|
+
/** @internal */
|
|
187
|
+
export const Result$outboundSchema: z.ZodType<
|
|
188
|
+
Result$Outbound,
|
|
189
|
+
z.ZodTypeDef,
|
|
190
|
+
Result
|
|
191
|
+
> = z.object({});
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* @internal
|
|
195
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
196
|
+
*/
|
|
197
|
+
export namespace Result$ {
|
|
198
|
+
/** @deprecated use `Result$inboundSchema` instead. */
|
|
199
|
+
export const inboundSchema = Result$inboundSchema;
|
|
200
|
+
/** @deprecated use `Result$outboundSchema` instead. */
|
|
201
|
+
export const outboundSchema = Result$outboundSchema;
|
|
202
|
+
/** @deprecated use `Result$Outbound` instead. */
|
|
203
|
+
export type Outbound = Result$Outbound;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export function resultToJSON(result: Result): string {
|
|
207
|
+
return JSON.stringify(Result$outboundSchema.parse(result));
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export function resultFromJSON(
|
|
211
|
+
jsonString: string,
|
|
212
|
+
): SafeParseResult<Result, SDKValidationError> {
|
|
213
|
+
return safeParse(
|
|
214
|
+
jsonString,
|
|
215
|
+
(x) => Result$inboundSchema.parse(JSON.parse(x)),
|
|
216
|
+
`Failed to parse 'Result' from JSON`,
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/** @internal */
|
|
221
|
+
export const SDKToolDefinition$inboundSchema: z.ZodType<
|
|
222
|
+
SDKToolDefinition,
|
|
223
|
+
z.ZodTypeDef,
|
|
224
|
+
unknown
|
|
225
|
+
> = z.object({
|
|
226
|
+
type: z.nullable(Type$inboundSchema).optional(),
|
|
227
|
+
tool: SDKInternalTool$inboundSchema,
|
|
228
|
+
endpoint: z.nullable(HttpEndpoint$inboundSchema).optional(),
|
|
229
|
+
defaults: z.nullable(
|
|
230
|
+
z.union([
|
|
231
|
+
z.lazy(() => One$inboundSchema),
|
|
232
|
+
z.record(ToolParameterDefault$inboundSchema),
|
|
233
|
+
]),
|
|
234
|
+
).optional(),
|
|
235
|
+
result: z.nullable(z.lazy(() => Result$inboundSchema)).optional(),
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
/** @internal */
|
|
239
|
+
export type SDKToolDefinition$Outbound = {
|
|
240
|
+
type?: string | null | undefined;
|
|
241
|
+
tool: SDKInternalTool$Outbound;
|
|
242
|
+
endpoint?: HttpEndpoint$Outbound | null | undefined;
|
|
243
|
+
defaults?:
|
|
244
|
+
| One$Outbound
|
|
245
|
+
| { [k: string]: ToolParameterDefault$Outbound }
|
|
246
|
+
| null
|
|
247
|
+
| undefined;
|
|
248
|
+
result?: Result$Outbound | null | undefined;
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
/** @internal */
|
|
252
|
+
export const SDKToolDefinition$outboundSchema: z.ZodType<
|
|
253
|
+
SDKToolDefinition$Outbound,
|
|
254
|
+
z.ZodTypeDef,
|
|
255
|
+
SDKToolDefinition
|
|
256
|
+
> = z.object({
|
|
257
|
+
type: z.nullable(Type$outboundSchema).optional(),
|
|
258
|
+
tool: SDKInternalTool$outboundSchema,
|
|
259
|
+
endpoint: z.nullable(HttpEndpoint$outboundSchema).optional(),
|
|
260
|
+
defaults: z.nullable(
|
|
261
|
+
z.union([
|
|
262
|
+
z.lazy(() => One$outboundSchema),
|
|
263
|
+
z.record(ToolParameterDefault$outboundSchema),
|
|
264
|
+
]),
|
|
265
|
+
).optional(),
|
|
266
|
+
result: z.nullable(z.lazy(() => Result$outboundSchema)).optional(),
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* @internal
|
|
271
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
272
|
+
*/
|
|
273
|
+
export namespace SDKToolDefinition$ {
|
|
274
|
+
/** @deprecated use `SDKToolDefinition$inboundSchema` instead. */
|
|
275
|
+
export const inboundSchema = SDKToolDefinition$inboundSchema;
|
|
276
|
+
/** @deprecated use `SDKToolDefinition$outboundSchema` instead. */
|
|
277
|
+
export const outboundSchema = SDKToolDefinition$outboundSchema;
|
|
278
|
+
/** @deprecated use `SDKToolDefinition$Outbound` instead. */
|
|
279
|
+
export type Outbound = SDKToolDefinition$Outbound;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export function sdkToolDefinitionToJSON(
|
|
283
|
+
sdkToolDefinition: SDKToolDefinition,
|
|
284
|
+
): string {
|
|
285
|
+
return JSON.stringify(
|
|
286
|
+
SDKToolDefinition$outboundSchema.parse(sdkToolDefinition),
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export function sdkToolDefinitionFromJSON(
|
|
291
|
+
jsonString: string,
|
|
292
|
+
): SafeParseResult<SDKToolDefinition, SDKValidationError> {
|
|
293
|
+
return safeParse(
|
|
294
|
+
jsonString,
|
|
295
|
+
(x) => SDKToolDefinition$inboundSchema.parse(JSON.parse(x)),
|
|
296
|
+
`Failed to parse 'SDKToolDefinition' from JSON`,
|
|
297
|
+
);
|
|
298
|
+
}
|
|
@@ -7,21 +7,19 @@ import { remap as remap$ } from "../../lib/primitives.js";
|
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
8
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
import {
|
|
11
|
+
SDKToolDefinition,
|
|
12
|
+
SDKToolDefinition$inboundSchema,
|
|
13
|
+
SDKToolDefinition$Outbound,
|
|
14
|
+
SDKToolDefinition$outboundSchema,
|
|
15
|
+
} from "./sdktooldefinition.js";
|
|
15
16
|
|
|
16
17
|
export type Tool = {
|
|
17
18
|
/**
|
|
18
19
|
* The name of the tool
|
|
19
20
|
*/
|
|
20
21
|
name: string;
|
|
21
|
-
|
|
22
|
-
* The definition of the tool
|
|
23
|
-
*/
|
|
24
|
-
definition?: Definition | undefined;
|
|
22
|
+
definition: SDKToolDefinition;
|
|
25
23
|
/**
|
|
26
24
|
* The service this tool belongs to
|
|
27
25
|
*/
|
|
@@ -36,55 +34,11 @@ export type Tool = {
|
|
|
36
34
|
serviceName?: string | null | undefined;
|
|
37
35
|
};
|
|
38
36
|
|
|
39
|
-
/** @internal */
|
|
40
|
-
export const Definition$inboundSchema: z.ZodType<
|
|
41
|
-
Definition,
|
|
42
|
-
z.ZodTypeDef,
|
|
43
|
-
unknown
|
|
44
|
-
> = z.object({});
|
|
45
|
-
|
|
46
|
-
/** @internal */
|
|
47
|
-
export type Definition$Outbound = {};
|
|
48
|
-
|
|
49
|
-
/** @internal */
|
|
50
|
-
export const Definition$outboundSchema: z.ZodType<
|
|
51
|
-
Definition$Outbound,
|
|
52
|
-
z.ZodTypeDef,
|
|
53
|
-
Definition
|
|
54
|
-
> = z.object({});
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* @internal
|
|
58
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
59
|
-
*/
|
|
60
|
-
export namespace Definition$ {
|
|
61
|
-
/** @deprecated use `Definition$inboundSchema` instead. */
|
|
62
|
-
export const inboundSchema = Definition$inboundSchema;
|
|
63
|
-
/** @deprecated use `Definition$outboundSchema` instead. */
|
|
64
|
-
export const outboundSchema = Definition$outboundSchema;
|
|
65
|
-
/** @deprecated use `Definition$Outbound` instead. */
|
|
66
|
-
export type Outbound = Definition$Outbound;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export function definitionToJSON(definition: Definition): string {
|
|
70
|
-
return JSON.stringify(Definition$outboundSchema.parse(definition));
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export function definitionFromJSON(
|
|
74
|
-
jsonString: string,
|
|
75
|
-
): SafeParseResult<Definition, SDKValidationError> {
|
|
76
|
-
return safeParse(
|
|
77
|
-
jsonString,
|
|
78
|
-
(x) => Definition$inboundSchema.parse(JSON.parse(x)),
|
|
79
|
-
`Failed to parse 'Definition' from JSON`,
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
37
|
/** @internal */
|
|
84
38
|
export const Tool$inboundSchema: z.ZodType<Tool, z.ZodTypeDef, unknown> = z
|
|
85
39
|
.object({
|
|
86
40
|
name: z.string(),
|
|
87
|
-
definition:
|
|
41
|
+
definition: SDKToolDefinition$inboundSchema,
|
|
88
42
|
service_id: z.number().int(),
|
|
89
43
|
id: z.number().int(),
|
|
90
44
|
service_name: z.nullable(z.string()).optional(),
|
|
@@ -98,7 +52,7 @@ export const Tool$inboundSchema: z.ZodType<Tool, z.ZodTypeDef, unknown> = z
|
|
|
98
52
|
/** @internal */
|
|
99
53
|
export type Tool$Outbound = {
|
|
100
54
|
name: string;
|
|
101
|
-
definition
|
|
55
|
+
definition: SDKToolDefinition$Outbound;
|
|
102
56
|
service_id: number;
|
|
103
57
|
id: number;
|
|
104
58
|
service_name?: string | null | undefined;
|
|
@@ -108,7 +62,7 @@ export type Tool$Outbound = {
|
|
|
108
62
|
export const Tool$outboundSchema: z.ZodType<Tool$Outbound, z.ZodTypeDef, Tool> =
|
|
109
63
|
z.object({
|
|
110
64
|
name: z.string(),
|
|
111
|
-
definition:
|
|
65
|
+
definition: SDKToolDefinition$outboundSchema,
|
|
112
66
|
serviceId: z.number().int(),
|
|
113
67
|
id: z.number().int(),
|
|
114
68
|
serviceName: z.nullable(z.string()).optional(),
|
|
@@ -7,75 +7,25 @@ import { remap as remap$ } from "../../lib/primitives.js";
|
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
8
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
import {
|
|
11
|
+
SDKToolDefinition,
|
|
12
|
+
SDKToolDefinition$inboundSchema,
|
|
13
|
+
SDKToolDefinition$Outbound,
|
|
14
|
+
SDKToolDefinition$outboundSchema,
|
|
15
|
+
} from "./sdktooldefinition.js";
|
|
15
16
|
|
|
16
17
|
export type ToolCreate = {
|
|
17
18
|
/**
|
|
18
19
|
* The name of the tool
|
|
19
20
|
*/
|
|
20
21
|
name: string;
|
|
21
|
-
|
|
22
|
-
* The definition of the tool
|
|
23
|
-
*/
|
|
24
|
-
definition?: ToolCreateDefinition | undefined;
|
|
22
|
+
definition: SDKToolDefinition;
|
|
25
23
|
/**
|
|
26
24
|
* The service this tool belongs to
|
|
27
25
|
*/
|
|
28
26
|
serviceId: number;
|
|
29
27
|
};
|
|
30
28
|
|
|
31
|
-
/** @internal */
|
|
32
|
-
export const ToolCreateDefinition$inboundSchema: z.ZodType<
|
|
33
|
-
ToolCreateDefinition,
|
|
34
|
-
z.ZodTypeDef,
|
|
35
|
-
unknown
|
|
36
|
-
> = z.object({});
|
|
37
|
-
|
|
38
|
-
/** @internal */
|
|
39
|
-
export type ToolCreateDefinition$Outbound = {};
|
|
40
|
-
|
|
41
|
-
/** @internal */
|
|
42
|
-
export const ToolCreateDefinition$outboundSchema: z.ZodType<
|
|
43
|
-
ToolCreateDefinition$Outbound,
|
|
44
|
-
z.ZodTypeDef,
|
|
45
|
-
ToolCreateDefinition
|
|
46
|
-
> = z.object({});
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* @internal
|
|
50
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
51
|
-
*/
|
|
52
|
-
export namespace ToolCreateDefinition$ {
|
|
53
|
-
/** @deprecated use `ToolCreateDefinition$inboundSchema` instead. */
|
|
54
|
-
export const inboundSchema = ToolCreateDefinition$inboundSchema;
|
|
55
|
-
/** @deprecated use `ToolCreateDefinition$outboundSchema` instead. */
|
|
56
|
-
export const outboundSchema = ToolCreateDefinition$outboundSchema;
|
|
57
|
-
/** @deprecated use `ToolCreateDefinition$Outbound` instead. */
|
|
58
|
-
export type Outbound = ToolCreateDefinition$Outbound;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export function toolCreateDefinitionToJSON(
|
|
62
|
-
toolCreateDefinition: ToolCreateDefinition,
|
|
63
|
-
): string {
|
|
64
|
-
return JSON.stringify(
|
|
65
|
-
ToolCreateDefinition$outboundSchema.parse(toolCreateDefinition),
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export function toolCreateDefinitionFromJSON(
|
|
70
|
-
jsonString: string,
|
|
71
|
-
): SafeParseResult<ToolCreateDefinition, SDKValidationError> {
|
|
72
|
-
return safeParse(
|
|
73
|
-
jsonString,
|
|
74
|
-
(x) => ToolCreateDefinition$inboundSchema.parse(JSON.parse(x)),
|
|
75
|
-
`Failed to parse 'ToolCreateDefinition' from JSON`,
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
29
|
/** @internal */
|
|
80
30
|
export const ToolCreate$inboundSchema: z.ZodType<
|
|
81
31
|
ToolCreate,
|
|
@@ -83,7 +33,7 @@ export const ToolCreate$inboundSchema: z.ZodType<
|
|
|
83
33
|
unknown
|
|
84
34
|
> = z.object({
|
|
85
35
|
name: z.string(),
|
|
86
|
-
definition:
|
|
36
|
+
definition: SDKToolDefinition$inboundSchema,
|
|
87
37
|
service_id: z.number().int(),
|
|
88
38
|
}).transform((v) => {
|
|
89
39
|
return remap$(v, {
|
|
@@ -94,7 +44,7 @@ export const ToolCreate$inboundSchema: z.ZodType<
|
|
|
94
44
|
/** @internal */
|
|
95
45
|
export type ToolCreate$Outbound = {
|
|
96
46
|
name: string;
|
|
97
|
-
definition
|
|
47
|
+
definition: SDKToolDefinition$Outbound;
|
|
98
48
|
service_id: number;
|
|
99
49
|
};
|
|
100
50
|
|
|
@@ -105,7 +55,7 @@ export const ToolCreate$outboundSchema: z.ZodType<
|
|
|
105
55
|
ToolCreate
|
|
106
56
|
> = z.object({
|
|
107
57
|
name: z.string(),
|
|
108
|
-
definition:
|
|
58
|
+
definition: SDKToolDefinition$outboundSchema,
|
|
109
59
|
serviceId: z.number().int(),
|
|
110
60
|
}).transform((v) => {
|
|
111
61
|
return remap$(v, {
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
ToolParameterTransform,
|
|
11
|
+
ToolParameterTransform$inboundSchema,
|
|
12
|
+
ToolParameterTransform$Outbound,
|
|
13
|
+
ToolParameterTransform$outboundSchema,
|
|
14
|
+
} from "./toolparametertransform.js";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The default value for a parameter of the tool call.
|
|
18
|
+
*/
|
|
19
|
+
export type ToolParameterDefault = {
|
|
20
|
+
/**
|
|
21
|
+
* A transform to be applied to the value of a parameter.
|
|
22
|
+
*/
|
|
23
|
+
transform: ToolParameterTransform;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/** @internal */
|
|
27
|
+
export const ToolParameterDefault$inboundSchema: z.ZodType<
|
|
28
|
+
ToolParameterDefault,
|
|
29
|
+
z.ZodTypeDef,
|
|
30
|
+
unknown
|
|
31
|
+
> = z.object({
|
|
32
|
+
transform: ToolParameterTransform$inboundSchema,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
/** @internal */
|
|
36
|
+
export type ToolParameterDefault$Outbound = {
|
|
37
|
+
transform: ToolParameterTransform$Outbound;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** @internal */
|
|
41
|
+
export const ToolParameterDefault$outboundSchema: z.ZodType<
|
|
42
|
+
ToolParameterDefault$Outbound,
|
|
43
|
+
z.ZodTypeDef,
|
|
44
|
+
ToolParameterDefault
|
|
45
|
+
> = z.object({
|
|
46
|
+
transform: ToolParameterTransform$outboundSchema,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @internal
|
|
51
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
52
|
+
*/
|
|
53
|
+
export namespace ToolParameterDefault$ {
|
|
54
|
+
/** @deprecated use `ToolParameterDefault$inboundSchema` instead. */
|
|
55
|
+
export const inboundSchema = ToolParameterDefault$inboundSchema;
|
|
56
|
+
/** @deprecated use `ToolParameterDefault$outboundSchema` instead. */
|
|
57
|
+
export const outboundSchema = ToolParameterDefault$outboundSchema;
|
|
58
|
+
/** @deprecated use `ToolParameterDefault$Outbound` instead. */
|
|
59
|
+
export type Outbound = ToolParameterDefault$Outbound;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function toolParameterDefaultToJSON(
|
|
63
|
+
toolParameterDefault: ToolParameterDefault,
|
|
64
|
+
): string {
|
|
65
|
+
return JSON.stringify(
|
|
66
|
+
ToolParameterDefault$outboundSchema.parse(toolParameterDefault),
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function toolParameterDefaultFromJSON(
|
|
71
|
+
jsonString: string,
|
|
72
|
+
): SafeParseResult<ToolParameterDefault, SDKValidationError> {
|
|
73
|
+
return safeParse(
|
|
74
|
+
jsonString,
|
|
75
|
+
(x) => ToolParameterDefault$inboundSchema.parse(JSON.parse(x)),
|
|
76
|
+
`Failed to parse 'ToolParameterDefault' from JSON`,
|
|
77
|
+
);
|
|
78
|
+
}
|