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.
Files changed (105) hide show
  1. package/docs/sdks/tools/README.md +36 -0
  2. package/lib/config.d.ts +2 -2
  3. package/lib/config.js +2 -2
  4. package/models/components/channel.d.ts +0 -3
  5. package/models/components/channel.d.ts.map +1 -1
  6. package/models/components/channel.js.map +1 -1
  7. package/models/components/channeltarget.d.ts +16 -16
  8. package/models/components/channeltarget.d.ts.map +1 -1
  9. package/models/components/channeltarget.js +16 -16
  10. package/models/components/channeltarget.js.map +1 -1
  11. package/models/components/channeltargetcreaterequest.d.ts +12 -12
  12. package/models/components/channeltargetcreaterequest.d.ts.map +1 -1
  13. package/models/components/channeltargetcreaterequest.js +12 -12
  14. package/models/components/channeltargetcreaterequest.js.map +1 -1
  15. package/models/components/channeltargetupdaterequest.d.ts +12 -12
  16. package/models/components/channeltargetupdaterequest.d.ts.map +1 -1
  17. package/models/components/channeltargetupdaterequest.js +12 -12
  18. package/models/components/channeltargetupdaterequest.js.map +1 -1
  19. package/models/components/function.d.ts +74 -0
  20. package/models/components/function.d.ts.map +1 -0
  21. package/models/components/function.js +86 -0
  22. package/models/components/function.js.map +1 -0
  23. package/models/components/httpendpoint.d.ts +114 -0
  24. package/models/components/httpendpoint.d.ts.map +1 -0
  25. package/models/components/httpendpoint.js +119 -0
  26. package/models/components/httpendpoint.js.map +1 -0
  27. package/models/components/index.d.ts +8 -0
  28. package/models/components/index.d.ts.map +1 -1
  29. package/models/components/index.js +8 -0
  30. package/models/components/index.js.map +1 -1
  31. package/models/components/llmconfig.d.ts +3 -34
  32. package/models/components/llmconfig.d.ts.map +1 -1
  33. package/models/components/llmconfig.js +4 -26
  34. package/models/components/llmconfig.js.map +1 -1
  35. package/models/components/prompt.d.ts +0 -3
  36. package/models/components/prompt.d.ts.map +1 -1
  37. package/models/components/prompt.js.map +1 -1
  38. package/models/components/promptcreate.d.ts +0 -3
  39. package/models/components/promptcreate.d.ts.map +1 -1
  40. package/models/components/promptcreate.js.map +1 -1
  41. package/models/components/promptupdate.d.ts +0 -3
  42. package/models/components/promptupdate.d.ts.map +1 -1
  43. package/models/components/promptupdate.js.map +1 -1
  44. package/models/components/provider.d.ts +34 -0
  45. package/models/components/provider.d.ts.map +1 -0
  46. package/models/components/provider.js +54 -0
  47. package/models/components/provider.js.map +1 -0
  48. package/models/components/sdkinternaltool.d.ts +46 -0
  49. package/models/components/sdkinternaltool.d.ts.map +1 -0
  50. package/models/components/sdkinternaltool.js +62 -0
  51. package/models/components/sdkinternaltool.js.map +1 -0
  52. package/models/components/sdktooldefinition.d.ts +161 -0
  53. package/models/components/sdktooldefinition.d.ts.map +1 -0
  54. package/models/components/sdktooldefinition.js +175 -0
  55. package/models/components/sdktooldefinition.js.map +1 -0
  56. package/models/components/target.d.ts +0 -3
  57. package/models/components/target.d.ts.map +1 -1
  58. package/models/components/target.js.map +1 -1
  59. package/models/components/tool.d.ts +3 -29
  60. package/models/components/tool.d.ts.map +1 -1
  61. package/models/components/tool.js +4 -26
  62. package/models/components/tool.js.map +1 -1
  63. package/models/components/toolcreate.d.ts +3 -29
  64. package/models/components/toolcreate.d.ts.map +1 -1
  65. package/models/components/toolcreate.js +4 -26
  66. package/models/components/toolcreate.js.map +1 -1
  67. package/models/components/toolparameterdefault.d.ts +36 -0
  68. package/models/components/toolparameterdefault.d.ts.map +1 -0
  69. package/models/components/toolparameterdefault.js +60 -0
  70. package/models/components/toolparameterdefault.js.map +1 -0
  71. package/models/components/toolparametertransform.d.ts +81 -0
  72. package/models/components/toolparametertransform.d.ts.map +1 -0
  73. package/models/components/toolparametertransform.js +88 -0
  74. package/models/components/toolparametertransform.js.map +1 -0
  75. package/models/components/toolparametertransformcondition.d.ts +45 -0
  76. package/models/components/toolparametertransformcondition.d.ts.map +1 -0
  77. package/models/components/toolparametertransformcondition.js +63 -0
  78. package/models/components/toolparametertransformcondition.js.map +1 -0
  79. package/models/components/toolupdate.d.ts +3 -29
  80. package/models/components/toolupdate.d.ts.map +1 -1
  81. package/models/components/toolupdate.js +4 -26
  82. package/models/components/toolupdate.js.map +1 -1
  83. package/package.json +1 -1
  84. package/src/lib/config.ts +2 -2
  85. package/src/models/components/channel.ts +0 -3
  86. package/src/models/components/channeltarget.ts +32 -32
  87. package/src/models/components/channeltargetcreaterequest.ts +24 -24
  88. package/src/models/components/channeltargetupdaterequest.ts +24 -24
  89. package/src/models/components/function.ts +136 -0
  90. package/src/models/components/httpendpoint.ts +158 -0
  91. package/src/models/components/index.ts +8 -0
  92. package/src/models/components/llmconfig.ts +9 -36
  93. package/src/models/components/prompt.ts +0 -3
  94. package/src/models/components/promptcreate.ts +0 -3
  95. package/src/models/components/promptupdate.ts +0 -3
  96. package/src/models/components/provider.ts +37 -0
  97. package/src/models/components/sdkinternaltool.ts +88 -0
  98. package/src/models/components/sdktooldefinition.ts +298 -0
  99. package/src/models/components/target.ts +0 -3
  100. package/src/models/components/tool.ts +10 -56
  101. package/src/models/components/toolcreate.ts +10 -60
  102. package/src/models/components/toolparameterdefault.ts +78 -0
  103. package/src/models/components/toolparametertransform.ts +125 -0
  104. package/src/models/components/toolparametertransformcondition.ts +88 -0
  105. package/src/models/components/toolupdate.ts +10 -60
@@ -0,0 +1,158 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { ClosedEnum } from "../../types/enums.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ /**
13
+ * The HTTP method to use for the service call.
14
+ */
15
+ export const Method = {
16
+ Get: "get",
17
+ Post: "post",
18
+ } as const;
19
+ /**
20
+ * The HTTP method to use for the service call.
21
+ */
22
+ export type Method = ClosedEnum<typeof Method>;
23
+
24
+ /**
25
+ * How to pass the arguments to the request.
26
+ */
27
+ export const ArgumentLocation = {
28
+ Body: "body",
29
+ Form: "form",
30
+ Path: "path",
31
+ Query: "query",
32
+ } as const;
33
+ /**
34
+ * How to pass the arguments to the request.
35
+ */
36
+ export type ArgumentLocation = ClosedEnum<typeof ArgumentLocation>;
37
+
38
+ /**
39
+ * The configuration for an HTTP API call.
40
+ */
41
+ export type HttpEndpoint = {
42
+ /**
43
+ * The endpoint URL of the external service to call.
44
+ */
45
+ url: string;
46
+ /**
47
+ * The HTTP method to use for the service call.
48
+ */
49
+ method: Method;
50
+ /**
51
+ * How to pass the arguments to the request.
52
+ */
53
+ argumentLocation: ArgumentLocation;
54
+ };
55
+
56
+ /** @internal */
57
+ export const Method$inboundSchema: z.ZodNativeEnum<typeof Method> = z
58
+ .nativeEnum(Method);
59
+
60
+ /** @internal */
61
+ export const Method$outboundSchema: z.ZodNativeEnum<typeof Method> =
62
+ Method$inboundSchema;
63
+
64
+ /**
65
+ * @internal
66
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
67
+ */
68
+ export namespace Method$ {
69
+ /** @deprecated use `Method$inboundSchema` instead. */
70
+ export const inboundSchema = Method$inboundSchema;
71
+ /** @deprecated use `Method$outboundSchema` instead. */
72
+ export const outboundSchema = Method$outboundSchema;
73
+ }
74
+
75
+ /** @internal */
76
+ export const ArgumentLocation$inboundSchema: z.ZodNativeEnum<
77
+ typeof ArgumentLocation
78
+ > = z.nativeEnum(ArgumentLocation);
79
+
80
+ /** @internal */
81
+ export const ArgumentLocation$outboundSchema: z.ZodNativeEnum<
82
+ typeof ArgumentLocation
83
+ > = ArgumentLocation$inboundSchema;
84
+
85
+ /**
86
+ * @internal
87
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
88
+ */
89
+ export namespace ArgumentLocation$ {
90
+ /** @deprecated use `ArgumentLocation$inboundSchema` instead. */
91
+ export const inboundSchema = ArgumentLocation$inboundSchema;
92
+ /** @deprecated use `ArgumentLocation$outboundSchema` instead. */
93
+ export const outboundSchema = ArgumentLocation$outboundSchema;
94
+ }
95
+
96
+ /** @internal */
97
+ export const HttpEndpoint$inboundSchema: z.ZodType<
98
+ HttpEndpoint,
99
+ z.ZodTypeDef,
100
+ unknown
101
+ > = z.object({
102
+ url: z.string(),
103
+ method: Method$inboundSchema,
104
+ argument_location: ArgumentLocation$inboundSchema,
105
+ }).transform((v) => {
106
+ return remap$(v, {
107
+ "argument_location": "argumentLocation",
108
+ });
109
+ });
110
+
111
+ /** @internal */
112
+ export type HttpEndpoint$Outbound = {
113
+ url: string;
114
+ method: string;
115
+ argument_location: string;
116
+ };
117
+
118
+ /** @internal */
119
+ export const HttpEndpoint$outboundSchema: z.ZodType<
120
+ HttpEndpoint$Outbound,
121
+ z.ZodTypeDef,
122
+ HttpEndpoint
123
+ > = z.object({
124
+ url: z.string(),
125
+ method: Method$outboundSchema,
126
+ argumentLocation: ArgumentLocation$outboundSchema,
127
+ }).transform((v) => {
128
+ return remap$(v, {
129
+ argumentLocation: "argument_location",
130
+ });
131
+ });
132
+
133
+ /**
134
+ * @internal
135
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
136
+ */
137
+ export namespace HttpEndpoint$ {
138
+ /** @deprecated use `HttpEndpoint$inboundSchema` instead. */
139
+ export const inboundSchema = HttpEndpoint$inboundSchema;
140
+ /** @deprecated use `HttpEndpoint$outboundSchema` instead. */
141
+ export const outboundSchema = HttpEndpoint$outboundSchema;
142
+ /** @deprecated use `HttpEndpoint$Outbound` instead. */
143
+ export type Outbound = HttpEndpoint$Outbound;
144
+ }
145
+
146
+ export function httpEndpointToJSON(httpEndpoint: HttpEndpoint): string {
147
+ return JSON.stringify(HttpEndpoint$outboundSchema.parse(httpEndpoint));
148
+ }
149
+
150
+ export function httpEndpointFromJSON(
151
+ jsonString: string,
152
+ ): SafeParseResult<HttpEndpoint, SDKValidationError> {
153
+ return safeParse(
154
+ jsonString,
155
+ (x) => HttpEndpoint$inboundSchema.parse(JSON.parse(x)),
156
+ `Failed to parse 'HttpEndpoint' from JSON`,
157
+ );
158
+ }
@@ -37,6 +37,8 @@ export * from "./directorymembercreate.js";
37
37
  export * from "./directorymemberproperties.js";
38
38
  export * from "./event.js";
39
39
  export * from "./eventproperties.js";
40
+ export * from "./function.js";
41
+ export * from "./httpendpoint.js";
40
42
  export * from "./listresponseagentresponse.js";
41
43
  export * from "./listresponseavailabletarget.js";
42
44
  export * from "./listresponsechannel.js";
@@ -57,6 +59,9 @@ export * from "./promptcreate.js";
57
59
  export * from "./prompthistory.js";
58
60
  export * from "./promptproperties.js";
59
61
  export * from "./promptupdate.js";
62
+ export * from "./provider.js";
63
+ export * from "./sdkinternaltool.js";
64
+ export * from "./sdktooldefinition.js";
60
65
  export * from "./security.js";
61
66
  export * from "./service.js";
62
67
  export * from "./servicecreate.js";
@@ -79,6 +84,9 @@ export * from "./testmessageresponse.js";
79
84
  export * from "./tool.js";
80
85
  export * from "./toolcreate.js";
81
86
  export * from "./tooldetailresponse.js";
87
+ export * from "./toolparameterdefault.js";
88
+ export * from "./toolparametertransform.js";
89
+ export * from "./toolparametertransformcondition.js";
82
90
  export * from "./toolproperties.js";
83
91
  export * from "./toolupdate.js";
84
92
  export * from "./validationerror.js";
@@ -5,25 +5,17 @@
5
5
  import * as z from "zod";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
- import { ClosedEnum } from "../../types/enums.js";
9
8
  import { Result as SafeParseResult } from "../../types/fp.js";
10
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
-
12
- /**
13
- * Provider of the LLM model.
14
- */
15
- export const Provider = {
16
- AzureOpenai: "azure_openai",
17
- Openai: "openai",
18
- } as const;
19
- /**
20
- * Provider of the LLM model.
21
- */
22
- export type Provider = ClosedEnum<typeof Provider>;
10
+ import {
11
+ Provider,
12
+ Provider$inboundSchema,
13
+ Provider$outboundSchema,
14
+ } from "./provider.js";
23
15
 
24
16
  export type LlmConfig = {
25
17
  /**
26
- * Provider of the LLM model.
18
+ * LLM API provider.
27
19
  */
28
20
  provider?: Provider | undefined;
29
21
  /**
@@ -40,32 +32,13 @@ export type LlmConfig = {
40
32
  apiVersion?: string | null | undefined;
41
33
  };
42
34
 
43
- /** @internal */
44
- export const Provider$inboundSchema: z.ZodNativeEnum<typeof Provider> = z
45
- .nativeEnum(Provider);
46
-
47
- /** @internal */
48
- export const Provider$outboundSchema: z.ZodNativeEnum<typeof Provider> =
49
- Provider$inboundSchema;
50
-
51
- /**
52
- * @internal
53
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
54
- */
55
- export namespace Provider$ {
56
- /** @deprecated use `Provider$inboundSchema` instead. */
57
- export const inboundSchema = Provider$inboundSchema;
58
- /** @deprecated use `Provider$outboundSchema` instead. */
59
- export const outboundSchema = Provider$outboundSchema;
60
- }
61
-
62
35
  /** @internal */
63
36
  export const LlmConfig$inboundSchema: z.ZodType<
64
37
  LlmConfig,
65
38
  z.ZodTypeDef,
66
39
  unknown
67
40
  > = z.object({
68
- provider: Provider$inboundSchema.default("azure_openai"),
41
+ provider: Provider$inboundSchema.optional(),
69
42
  model: z.string().default("gpt-4o"),
70
43
  version: z.nullable(z.string()).optional(),
71
44
  api_version: z.nullable(z.string()).optional(),
@@ -77,7 +50,7 @@ export const LlmConfig$inboundSchema: z.ZodType<
77
50
 
78
51
  /** @internal */
79
52
  export type LlmConfig$Outbound = {
80
- provider: string;
53
+ provider?: string | undefined;
81
54
  model: string;
82
55
  version?: string | null | undefined;
83
56
  api_version?: string | null | undefined;
@@ -89,7 +62,7 @@ export const LlmConfig$outboundSchema: z.ZodType<
89
62
  z.ZodTypeDef,
90
63
  LlmConfig
91
64
  > = z.object({
92
- provider: Provider$outboundSchema.default("azure_openai"),
65
+ provider: Provider$outboundSchema.optional(),
93
66
  model: z.string().default("gpt-4o"),
94
67
  version: z.nullable(z.string()).optional(),
95
68
  apiVersion: z.nullable(z.string()).optional(),
@@ -35,9 +35,6 @@ export type Prompt = {
35
35
  * The tools for the prompt
36
36
  */
37
37
  tools?: Array<string> | undefined;
38
- /**
39
- * The configuration for the language model used by the Cortex API.
40
- */
41
38
  llmConfig: LlmConfig;
42
39
  /**
43
40
  * The Prompt ID
@@ -35,9 +35,6 @@ export type PromptCreate = {
35
35
  * The tools for the prompt
36
36
  */
37
37
  tools?: Array<string> | undefined;
38
- /**
39
- * The configuration for the language model used by the Cortex API.
40
- */
41
38
  llmConfig: LlmConfig;
42
39
  };
43
40
 
@@ -35,9 +35,6 @@ export type PromptUpdate = {
35
35
  * The tools for the prompt
36
36
  */
37
37
  tools?: Array<string> | undefined;
38
- /**
39
- * The configuration for the language model used by the Cortex API.
40
- */
41
38
  llmConfig: LlmConfig;
42
39
  /**
43
40
  * The Prompt ID
@@ -0,0 +1,37 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { ClosedEnum } from "../../types/enums.js";
7
+
8
+ /**
9
+ * LLM API provider.
10
+ */
11
+ export const Provider = {
12
+ AzureOpenai: "azure_openai",
13
+ Openai: "openai",
14
+ } as const;
15
+ /**
16
+ * LLM API provider.
17
+ */
18
+ export type Provider = ClosedEnum<typeof Provider>;
19
+
20
+ /** @internal */
21
+ export const Provider$inboundSchema: z.ZodNativeEnum<typeof Provider> = z
22
+ .nativeEnum(Provider);
23
+
24
+ /** @internal */
25
+ export const Provider$outboundSchema: z.ZodNativeEnum<typeof Provider> =
26
+ Provider$inboundSchema;
27
+
28
+ /**
29
+ * @internal
30
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
31
+ */
32
+ export namespace Provider$ {
33
+ /** @deprecated use `Provider$inboundSchema` instead. */
34
+ export const inboundSchema = Provider$inboundSchema;
35
+ /** @deprecated use `Provider$outboundSchema` instead. */
36
+ export const outboundSchema = Provider$outboundSchema;
37
+ }
@@ -0,0 +1,88 @@
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
+ FunctionT,
11
+ FunctionT$inboundSchema,
12
+ FunctionT$Outbound,
13
+ FunctionT$outboundSchema,
14
+ } from "./function.js";
15
+
16
+ /**
17
+ * A tool definition to be used by the OpenAI API.
18
+ */
19
+ export type SDKInternalTool = {
20
+ /**
21
+ * Always `function`.
22
+ */
23
+ type?: "function" | undefined;
24
+ /**
25
+ * A tool definition to be used by the OpenAI API.
26
+ *
27
+ * @remarks
28
+ *
29
+ * See:
30
+ * - https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/function-calling
31
+ */
32
+ function: FunctionT;
33
+ };
34
+
35
+ /** @internal */
36
+ export const SDKInternalTool$inboundSchema: z.ZodType<
37
+ SDKInternalTool,
38
+ z.ZodTypeDef,
39
+ unknown
40
+ > = z.object({
41
+ type: z.literal("function").default("function"),
42
+ function: FunctionT$inboundSchema,
43
+ });
44
+
45
+ /** @internal */
46
+ export type SDKInternalTool$Outbound = {
47
+ type: "function";
48
+ function: FunctionT$Outbound;
49
+ };
50
+
51
+ /** @internal */
52
+ export const SDKInternalTool$outboundSchema: z.ZodType<
53
+ SDKInternalTool$Outbound,
54
+ z.ZodTypeDef,
55
+ SDKInternalTool
56
+ > = z.object({
57
+ type: z.literal("function").default("function" as const),
58
+ function: FunctionT$outboundSchema,
59
+ });
60
+
61
+ /**
62
+ * @internal
63
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
64
+ */
65
+ export namespace SDKInternalTool$ {
66
+ /** @deprecated use `SDKInternalTool$inboundSchema` instead. */
67
+ export const inboundSchema = SDKInternalTool$inboundSchema;
68
+ /** @deprecated use `SDKInternalTool$outboundSchema` instead. */
69
+ export const outboundSchema = SDKInternalTool$outboundSchema;
70
+ /** @deprecated use `SDKInternalTool$Outbound` instead. */
71
+ export type Outbound = SDKInternalTool$Outbound;
72
+ }
73
+
74
+ export function sdkInternalToolToJSON(
75
+ sdkInternalTool: SDKInternalTool,
76
+ ): string {
77
+ return JSON.stringify(SDKInternalTool$outboundSchema.parse(sdkInternalTool));
78
+ }
79
+
80
+ export function sdkInternalToolFromJSON(
81
+ jsonString: string,
82
+ ): SafeParseResult<SDKInternalTool, SDKValidationError> {
83
+ return safeParse(
84
+ jsonString,
85
+ (x) => SDKInternalTool$inboundSchema.parse(JSON.parse(x)),
86
+ `Failed to parse 'SDKInternalTool' from JSON`,
87
+ );
88
+ }