@orq-ai/node 4.11.0-rc.28 → 4.11.0-rc.29

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 (206) hide show
  1. package/funcs/agentsInvoke.d.ts +1 -1
  2. package/funcs/agentsInvoke.d.ts.map +1 -1
  3. package/funcs/agentsInvoke.js.map +1 -1
  4. package/funcs/agentsResponsesCreate.d.ts +2 -1
  5. package/funcs/agentsResponsesCreate.d.ts.map +1 -1
  6. package/funcs/agentsResponsesCreate.js +7 -5
  7. package/funcs/agentsResponsesCreate.js.map +1 -1
  8. package/funcs/agentsStream.d.ts +1 -1
  9. package/funcs/agentsStream.d.ts.map +1 -1
  10. package/funcs/agentsStream.js.map +1 -1
  11. package/funcs/annotationsCreate.d.ts +1 -1
  12. package/funcs/annotationsCreate.js +1 -1
  13. package/funcs/annotationsDelete.d.ts +1 -1
  14. package/funcs/annotationsDelete.js +1 -1
  15. package/funcs/deploymentsInvoke.d.ts +2 -1
  16. package/funcs/deploymentsInvoke.d.ts.map +1 -1
  17. package/funcs/deploymentsInvoke.js +2 -1
  18. package/funcs/deploymentsInvoke.js.map +1 -1
  19. package/funcs/promptsCreate.d.ts +1 -1
  20. package/funcs/promptsCreate.d.ts.map +1 -1
  21. package/funcs/promptsCreate.js +2 -1
  22. package/funcs/promptsCreate.js.map +1 -1
  23. package/jsr.json +1 -1
  24. package/lib/config.d.ts +2 -2
  25. package/lib/config.js +2 -2
  26. package/models/components/agentresponserequest.d.ts +336 -0
  27. package/models/components/agentresponserequest.d.ts.map +1 -0
  28. package/models/components/agentresponserequest.js +210 -0
  29. package/models/components/agentresponserequest.js.map +1 -0
  30. package/models/components/agentthoughtstreamingevent.d.ts +12 -12
  31. package/models/components/agentthoughtstreamingevent.d.ts.map +1 -1
  32. package/models/components/agentthoughtstreamingevent.js +17 -17
  33. package/models/components/agentthoughtstreamingevent.js.map +1 -1
  34. package/models/components/index.d.ts +2 -0
  35. package/models/components/index.d.ts.map +1 -1
  36. package/models/components/index.js +2 -0
  37. package/models/components/index.js.map +1 -1
  38. package/models/components/invokedeploymentrequest.d.ts +1573 -0
  39. package/models/components/invokedeploymentrequest.d.ts.map +1 -0
  40. package/models/components/invokedeploymentrequest.js +1137 -0
  41. package/models/components/invokedeploymentrequest.js.map +1 -0
  42. package/models/components/reasoningpart.js +1 -1
  43. package/models/components/toolexecutionstartedstreamingevent.d.ts +4 -4
  44. package/models/components/toolexecutionstartedstreamingevent.d.ts.map +1 -1
  45. package/models/components/toolexecutionstartedstreamingevent.js +7 -7
  46. package/models/components/toolexecutionstartedstreamingevent.js.map +1 -1
  47. package/models/operations/createagentresponserequest.d.ts +2 -329
  48. package/models/operations/createagentresponserequest.d.ts.map +1 -1
  49. package/models/operations/createagentresponserequest.js +3 -166
  50. package/models/operations/createagentresponserequest.js.map +1 -1
  51. package/models/operations/createannotation.d.ts +48 -10
  52. package/models/operations/createannotation.d.ts.map +1 -1
  53. package/models/operations/createannotation.js +37 -5
  54. package/models/operations/createannotation.js.map +1 -1
  55. package/models/operations/createdataset.js +1 -1
  56. package/models/operations/createdatasetitem.d.ts +210 -12
  57. package/models/operations/createdatasetitem.d.ts.map +1 -1
  58. package/models/operations/createdatasetitem.js +136 -9
  59. package/models/operations/createdatasetitem.js.map +1 -1
  60. package/models/operations/createdatasource.d.ts +3 -0
  61. package/models/operations/createdatasource.d.ts.map +1 -1
  62. package/models/operations/createdatasource.js +1 -1
  63. package/models/operations/createdatasource.js.map +1 -1
  64. package/models/operations/createeval.js +16 -16
  65. package/models/operations/createprompt.d.ts +7 -4
  66. package/models/operations/createprompt.d.ts.map +1 -1
  67. package/models/operations/createprompt.js +5 -5
  68. package/models/operations/createprompt.js.map +1 -1
  69. package/models/operations/createtool.js +6 -6
  70. package/models/operations/deleteannotation.d.ts +19 -2
  71. package/models/operations/deleteannotation.d.ts.map +1 -1
  72. package/models/operations/deleteannotation.js +20 -2
  73. package/models/operations/deleteannotation.js.map +1 -1
  74. package/models/operations/deploymentgetconfig.d.ts +440 -440
  75. package/models/operations/deploymentgetconfig.d.ts.map +1 -1
  76. package/models/operations/deploymentgetconfig.js +484 -479
  77. package/models/operations/deploymentgetconfig.js.map +1 -1
  78. package/models/operations/deploymentinvoke.d.ts +0 -1560
  79. package/models/operations/deploymentinvoke.d.ts.map +1 -1
  80. package/models/operations/deploymentinvoke.js +1 -1126
  81. package/models/operations/deploymentinvoke.js.map +1 -1
  82. package/models/operations/deploymentstream.d.ts +56 -56
  83. package/models/operations/deploymentstream.d.ts.map +1 -1
  84. package/models/operations/deploymentstream.js +73 -72
  85. package/models/operations/deploymentstream.js.map +1 -1
  86. package/models/operations/getalltools.js +6 -6
  87. package/models/operations/getevals.js +16 -16
  88. package/models/operations/getv2humanevalsets.js +2 -2
  89. package/models/operations/getv2humanevalsetsid.js +2 -2
  90. package/models/operations/invokeagent.d.ts +51 -48
  91. package/models/operations/invokeagent.d.ts.map +1 -1
  92. package/models/operations/invokeagent.js +43 -46
  93. package/models/operations/invokeagent.js.map +1 -1
  94. package/models/operations/listdatasetdatapoints.d.ts +210 -12
  95. package/models/operations/listdatasetdatapoints.d.ts.map +1 -1
  96. package/models/operations/listdatasetdatapoints.js +138 -9
  97. package/models/operations/listdatasetdatapoints.js.map +1 -1
  98. package/models/operations/listdatasets.js +1 -1
  99. package/models/operations/listdatasources.js +1 -1
  100. package/models/operations/patchv2humanevalsetsid.js +2 -2
  101. package/models/operations/postv2feedbackevaluation.d.ts +33 -12
  102. package/models/operations/postv2feedbackevaluation.d.ts.map +1 -1
  103. package/models/operations/postv2feedbackevaluation.js +9 -6
  104. package/models/operations/postv2feedbackevaluation.js.map +1 -1
  105. package/models/operations/postv2humanevalsets.js +2 -2
  106. package/models/operations/retrievedatapoint.d.ts +210 -12
  107. package/models/operations/retrievedatapoint.d.ts.map +1 -1
  108. package/models/operations/retrievedatapoint.js +140 -8
  109. package/models/operations/retrievedatapoint.js.map +1 -1
  110. package/models/operations/retrievedataset.js +1 -1
  111. package/models/operations/retrievedatasource.js +1 -1
  112. package/models/operations/retrievetool.js +6 -6
  113. package/models/operations/runagent.js +1 -1
  114. package/models/operations/streamagent.d.ts +9 -6
  115. package/models/operations/streamagent.d.ts.map +1 -1
  116. package/models/operations/streamagent.js +6 -6
  117. package/models/operations/streamagent.js.map +1 -1
  118. package/models/operations/streamrunagent.js +1 -1
  119. package/models/operations/updatedatapoint.d.ts +210 -12
  120. package/models/operations/updatedatapoint.d.ts.map +1 -1
  121. package/models/operations/updatedatapoint.js +138 -9
  122. package/models/operations/updatedatapoint.js.map +1 -1
  123. package/models/operations/updatedataset.js +1 -1
  124. package/models/operations/updatedatasource.js +1 -1
  125. package/models/operations/updateeval.js +16 -16
  126. package/models/operations/updateprompt.d.ts +9 -6
  127. package/models/operations/updateprompt.d.ts.map +1 -1
  128. package/models/operations/updateprompt.js +7 -6
  129. package/models/operations/updateprompt.js.map +1 -1
  130. package/models/operations/updatetool.js +7 -7
  131. package/package.json +3 -3
  132. package/sdk/agents.d.ts +2 -2
  133. package/sdk/agents.d.ts.map +1 -1
  134. package/sdk/agents.js.map +1 -1
  135. package/sdk/annotations.d.ts +2 -2
  136. package/sdk/annotations.js +2 -2
  137. package/sdk/deployments.d.ts +2 -1
  138. package/sdk/deployments.d.ts.map +1 -1
  139. package/sdk/deployments.js.map +1 -1
  140. package/sdk/feedback.d.ts +1 -4
  141. package/sdk/feedback.d.ts.map +1 -1
  142. package/sdk/feedback.js +1 -4
  143. package/sdk/feedback.js.map +1 -1
  144. package/sdk/orqresponses.d.ts +1 -1
  145. package/sdk/orqresponses.d.ts.map +1 -1
  146. package/sdk/orqresponses.js +2 -2
  147. package/sdk/orqresponses.js.map +1 -1
  148. package/sdk/prompts.d.ts +1 -1
  149. package/sdk/prompts.d.ts.map +1 -1
  150. package/sdk/prompts.js.map +1 -1
  151. package/src/funcs/agentsInvoke.ts +2 -2
  152. package/src/funcs/agentsResponsesCreate.ts +8 -5
  153. package/src/funcs/agentsStream.ts +2 -2
  154. package/src/funcs/annotationsCreate.ts +1 -1
  155. package/src/funcs/annotationsDelete.ts +1 -1
  156. package/src/funcs/deploymentsInvoke.ts +4 -4
  157. package/src/funcs/promptsCreate.ts +4 -3
  158. package/src/lib/config.ts +2 -2
  159. package/src/models/components/agentresponserequest.ts +565 -0
  160. package/src/models/components/agentthoughtstreamingevent.ts +55 -43
  161. package/src/models/components/index.ts +2 -0
  162. package/src/models/components/invokedeploymentrequest.ts +3457 -0
  163. package/src/models/components/reasoningpart.ts +1 -1
  164. package/src/models/components/toolexecutionstartedstreamingevent.ts +24 -14
  165. package/src/models/operations/createagentresponserequest.ts +4 -550
  166. package/src/models/operations/createannotation.ts +110 -16
  167. package/src/models/operations/createdataset.ts +1 -1
  168. package/src/models/operations/createdatasetitem.ts +335 -19
  169. package/src/models/operations/createdatasource.ts +4 -1
  170. package/src/models/operations/createeval.ts +16 -16
  171. package/src/models/operations/createprompt.ts +13 -8
  172. package/src/models/operations/createtool.ts +6 -6
  173. package/src/models/operations/deleteannotation.ts +46 -3
  174. package/src/models/operations/deploymentgetconfig.ts +1156 -1606
  175. package/src/models/operations/deploymentinvoke.ts +222 -3675
  176. package/src/models/operations/deploymentstream.ts +244 -285
  177. package/src/models/operations/getalltools.ts +6 -6
  178. package/src/models/operations/getevals.ts +16 -16
  179. package/src/models/operations/getv2humanevalsets.ts +2 -2
  180. package/src/models/operations/getv2humanevalsetsid.ts +2 -2
  181. package/src/models/operations/invokeagent.ts +90 -116
  182. package/src/models/operations/listdatasetdatapoints.ts +378 -19
  183. package/src/models/operations/listdatasets.ts +1 -1
  184. package/src/models/operations/listdatasources.ts +1 -1
  185. package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  186. package/src/models/operations/postv2feedbackevaluation.ts +42 -18
  187. package/src/models/operations/postv2humanevalsets.ts +2 -2
  188. package/src/models/operations/retrievedatapoint.ts +363 -19
  189. package/src/models/operations/retrievedataset.ts +1 -1
  190. package/src/models/operations/retrievedatasource.ts +1 -1
  191. package/src/models/operations/retrievetool.ts +6 -6
  192. package/src/models/operations/runagent.ts +1 -1
  193. package/src/models/operations/streamagent.ts +16 -11
  194. package/src/models/operations/streamrunagent.ts +1 -1
  195. package/src/models/operations/updatedatapoint.ts +366 -19
  196. package/src/models/operations/updatedataset.ts +1 -1
  197. package/src/models/operations/updatedatasource.ts +1 -1
  198. package/src/models/operations/updateeval.ts +16 -16
  199. package/src/models/operations/updateprompt.ts +17 -11
  200. package/src/models/operations/updatetool.ts +7 -7
  201. package/src/sdk/agents.ts +2 -2
  202. package/src/sdk/annotations.ts +2 -2
  203. package/src/sdk/deployments.ts +2 -1
  204. package/src/sdk/feedback.ts +1 -4
  205. package/src/sdk/orqresponses.ts +2 -2
  206. package/src/sdk/prompts.ts +1 -1
@@ -7,3788 +7,335 @@ import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
8
  import { ClosedEnum } from "../../types/enums.js";
9
9
  import { Result as SafeParseResult } from "../../types/fp.js";
10
- import * as components from "../components/index.js";
11
10
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
12
11
 
13
- export type DeploymentInvokeContentDeployments2 =
14
- components.TextContentPartSchema;
15
-
16
- /**
17
- * The contents of the tool message.
18
- */
19
- export type DeploymentInvokePrefixMessagesDeploymentsRequestRequestBodyContent =
20
- | string
21
- | Array<components.TextContentPartSchema>;
22
-
23
12
  /**
24
- * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
13
+ * Indicates the type of model used to generate the response
25
14
  */
26
- export const DeploymentInvokePrefixMessagesType = {
27
- Ephemeral: "ephemeral",
15
+ export const DeploymentInvokeObject = {
16
+ Chat: "chat",
17
+ Completion: "completion",
18
+ Image: "image",
28
19
  } as const;
29
20
  /**
30
- * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
21
+ * Indicates the type of model used to generate the response
31
22
  */
32
- export type DeploymentInvokePrefixMessagesType = ClosedEnum<
33
- typeof DeploymentInvokePrefixMessagesType
34
- >;
23
+ export type DeploymentInvokeObject = ClosedEnum<typeof DeploymentInvokeObject>;
35
24
 
36
25
  /**
37
- * The time-to-live for the cache control breakpoint. This may be one of the following values:
38
- *
39
- * @remarks
40
- *
41
- * - `5m`: 5 minutes
42
- * - `1h`: 1 hour
43
- *
44
- * Defaults to `5m`. Only supported by `Anthropic` Claude models.
26
+ * The provider used to generate the response
45
27
  */
46
- export const PrefixMessagesTtl = {
47
- Fivem: "5m",
48
- Oneh: "1h",
28
+ export const Provider = {
29
+ Openai: "openai",
30
+ Groq: "groq",
31
+ Cohere: "cohere",
32
+ Azure: "azure",
33
+ Aws: "aws",
34
+ Google: "google",
35
+ GoogleAi: "google-ai",
36
+ Huggingface: "huggingface",
37
+ Togetherai: "togetherai",
38
+ Perplexity: "perplexity",
39
+ Anthropic: "anthropic",
40
+ Leonardoai: "leonardoai",
41
+ Fal: "fal",
42
+ Nvidia: "nvidia",
43
+ Jina: "jina",
44
+ Elevenlabs: "elevenlabs",
45
+ Litellm: "litellm",
46
+ Cerebras: "cerebras",
47
+ Openailike: "openailike",
48
+ Bytedance: "bytedance",
49
+ Mistral: "mistral",
50
+ Deepseek: "deepseek",
51
+ Contextualai: "contextualai",
52
+ Moonshotai: "moonshotai",
53
+ Zai: "zai",
54
+ Minimax: "minimax",
55
+ Xai: "xai",
56
+ Alibaba: "alibaba",
57
+ Tensorix: "tensorix",
58
+ Scaleway: "scaleway",
59
+ Hcompany: "hcompany",
60
+ Inceptron: "inceptron",
61
+ Wafer: "wafer",
62
+ Slack: "slack",
63
+ Orq: "orq",
49
64
  } as const;
50
65
  /**
51
- * The time-to-live for the cache control breakpoint. This may be one of the following values:
52
- *
53
- * @remarks
54
- *
55
- * - `5m`: 5 minutes
56
- * - `1h`: 1 hour
57
- *
58
- * Defaults to `5m`. Only supported by `Anthropic` Claude models.
66
+ * The provider used to generate the response
59
67
  */
60
- export type PrefixMessagesTtl = ClosedEnum<typeof PrefixMessagesTtl>;
68
+ export type Provider = ClosedEnum<typeof Provider>;
61
69
 
62
- export type PrefixMessagesCacheControl = {
70
+ export type Telemetry = {
63
71
  /**
64
- * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
72
+ * The trace id for the request that generated this response
65
73
  */
66
- type: DeploymentInvokePrefixMessagesType;
74
+ traceId: string;
67
75
  /**
68
- * The time-to-live for the cache control breakpoint. This may be one of the following values:
69
- *
70
- * @remarks
71
- *
72
- * - `5m`: 5 minutes
73
- * - `1h`: 1 hour
74
- *
75
- * Defaults to `5m`. Only supported by `Anthropic` Claude models.
76
+ * The span id for the request that generated this response
76
77
  */
77
- ttl?: PrefixMessagesTtl | undefined;
78
+ spanId: string;
78
79
  };
79
80
 
80
- export type ToolMessage = {
81
+ /**
82
+ * Metadata of the retrieved chunk from the knowledge base
83
+ */
84
+ export type DeploymentInvokeMetadata = {
85
+ /**
86
+ * Name of the file
87
+ */
88
+ fileName: string;
81
89
  /**
82
- * The role of the messages author, in this case tool.
90
+ * Page number of the chunk
91
+ */
92
+ pageNumber: number | null;
93
+ /**
94
+ * Type of the file
95
+ */
96
+ fileType: string;
97
+ /**
98
+ * Rerank scores are normalized to be in the range [0, 1]. Scores close to 1 indicate a high relevance to the query, and scores closer to 0 indicate low relevance. It is not accurate to assume a score of 0.9 means the document is 2x more relevant than a document with a score of 0.45
99
+ */
100
+ rerankScore?: number | undefined;
101
+ /**
102
+ * Search scores are normalized to be in the range [0, 1]. Search score is calculated based on `[Cosine Similarity](https://en.wikipedia.org/wiki/Cosine_similarity)` algorithm. Scores close to 1 indicate the document is closer to the query, and scores closer to 0 indicate the document is farther from the query.
83
103
  */
84
- role: "tool";
104
+ searchScore: number;
105
+ };
106
+
107
+ export type Retrievals = {
85
108
  /**
86
- * The contents of the tool message.
109
+ * Content of the retrieved chunk from the knowledge base
87
110
  */
88
- content: string | Array<components.TextContentPartSchema>;
111
+ document: string;
89
112
  /**
90
- * Tool call that this message is responding to.
113
+ * Metadata of the retrieved chunk from the knowledge base
91
114
  */
92
- toolCallId: string | null;
93
- cacheControl?: PrefixMessagesCacheControl | undefined;
115
+ metadata: DeploymentInvokeMetadata;
94
116
  };
95
117
 
96
- export type DeploymentInvokeContent2 =
97
- | (components.TextContentPartSchema & { type: "text" })
98
- | components.RefusalPartSchema
99
- | components.ReasoningPartSchema
100
- | components.RedactedReasoningPartSchema;
118
+ export type PromptTokensDetails = {
119
+ cachedTokens?: number | null | undefined;
120
+ };
101
121
 
102
- /**
103
- * The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.
104
- */
105
- export type DeploymentInvokePrefixMessagesDeploymentsRequestContent =
106
- | string
107
- | Array<
108
- | (components.TextContentPartSchema & { type: "text" })
109
- | components.RefusalPartSchema
110
- | components.ReasoningPartSchema
111
- | components.RedactedReasoningPartSchema
112
- >;
122
+ export type CompletionTokensDetails = {
123
+ reasoningTokens?: number | null | undefined;
124
+ };
113
125
 
114
126
  /**
115
- * Data about a previous audio response from the model.
127
+ * Usage metrics for the response
116
128
  */
117
- export type Audio = {
118
- /**
119
- * Unique identifier for a previous audio response from the model.
120
- */
121
- id: string;
129
+ export type Usage = {
130
+ totalTokens?: number | undefined;
131
+ promptTokens?: number | undefined;
132
+ completionTokens?: number | undefined;
133
+ promptTokensDetails?: PromptTokensDetails | undefined;
134
+ completionTokensDetails?: CompletionTokensDetails | null | undefined;
122
135
  };
123
136
 
124
137
  /**
125
- * The type of the tool. Currently, only `function` is supported.
138
+ * The role of the prompt message
126
139
  */
127
- export const PrefixMessagesType = {
128
- Function: "function",
140
+ export const DeploymentInvokeMessageDeploymentsRole = {
141
+ System: "system",
142
+ Developer: "developer",
143
+ Assistant: "assistant",
144
+ User: "user",
145
+ Exception: "exception",
146
+ Tool: "tool",
147
+ Prompt: "prompt",
148
+ Correction: "correction",
149
+ ExpectedOutput: "expected_output",
129
150
  } as const;
130
151
  /**
131
- * The type of the tool. Currently, only `function` is supported.
152
+ * The role of the prompt message
132
153
  */
133
- export type PrefixMessagesType = ClosedEnum<typeof PrefixMessagesType>;
154
+ export type DeploymentInvokeMessageDeploymentsRole = ClosedEnum<
155
+ typeof DeploymentInvokeMessageDeploymentsRole
156
+ >;
134
157
 
135
- export type PrefixMessagesFunction = {
136
- /**
137
- * The name of the function to call.
138
- */
139
- name?: string | undefined;
158
+ export type Message3 = {
159
+ type: "image";
140
160
  /**
141
- * The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.
161
+ * The role of the prompt message
142
162
  */
143
- arguments?: string | undefined;
163
+ role: DeploymentInvokeMessageDeploymentsRole;
164
+ url: string;
144
165
  };
145
166
 
146
- export type PrefixMessagesToolCalls = {
147
- /**
148
- * The ID of the tool call.
149
- */
150
- id: string;
151
- /**
152
- * The type of the tool. Currently, only `function` is supported.
153
- */
154
- type: PrefixMessagesType;
155
- function: PrefixMessagesFunction;
156
- /**
157
- * Encrypted representation of the model internal reasoning state during function calling. Required by Gemini 3 models when continuing a conversation after a tool call.
158
- */
159
- thoughtSignature?: string | undefined;
160
- };
167
+ /**
168
+ * The role of the prompt message
169
+ */
170
+ export const DeploymentInvokeMessageRole = {
171
+ System: "system",
172
+ Developer: "developer",
173
+ Assistant: "assistant",
174
+ User: "user",
175
+ Exception: "exception",
176
+ Tool: "tool",
177
+ Prompt: "prompt",
178
+ Correction: "correction",
179
+ ExpectedOutput: "expected_output",
180
+ } as const;
181
+ /**
182
+ * The role of the prompt message
183
+ */
184
+ export type DeploymentInvokeMessageRole = ClosedEnum<
185
+ typeof DeploymentInvokeMessageRole
186
+ >;
161
187
 
162
- export type AssistantMessage = {
163
- /**
164
- * The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.
165
- */
166
- content?:
167
- | string
168
- | Array<
169
- | (components.TextContentPartSchema & { type: "text" })
170
- | components.RefusalPartSchema
171
- | components.ReasoningPartSchema
172
- | components.RedactedReasoningPartSchema
173
- >
174
- | null
175
- | undefined;
176
- /**
177
- * The refusal message by the assistant.
178
- */
179
- refusal?: string | null | undefined;
188
+ export type Message2 = {
189
+ type: "content";
180
190
  /**
181
- * The role of the messages author, in this case `assistant`.
191
+ * The role of the prompt message
182
192
  */
183
- role: "assistant";
193
+ role: DeploymentInvokeMessageRole;
194
+ content: string | null;
184
195
  /**
185
- * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
196
+ * Internal thought process of the model
186
197
  */
187
- name?: string | undefined;
198
+ reasoning?: string | undefined;
188
199
  /**
189
- * Data about a previous audio response from the model.
200
+ * The signature holds a cryptographic token which verifies that the thinking block was generated by the model, and is verified when thinking is part of a multiturn conversation. This value should not be modified and should always be sent to the API when the reasoning is redacted. Currently only supported by `Anthropic`.
190
201
  */
191
- audio?: Audio | null | undefined;
202
+ reasoningSignature?: string | undefined;
192
203
  /**
193
- * The tool calls generated by the model, such as function calls.
204
+ * Occasionally the model's internal reasoning will be flagged by the safety systems of the provider. When this occurs, the provider will encrypt the reasoning. These redacted reasoning is decrypted when passed back to the API, allowing the model to continue its response without losing context.
194
205
  */
195
- toolCalls?: Array<PrefixMessagesToolCalls> | undefined;
206
+ redactedReasoning?: string | undefined;
196
207
  };
197
208
 
198
209
  /**
199
- * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
210
+ * The role of the prompt message
200
211
  */
201
- export const DeploymentInvoke2DeploymentsType = {
202
- Ephemeral: "ephemeral",
212
+ export const MessageRole = {
213
+ System: "system",
214
+ Developer: "developer",
215
+ Assistant: "assistant",
216
+ User: "user",
217
+ Exception: "exception",
218
+ Tool: "tool",
219
+ Prompt: "prompt",
220
+ Correction: "correction",
221
+ ExpectedOutput: "expected_output",
203
222
  } as const;
204
223
  /**
205
- * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
224
+ * The role of the prompt message
206
225
  */
207
- export type DeploymentInvoke2DeploymentsType = ClosedEnum<
208
- typeof DeploymentInvoke2DeploymentsType
209
- >;
226
+ export type MessageRole = ClosedEnum<typeof MessageRole>;
210
227
 
211
- /**
212
- * The time-to-live for the cache control breakpoint. This may be one of the following values:
213
- *
214
- * @remarks
215
- *
216
- * - `5m`: 5 minutes
217
- * - `1h`: 1 hour
218
- *
219
- * Defaults to `5m`. Only supported by `Anthropic` Claude models.
220
- */
221
- export const Ttl = {
222
- Fivem: "5m",
223
- Oneh: "1h",
228
+ export const DeploymentInvokeMessageDeploymentsResponseType = {
229
+ Function: "function",
224
230
  } as const;
225
- /**
226
- * The time-to-live for the cache control breakpoint. This may be one of the following values:
227
- *
228
- * @remarks
229
- *
230
- * - `5m`: 5 minutes
231
- * - `1h`: 1 hour
232
- *
233
- * Defaults to `5m`. Only supported by `Anthropic` Claude models.
234
- */
235
- export type Ttl = ClosedEnum<typeof Ttl>;
231
+ export type DeploymentInvokeMessageDeploymentsResponseType = ClosedEnum<
232
+ typeof DeploymentInvokeMessageDeploymentsResponseType
233
+ >;
236
234
 
237
- export type CacheControl = {
238
- /**
239
- * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
240
- */
241
- type: DeploymentInvoke2DeploymentsType;
235
+ export type MessageFunction = {
236
+ name: string;
242
237
  /**
243
- * The time-to-live for the cache control breakpoint. This may be one of the following values:
244
- *
245
- * @remarks
246
- *
247
- * - `5m`: 5 minutes
248
- * - `1h`: 1 hour
249
- *
250
- * Defaults to `5m`. Only supported by `Anthropic` Claude models.
238
+ * JSON string arguments for the functions
251
239
  */
252
- ttl?: Ttl | undefined;
240
+ arguments: string;
253
241
  };
254
242
 
255
- export type Four = {
256
- /**
257
- * The type of the content part. Always `file`.
258
- */
259
- type: "file";
260
- cacheControl?: CacheControl | undefined;
261
- /**
262
- * File data for the content part. Must contain either file_data or uri, but not both.
263
- */
264
- file: components.FileContentPartSchema;
243
+ export type MessageToolCalls = {
244
+ id?: string | undefined;
245
+ index?: number | undefined;
246
+ type: DeploymentInvokeMessageDeploymentsResponseType;
247
+ function: MessageFunction;
265
248
  };
266
249
 
267
- export type Content2 =
268
- | (components.TextContentPartSchema & { type: "text" })
269
- | components.ImageContentPartSchema
270
- | components.AudioContentPartSchema
271
- | Four;
272
-
273
- /**
274
- * The contents of the user message.
275
- */
276
- export type DeploymentInvokePrefixMessagesDeploymentsContent =
277
- | string
278
- | Array<
279
- | (components.TextContentPartSchema & { type: "text" })
280
- | components.ImageContentPartSchema
281
- | components.AudioContentPartSchema
282
- | Four
283
- >;
284
-
285
- export type UserMessage = {
250
+ export type Message1 = {
251
+ type: "tool_calls";
252
+ /**
253
+ * The role of the prompt message
254
+ */
255
+ role: MessageRole;
256
+ content?: string | null | undefined;
257
+ toolCalls: Array<MessageToolCalls>;
286
258
  /**
287
- * The role of the messages author, in this case `user`.
259
+ * Internal thought process of the model
288
260
  */
289
- role: "user";
261
+ reasoning?: string | undefined;
290
262
  /**
291
- * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
263
+ * The signature holds a cryptographic token which verifies that the thinking block was generated by the model, and is verified when thinking is part of a multiturn conversation. This value should not be modified and should always be sent to the API when the reasoning is redacted. Currently only supported by `Anthropic`.
292
264
  */
293
- name?: string | undefined;
265
+ reasoningSignature?: string | undefined;
294
266
  /**
295
- * The contents of the user message.
267
+ * Occasionally the model's internal reasoning will be flagged by the safety systems of the provider. When this occurs, the provider will encrypt the reasoning. These redacted reasoning is decrypted when passed back to the API, allowing the model to continue its response without losing context.
296
268
  */
297
- content:
298
- | string
299
- | Array<
300
- | (components.TextContentPartSchema & { type: "text" })
301
- | components.ImageContentPartSchema
302
- | components.AudioContentPartSchema
303
- | Four
304
- >;
269
+ redactedReasoning?: string | undefined;
270
+ };
271
+
272
+ export type Message = Message1 | Message2 | Message3;
273
+
274
+ export type Choices = {
275
+ index: number;
276
+ message: Message1 | Message2 | Message3;
277
+ finishReason?: string | null | undefined;
305
278
  };
306
279
 
307
280
  /**
308
- * The contents of the developer message.
281
+ * Successful operation
309
282
  */
310
- export type DeploymentInvokePrefixMessagesContent =
311
- | string
312
- | Array<components.TextContentPartSchema>;
313
-
314
- export type DeveloperMessage = {
283
+ export type DeploymentInvokeResponseBody = {
315
284
  /**
316
- * The role of the messages author, in this case `developer`.
285
+ * A unique identifier for the response. Can be used to add metrics to the transaction.
317
286
  */
318
- role: "developer";
287
+ id: string;
319
288
  /**
320
- * The contents of the developer message.
289
+ * A timestamp indicating when the object was created. Usually in a standardized format like ISO 8601
321
290
  */
322
- content: string | Array<components.TextContentPartSchema>;
291
+ created: Date;
323
292
  /**
324
- * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
293
+ * Indicates the type of model used to generate the response
325
294
  */
326
- name?: string | undefined;
327
- };
328
-
329
- /**
330
- * The contents of the system message.
331
- */
332
- export type PrefixMessagesContent =
333
- | string
334
- | Array<components.TextContentPartSchema>;
335
-
336
- /**
337
- * Developer-provided instructions that the model should follow, regardless of messages sent by the user.
338
- */
339
- export type SystemMessage = {
295
+ object: DeploymentInvokeObject;
340
296
  /**
341
- * The role of the messages author, in this case `system`.
297
+ * The model used to generate the response
342
298
  */
343
- role: "system";
299
+ model: string;
344
300
  /**
345
- * The contents of the system message.
301
+ * The provider used to generate the response
346
302
  */
347
- content: string | Array<components.TextContentPartSchema>;
303
+ provider: Provider;
348
304
  /**
349
- * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
305
+ * Indicates if the response is the final response
350
306
  */
351
- name?: string | undefined;
352
- };
353
-
354
- export type PrefixMessages =
355
- | SystemMessage
356
- | DeveloperMessage
357
- | UserMessage
358
- | AssistantMessage
359
- | ToolMessage;
360
-
361
- export type DeploymentInvokeContentDeploymentsRequestRequestBodyMessages2 =
362
- components.TextContentPartSchema;
363
-
364
- /**
365
- * The contents of the tool message.
366
- */
367
- export type DeploymentInvokeMessagesDeploymentsRequestRequestBodyContent =
368
- | string
369
- | Array<components.TextContentPartSchema>;
370
-
371
- /**
372
- * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
373
- */
374
- export const DeploymentInvokeMessagesType = {
375
- Ephemeral: "ephemeral",
376
- } as const;
377
- /**
378
- * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
379
- */
380
- export type DeploymentInvokeMessagesType = ClosedEnum<
381
- typeof DeploymentInvokeMessagesType
382
- >;
383
-
384
- /**
385
- * The time-to-live for the cache control breakpoint. This may be one of the following values:
386
- *
387
- * @remarks
388
- *
389
- * - `5m`: 5 minutes
390
- * - `1h`: 1 hour
391
- *
392
- * Defaults to `5m`. Only supported by `Anthropic` Claude models.
393
- */
394
- export const MessagesTtl = {
395
- Fivem: "5m",
396
- Oneh: "1h",
397
- } as const;
398
- /**
399
- * The time-to-live for the cache control breakpoint. This may be one of the following values:
400
- *
401
- * @remarks
402
- *
403
- * - `5m`: 5 minutes
404
- * - `1h`: 1 hour
405
- *
406
- * Defaults to `5m`. Only supported by `Anthropic` Claude models.
407
- */
408
- export type MessagesTtl = ClosedEnum<typeof MessagesTtl>;
409
-
410
- export type MessagesCacheControl = {
411
- /**
412
- * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
413
- */
414
- type: DeploymentInvokeMessagesType;
415
- /**
416
- * The time-to-live for the cache control breakpoint. This may be one of the following values:
417
- *
418
- * @remarks
419
- *
420
- * - `5m`: 5 minutes
421
- * - `1h`: 1 hour
422
- *
423
- * Defaults to `5m`. Only supported by `Anthropic` Claude models.
424
- */
425
- ttl?: MessagesTtl | undefined;
426
- };
427
-
428
- export type MessagesToolMessage = {
429
- /**
430
- * The role of the messages author, in this case tool.
431
- */
432
- role: "tool";
433
- /**
434
- * The contents of the tool message.
435
- */
436
- content: string | Array<components.TextContentPartSchema>;
437
- /**
438
- * Tool call that this message is responding to.
439
- */
440
- toolCallId: string | null;
441
- cacheControl?: MessagesCacheControl | undefined;
442
- };
443
-
444
- export type DeploymentInvokeContentDeploymentsRequestRequestBody2 =
445
- | (components.TextContentPartSchema & { type: "text" })
446
- | components.RefusalPartSchema
447
- | components.ReasoningPartSchema
448
- | components.RedactedReasoningPartSchema;
449
-
450
- /**
451
- * The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.
452
- */
453
- export type DeploymentInvokeMessagesDeploymentsRequestContent =
454
- | string
455
- | Array<
456
- | (components.TextContentPartSchema & { type: "text" })
457
- | components.RefusalPartSchema
458
- | components.ReasoningPartSchema
459
- | components.RedactedReasoningPartSchema
460
- >;
461
-
462
- /**
463
- * Data about a previous audio response from the model.
464
- */
465
- export type MessagesAudio = {
466
- /**
467
- * Unique identifier for a previous audio response from the model.
468
- */
469
- id: string;
470
- };
471
-
472
- /**
473
- * The type of the tool. Currently, only `function` is supported.
474
- */
475
- export const MessagesType = {
476
- Function: "function",
477
- } as const;
478
- /**
479
- * The type of the tool. Currently, only `function` is supported.
480
- */
481
- export type MessagesType = ClosedEnum<typeof MessagesType>;
482
-
483
- export type MessagesFunction = {
484
- /**
485
- * The name of the function to call.
486
- */
487
- name?: string | undefined;
488
- /**
489
- * The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.
490
- */
491
- arguments?: string | undefined;
492
- };
493
-
494
- export type MessagesToolCalls = {
495
- /**
496
- * The ID of the tool call.
497
- */
498
- id: string;
499
- /**
500
- * The type of the tool. Currently, only `function` is supported.
501
- */
502
- type: MessagesType;
503
- function: MessagesFunction;
504
- /**
505
- * Encrypted representation of the model internal reasoning state during function calling. Required by Gemini 3 models when continuing a conversation after a tool call.
506
- */
507
- thoughtSignature?: string | undefined;
508
- };
509
-
510
- export type MessagesAssistantMessage = {
511
- /**
512
- * The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.
513
- */
514
- content?:
515
- | string
516
- | Array<
517
- | (components.TextContentPartSchema & { type: "text" })
518
- | components.RefusalPartSchema
519
- | components.ReasoningPartSchema
520
- | components.RedactedReasoningPartSchema
521
- >
522
- | null
523
- | undefined;
524
- /**
525
- * The refusal message by the assistant.
526
- */
527
- refusal?: string | null | undefined;
528
- /**
529
- * The role of the messages author, in this case `assistant`.
530
- */
531
- role: "assistant";
532
- /**
533
- * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
534
- */
535
- name?: string | undefined;
536
- /**
537
- * Data about a previous audio response from the model.
538
- */
539
- audio?: MessagesAudio | null | undefined;
540
- /**
541
- * The tool calls generated by the model, such as function calls.
542
- */
543
- toolCalls?: Array<MessagesToolCalls> | undefined;
544
- };
545
-
546
- /**
547
- * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
548
- */
549
- export const DeploymentInvoke2DeploymentsRequestRequestBodyType = {
550
- Ephemeral: "ephemeral",
551
- } as const;
552
- /**
553
- * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
554
- */
555
- export type DeploymentInvoke2DeploymentsRequestRequestBodyType = ClosedEnum<
556
- typeof DeploymentInvoke2DeploymentsRequestRequestBodyType
557
- >;
558
-
559
- /**
560
- * The time-to-live for the cache control breakpoint. This may be one of the following values:
561
- *
562
- * @remarks
563
- *
564
- * - `5m`: 5 minutes
565
- * - `1h`: 1 hour
566
- *
567
- * Defaults to `5m`. Only supported by `Anthropic` Claude models.
568
- */
569
- export const TwoTtl = {
570
- Fivem: "5m",
571
- Oneh: "1h",
572
- } as const;
573
- /**
574
- * The time-to-live for the cache control breakpoint. This may be one of the following values:
575
- *
576
- * @remarks
577
- *
578
- * - `5m`: 5 minutes
579
- * - `1h`: 1 hour
580
- *
581
- * Defaults to `5m`. Only supported by `Anthropic` Claude models.
582
- */
583
- export type TwoTtl = ClosedEnum<typeof TwoTtl>;
584
-
585
- export type TwoCacheControl = {
586
- /**
587
- * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
588
- */
589
- type: DeploymentInvoke2DeploymentsRequestRequestBodyType;
590
- /**
591
- * The time-to-live for the cache control breakpoint. This may be one of the following values:
592
- *
593
- * @remarks
594
- *
595
- * - `5m`: 5 minutes
596
- * - `1h`: 1 hour
597
- *
598
- * Defaults to `5m`. Only supported by `Anthropic` Claude models.
599
- */
600
- ttl?: TwoTtl | undefined;
601
- };
602
-
603
- export type Two4 = {
604
- /**
605
- * The type of the content part. Always `file`.
606
- */
607
- type: "file";
608
- cacheControl?: TwoCacheControl | undefined;
609
- /**
610
- * File data for the content part. Must contain either file_data or uri, but not both.
611
- */
612
- file: components.FileContentPartSchema;
613
- };
614
-
615
- export type DeploymentInvokeContentDeploymentsRequest2 =
616
- | (components.TextContentPartSchema & { type: "text" })
617
- | components.ImageContentPartSchema
618
- | components.AudioContentPartSchema
619
- | Two4;
620
-
621
- /**
622
- * The contents of the user message.
623
- */
624
- export type DeploymentInvokeMessagesDeploymentsContent =
625
- | string
626
- | Array<
627
- | (components.TextContentPartSchema & { type: "text" })
628
- | components.ImageContentPartSchema
629
- | components.AudioContentPartSchema
630
- | Two4
631
- >;
632
-
633
- export type MessagesUserMessage = {
634
- /**
635
- * The role of the messages author, in this case `user`.
636
- */
637
- role: "user";
638
- /**
639
- * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
640
- */
641
- name?: string | undefined;
642
- /**
643
- * The contents of the user message.
644
- */
645
- content:
646
- | string
647
- | Array<
648
- | (components.TextContentPartSchema & { type: "text" })
649
- | components.ImageContentPartSchema
650
- | components.AudioContentPartSchema
651
- | Two4
652
- >;
653
- };
654
-
655
- /**
656
- * The contents of the developer message.
657
- */
658
- export type DeploymentInvokeMessagesContent =
659
- | string
660
- | Array<components.TextContentPartSchema>;
661
-
662
- export type MessagesDeveloperMessage = {
663
- /**
664
- * The role of the messages author, in this case `developer`.
665
- */
666
- role: "developer";
667
- /**
668
- * The contents of the developer message.
669
- */
670
- content: string | Array<components.TextContentPartSchema>;
671
- /**
672
- * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
673
- */
674
- name?: string | undefined;
675
- };
676
-
677
- /**
678
- * The contents of the system message.
679
- */
680
- export type MessagesContent = string | Array<components.TextContentPartSchema>;
681
-
682
- /**
683
- * Developer-provided instructions that the model should follow, regardless of messages sent by the user.
684
- */
685
- export type MessagesSystemMessage = {
686
- /**
687
- * The role of the messages author, in this case `system`.
688
- */
689
- role: "system";
690
- /**
691
- * The contents of the system message.
692
- */
693
- content: string | Array<components.TextContentPartSchema>;
694
- /**
695
- * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
696
- */
697
- name?: string | undefined;
698
- };
699
-
700
- export type DeploymentInvokeMessages =
701
- | MessagesSystemMessage
702
- | MessagesDeveloperMessage
703
- | MessagesUserMessage
704
- | MessagesAssistantMessage
705
- | MessagesToolMessage;
706
-
707
- /**
708
- * Metadata about the document
709
- */
710
- export type Metadata = {
711
- /**
712
- * Name of the file the text is from.
713
- */
714
- fileName?: string | undefined;
715
- /**
716
- * Content type of the file the text is from.
717
- */
718
- fileType?: string | undefined;
719
- /**
720
- * The page number the text is from.
721
- */
722
- pageNumber?: number | undefined;
723
- };
724
-
725
- export type Documents = {
307
+ isFinal: boolean;
726
308
  /**
727
- * The text content of the document
309
+ * Indicates integration id used to generate the response
728
310
  */
729
- text: string;
311
+ integrationId?: string | undefined;
312
+ telemetry: Telemetry;
730
313
  /**
731
- * Metadata about the document
314
+ * A timestamp indicating when the object was finalized. Usually in a standardized format like ISO 8601
732
315
  */
733
- metadata?: Metadata | undefined;
734
- };
735
-
736
- export type InvokeOptions = {
316
+ finalized?: Date | undefined;
737
317
  /**
738
- * Whether to include the retrieved knowledge chunks in the response.
318
+ * Provider backed system fingerprint.
739
319
  */
740
- includeRetrievals?: boolean | undefined;
320
+ systemFingerprint?: string | null | undefined;
741
321
  /**
742
- * Whether to include the usage metrics in the response.
322
+ * List of documents retrieved from the knowledge base. This property is only available when the `include_retrievals` flag is set to `true` in the invoke settings. When stream is set to true, the `retrievals` property will be returned in the last streamed chunk where the property `is_final` is set to `true`.
743
323
  */
744
- includeUsage?: boolean | undefined;
324
+ retrievals?: Array<Retrievals> | undefined;
745
325
  /**
746
- * A mock response to use instead of calling the LLM API. This is useful for testing purposes. When provided, the system will return a response object with this content as the completion, without making an actual API call to the LLM provider. This works for both streaming and non-streaming requests. Mock responses will not generate logs, traces or be counted for your plan usage.
326
+ * Response returned by the model provider. This functionality is only supported when streaming is not used. If streaming is used, the `provider_response` property will be set to `null`.
747
327
  */
748
- mockResponse?: string | undefined;
749
- };
750
-
751
- export type Thread = {
328
+ providerResponse?: any | undefined;
752
329
  /**
753
- * Unique thread identifier to group related invocations.
330
+ * Usage metrics for the response
754
331
  */
755
- id: string;
332
+ usage?: Usage | null | undefined;
756
333
  /**
757
- * Optional tags to differentiate or categorize threads
334
+ * A list of choices generated by the model
758
335
  */
759
- tags?: Array<string> | undefined;
760
- };
761
-
762
- /**
763
- * Exists
764
- */
765
- export type OrExists = {
766
- exists: boolean;
767
- };
768
-
769
- export type DeploymentInvokeOrNin = string | number | boolean;
770
-
771
- /**
772
- * Not in
773
- */
774
- export type OrNin = {
775
- nin: Array<string | number | boolean>;
776
- };
777
-
778
- export type DeploymentInvokeOrIn = string | number | boolean;
779
-
780
- /**
781
- * In
782
- */
783
- export type OrIn = {
784
- in: Array<string | number | boolean>;
785
- };
786
-
787
- /**
788
- * Less than or equal to
789
- */
790
- export type OrLte = {
791
- lte: number;
792
- };
793
-
794
- /**
795
- * Less than
796
- */
797
- export type OrLt = {
798
- lt: number;
799
- };
800
-
801
- /**
802
- * Greater than or equal to
803
- */
804
- export type OrGte = {
805
- gte: number;
806
- };
807
-
808
- /**
809
- * Greater than
810
- */
811
- export type OrGt = {
812
- gt: number;
813
- };
814
-
815
- export type DeploymentInvokeOrNe = string | number | boolean;
816
-
817
- /**
818
- * Not equal to
819
- */
820
- export type OrNe = {
821
- ne: string | number | boolean;
822
- };
823
-
824
- export type DeploymentInvokeOrEq = string | number | boolean;
825
-
826
- /**
827
- * Equal to
828
- */
829
- export type OrEq = {
830
- eq: string | number | boolean;
831
- };
832
-
833
- export type KnowledgeFilterOr =
834
- | OrEq
835
- | OrNe
836
- | OrGt
837
- | OrGte
838
- | OrLt
839
- | OrLte
840
- | OrIn
841
- | OrNin
842
- | OrExists;
843
-
844
- /**
845
- * Or
846
- */
847
- export type Or = {
848
- or: Array<
849
- {
850
- [k: string]:
851
- | OrEq
852
- | OrNe
853
- | OrGt
854
- | OrGte
855
- | OrLt
856
- | OrLte
857
- | OrIn
858
- | OrNin
859
- | OrExists;
860
- }
861
- >;
862
- };
863
-
864
- /**
865
- * Exists
866
- */
867
- export type AndExists = {
868
- exists: boolean;
869
- };
870
-
871
- export type DeploymentInvokeAndNin = string | number | boolean;
872
-
873
- /**
874
- * Not in
875
- */
876
- export type AndNin = {
877
- nin: Array<string | number | boolean>;
878
- };
879
-
880
- export type DeploymentInvokeAndIn = string | number | boolean;
881
-
882
- /**
883
- * In
884
- */
885
- export type AndIn = {
886
- in: Array<string | number | boolean>;
887
- };
888
-
889
- /**
890
- * Less than or equal to
891
- */
892
- export type AndLte = {
893
- lte: number;
894
- };
895
-
896
- /**
897
- * Less than
898
- */
899
- export type AndLt = {
900
- lt: number;
901
- };
902
-
903
- /**
904
- * Greater than or equal to
905
- */
906
- export type AndGte = {
907
- gte: number;
908
- };
909
-
910
- /**
911
- * Greater than
912
- */
913
- export type AndGt = {
914
- gt: number;
915
- };
916
-
917
- export type DeploymentInvokeAndNe = string | number | boolean;
918
-
919
- /**
920
- * Not equal to
921
- */
922
- export type AndNe = {
923
- ne: string | number | boolean;
336
+ choices: Array<Choices>;
924
337
  };
925
338
 
926
- export type DeploymentInvokeAndEq = string | number | boolean;
927
-
928
- /**
929
- * Equal to
930
- */
931
- export type AndEq = {
932
- eq: string | number | boolean;
933
- };
934
-
935
- export type KnowledgeFilterAnd =
936
- | AndEq
937
- | AndNe
938
- | AndGt
939
- | AndGte
940
- | AndLt
941
- | AndLte
942
- | AndIn
943
- | AndNin
944
- | AndExists;
945
-
946
- /**
947
- * And
948
- */
949
- export type And = {
950
- and: Array<
951
- {
952
- [k: string]:
953
- | AndEq
954
- | AndNe
955
- | AndGt
956
- | AndGte
957
- | AndLt
958
- | AndLte
959
- | AndIn
960
- | AndNin
961
- | AndExists;
962
- }
963
- >;
964
- };
965
-
966
- /**
967
- * Exists
968
- */
969
- export type Exists = {
970
- exists: boolean;
971
- };
972
-
973
- export type OneNin = string | number | boolean;
974
-
975
- /**
976
- * Not in
977
- */
978
- export type Nin = {
979
- nin: Array<string | number | boolean>;
980
- };
981
-
982
- export type OneIn = string | number | boolean;
983
-
984
- /**
985
- * In
986
- */
987
- export type In = {
988
- in: Array<string | number | boolean>;
989
- };
990
-
991
- /**
992
- * Less than or equal to
993
- */
994
- export type Lte = {
995
- lte: number;
996
- };
997
-
998
- /**
999
- * Less than
1000
- */
1001
- export type Lt = {
1002
- lt: number;
1003
- };
1004
-
1005
- /**
1006
- * Greater than or equal to
1007
- */
1008
- export type Gte = {
1009
- gte: number;
1010
- };
1011
-
1012
- /**
1013
- * Greater than
1014
- */
1015
- export type Gt = {
1016
- gt: number;
1017
- };
1018
-
1019
- export type OneNe = string | number | boolean;
1020
-
1021
- /**
1022
- * Not equal to
1023
- */
1024
- export type Ne = {
1025
- ne: string | number | boolean;
1026
- };
1027
-
1028
- export type OneEq = string | number | boolean;
1029
-
1030
- /**
1031
- * Equal to
1032
- */
1033
- export type Eq = {
1034
- eq: string | number | boolean;
1035
- };
1036
-
1037
- export type KnowledgeFilter1 =
1038
- | Eq
1039
- | Ne
1040
- | Gt
1041
- | Gte
1042
- | Lt
1043
- | Lte
1044
- | In
1045
- | Nin
1046
- | Exists;
1047
-
1048
- /**
1049
- * A filter to apply to the knowledge base chunk metadata when using knowledge bases in the deployment.
1050
- */
1051
- export type KnowledgeFilter = And | Or | {
1052
- [k: string]: Eq | Ne | Gt | Gte | Lt | Lte | In | Nin | Exists;
1053
- };
1054
-
1055
- export type DeploymentInvokeRequestBody = {
1056
- /**
1057
- * The deployment key to invoke
1058
- */
1059
- key: string;
1060
- /**
1061
- * If set, partial message content will be sent. Tokens will be sent as data-only `server-sent events` as they become available, with the stream terminated by a `data: [DONE]` message.
1062
- */
1063
- stream?: boolean | undefined;
1064
- /**
1065
- * Key-value pairs variables to replace in your prompts. If a variable is not provided that is defined in the prompt, the default variables are used.
1066
- */
1067
- inputs?: { [k: string]: any } | undefined;
1068
- /**
1069
- * Key-value pairs that match your data model and fields declared in your deployment routing configuration
1070
- */
1071
- context?: { [k: string]: any } | undefined;
1072
- /**
1073
- * A list of messages to include after the `System` message, but before the `User` and `Assistant` pairs configured in your deployment.
1074
- */
1075
- prefixMessages?:
1076
- | Array<
1077
- | SystemMessage
1078
- | DeveloperMessage
1079
- | UserMessage
1080
- | AssistantMessage
1081
- | ToolMessage
1082
- >
1083
- | undefined;
1084
- /**
1085
- * A list of messages to send to the deployment.
1086
- */
1087
- messages?:
1088
- | Array<
1089
- | MessagesSystemMessage
1090
- | MessagesDeveloperMessage
1091
- | MessagesUserMessage
1092
- | MessagesAssistantMessage
1093
- | MessagesToolMessage
1094
- >
1095
- | undefined;
1096
- /**
1097
- * Information about the identity making the request. If the identity does not exist, it will be created automatically.
1098
- */
1099
- identity?: components.PublicIdentity | undefined;
1100
- /**
1101
- * A list of file IDs that are associated with the deployment request.
1102
- */
1103
- fileIds?: Array<string> | undefined;
1104
- /**
1105
- * Key-value pairs that you want to attach to the log generated by this request.
1106
- */
1107
- metadata?: { [k: string]: any } | undefined;
1108
- /**
1109
- * Utilized for passing additional parameters to the model provider. Exercise caution when using this feature, as the included parameters will overwrite any parameters specified in the deployment prompt configuration.
1110
- */
1111
- extraParams?: { [k: string]: any } | undefined;
1112
- /**
1113
- * A list of documents from your external knowledge base (e.g., chunks retrieved from your own vector database or RAG pipeline) that provide context for the model response. These documents can be used by evaluators and guardrails to assess the relevance and accuracy of the model output against the provided context.
1114
- */
1115
- documents?: Array<Documents> | undefined;
1116
- invokeOptions?: InvokeOptions | undefined;
1117
- thread?: Thread | undefined;
1118
- /**
1119
- * A filter to apply to the knowledge base chunk metadata when using knowledge bases in the deployment.
1120
- */
1121
- knowledgeFilter?: And | Or | {
1122
- [k: string]: Eq | Ne | Gt | Gte | Lt | Lte | In | Nin | Exists;
1123
- } | undefined;
1124
- };
1125
-
1126
- /**
1127
- * Indicates the type of model used to generate the response
1128
- */
1129
- export const DeploymentInvokeObject = {
1130
- Chat: "chat",
1131
- Completion: "completion",
1132
- Image: "image",
1133
- } as const;
1134
- /**
1135
- * Indicates the type of model used to generate the response
1136
- */
1137
- export type DeploymentInvokeObject = ClosedEnum<typeof DeploymentInvokeObject>;
1138
-
1139
- /**
1140
- * The provider used to generate the response
1141
- */
1142
- export const Provider = {
1143
- Openai: "openai",
1144
- Groq: "groq",
1145
- Cohere: "cohere",
1146
- Azure: "azure",
1147
- Aws: "aws",
1148
- Google: "google",
1149
- GoogleAi: "google-ai",
1150
- Huggingface: "huggingface",
1151
- Togetherai: "togetherai",
1152
- Perplexity: "perplexity",
1153
- Anthropic: "anthropic",
1154
- Leonardoai: "leonardoai",
1155
- Fal: "fal",
1156
- Nvidia: "nvidia",
1157
- Jina: "jina",
1158
- Elevenlabs: "elevenlabs",
1159
- Litellm: "litellm",
1160
- Cerebras: "cerebras",
1161
- Openailike: "openailike",
1162
- Bytedance: "bytedance",
1163
- Mistral: "mistral",
1164
- Deepseek: "deepseek",
1165
- Contextualai: "contextualai",
1166
- Moonshotai: "moonshotai",
1167
- Zai: "zai",
1168
- Minimax: "minimax",
1169
- Xai: "xai",
1170
- Alibaba: "alibaba",
1171
- Tensorix: "tensorix",
1172
- Scaleway: "scaleway",
1173
- Hcompany: "hcompany",
1174
- Inceptron: "inceptron",
1175
- Wafer: "wafer",
1176
- Slack: "slack",
1177
- Orq: "orq",
1178
- } as const;
1179
- /**
1180
- * The provider used to generate the response
1181
- */
1182
- export type Provider = ClosedEnum<typeof Provider>;
1183
-
1184
- export type Telemetry = {
1185
- /**
1186
- * The trace id for the request that generated this response
1187
- */
1188
- traceId: string;
1189
- /**
1190
- * The span id for the request that generated this response
1191
- */
1192
- spanId: string;
1193
- };
1194
-
1195
- /**
1196
- * Metadata of the retrieved chunk from the knowledge base
1197
- */
1198
- export type DeploymentInvokeMetadata = {
1199
- /**
1200
- * Name of the file
1201
- */
1202
- fileName: string;
1203
- /**
1204
- * Page number of the chunk
1205
- */
1206
- pageNumber: number | null;
1207
- /**
1208
- * Type of the file
1209
- */
1210
- fileType: string;
1211
- /**
1212
- * Rerank scores are normalized to be in the range [0, 1]. Scores close to 1 indicate a high relevance to the query, and scores closer to 0 indicate low relevance. It is not accurate to assume a score of 0.9 means the document is 2x more relevant than a document with a score of 0.45
1213
- */
1214
- rerankScore?: number | undefined;
1215
- /**
1216
- * Search scores are normalized to be in the range [0, 1]. Search score is calculated based on `[Cosine Similarity](https://en.wikipedia.org/wiki/Cosine_similarity)` algorithm. Scores close to 1 indicate the document is closer to the query, and scores closer to 0 indicate the document is farther from the query.
1217
- */
1218
- searchScore: number;
1219
- };
1220
-
1221
- export type Retrievals = {
1222
- /**
1223
- * Content of the retrieved chunk from the knowledge base
1224
- */
1225
- document: string;
1226
- /**
1227
- * Metadata of the retrieved chunk from the knowledge base
1228
- */
1229
- metadata: DeploymentInvokeMetadata;
1230
- };
1231
-
1232
- export type PromptTokensDetails = {
1233
- cachedTokens?: number | null | undefined;
1234
- };
1235
-
1236
- export type CompletionTokensDetails = {
1237
- reasoningTokens?: number | null | undefined;
1238
- };
1239
-
1240
- /**
1241
- * Usage metrics for the response
1242
- */
1243
- export type Usage = {
1244
- totalTokens?: number | undefined;
1245
- promptTokens?: number | undefined;
1246
- completionTokens?: number | undefined;
1247
- promptTokensDetails?: PromptTokensDetails | undefined;
1248
- completionTokensDetails?: CompletionTokensDetails | null | undefined;
1249
- };
1250
-
1251
- /**
1252
- * The role of the prompt message
1253
- */
1254
- export const DeploymentInvokeMessageDeploymentsRole = {
1255
- System: "system",
1256
- Developer: "developer",
1257
- Assistant: "assistant",
1258
- User: "user",
1259
- Exception: "exception",
1260
- Tool: "tool",
1261
- Prompt: "prompt",
1262
- Correction: "correction",
1263
- ExpectedOutput: "expected_output",
1264
- } as const;
1265
- /**
1266
- * The role of the prompt message
1267
- */
1268
- export type DeploymentInvokeMessageDeploymentsRole = ClosedEnum<
1269
- typeof DeploymentInvokeMessageDeploymentsRole
1270
- >;
1271
-
1272
- export type Message3 = {
1273
- type: "image";
1274
- /**
1275
- * The role of the prompt message
1276
- */
1277
- role: DeploymentInvokeMessageDeploymentsRole;
1278
- url: string;
1279
- };
1280
-
1281
- /**
1282
- * The role of the prompt message
1283
- */
1284
- export const DeploymentInvokeMessageRole = {
1285
- System: "system",
1286
- Developer: "developer",
1287
- Assistant: "assistant",
1288
- User: "user",
1289
- Exception: "exception",
1290
- Tool: "tool",
1291
- Prompt: "prompt",
1292
- Correction: "correction",
1293
- ExpectedOutput: "expected_output",
1294
- } as const;
1295
- /**
1296
- * The role of the prompt message
1297
- */
1298
- export type DeploymentInvokeMessageRole = ClosedEnum<
1299
- typeof DeploymentInvokeMessageRole
1300
- >;
1301
-
1302
- export type Message2 = {
1303
- type: "content";
1304
- /**
1305
- * The role of the prompt message
1306
- */
1307
- role: DeploymentInvokeMessageRole;
1308
- content: string | null;
1309
- /**
1310
- * Internal thought process of the model
1311
- */
1312
- reasoning?: string | undefined;
1313
- /**
1314
- * The signature holds a cryptographic token which verifies that the thinking block was generated by the model, and is verified when thinking is part of a multiturn conversation. This value should not be modified and should always be sent to the API when the reasoning is redacted. Currently only supported by `Anthropic`.
1315
- */
1316
- reasoningSignature?: string | undefined;
1317
- /**
1318
- * Occasionally the model's internal reasoning will be flagged by the safety systems of the provider. When this occurs, the provider will encrypt the reasoning. These redacted reasoning is decrypted when passed back to the API, allowing the model to continue its response without losing context.
1319
- */
1320
- redactedReasoning?: string | undefined;
1321
- };
1322
-
1323
- /**
1324
- * The role of the prompt message
1325
- */
1326
- export const MessageRole = {
1327
- System: "system",
1328
- Developer: "developer",
1329
- Assistant: "assistant",
1330
- User: "user",
1331
- Exception: "exception",
1332
- Tool: "tool",
1333
- Prompt: "prompt",
1334
- Correction: "correction",
1335
- ExpectedOutput: "expected_output",
1336
- } as const;
1337
- /**
1338
- * The role of the prompt message
1339
- */
1340
- export type MessageRole = ClosedEnum<typeof MessageRole>;
1341
-
1342
- export const DeploymentInvokeMessageDeploymentsResponseType = {
1343
- Function: "function",
1344
- } as const;
1345
- export type DeploymentInvokeMessageDeploymentsResponseType = ClosedEnum<
1346
- typeof DeploymentInvokeMessageDeploymentsResponseType
1347
- >;
1348
-
1349
- export type MessageFunction = {
1350
- name: string;
1351
- /**
1352
- * JSON string arguments for the functions
1353
- */
1354
- arguments: string;
1355
- };
1356
-
1357
- export type MessageToolCalls = {
1358
- id?: string | undefined;
1359
- index?: number | undefined;
1360
- type: DeploymentInvokeMessageDeploymentsResponseType;
1361
- function: MessageFunction;
1362
- };
1363
-
1364
- export type Message1 = {
1365
- type: "tool_calls";
1366
- /**
1367
- * The role of the prompt message
1368
- */
1369
- role: MessageRole;
1370
- content?: string | null | undefined;
1371
- toolCalls: Array<MessageToolCalls>;
1372
- /**
1373
- * Internal thought process of the model
1374
- */
1375
- reasoning?: string | undefined;
1376
- /**
1377
- * The signature holds a cryptographic token which verifies that the thinking block was generated by the model, and is verified when thinking is part of a multiturn conversation. This value should not be modified and should always be sent to the API when the reasoning is redacted. Currently only supported by `Anthropic`.
1378
- */
1379
- reasoningSignature?: string | undefined;
1380
- /**
1381
- * Occasionally the model's internal reasoning will be flagged by the safety systems of the provider. When this occurs, the provider will encrypt the reasoning. These redacted reasoning is decrypted when passed back to the API, allowing the model to continue its response without losing context.
1382
- */
1383
- redactedReasoning?: string | undefined;
1384
- };
1385
-
1386
- export type Message = Message1 | Message2 | Message3;
1387
-
1388
- export type Choices = {
1389
- index: number;
1390
- message: Message1 | Message2 | Message3;
1391
- finishReason?: string | null | undefined;
1392
- };
1393
-
1394
- /**
1395
- * Successful operation
1396
- */
1397
- export type DeploymentInvokeResponseBody = {
1398
- /**
1399
- * A unique identifier for the response. Can be used to add metrics to the transaction.
1400
- */
1401
- id: string;
1402
- /**
1403
- * A timestamp indicating when the object was created. Usually in a standardized format like ISO 8601
1404
- */
1405
- created: Date;
1406
- /**
1407
- * Indicates the type of model used to generate the response
1408
- */
1409
- object: DeploymentInvokeObject;
1410
- /**
1411
- * The model used to generate the response
1412
- */
1413
- model: string;
1414
- /**
1415
- * The provider used to generate the response
1416
- */
1417
- provider: Provider;
1418
- /**
1419
- * Indicates if the response is the final response
1420
- */
1421
- isFinal: boolean;
1422
- /**
1423
- * Indicates integration id used to generate the response
1424
- */
1425
- integrationId?: string | undefined;
1426
- telemetry: Telemetry;
1427
- /**
1428
- * A timestamp indicating when the object was finalized. Usually in a standardized format like ISO 8601
1429
- */
1430
- finalized?: Date | undefined;
1431
- /**
1432
- * Provider backed system fingerprint.
1433
- */
1434
- systemFingerprint?: string | null | undefined;
1435
- /**
1436
- * List of documents retrieved from the knowledge base. This property is only available when the `include_retrievals` flag is set to `true` in the invoke settings. When stream is set to true, the `retrievals` property will be returned in the last streamed chunk where the property `is_final` is set to `true`.
1437
- */
1438
- retrievals?: Array<Retrievals> | undefined;
1439
- /**
1440
- * Response returned by the model provider. This functionality is only supported when streaming is not used. If streaming is used, the `provider_response` property will be set to `null`.
1441
- */
1442
- providerResponse?: any | undefined;
1443
- /**
1444
- * Usage metrics for the response
1445
- */
1446
- usage?: Usage | null | undefined;
1447
- /**
1448
- * A list of choices generated by the model
1449
- */
1450
- choices: Array<Choices>;
1451
- };
1452
-
1453
- /** @internal */
1454
- export type DeploymentInvokeContentDeployments2$Outbound =
1455
- components.TextContentPartSchema$Outbound;
1456
-
1457
- /** @internal */
1458
- export const DeploymentInvokeContentDeployments2$outboundSchema: z.ZodType<
1459
- DeploymentInvokeContentDeployments2$Outbound,
1460
- z.ZodTypeDef,
1461
- DeploymentInvokeContentDeployments2
1462
- > = components.TextContentPartSchema$outboundSchema;
1463
-
1464
- export function deploymentInvokeContentDeployments2ToJSON(
1465
- deploymentInvokeContentDeployments2: DeploymentInvokeContentDeployments2,
1466
- ): string {
1467
- return JSON.stringify(
1468
- DeploymentInvokeContentDeployments2$outboundSchema.parse(
1469
- deploymentInvokeContentDeployments2,
1470
- ),
1471
- );
1472
- }
1473
-
1474
- /** @internal */
1475
- export type DeploymentInvokePrefixMessagesDeploymentsRequestRequestBodyContent$Outbound =
1476
- | string
1477
- | Array<components.TextContentPartSchema$Outbound>;
1478
-
1479
- /** @internal */
1480
- export const DeploymentInvokePrefixMessagesDeploymentsRequestRequestBodyContent$outboundSchema:
1481
- z.ZodType<
1482
- DeploymentInvokePrefixMessagesDeploymentsRequestRequestBodyContent$Outbound,
1483
- z.ZodTypeDef,
1484
- DeploymentInvokePrefixMessagesDeploymentsRequestRequestBodyContent
1485
- > = z.union([
1486
- z.string(),
1487
- z.array(components.TextContentPartSchema$outboundSchema),
1488
- ]);
1489
-
1490
- export function deploymentInvokePrefixMessagesDeploymentsRequestRequestBodyContentToJSON(
1491
- deploymentInvokePrefixMessagesDeploymentsRequestRequestBodyContent:
1492
- DeploymentInvokePrefixMessagesDeploymentsRequestRequestBodyContent,
1493
- ): string {
1494
- return JSON.stringify(
1495
- DeploymentInvokePrefixMessagesDeploymentsRequestRequestBodyContent$outboundSchema
1496
- .parse(
1497
- deploymentInvokePrefixMessagesDeploymentsRequestRequestBodyContent,
1498
- ),
1499
- );
1500
- }
1501
-
1502
- /** @internal */
1503
- export const DeploymentInvokePrefixMessagesType$outboundSchema: z.ZodNativeEnum<
1504
- typeof DeploymentInvokePrefixMessagesType
1505
- > = z.nativeEnum(DeploymentInvokePrefixMessagesType);
1506
-
1507
- /** @internal */
1508
- export const PrefixMessagesTtl$outboundSchema: z.ZodNativeEnum<
1509
- typeof PrefixMessagesTtl
1510
- > = z.nativeEnum(PrefixMessagesTtl);
1511
-
1512
- /** @internal */
1513
- export type PrefixMessagesCacheControl$Outbound = {
1514
- type: string;
1515
- ttl: string;
1516
- };
1517
-
1518
- /** @internal */
1519
- export const PrefixMessagesCacheControl$outboundSchema: z.ZodType<
1520
- PrefixMessagesCacheControl$Outbound,
1521
- z.ZodTypeDef,
1522
- PrefixMessagesCacheControl
1523
- > = z.object({
1524
- type: DeploymentInvokePrefixMessagesType$outboundSchema,
1525
- ttl: PrefixMessagesTtl$outboundSchema.default("5m"),
1526
- });
1527
-
1528
- export function prefixMessagesCacheControlToJSON(
1529
- prefixMessagesCacheControl: PrefixMessagesCacheControl,
1530
- ): string {
1531
- return JSON.stringify(
1532
- PrefixMessagesCacheControl$outboundSchema.parse(prefixMessagesCacheControl),
1533
- );
1534
- }
1535
-
1536
- /** @internal */
1537
- export type ToolMessage$Outbound = {
1538
- role: "tool";
1539
- content: string | Array<components.TextContentPartSchema$Outbound>;
1540
- tool_call_id: string | null;
1541
- cache_control?: PrefixMessagesCacheControl$Outbound | undefined;
1542
- };
1543
-
1544
- /** @internal */
1545
- export const ToolMessage$outboundSchema: z.ZodType<
1546
- ToolMessage$Outbound,
1547
- z.ZodTypeDef,
1548
- ToolMessage
1549
- > = z.object({
1550
- role: z.literal("tool"),
1551
- content: z.union([
1552
- z.string(),
1553
- z.array(components.TextContentPartSchema$outboundSchema),
1554
- ]),
1555
- toolCallId: z.nullable(z.string()),
1556
- cacheControl: z.lazy(() => PrefixMessagesCacheControl$outboundSchema)
1557
- .optional(),
1558
- }).transform((v) => {
1559
- return remap$(v, {
1560
- toolCallId: "tool_call_id",
1561
- cacheControl: "cache_control",
1562
- });
1563
- });
1564
-
1565
- export function toolMessageToJSON(toolMessage: ToolMessage): string {
1566
- return JSON.stringify(ToolMessage$outboundSchema.parse(toolMessage));
1567
- }
1568
-
1569
- /** @internal */
1570
- export type DeploymentInvokeContent2$Outbound =
1571
- | (components.TextContentPartSchema$Outbound & { type: "text" })
1572
- | components.RefusalPartSchema$Outbound
1573
- | components.ReasoningPartSchema$Outbound
1574
- | components.RedactedReasoningPartSchema$Outbound;
1575
-
1576
- /** @internal */
1577
- export const DeploymentInvokeContent2$outboundSchema: z.ZodType<
1578
- DeploymentInvokeContent2$Outbound,
1579
- z.ZodTypeDef,
1580
- DeploymentInvokeContent2
1581
- > = z.union([
1582
- components.TextContentPartSchema$outboundSchema.and(
1583
- z.object({ type: z.literal("text") }),
1584
- ),
1585
- components.RefusalPartSchema$outboundSchema,
1586
- components.ReasoningPartSchema$outboundSchema,
1587
- components.RedactedReasoningPartSchema$outboundSchema,
1588
- ]);
1589
-
1590
- export function deploymentInvokeContent2ToJSON(
1591
- deploymentInvokeContent2: DeploymentInvokeContent2,
1592
- ): string {
1593
- return JSON.stringify(
1594
- DeploymentInvokeContent2$outboundSchema.parse(deploymentInvokeContent2),
1595
- );
1596
- }
1597
-
1598
- /** @internal */
1599
- export type DeploymentInvokePrefixMessagesDeploymentsRequestContent$Outbound =
1600
- | string
1601
- | Array<
1602
- | (components.TextContentPartSchema$Outbound & { type: "text" })
1603
- | components.RefusalPartSchema$Outbound
1604
- | components.ReasoningPartSchema$Outbound
1605
- | components.RedactedReasoningPartSchema$Outbound
1606
- >;
1607
-
1608
- /** @internal */
1609
- export const DeploymentInvokePrefixMessagesDeploymentsRequestContent$outboundSchema:
1610
- z.ZodType<
1611
- DeploymentInvokePrefixMessagesDeploymentsRequestContent$Outbound,
1612
- z.ZodTypeDef,
1613
- DeploymentInvokePrefixMessagesDeploymentsRequestContent
1614
- > = z.union([
1615
- z.string(),
1616
- z.array(
1617
- z.union([
1618
- components.TextContentPartSchema$outboundSchema.and(
1619
- z.object({ type: z.literal("text") }),
1620
- ),
1621
- components.RefusalPartSchema$outboundSchema,
1622
- components.ReasoningPartSchema$outboundSchema,
1623
- components.RedactedReasoningPartSchema$outboundSchema,
1624
- ]),
1625
- ),
1626
- ]);
1627
-
1628
- export function deploymentInvokePrefixMessagesDeploymentsRequestContentToJSON(
1629
- deploymentInvokePrefixMessagesDeploymentsRequestContent:
1630
- DeploymentInvokePrefixMessagesDeploymentsRequestContent,
1631
- ): string {
1632
- return JSON.stringify(
1633
- DeploymentInvokePrefixMessagesDeploymentsRequestContent$outboundSchema
1634
- .parse(deploymentInvokePrefixMessagesDeploymentsRequestContent),
1635
- );
1636
- }
1637
-
1638
- /** @internal */
1639
- export type Audio$Outbound = {
1640
- id: string;
1641
- };
1642
-
1643
- /** @internal */
1644
- export const Audio$outboundSchema: z.ZodType<
1645
- Audio$Outbound,
1646
- z.ZodTypeDef,
1647
- Audio
1648
- > = z.object({
1649
- id: z.string(),
1650
- });
1651
-
1652
- export function audioToJSON(audio: Audio): string {
1653
- return JSON.stringify(Audio$outboundSchema.parse(audio));
1654
- }
1655
-
1656
- /** @internal */
1657
- export const PrefixMessagesType$outboundSchema: z.ZodNativeEnum<
1658
- typeof PrefixMessagesType
1659
- > = z.nativeEnum(PrefixMessagesType);
1660
-
1661
- /** @internal */
1662
- export type PrefixMessagesFunction$Outbound = {
1663
- name?: string | undefined;
1664
- arguments?: string | undefined;
1665
- };
1666
-
1667
- /** @internal */
1668
- export const PrefixMessagesFunction$outboundSchema: z.ZodType<
1669
- PrefixMessagesFunction$Outbound,
1670
- z.ZodTypeDef,
1671
- PrefixMessagesFunction
1672
- > = z.object({
1673
- name: z.string().optional(),
1674
- arguments: z.string().optional(),
1675
- });
1676
-
1677
- export function prefixMessagesFunctionToJSON(
1678
- prefixMessagesFunction: PrefixMessagesFunction,
1679
- ): string {
1680
- return JSON.stringify(
1681
- PrefixMessagesFunction$outboundSchema.parse(prefixMessagesFunction),
1682
- );
1683
- }
1684
-
1685
- /** @internal */
1686
- export type PrefixMessagesToolCalls$Outbound = {
1687
- id: string;
1688
- type: string;
1689
- function: PrefixMessagesFunction$Outbound;
1690
- thought_signature?: string | undefined;
1691
- };
1692
-
1693
- /** @internal */
1694
- export const PrefixMessagesToolCalls$outboundSchema: z.ZodType<
1695
- PrefixMessagesToolCalls$Outbound,
1696
- z.ZodTypeDef,
1697
- PrefixMessagesToolCalls
1698
- > = z.object({
1699
- id: z.string(),
1700
- type: PrefixMessagesType$outboundSchema,
1701
- function: z.lazy(() => PrefixMessagesFunction$outboundSchema),
1702
- thoughtSignature: z.string().optional(),
1703
- }).transform((v) => {
1704
- return remap$(v, {
1705
- thoughtSignature: "thought_signature",
1706
- });
1707
- });
1708
-
1709
- export function prefixMessagesToolCallsToJSON(
1710
- prefixMessagesToolCalls: PrefixMessagesToolCalls,
1711
- ): string {
1712
- return JSON.stringify(
1713
- PrefixMessagesToolCalls$outboundSchema.parse(prefixMessagesToolCalls),
1714
- );
1715
- }
1716
-
1717
- /** @internal */
1718
- export type AssistantMessage$Outbound = {
1719
- content?:
1720
- | string
1721
- | Array<
1722
- | (components.TextContentPartSchema$Outbound & { type: "text" })
1723
- | components.RefusalPartSchema$Outbound
1724
- | components.ReasoningPartSchema$Outbound
1725
- | components.RedactedReasoningPartSchema$Outbound
1726
- >
1727
- | null
1728
- | undefined;
1729
- refusal?: string | null | undefined;
1730
- role: "assistant";
1731
- name?: string | undefined;
1732
- audio?: Audio$Outbound | null | undefined;
1733
- tool_calls?: Array<PrefixMessagesToolCalls$Outbound> | undefined;
1734
- };
1735
-
1736
- /** @internal */
1737
- export const AssistantMessage$outboundSchema: z.ZodType<
1738
- AssistantMessage$Outbound,
1739
- z.ZodTypeDef,
1740
- AssistantMessage
1741
- > = z.object({
1742
- content: z.nullable(
1743
- z.union([
1744
- z.string(),
1745
- z.array(
1746
- z.union([
1747
- components.TextContentPartSchema$outboundSchema.and(
1748
- z.object({ type: z.literal("text") }),
1749
- ),
1750
- components.RefusalPartSchema$outboundSchema,
1751
- components.ReasoningPartSchema$outboundSchema,
1752
- components.RedactedReasoningPartSchema$outboundSchema,
1753
- ]),
1754
- ),
1755
- ]),
1756
- ).optional(),
1757
- refusal: z.nullable(z.string()).optional(),
1758
- role: z.literal("assistant"),
1759
- name: z.string().optional(),
1760
- audio: z.nullable(z.lazy(() => Audio$outboundSchema)).optional(),
1761
- toolCalls: z.array(z.lazy(() => PrefixMessagesToolCalls$outboundSchema))
1762
- .optional(),
1763
- }).transform((v) => {
1764
- return remap$(v, {
1765
- toolCalls: "tool_calls",
1766
- });
1767
- });
1768
-
1769
- export function assistantMessageToJSON(
1770
- assistantMessage: AssistantMessage,
1771
- ): string {
1772
- return JSON.stringify(
1773
- AssistantMessage$outboundSchema.parse(assistantMessage),
1774
- );
1775
- }
1776
-
1777
- /** @internal */
1778
- export const DeploymentInvoke2DeploymentsType$outboundSchema: z.ZodNativeEnum<
1779
- typeof DeploymentInvoke2DeploymentsType
1780
- > = z.nativeEnum(DeploymentInvoke2DeploymentsType);
1781
-
1782
- /** @internal */
1783
- export const Ttl$outboundSchema: z.ZodNativeEnum<typeof Ttl> = z.nativeEnum(
1784
- Ttl,
1785
- );
1786
-
1787
- /** @internal */
1788
- export type CacheControl$Outbound = {
1789
- type: string;
1790
- ttl: string;
1791
- };
1792
-
1793
- /** @internal */
1794
- export const CacheControl$outboundSchema: z.ZodType<
1795
- CacheControl$Outbound,
1796
- z.ZodTypeDef,
1797
- CacheControl
1798
- > = z.object({
1799
- type: DeploymentInvoke2DeploymentsType$outboundSchema,
1800
- ttl: Ttl$outboundSchema.default("5m"),
1801
- });
1802
-
1803
- export function cacheControlToJSON(cacheControl: CacheControl): string {
1804
- return JSON.stringify(CacheControl$outboundSchema.parse(cacheControl));
1805
- }
1806
-
1807
- /** @internal */
1808
- export type Four$Outbound = {
1809
- type: "file";
1810
- cache_control?: CacheControl$Outbound | undefined;
1811
- file: components.FileContentPartSchema$Outbound;
1812
- };
1813
-
1814
- /** @internal */
1815
- export const Four$outboundSchema: z.ZodType<Four$Outbound, z.ZodTypeDef, Four> =
1816
- z.object({
1817
- type: z.literal("file"),
1818
- cacheControl: z.lazy(() => CacheControl$outboundSchema).optional(),
1819
- file: components.FileContentPartSchema$outboundSchema,
1820
- }).transform((v) => {
1821
- return remap$(v, {
1822
- cacheControl: "cache_control",
1823
- });
1824
- });
1825
-
1826
- export function fourToJSON(four: Four): string {
1827
- return JSON.stringify(Four$outboundSchema.parse(four));
1828
- }
1829
-
1830
- /** @internal */
1831
- export type Content2$Outbound =
1832
- | (components.TextContentPartSchema$Outbound & { type: "text" })
1833
- | components.ImageContentPartSchema$Outbound
1834
- | components.AudioContentPartSchema$Outbound
1835
- | Four$Outbound;
1836
-
1837
- /** @internal */
1838
- export const Content2$outboundSchema: z.ZodType<
1839
- Content2$Outbound,
1840
- z.ZodTypeDef,
1841
- Content2
1842
- > = z.union([
1843
- components.TextContentPartSchema$outboundSchema.and(
1844
- z.object({ type: z.literal("text") }),
1845
- ),
1846
- components.ImageContentPartSchema$outboundSchema,
1847
- components.AudioContentPartSchema$outboundSchema,
1848
- z.lazy(() => Four$outboundSchema),
1849
- ]);
1850
-
1851
- export function content2ToJSON(content2: Content2): string {
1852
- return JSON.stringify(Content2$outboundSchema.parse(content2));
1853
- }
1854
-
1855
- /** @internal */
1856
- export type DeploymentInvokePrefixMessagesDeploymentsContent$Outbound =
1857
- | string
1858
- | Array<
1859
- | (components.TextContentPartSchema$Outbound & { type: "text" })
1860
- | components.ImageContentPartSchema$Outbound
1861
- | components.AudioContentPartSchema$Outbound
1862
- | Four$Outbound
1863
- >;
1864
-
1865
- /** @internal */
1866
- export const DeploymentInvokePrefixMessagesDeploymentsContent$outboundSchema:
1867
- z.ZodType<
1868
- DeploymentInvokePrefixMessagesDeploymentsContent$Outbound,
1869
- z.ZodTypeDef,
1870
- DeploymentInvokePrefixMessagesDeploymentsContent
1871
- > = z.union([
1872
- z.string(),
1873
- z.array(
1874
- z.union([
1875
- components.TextContentPartSchema$outboundSchema.and(
1876
- z.object({ type: z.literal("text") }),
1877
- ),
1878
- components.ImageContentPartSchema$outboundSchema,
1879
- components.AudioContentPartSchema$outboundSchema,
1880
- z.lazy(() => Four$outboundSchema),
1881
- ]),
1882
- ),
1883
- ]);
1884
-
1885
- export function deploymentInvokePrefixMessagesDeploymentsContentToJSON(
1886
- deploymentInvokePrefixMessagesDeploymentsContent:
1887
- DeploymentInvokePrefixMessagesDeploymentsContent,
1888
- ): string {
1889
- return JSON.stringify(
1890
- DeploymentInvokePrefixMessagesDeploymentsContent$outboundSchema.parse(
1891
- deploymentInvokePrefixMessagesDeploymentsContent,
1892
- ),
1893
- );
1894
- }
1895
-
1896
- /** @internal */
1897
- export type UserMessage$Outbound = {
1898
- role: "user";
1899
- name?: string | undefined;
1900
- content:
1901
- | string
1902
- | Array<
1903
- | (components.TextContentPartSchema$Outbound & { type: "text" })
1904
- | components.ImageContentPartSchema$Outbound
1905
- | components.AudioContentPartSchema$Outbound
1906
- | Four$Outbound
1907
- >;
1908
- };
1909
-
1910
- /** @internal */
1911
- export const UserMessage$outboundSchema: z.ZodType<
1912
- UserMessage$Outbound,
1913
- z.ZodTypeDef,
1914
- UserMessage
1915
- > = z.object({
1916
- role: z.literal("user"),
1917
- name: z.string().optional(),
1918
- content: z.union([
1919
- z.string(),
1920
- z.array(
1921
- z.union([
1922
- components.TextContentPartSchema$outboundSchema.and(
1923
- z.object({ type: z.literal("text") }),
1924
- ),
1925
- components.ImageContentPartSchema$outboundSchema,
1926
- components.AudioContentPartSchema$outboundSchema,
1927
- z.lazy(() => Four$outboundSchema),
1928
- ]),
1929
- ),
1930
- ]),
1931
- });
1932
-
1933
- export function userMessageToJSON(userMessage: UserMessage): string {
1934
- return JSON.stringify(UserMessage$outboundSchema.parse(userMessage));
1935
- }
1936
-
1937
- /** @internal */
1938
- export type DeploymentInvokePrefixMessagesContent$Outbound =
1939
- | string
1940
- | Array<components.TextContentPartSchema$Outbound>;
1941
-
1942
- /** @internal */
1943
- export const DeploymentInvokePrefixMessagesContent$outboundSchema: z.ZodType<
1944
- DeploymentInvokePrefixMessagesContent$Outbound,
1945
- z.ZodTypeDef,
1946
- DeploymentInvokePrefixMessagesContent
1947
- > = z.union([
1948
- z.string(),
1949
- z.array(components.TextContentPartSchema$outboundSchema),
1950
- ]);
1951
-
1952
- export function deploymentInvokePrefixMessagesContentToJSON(
1953
- deploymentInvokePrefixMessagesContent: DeploymentInvokePrefixMessagesContent,
1954
- ): string {
1955
- return JSON.stringify(
1956
- DeploymentInvokePrefixMessagesContent$outboundSchema.parse(
1957
- deploymentInvokePrefixMessagesContent,
1958
- ),
1959
- );
1960
- }
1961
-
1962
- /** @internal */
1963
- export type DeveloperMessage$Outbound = {
1964
- role: "developer";
1965
- content: string | Array<components.TextContentPartSchema$Outbound>;
1966
- name?: string | undefined;
1967
- };
1968
-
1969
- /** @internal */
1970
- export const DeveloperMessage$outboundSchema: z.ZodType<
1971
- DeveloperMessage$Outbound,
1972
- z.ZodTypeDef,
1973
- DeveloperMessage
1974
- > = z.object({
1975
- role: z.literal("developer"),
1976
- content: z.union([
1977
- z.string(),
1978
- z.array(components.TextContentPartSchema$outboundSchema),
1979
- ]),
1980
- name: z.string().optional(),
1981
- });
1982
-
1983
- export function developerMessageToJSON(
1984
- developerMessage: DeveloperMessage,
1985
- ): string {
1986
- return JSON.stringify(
1987
- DeveloperMessage$outboundSchema.parse(developerMessage),
1988
- );
1989
- }
1990
-
1991
- /** @internal */
1992
- export type PrefixMessagesContent$Outbound =
1993
- | string
1994
- | Array<components.TextContentPartSchema$Outbound>;
1995
-
1996
- /** @internal */
1997
- export const PrefixMessagesContent$outboundSchema: z.ZodType<
1998
- PrefixMessagesContent$Outbound,
1999
- z.ZodTypeDef,
2000
- PrefixMessagesContent
2001
- > = z.union([
2002
- z.string(),
2003
- z.array(components.TextContentPartSchema$outboundSchema),
2004
- ]);
2005
-
2006
- export function prefixMessagesContentToJSON(
2007
- prefixMessagesContent: PrefixMessagesContent,
2008
- ): string {
2009
- return JSON.stringify(
2010
- PrefixMessagesContent$outboundSchema.parse(prefixMessagesContent),
2011
- );
2012
- }
2013
-
2014
- /** @internal */
2015
- export type SystemMessage$Outbound = {
2016
- role: "system";
2017
- content: string | Array<components.TextContentPartSchema$Outbound>;
2018
- name?: string | undefined;
2019
- };
2020
-
2021
- /** @internal */
2022
- export const SystemMessage$outboundSchema: z.ZodType<
2023
- SystemMessage$Outbound,
2024
- z.ZodTypeDef,
2025
- SystemMessage
2026
- > = z.object({
2027
- role: z.literal("system"),
2028
- content: z.union([
2029
- z.string(),
2030
- z.array(components.TextContentPartSchema$outboundSchema),
2031
- ]),
2032
- name: z.string().optional(),
2033
- });
2034
-
2035
- export function systemMessageToJSON(systemMessage: SystemMessage): string {
2036
- return JSON.stringify(SystemMessage$outboundSchema.parse(systemMessage));
2037
- }
2038
-
2039
- /** @internal */
2040
- export type PrefixMessages$Outbound =
2041
- | SystemMessage$Outbound
2042
- | DeveloperMessage$Outbound
2043
- | UserMessage$Outbound
2044
- | AssistantMessage$Outbound
2045
- | ToolMessage$Outbound;
2046
-
2047
- /** @internal */
2048
- export const PrefixMessages$outboundSchema: z.ZodType<
2049
- PrefixMessages$Outbound,
2050
- z.ZodTypeDef,
2051
- PrefixMessages
2052
- > = z.union([
2053
- z.lazy(() => SystemMessage$outboundSchema),
2054
- z.lazy(() => DeveloperMessage$outboundSchema),
2055
- z.lazy(() => UserMessage$outboundSchema),
2056
- z.lazy(() => AssistantMessage$outboundSchema),
2057
- z.lazy(() => ToolMessage$outboundSchema),
2058
- ]);
2059
-
2060
- export function prefixMessagesToJSON(prefixMessages: PrefixMessages): string {
2061
- return JSON.stringify(PrefixMessages$outboundSchema.parse(prefixMessages));
2062
- }
2063
-
2064
- /** @internal */
2065
- export type DeploymentInvokeContentDeploymentsRequestRequestBodyMessages2$Outbound =
2066
- components.TextContentPartSchema$Outbound;
2067
-
2068
- /** @internal */
2069
- export const DeploymentInvokeContentDeploymentsRequestRequestBodyMessages2$outboundSchema:
2070
- z.ZodType<
2071
- DeploymentInvokeContentDeploymentsRequestRequestBodyMessages2$Outbound,
2072
- z.ZodTypeDef,
2073
- DeploymentInvokeContentDeploymentsRequestRequestBodyMessages2
2074
- > = components.TextContentPartSchema$outboundSchema;
2075
-
2076
- export function deploymentInvokeContentDeploymentsRequestRequestBodyMessages2ToJSON(
2077
- deploymentInvokeContentDeploymentsRequestRequestBodyMessages2:
2078
- DeploymentInvokeContentDeploymentsRequestRequestBodyMessages2,
2079
- ): string {
2080
- return JSON.stringify(
2081
- DeploymentInvokeContentDeploymentsRequestRequestBodyMessages2$outboundSchema
2082
- .parse(deploymentInvokeContentDeploymentsRequestRequestBodyMessages2),
2083
- );
2084
- }
2085
-
2086
- /** @internal */
2087
- export type DeploymentInvokeMessagesDeploymentsRequestRequestBodyContent$Outbound =
2088
- | string
2089
- | Array<components.TextContentPartSchema$Outbound>;
2090
-
2091
- /** @internal */
2092
- export const DeploymentInvokeMessagesDeploymentsRequestRequestBodyContent$outboundSchema:
2093
- z.ZodType<
2094
- DeploymentInvokeMessagesDeploymentsRequestRequestBodyContent$Outbound,
2095
- z.ZodTypeDef,
2096
- DeploymentInvokeMessagesDeploymentsRequestRequestBodyContent
2097
- > = z.union([
2098
- z.string(),
2099
- z.array(components.TextContentPartSchema$outboundSchema),
2100
- ]);
2101
-
2102
- export function deploymentInvokeMessagesDeploymentsRequestRequestBodyContentToJSON(
2103
- deploymentInvokeMessagesDeploymentsRequestRequestBodyContent:
2104
- DeploymentInvokeMessagesDeploymentsRequestRequestBodyContent,
2105
- ): string {
2106
- return JSON.stringify(
2107
- DeploymentInvokeMessagesDeploymentsRequestRequestBodyContent$outboundSchema
2108
- .parse(deploymentInvokeMessagesDeploymentsRequestRequestBodyContent),
2109
- );
2110
- }
2111
-
2112
- /** @internal */
2113
- export const DeploymentInvokeMessagesType$outboundSchema: z.ZodNativeEnum<
2114
- typeof DeploymentInvokeMessagesType
2115
- > = z.nativeEnum(DeploymentInvokeMessagesType);
2116
-
2117
- /** @internal */
2118
- export const MessagesTtl$outboundSchema: z.ZodNativeEnum<typeof MessagesTtl> = z
2119
- .nativeEnum(MessagesTtl);
2120
-
2121
- /** @internal */
2122
- export type MessagesCacheControl$Outbound = {
2123
- type: string;
2124
- ttl: string;
2125
- };
2126
-
2127
- /** @internal */
2128
- export const MessagesCacheControl$outboundSchema: z.ZodType<
2129
- MessagesCacheControl$Outbound,
2130
- z.ZodTypeDef,
2131
- MessagesCacheControl
2132
- > = z.object({
2133
- type: DeploymentInvokeMessagesType$outboundSchema,
2134
- ttl: MessagesTtl$outboundSchema.default("5m"),
2135
- });
2136
-
2137
- export function messagesCacheControlToJSON(
2138
- messagesCacheControl: MessagesCacheControl,
2139
- ): string {
2140
- return JSON.stringify(
2141
- MessagesCacheControl$outboundSchema.parse(messagesCacheControl),
2142
- );
2143
- }
2144
-
2145
- /** @internal */
2146
- export type MessagesToolMessage$Outbound = {
2147
- role: "tool";
2148
- content: string | Array<components.TextContentPartSchema$Outbound>;
2149
- tool_call_id: string | null;
2150
- cache_control?: MessagesCacheControl$Outbound | undefined;
2151
- };
2152
-
2153
- /** @internal */
2154
- export const MessagesToolMessage$outboundSchema: z.ZodType<
2155
- MessagesToolMessage$Outbound,
2156
- z.ZodTypeDef,
2157
- MessagesToolMessage
2158
- > = z.object({
2159
- role: z.literal("tool"),
2160
- content: z.union([
2161
- z.string(),
2162
- z.array(components.TextContentPartSchema$outboundSchema),
2163
- ]),
2164
- toolCallId: z.nullable(z.string()),
2165
- cacheControl: z.lazy(() => MessagesCacheControl$outboundSchema).optional(),
2166
- }).transform((v) => {
2167
- return remap$(v, {
2168
- toolCallId: "tool_call_id",
2169
- cacheControl: "cache_control",
2170
- });
2171
- });
2172
-
2173
- export function messagesToolMessageToJSON(
2174
- messagesToolMessage: MessagesToolMessage,
2175
- ): string {
2176
- return JSON.stringify(
2177
- MessagesToolMessage$outboundSchema.parse(messagesToolMessage),
2178
- );
2179
- }
2180
-
2181
- /** @internal */
2182
- export type DeploymentInvokeContentDeploymentsRequestRequestBody2$Outbound =
2183
- | (components.TextContentPartSchema$Outbound & { type: "text" })
2184
- | components.RefusalPartSchema$Outbound
2185
- | components.ReasoningPartSchema$Outbound
2186
- | components.RedactedReasoningPartSchema$Outbound;
2187
-
2188
- /** @internal */
2189
- export const DeploymentInvokeContentDeploymentsRequestRequestBody2$outboundSchema:
2190
- z.ZodType<
2191
- DeploymentInvokeContentDeploymentsRequestRequestBody2$Outbound,
2192
- z.ZodTypeDef,
2193
- DeploymentInvokeContentDeploymentsRequestRequestBody2
2194
- > = z.union([
2195
- components.TextContentPartSchema$outboundSchema.and(
2196
- z.object({ type: z.literal("text") }),
2197
- ),
2198
- components.RefusalPartSchema$outboundSchema,
2199
- components.ReasoningPartSchema$outboundSchema,
2200
- components.RedactedReasoningPartSchema$outboundSchema,
2201
- ]);
2202
-
2203
- export function deploymentInvokeContentDeploymentsRequestRequestBody2ToJSON(
2204
- deploymentInvokeContentDeploymentsRequestRequestBody2:
2205
- DeploymentInvokeContentDeploymentsRequestRequestBody2,
2206
- ): string {
2207
- return JSON.stringify(
2208
- DeploymentInvokeContentDeploymentsRequestRequestBody2$outboundSchema.parse(
2209
- deploymentInvokeContentDeploymentsRequestRequestBody2,
2210
- ),
2211
- );
2212
- }
2213
-
2214
- /** @internal */
2215
- export type DeploymentInvokeMessagesDeploymentsRequestContent$Outbound =
2216
- | string
2217
- | Array<
2218
- | (components.TextContentPartSchema$Outbound & { type: "text" })
2219
- | components.RefusalPartSchema$Outbound
2220
- | components.ReasoningPartSchema$Outbound
2221
- | components.RedactedReasoningPartSchema$Outbound
2222
- >;
2223
-
2224
- /** @internal */
2225
- export const DeploymentInvokeMessagesDeploymentsRequestContent$outboundSchema:
2226
- z.ZodType<
2227
- DeploymentInvokeMessagesDeploymentsRequestContent$Outbound,
2228
- z.ZodTypeDef,
2229
- DeploymentInvokeMessagesDeploymentsRequestContent
2230
- > = z.union([
2231
- z.string(),
2232
- z.array(
2233
- z.union([
2234
- components.TextContentPartSchema$outboundSchema.and(
2235
- z.object({ type: z.literal("text") }),
2236
- ),
2237
- components.RefusalPartSchema$outboundSchema,
2238
- components.ReasoningPartSchema$outboundSchema,
2239
- components.RedactedReasoningPartSchema$outboundSchema,
2240
- ]),
2241
- ),
2242
- ]);
2243
-
2244
- export function deploymentInvokeMessagesDeploymentsRequestContentToJSON(
2245
- deploymentInvokeMessagesDeploymentsRequestContent:
2246
- DeploymentInvokeMessagesDeploymentsRequestContent,
2247
- ): string {
2248
- return JSON.stringify(
2249
- DeploymentInvokeMessagesDeploymentsRequestContent$outboundSchema.parse(
2250
- deploymentInvokeMessagesDeploymentsRequestContent,
2251
- ),
2252
- );
2253
- }
2254
-
2255
- /** @internal */
2256
- export type MessagesAudio$Outbound = {
2257
- id: string;
2258
- };
2259
-
2260
- /** @internal */
2261
- export const MessagesAudio$outboundSchema: z.ZodType<
2262
- MessagesAudio$Outbound,
2263
- z.ZodTypeDef,
2264
- MessagesAudio
2265
- > = z.object({
2266
- id: z.string(),
2267
- });
2268
-
2269
- export function messagesAudioToJSON(messagesAudio: MessagesAudio): string {
2270
- return JSON.stringify(MessagesAudio$outboundSchema.parse(messagesAudio));
2271
- }
2272
-
2273
- /** @internal */
2274
- export const MessagesType$outboundSchema: z.ZodNativeEnum<typeof MessagesType> =
2275
- z.nativeEnum(MessagesType);
2276
-
2277
- /** @internal */
2278
- export type MessagesFunction$Outbound = {
2279
- name?: string | undefined;
2280
- arguments?: string | undefined;
2281
- };
2282
-
2283
- /** @internal */
2284
- export const MessagesFunction$outboundSchema: z.ZodType<
2285
- MessagesFunction$Outbound,
2286
- z.ZodTypeDef,
2287
- MessagesFunction
2288
- > = z.object({
2289
- name: z.string().optional(),
2290
- arguments: z.string().optional(),
2291
- });
2292
-
2293
- export function messagesFunctionToJSON(
2294
- messagesFunction: MessagesFunction,
2295
- ): string {
2296
- return JSON.stringify(
2297
- MessagesFunction$outboundSchema.parse(messagesFunction),
2298
- );
2299
- }
2300
-
2301
- /** @internal */
2302
- export type MessagesToolCalls$Outbound = {
2303
- id: string;
2304
- type: string;
2305
- function: MessagesFunction$Outbound;
2306
- thought_signature?: string | undefined;
2307
- };
2308
-
2309
- /** @internal */
2310
- export const MessagesToolCalls$outboundSchema: z.ZodType<
2311
- MessagesToolCalls$Outbound,
2312
- z.ZodTypeDef,
2313
- MessagesToolCalls
2314
- > = z.object({
2315
- id: z.string(),
2316
- type: MessagesType$outboundSchema,
2317
- function: z.lazy(() => MessagesFunction$outboundSchema),
2318
- thoughtSignature: z.string().optional(),
2319
- }).transform((v) => {
2320
- return remap$(v, {
2321
- thoughtSignature: "thought_signature",
2322
- });
2323
- });
2324
-
2325
- export function messagesToolCallsToJSON(
2326
- messagesToolCalls: MessagesToolCalls,
2327
- ): string {
2328
- return JSON.stringify(
2329
- MessagesToolCalls$outboundSchema.parse(messagesToolCalls),
2330
- );
2331
- }
2332
-
2333
- /** @internal */
2334
- export type MessagesAssistantMessage$Outbound = {
2335
- content?:
2336
- | string
2337
- | Array<
2338
- | (components.TextContentPartSchema$Outbound & { type: "text" })
2339
- | components.RefusalPartSchema$Outbound
2340
- | components.ReasoningPartSchema$Outbound
2341
- | components.RedactedReasoningPartSchema$Outbound
2342
- >
2343
- | null
2344
- | undefined;
2345
- refusal?: string | null | undefined;
2346
- role: "assistant";
2347
- name?: string | undefined;
2348
- audio?: MessagesAudio$Outbound | null | undefined;
2349
- tool_calls?: Array<MessagesToolCalls$Outbound> | undefined;
2350
- };
2351
-
2352
- /** @internal */
2353
- export const MessagesAssistantMessage$outboundSchema: z.ZodType<
2354
- MessagesAssistantMessage$Outbound,
2355
- z.ZodTypeDef,
2356
- MessagesAssistantMessage
2357
- > = z.object({
2358
- content: z.nullable(
2359
- z.union([
2360
- z.string(),
2361
- z.array(
2362
- z.union([
2363
- components.TextContentPartSchema$outboundSchema.and(
2364
- z.object({ type: z.literal("text") }),
2365
- ),
2366
- components.RefusalPartSchema$outboundSchema,
2367
- components.ReasoningPartSchema$outboundSchema,
2368
- components.RedactedReasoningPartSchema$outboundSchema,
2369
- ]),
2370
- ),
2371
- ]),
2372
- ).optional(),
2373
- refusal: z.nullable(z.string()).optional(),
2374
- role: z.literal("assistant"),
2375
- name: z.string().optional(),
2376
- audio: z.nullable(z.lazy(() => MessagesAudio$outboundSchema)).optional(),
2377
- toolCalls: z.array(z.lazy(() => MessagesToolCalls$outboundSchema)).optional(),
2378
- }).transform((v) => {
2379
- return remap$(v, {
2380
- toolCalls: "tool_calls",
2381
- });
2382
- });
2383
-
2384
- export function messagesAssistantMessageToJSON(
2385
- messagesAssistantMessage: MessagesAssistantMessage,
2386
- ): string {
2387
- return JSON.stringify(
2388
- MessagesAssistantMessage$outboundSchema.parse(messagesAssistantMessage),
2389
- );
2390
- }
2391
-
2392
- /** @internal */
2393
- export const DeploymentInvoke2DeploymentsRequestRequestBodyType$outboundSchema:
2394
- z.ZodNativeEnum<typeof DeploymentInvoke2DeploymentsRequestRequestBodyType> = z
2395
- .nativeEnum(DeploymentInvoke2DeploymentsRequestRequestBodyType);
2396
-
2397
- /** @internal */
2398
- export const TwoTtl$outboundSchema: z.ZodNativeEnum<typeof TwoTtl> = z
2399
- .nativeEnum(TwoTtl);
2400
-
2401
- /** @internal */
2402
- export type TwoCacheControl$Outbound = {
2403
- type: string;
2404
- ttl: string;
2405
- };
2406
-
2407
- /** @internal */
2408
- export const TwoCacheControl$outboundSchema: z.ZodType<
2409
- TwoCacheControl$Outbound,
2410
- z.ZodTypeDef,
2411
- TwoCacheControl
2412
- > = z.object({
2413
- type: DeploymentInvoke2DeploymentsRequestRequestBodyType$outboundSchema,
2414
- ttl: TwoTtl$outboundSchema.default("5m"),
2415
- });
2416
-
2417
- export function twoCacheControlToJSON(
2418
- twoCacheControl: TwoCacheControl,
2419
- ): string {
2420
- return JSON.stringify(TwoCacheControl$outboundSchema.parse(twoCacheControl));
2421
- }
2422
-
2423
- /** @internal */
2424
- export type Two4$Outbound = {
2425
- type: "file";
2426
- cache_control?: TwoCacheControl$Outbound | undefined;
2427
- file: components.FileContentPartSchema$Outbound;
2428
- };
2429
-
2430
- /** @internal */
2431
- export const Two4$outboundSchema: z.ZodType<Two4$Outbound, z.ZodTypeDef, Two4> =
2432
- z.object({
2433
- type: z.literal("file"),
2434
- cacheControl: z.lazy(() => TwoCacheControl$outboundSchema).optional(),
2435
- file: components.FileContentPartSchema$outboundSchema,
2436
- }).transform((v) => {
2437
- return remap$(v, {
2438
- cacheControl: "cache_control",
2439
- });
2440
- });
2441
-
2442
- export function two4ToJSON(two4: Two4): string {
2443
- return JSON.stringify(Two4$outboundSchema.parse(two4));
2444
- }
2445
-
2446
- /** @internal */
2447
- export type DeploymentInvokeContentDeploymentsRequest2$Outbound =
2448
- | (components.TextContentPartSchema$Outbound & { type: "text" })
2449
- | components.ImageContentPartSchema$Outbound
2450
- | components.AudioContentPartSchema$Outbound
2451
- | Two4$Outbound;
2452
-
2453
- /** @internal */
2454
- export const DeploymentInvokeContentDeploymentsRequest2$outboundSchema:
2455
- z.ZodType<
2456
- DeploymentInvokeContentDeploymentsRequest2$Outbound,
2457
- z.ZodTypeDef,
2458
- DeploymentInvokeContentDeploymentsRequest2
2459
- > = z.union([
2460
- components.TextContentPartSchema$outboundSchema.and(
2461
- z.object({ type: z.literal("text") }),
2462
- ),
2463
- components.ImageContentPartSchema$outboundSchema,
2464
- components.AudioContentPartSchema$outboundSchema,
2465
- z.lazy(() => Two4$outboundSchema),
2466
- ]);
2467
-
2468
- export function deploymentInvokeContentDeploymentsRequest2ToJSON(
2469
- deploymentInvokeContentDeploymentsRequest2:
2470
- DeploymentInvokeContentDeploymentsRequest2,
2471
- ): string {
2472
- return JSON.stringify(
2473
- DeploymentInvokeContentDeploymentsRequest2$outboundSchema.parse(
2474
- deploymentInvokeContentDeploymentsRequest2,
2475
- ),
2476
- );
2477
- }
2478
-
2479
- /** @internal */
2480
- export type DeploymentInvokeMessagesDeploymentsContent$Outbound =
2481
- | string
2482
- | Array<
2483
- | (components.TextContentPartSchema$Outbound & { type: "text" })
2484
- | components.ImageContentPartSchema$Outbound
2485
- | components.AudioContentPartSchema$Outbound
2486
- | Two4$Outbound
2487
- >;
2488
-
2489
- /** @internal */
2490
- export const DeploymentInvokeMessagesDeploymentsContent$outboundSchema:
2491
- z.ZodType<
2492
- DeploymentInvokeMessagesDeploymentsContent$Outbound,
2493
- z.ZodTypeDef,
2494
- DeploymentInvokeMessagesDeploymentsContent
2495
- > = z.union([
2496
- z.string(),
2497
- z.array(
2498
- z.union([
2499
- components.TextContentPartSchema$outboundSchema.and(
2500
- z.object({ type: z.literal("text") }),
2501
- ),
2502
- components.ImageContentPartSchema$outboundSchema,
2503
- components.AudioContentPartSchema$outboundSchema,
2504
- z.lazy(() => Two4$outboundSchema),
2505
- ]),
2506
- ),
2507
- ]);
2508
-
2509
- export function deploymentInvokeMessagesDeploymentsContentToJSON(
2510
- deploymentInvokeMessagesDeploymentsContent:
2511
- DeploymentInvokeMessagesDeploymentsContent,
2512
- ): string {
2513
- return JSON.stringify(
2514
- DeploymentInvokeMessagesDeploymentsContent$outboundSchema.parse(
2515
- deploymentInvokeMessagesDeploymentsContent,
2516
- ),
2517
- );
2518
- }
2519
-
2520
- /** @internal */
2521
- export type MessagesUserMessage$Outbound = {
2522
- role: "user";
2523
- name?: string | undefined;
2524
- content:
2525
- | string
2526
- | Array<
2527
- | (components.TextContentPartSchema$Outbound & { type: "text" })
2528
- | components.ImageContentPartSchema$Outbound
2529
- | components.AudioContentPartSchema$Outbound
2530
- | Two4$Outbound
2531
- >;
2532
- };
2533
-
2534
- /** @internal */
2535
- export const MessagesUserMessage$outboundSchema: z.ZodType<
2536
- MessagesUserMessage$Outbound,
2537
- z.ZodTypeDef,
2538
- MessagesUserMessage
2539
- > = z.object({
2540
- role: z.literal("user"),
2541
- name: z.string().optional(),
2542
- content: z.union([
2543
- z.string(),
2544
- z.array(
2545
- z.union([
2546
- components.TextContentPartSchema$outboundSchema.and(
2547
- z.object({ type: z.literal("text") }),
2548
- ),
2549
- components.ImageContentPartSchema$outboundSchema,
2550
- components.AudioContentPartSchema$outboundSchema,
2551
- z.lazy(() => Two4$outboundSchema),
2552
- ]),
2553
- ),
2554
- ]),
2555
- });
2556
-
2557
- export function messagesUserMessageToJSON(
2558
- messagesUserMessage: MessagesUserMessage,
2559
- ): string {
2560
- return JSON.stringify(
2561
- MessagesUserMessage$outboundSchema.parse(messagesUserMessage),
2562
- );
2563
- }
2564
-
2565
- /** @internal */
2566
- export type DeploymentInvokeMessagesContent$Outbound =
2567
- | string
2568
- | Array<components.TextContentPartSchema$Outbound>;
2569
-
2570
- /** @internal */
2571
- export const DeploymentInvokeMessagesContent$outboundSchema: z.ZodType<
2572
- DeploymentInvokeMessagesContent$Outbound,
2573
- z.ZodTypeDef,
2574
- DeploymentInvokeMessagesContent
2575
- > = z.union([
2576
- z.string(),
2577
- z.array(components.TextContentPartSchema$outboundSchema),
2578
- ]);
2579
-
2580
- export function deploymentInvokeMessagesContentToJSON(
2581
- deploymentInvokeMessagesContent: DeploymentInvokeMessagesContent,
2582
- ): string {
2583
- return JSON.stringify(
2584
- DeploymentInvokeMessagesContent$outboundSchema.parse(
2585
- deploymentInvokeMessagesContent,
2586
- ),
2587
- );
2588
- }
2589
-
2590
- /** @internal */
2591
- export type MessagesDeveloperMessage$Outbound = {
2592
- role: "developer";
2593
- content: string | Array<components.TextContentPartSchema$Outbound>;
2594
- name?: string | undefined;
2595
- };
2596
-
2597
- /** @internal */
2598
- export const MessagesDeveloperMessage$outboundSchema: z.ZodType<
2599
- MessagesDeveloperMessage$Outbound,
2600
- z.ZodTypeDef,
2601
- MessagesDeveloperMessage
2602
- > = z.object({
2603
- role: z.literal("developer"),
2604
- content: z.union([
2605
- z.string(),
2606
- z.array(components.TextContentPartSchema$outboundSchema),
2607
- ]),
2608
- name: z.string().optional(),
2609
- });
2610
-
2611
- export function messagesDeveloperMessageToJSON(
2612
- messagesDeveloperMessage: MessagesDeveloperMessage,
2613
- ): string {
2614
- return JSON.stringify(
2615
- MessagesDeveloperMessage$outboundSchema.parse(messagesDeveloperMessage),
2616
- );
2617
- }
2618
-
2619
- /** @internal */
2620
- export type MessagesContent$Outbound =
2621
- | string
2622
- | Array<components.TextContentPartSchema$Outbound>;
2623
-
2624
- /** @internal */
2625
- export const MessagesContent$outboundSchema: z.ZodType<
2626
- MessagesContent$Outbound,
2627
- z.ZodTypeDef,
2628
- MessagesContent
2629
- > = z.union([
2630
- z.string(),
2631
- z.array(components.TextContentPartSchema$outboundSchema),
2632
- ]);
2633
-
2634
- export function messagesContentToJSON(
2635
- messagesContent: MessagesContent,
2636
- ): string {
2637
- return JSON.stringify(MessagesContent$outboundSchema.parse(messagesContent));
2638
- }
2639
-
2640
- /** @internal */
2641
- export type MessagesSystemMessage$Outbound = {
2642
- role: "system";
2643
- content: string | Array<components.TextContentPartSchema$Outbound>;
2644
- name?: string | undefined;
2645
- };
2646
-
2647
- /** @internal */
2648
- export const MessagesSystemMessage$outboundSchema: z.ZodType<
2649
- MessagesSystemMessage$Outbound,
2650
- z.ZodTypeDef,
2651
- MessagesSystemMessage
2652
- > = z.object({
2653
- role: z.literal("system"),
2654
- content: z.union([
2655
- z.string(),
2656
- z.array(components.TextContentPartSchema$outboundSchema),
2657
- ]),
2658
- name: z.string().optional(),
2659
- });
2660
-
2661
- export function messagesSystemMessageToJSON(
2662
- messagesSystemMessage: MessagesSystemMessage,
2663
- ): string {
2664
- return JSON.stringify(
2665
- MessagesSystemMessage$outboundSchema.parse(messagesSystemMessage),
2666
- );
2667
- }
2668
-
2669
- /** @internal */
2670
- export type DeploymentInvokeMessages$Outbound =
2671
- | MessagesSystemMessage$Outbound
2672
- | MessagesDeveloperMessage$Outbound
2673
- | MessagesUserMessage$Outbound
2674
- | MessagesAssistantMessage$Outbound
2675
- | MessagesToolMessage$Outbound;
2676
-
2677
- /** @internal */
2678
- export const DeploymentInvokeMessages$outboundSchema: z.ZodType<
2679
- DeploymentInvokeMessages$Outbound,
2680
- z.ZodTypeDef,
2681
- DeploymentInvokeMessages
2682
- > = z.union([
2683
- z.lazy(() => MessagesSystemMessage$outboundSchema),
2684
- z.lazy(() => MessagesDeveloperMessage$outboundSchema),
2685
- z.lazy(() => MessagesUserMessage$outboundSchema),
2686
- z.lazy(() => MessagesAssistantMessage$outboundSchema),
2687
- z.lazy(() => MessagesToolMessage$outboundSchema),
2688
- ]);
2689
-
2690
- export function deploymentInvokeMessagesToJSON(
2691
- deploymentInvokeMessages: DeploymentInvokeMessages,
2692
- ): string {
2693
- return JSON.stringify(
2694
- DeploymentInvokeMessages$outboundSchema.parse(deploymentInvokeMessages),
2695
- );
2696
- }
2697
-
2698
- /** @internal */
2699
- export type Metadata$Outbound = {
2700
- file_name?: string | undefined;
2701
- file_type?: string | undefined;
2702
- page_number?: number | undefined;
2703
- };
2704
-
2705
- /** @internal */
2706
- export const Metadata$outboundSchema: z.ZodType<
2707
- Metadata$Outbound,
2708
- z.ZodTypeDef,
2709
- Metadata
2710
- > = z.object({
2711
- fileName: z.string().optional(),
2712
- fileType: z.string().optional(),
2713
- pageNumber: z.number().optional(),
2714
- }).transform((v) => {
2715
- return remap$(v, {
2716
- fileName: "file_name",
2717
- fileType: "file_type",
2718
- pageNumber: "page_number",
2719
- });
2720
- });
2721
-
2722
- export function metadataToJSON(metadata: Metadata): string {
2723
- return JSON.stringify(Metadata$outboundSchema.parse(metadata));
2724
- }
2725
-
2726
- /** @internal */
2727
- export type Documents$Outbound = {
2728
- text: string;
2729
- metadata?: Metadata$Outbound | undefined;
2730
- };
2731
-
2732
- /** @internal */
2733
- export const Documents$outboundSchema: z.ZodType<
2734
- Documents$Outbound,
2735
- z.ZodTypeDef,
2736
- Documents
2737
- > = z.object({
2738
- text: z.string(),
2739
- metadata: z.lazy(() => Metadata$outboundSchema).optional(),
2740
- });
2741
-
2742
- export function documentsToJSON(documents: Documents): string {
2743
- return JSON.stringify(Documents$outboundSchema.parse(documents));
2744
- }
2745
-
2746
- /** @internal */
2747
- export type InvokeOptions$Outbound = {
2748
- include_retrievals: boolean;
2749
- include_usage: boolean;
2750
- mock_response?: string | undefined;
2751
- };
2752
-
2753
- /** @internal */
2754
- export const InvokeOptions$outboundSchema: z.ZodType<
2755
- InvokeOptions$Outbound,
2756
- z.ZodTypeDef,
2757
- InvokeOptions
2758
- > = z.object({
2759
- includeRetrievals: z.boolean().default(false),
2760
- includeUsage: z.boolean().default(false),
2761
- mockResponse: z.string().optional(),
2762
- }).transform((v) => {
2763
- return remap$(v, {
2764
- includeRetrievals: "include_retrievals",
2765
- includeUsage: "include_usage",
2766
- mockResponse: "mock_response",
2767
- });
2768
- });
2769
-
2770
- export function invokeOptionsToJSON(invokeOptions: InvokeOptions): string {
2771
- return JSON.stringify(InvokeOptions$outboundSchema.parse(invokeOptions));
2772
- }
2773
-
2774
- /** @internal */
2775
- export type Thread$Outbound = {
2776
- id: string;
2777
- tags?: Array<string> | undefined;
2778
- };
2779
-
2780
- /** @internal */
2781
- export const Thread$outboundSchema: z.ZodType<
2782
- Thread$Outbound,
2783
- z.ZodTypeDef,
2784
- Thread
2785
- > = z.object({
2786
- id: z.string(),
2787
- tags: z.array(z.string()).optional(),
2788
- });
2789
-
2790
- export function threadToJSON(thread: Thread): string {
2791
- return JSON.stringify(Thread$outboundSchema.parse(thread));
2792
- }
2793
-
2794
- /** @internal */
2795
- export type OrExists$Outbound = {
2796
- exists: boolean;
2797
- };
2798
-
2799
- /** @internal */
2800
- export const OrExists$outboundSchema: z.ZodType<
2801
- OrExists$Outbound,
2802
- z.ZodTypeDef,
2803
- OrExists
2804
- > = z.object({
2805
- exists: z.boolean(),
2806
- });
2807
-
2808
- export function orExistsToJSON(orExists: OrExists): string {
2809
- return JSON.stringify(OrExists$outboundSchema.parse(orExists));
2810
- }
2811
-
2812
- /** @internal */
2813
- export type DeploymentInvokeOrNin$Outbound = string | number | boolean;
2814
-
2815
- /** @internal */
2816
- export const DeploymentInvokeOrNin$outboundSchema: z.ZodType<
2817
- DeploymentInvokeOrNin$Outbound,
2818
- z.ZodTypeDef,
2819
- DeploymentInvokeOrNin
2820
- > = z.union([z.string(), z.number(), z.boolean()]);
2821
-
2822
- export function deploymentInvokeOrNinToJSON(
2823
- deploymentInvokeOrNin: DeploymentInvokeOrNin,
2824
- ): string {
2825
- return JSON.stringify(
2826
- DeploymentInvokeOrNin$outboundSchema.parse(deploymentInvokeOrNin),
2827
- );
2828
- }
2829
-
2830
- /** @internal */
2831
- export type OrNin$Outbound = {
2832
- nin: Array<string | number | boolean>;
2833
- };
2834
-
2835
- /** @internal */
2836
- export const OrNin$outboundSchema: z.ZodType<
2837
- OrNin$Outbound,
2838
- z.ZodTypeDef,
2839
- OrNin
2840
- > = z.object({
2841
- nin: z.array(z.union([z.string(), z.number(), z.boolean()])),
2842
- });
2843
-
2844
- export function orNinToJSON(orNin: OrNin): string {
2845
- return JSON.stringify(OrNin$outboundSchema.parse(orNin));
2846
- }
2847
-
2848
- /** @internal */
2849
- export type DeploymentInvokeOrIn$Outbound = string | number | boolean;
2850
-
2851
- /** @internal */
2852
- export const DeploymentInvokeOrIn$outboundSchema: z.ZodType<
2853
- DeploymentInvokeOrIn$Outbound,
2854
- z.ZodTypeDef,
2855
- DeploymentInvokeOrIn
2856
- > = z.union([z.string(), z.number(), z.boolean()]);
2857
-
2858
- export function deploymentInvokeOrInToJSON(
2859
- deploymentInvokeOrIn: DeploymentInvokeOrIn,
2860
- ): string {
2861
- return JSON.stringify(
2862
- DeploymentInvokeOrIn$outboundSchema.parse(deploymentInvokeOrIn),
2863
- );
2864
- }
2865
-
2866
- /** @internal */
2867
- export type OrIn$Outbound = {
2868
- in: Array<string | number | boolean>;
2869
- };
2870
-
2871
- /** @internal */
2872
- export const OrIn$outboundSchema: z.ZodType<OrIn$Outbound, z.ZodTypeDef, OrIn> =
2873
- z.object({
2874
- in: z.array(z.union([z.string(), z.number(), z.boolean()])),
2875
- });
2876
-
2877
- export function orInToJSON(orIn: OrIn): string {
2878
- return JSON.stringify(OrIn$outboundSchema.parse(orIn));
2879
- }
2880
-
2881
- /** @internal */
2882
- export type OrLte$Outbound = {
2883
- lte: number;
2884
- };
2885
-
2886
- /** @internal */
2887
- export const OrLte$outboundSchema: z.ZodType<
2888
- OrLte$Outbound,
2889
- z.ZodTypeDef,
2890
- OrLte
2891
- > = z.object({
2892
- lte: z.number(),
2893
- });
2894
-
2895
- export function orLteToJSON(orLte: OrLte): string {
2896
- return JSON.stringify(OrLte$outboundSchema.parse(orLte));
2897
- }
2898
-
2899
- /** @internal */
2900
- export type OrLt$Outbound = {
2901
- lt: number;
2902
- };
2903
-
2904
- /** @internal */
2905
- export const OrLt$outboundSchema: z.ZodType<OrLt$Outbound, z.ZodTypeDef, OrLt> =
2906
- z.object({
2907
- lt: z.number(),
2908
- });
2909
-
2910
- export function orLtToJSON(orLt: OrLt): string {
2911
- return JSON.stringify(OrLt$outboundSchema.parse(orLt));
2912
- }
2913
-
2914
- /** @internal */
2915
- export type OrGte$Outbound = {
2916
- gte: number;
2917
- };
2918
-
2919
- /** @internal */
2920
- export const OrGte$outboundSchema: z.ZodType<
2921
- OrGte$Outbound,
2922
- z.ZodTypeDef,
2923
- OrGte
2924
- > = z.object({
2925
- gte: z.number(),
2926
- });
2927
-
2928
- export function orGteToJSON(orGte: OrGte): string {
2929
- return JSON.stringify(OrGte$outboundSchema.parse(orGte));
2930
- }
2931
-
2932
- /** @internal */
2933
- export type OrGt$Outbound = {
2934
- gt: number;
2935
- };
2936
-
2937
- /** @internal */
2938
- export const OrGt$outboundSchema: z.ZodType<OrGt$Outbound, z.ZodTypeDef, OrGt> =
2939
- z.object({
2940
- gt: z.number(),
2941
- });
2942
-
2943
- export function orGtToJSON(orGt: OrGt): string {
2944
- return JSON.stringify(OrGt$outboundSchema.parse(orGt));
2945
- }
2946
-
2947
- /** @internal */
2948
- export type DeploymentInvokeOrNe$Outbound = string | number | boolean;
2949
-
2950
- /** @internal */
2951
- export const DeploymentInvokeOrNe$outboundSchema: z.ZodType<
2952
- DeploymentInvokeOrNe$Outbound,
2953
- z.ZodTypeDef,
2954
- DeploymentInvokeOrNe
2955
- > = z.union([z.string(), z.number(), z.boolean()]);
2956
-
2957
- export function deploymentInvokeOrNeToJSON(
2958
- deploymentInvokeOrNe: DeploymentInvokeOrNe,
2959
- ): string {
2960
- return JSON.stringify(
2961
- DeploymentInvokeOrNe$outboundSchema.parse(deploymentInvokeOrNe),
2962
- );
2963
- }
2964
-
2965
- /** @internal */
2966
- export type OrNe$Outbound = {
2967
- ne: string | number | boolean;
2968
- };
2969
-
2970
- /** @internal */
2971
- export const OrNe$outboundSchema: z.ZodType<OrNe$Outbound, z.ZodTypeDef, OrNe> =
2972
- z.object({
2973
- ne: z.union([z.string(), z.number(), z.boolean()]),
2974
- });
2975
-
2976
- export function orNeToJSON(orNe: OrNe): string {
2977
- return JSON.stringify(OrNe$outboundSchema.parse(orNe));
2978
- }
2979
-
2980
- /** @internal */
2981
- export type DeploymentInvokeOrEq$Outbound = string | number | boolean;
2982
-
2983
- /** @internal */
2984
- export const DeploymentInvokeOrEq$outboundSchema: z.ZodType<
2985
- DeploymentInvokeOrEq$Outbound,
2986
- z.ZodTypeDef,
2987
- DeploymentInvokeOrEq
2988
- > = z.union([z.string(), z.number(), z.boolean()]);
2989
-
2990
- export function deploymentInvokeOrEqToJSON(
2991
- deploymentInvokeOrEq: DeploymentInvokeOrEq,
2992
- ): string {
2993
- return JSON.stringify(
2994
- DeploymentInvokeOrEq$outboundSchema.parse(deploymentInvokeOrEq),
2995
- );
2996
- }
2997
-
2998
- /** @internal */
2999
- export type OrEq$Outbound = {
3000
- eq: string | number | boolean;
3001
- };
3002
-
3003
- /** @internal */
3004
- export const OrEq$outboundSchema: z.ZodType<OrEq$Outbound, z.ZodTypeDef, OrEq> =
3005
- z.object({
3006
- eq: z.union([z.string(), z.number(), z.boolean()]),
3007
- });
3008
-
3009
- export function orEqToJSON(orEq: OrEq): string {
3010
- return JSON.stringify(OrEq$outboundSchema.parse(orEq));
3011
- }
3012
-
3013
- /** @internal */
3014
- export type KnowledgeFilterOr$Outbound =
3015
- | OrEq$Outbound
3016
- | OrNe$Outbound
3017
- | OrGt$Outbound
3018
- | OrGte$Outbound
3019
- | OrLt$Outbound
3020
- | OrLte$Outbound
3021
- | OrIn$Outbound
3022
- | OrNin$Outbound
3023
- | OrExists$Outbound;
3024
-
3025
- /** @internal */
3026
- export const KnowledgeFilterOr$outboundSchema: z.ZodType<
3027
- KnowledgeFilterOr$Outbound,
3028
- z.ZodTypeDef,
3029
- KnowledgeFilterOr
3030
- > = z.union([
3031
- z.lazy(() => OrEq$outboundSchema),
3032
- z.lazy(() => OrNe$outboundSchema),
3033
- z.lazy(() => OrGt$outboundSchema),
3034
- z.lazy(() => OrGte$outboundSchema),
3035
- z.lazy(() => OrLt$outboundSchema),
3036
- z.lazy(() => OrLte$outboundSchema),
3037
- z.lazy(() => OrIn$outboundSchema),
3038
- z.lazy(() => OrNin$outboundSchema),
3039
- z.lazy(() => OrExists$outboundSchema),
3040
- ]);
3041
-
3042
- export function knowledgeFilterOrToJSON(
3043
- knowledgeFilterOr: KnowledgeFilterOr,
3044
- ): string {
3045
- return JSON.stringify(
3046
- KnowledgeFilterOr$outboundSchema.parse(knowledgeFilterOr),
3047
- );
3048
- }
3049
-
3050
- /** @internal */
3051
- export type Or$Outbound = {
3052
- or: Array<
3053
- {
3054
- [k: string]:
3055
- | OrEq$Outbound
3056
- | OrNe$Outbound
3057
- | OrGt$Outbound
3058
- | OrGte$Outbound
3059
- | OrLt$Outbound
3060
- | OrLte$Outbound
3061
- | OrIn$Outbound
3062
- | OrNin$Outbound
3063
- | OrExists$Outbound;
3064
- }
3065
- >;
3066
- };
3067
-
3068
- /** @internal */
3069
- export const Or$outboundSchema: z.ZodType<Or$Outbound, z.ZodTypeDef, Or> = z
3070
- .object({
3071
- or: z.array(
3072
- z.record(z.union([
3073
- z.lazy(() => OrEq$outboundSchema),
3074
- z.lazy(() =>
3075
- OrNe$outboundSchema
3076
- ),
3077
- z.lazy(() => OrGt$outboundSchema),
3078
- z.lazy(() => OrGte$outboundSchema),
3079
- z.lazy(() => OrLt$outboundSchema),
3080
- z.lazy(() => OrLte$outboundSchema),
3081
- z.lazy(() => OrIn$outboundSchema),
3082
- z.lazy(() => OrNin$outboundSchema),
3083
- z.lazy(() => OrExists$outboundSchema),
3084
- ])),
3085
- ),
3086
- });
3087
-
3088
- export function orToJSON(or: Or): string {
3089
- return JSON.stringify(Or$outboundSchema.parse(or));
3090
- }
3091
-
3092
- /** @internal */
3093
- export type AndExists$Outbound = {
3094
- exists: boolean;
3095
- };
3096
-
3097
- /** @internal */
3098
- export const AndExists$outboundSchema: z.ZodType<
3099
- AndExists$Outbound,
3100
- z.ZodTypeDef,
3101
- AndExists
3102
- > = z.object({
3103
- exists: z.boolean(),
3104
- });
3105
-
3106
- export function andExistsToJSON(andExists: AndExists): string {
3107
- return JSON.stringify(AndExists$outboundSchema.parse(andExists));
3108
- }
3109
-
3110
- /** @internal */
3111
- export type DeploymentInvokeAndNin$Outbound = string | number | boolean;
3112
-
3113
- /** @internal */
3114
- export const DeploymentInvokeAndNin$outboundSchema: z.ZodType<
3115
- DeploymentInvokeAndNin$Outbound,
3116
- z.ZodTypeDef,
3117
- DeploymentInvokeAndNin
3118
- > = z.union([z.string(), z.number(), z.boolean()]);
3119
-
3120
- export function deploymentInvokeAndNinToJSON(
3121
- deploymentInvokeAndNin: DeploymentInvokeAndNin,
3122
- ): string {
3123
- return JSON.stringify(
3124
- DeploymentInvokeAndNin$outboundSchema.parse(deploymentInvokeAndNin),
3125
- );
3126
- }
3127
-
3128
- /** @internal */
3129
- export type AndNin$Outbound = {
3130
- nin: Array<string | number | boolean>;
3131
- };
3132
-
3133
- /** @internal */
3134
- export const AndNin$outboundSchema: z.ZodType<
3135
- AndNin$Outbound,
3136
- z.ZodTypeDef,
3137
- AndNin
3138
- > = z.object({
3139
- nin: z.array(z.union([z.string(), z.number(), z.boolean()])),
3140
- });
3141
-
3142
- export function andNinToJSON(andNin: AndNin): string {
3143
- return JSON.stringify(AndNin$outboundSchema.parse(andNin));
3144
- }
3145
-
3146
- /** @internal */
3147
- export type DeploymentInvokeAndIn$Outbound = string | number | boolean;
3148
-
3149
- /** @internal */
3150
- export const DeploymentInvokeAndIn$outboundSchema: z.ZodType<
3151
- DeploymentInvokeAndIn$Outbound,
3152
- z.ZodTypeDef,
3153
- DeploymentInvokeAndIn
3154
- > = z.union([z.string(), z.number(), z.boolean()]);
3155
-
3156
- export function deploymentInvokeAndInToJSON(
3157
- deploymentInvokeAndIn: DeploymentInvokeAndIn,
3158
- ): string {
3159
- return JSON.stringify(
3160
- DeploymentInvokeAndIn$outboundSchema.parse(deploymentInvokeAndIn),
3161
- );
3162
- }
3163
-
3164
- /** @internal */
3165
- export type AndIn$Outbound = {
3166
- in: Array<string | number | boolean>;
3167
- };
3168
-
3169
- /** @internal */
3170
- export const AndIn$outboundSchema: z.ZodType<
3171
- AndIn$Outbound,
3172
- z.ZodTypeDef,
3173
- AndIn
3174
- > = z.object({
3175
- in: z.array(z.union([z.string(), z.number(), z.boolean()])),
3176
- });
3177
-
3178
- export function andInToJSON(andIn: AndIn): string {
3179
- return JSON.stringify(AndIn$outboundSchema.parse(andIn));
3180
- }
3181
-
3182
- /** @internal */
3183
- export type AndLte$Outbound = {
3184
- lte: number;
3185
- };
3186
-
3187
- /** @internal */
3188
- export const AndLte$outboundSchema: z.ZodType<
3189
- AndLte$Outbound,
3190
- z.ZodTypeDef,
3191
- AndLte
3192
- > = z.object({
3193
- lte: z.number(),
3194
- });
3195
-
3196
- export function andLteToJSON(andLte: AndLte): string {
3197
- return JSON.stringify(AndLte$outboundSchema.parse(andLte));
3198
- }
3199
-
3200
- /** @internal */
3201
- export type AndLt$Outbound = {
3202
- lt: number;
3203
- };
3204
-
3205
- /** @internal */
3206
- export const AndLt$outboundSchema: z.ZodType<
3207
- AndLt$Outbound,
3208
- z.ZodTypeDef,
3209
- AndLt
3210
- > = z.object({
3211
- lt: z.number(),
3212
- });
3213
-
3214
- export function andLtToJSON(andLt: AndLt): string {
3215
- return JSON.stringify(AndLt$outboundSchema.parse(andLt));
3216
- }
3217
-
3218
- /** @internal */
3219
- export type AndGte$Outbound = {
3220
- gte: number;
3221
- };
3222
-
3223
- /** @internal */
3224
- export const AndGte$outboundSchema: z.ZodType<
3225
- AndGte$Outbound,
3226
- z.ZodTypeDef,
3227
- AndGte
3228
- > = z.object({
3229
- gte: z.number(),
3230
- });
3231
-
3232
- export function andGteToJSON(andGte: AndGte): string {
3233
- return JSON.stringify(AndGte$outboundSchema.parse(andGte));
3234
- }
3235
-
3236
- /** @internal */
3237
- export type AndGt$Outbound = {
3238
- gt: number;
3239
- };
3240
-
3241
- /** @internal */
3242
- export const AndGt$outboundSchema: z.ZodType<
3243
- AndGt$Outbound,
3244
- z.ZodTypeDef,
3245
- AndGt
3246
- > = z.object({
3247
- gt: z.number(),
3248
- });
3249
-
3250
- export function andGtToJSON(andGt: AndGt): string {
3251
- return JSON.stringify(AndGt$outboundSchema.parse(andGt));
3252
- }
3253
-
3254
- /** @internal */
3255
- export type DeploymentInvokeAndNe$Outbound = string | number | boolean;
3256
-
3257
- /** @internal */
3258
- export const DeploymentInvokeAndNe$outboundSchema: z.ZodType<
3259
- DeploymentInvokeAndNe$Outbound,
3260
- z.ZodTypeDef,
3261
- DeploymentInvokeAndNe
3262
- > = z.union([z.string(), z.number(), z.boolean()]);
3263
-
3264
- export function deploymentInvokeAndNeToJSON(
3265
- deploymentInvokeAndNe: DeploymentInvokeAndNe,
3266
- ): string {
3267
- return JSON.stringify(
3268
- DeploymentInvokeAndNe$outboundSchema.parse(deploymentInvokeAndNe),
3269
- );
3270
- }
3271
-
3272
- /** @internal */
3273
- export type AndNe$Outbound = {
3274
- ne: string | number | boolean;
3275
- };
3276
-
3277
- /** @internal */
3278
- export const AndNe$outboundSchema: z.ZodType<
3279
- AndNe$Outbound,
3280
- z.ZodTypeDef,
3281
- AndNe
3282
- > = z.object({
3283
- ne: z.union([z.string(), z.number(), z.boolean()]),
3284
- });
3285
-
3286
- export function andNeToJSON(andNe: AndNe): string {
3287
- return JSON.stringify(AndNe$outboundSchema.parse(andNe));
3288
- }
3289
-
3290
- /** @internal */
3291
- export type DeploymentInvokeAndEq$Outbound = string | number | boolean;
3292
-
3293
- /** @internal */
3294
- export const DeploymentInvokeAndEq$outboundSchema: z.ZodType<
3295
- DeploymentInvokeAndEq$Outbound,
3296
- z.ZodTypeDef,
3297
- DeploymentInvokeAndEq
3298
- > = z.union([z.string(), z.number(), z.boolean()]);
3299
-
3300
- export function deploymentInvokeAndEqToJSON(
3301
- deploymentInvokeAndEq: DeploymentInvokeAndEq,
3302
- ): string {
3303
- return JSON.stringify(
3304
- DeploymentInvokeAndEq$outboundSchema.parse(deploymentInvokeAndEq),
3305
- );
3306
- }
3307
-
3308
- /** @internal */
3309
- export type AndEq$Outbound = {
3310
- eq: string | number | boolean;
3311
- };
3312
-
3313
- /** @internal */
3314
- export const AndEq$outboundSchema: z.ZodType<
3315
- AndEq$Outbound,
3316
- z.ZodTypeDef,
3317
- AndEq
3318
- > = z.object({
3319
- eq: z.union([z.string(), z.number(), z.boolean()]),
3320
- });
3321
-
3322
- export function andEqToJSON(andEq: AndEq): string {
3323
- return JSON.stringify(AndEq$outboundSchema.parse(andEq));
3324
- }
3325
-
3326
- /** @internal */
3327
- export type KnowledgeFilterAnd$Outbound =
3328
- | AndEq$Outbound
3329
- | AndNe$Outbound
3330
- | AndGt$Outbound
3331
- | AndGte$Outbound
3332
- | AndLt$Outbound
3333
- | AndLte$Outbound
3334
- | AndIn$Outbound
3335
- | AndNin$Outbound
3336
- | AndExists$Outbound;
3337
-
3338
- /** @internal */
3339
- export const KnowledgeFilterAnd$outboundSchema: z.ZodType<
3340
- KnowledgeFilterAnd$Outbound,
3341
- z.ZodTypeDef,
3342
- KnowledgeFilterAnd
3343
- > = z.union([
3344
- z.lazy(() => AndEq$outboundSchema),
3345
- z.lazy(() => AndNe$outboundSchema),
3346
- z.lazy(() => AndGt$outboundSchema),
3347
- z.lazy(() => AndGte$outboundSchema),
3348
- z.lazy(() => AndLt$outboundSchema),
3349
- z.lazy(() => AndLte$outboundSchema),
3350
- z.lazy(() => AndIn$outboundSchema),
3351
- z.lazy(() => AndNin$outboundSchema),
3352
- z.lazy(() => AndExists$outboundSchema),
3353
- ]);
3354
-
3355
- export function knowledgeFilterAndToJSON(
3356
- knowledgeFilterAnd: KnowledgeFilterAnd,
3357
- ): string {
3358
- return JSON.stringify(
3359
- KnowledgeFilterAnd$outboundSchema.parse(knowledgeFilterAnd),
3360
- );
3361
- }
3362
-
3363
- /** @internal */
3364
- export type And$Outbound = {
3365
- and: Array<
3366
- {
3367
- [k: string]:
3368
- | AndEq$Outbound
3369
- | AndNe$Outbound
3370
- | AndGt$Outbound
3371
- | AndGte$Outbound
3372
- | AndLt$Outbound
3373
- | AndLte$Outbound
3374
- | AndIn$Outbound
3375
- | AndNin$Outbound
3376
- | AndExists$Outbound;
3377
- }
3378
- >;
3379
- };
3380
-
3381
- /** @internal */
3382
- export const And$outboundSchema: z.ZodType<And$Outbound, z.ZodTypeDef, And> = z
3383
- .object({
3384
- and: z.array(
3385
- z.record(z.union([
3386
- z.lazy(() => AndEq$outboundSchema),
3387
- z.lazy(() =>
3388
- AndNe$outboundSchema
3389
- ),
3390
- z.lazy(() => AndGt$outboundSchema),
3391
- z.lazy(() => AndGte$outboundSchema),
3392
- z.lazy(() => AndLt$outboundSchema),
3393
- z.lazy(() => AndLte$outboundSchema),
3394
- z.lazy(() => AndIn$outboundSchema),
3395
- z.lazy(() => AndNin$outboundSchema),
3396
- z.lazy(() => AndExists$outboundSchema),
3397
- ])),
3398
- ),
3399
- });
3400
-
3401
- export function andToJSON(and: And): string {
3402
- return JSON.stringify(And$outboundSchema.parse(and));
3403
- }
3404
-
3405
- /** @internal */
3406
- export type Exists$Outbound = {
3407
- exists: boolean;
3408
- };
3409
-
3410
- /** @internal */
3411
- export const Exists$outboundSchema: z.ZodType<
3412
- Exists$Outbound,
3413
- z.ZodTypeDef,
3414
- Exists
3415
- > = z.object({
3416
- exists: z.boolean(),
3417
- });
3418
-
3419
- export function existsToJSON(exists: Exists): string {
3420
- return JSON.stringify(Exists$outboundSchema.parse(exists));
3421
- }
3422
-
3423
- /** @internal */
3424
- export type OneNin$Outbound = string | number | boolean;
3425
-
3426
- /** @internal */
3427
- export const OneNin$outboundSchema: z.ZodType<
3428
- OneNin$Outbound,
3429
- z.ZodTypeDef,
3430
- OneNin
3431
- > = z.union([z.string(), z.number(), z.boolean()]);
3432
-
3433
- export function oneNinToJSON(oneNin: OneNin): string {
3434
- return JSON.stringify(OneNin$outboundSchema.parse(oneNin));
3435
- }
3436
-
3437
- /** @internal */
3438
- export type Nin$Outbound = {
3439
- nin: Array<string | number | boolean>;
3440
- };
3441
-
3442
- /** @internal */
3443
- export const Nin$outboundSchema: z.ZodType<Nin$Outbound, z.ZodTypeDef, Nin> = z
3444
- .object({
3445
- nin: z.array(z.union([z.string(), z.number(), z.boolean()])),
3446
- });
3447
-
3448
- export function ninToJSON(nin: Nin): string {
3449
- return JSON.stringify(Nin$outboundSchema.parse(nin));
3450
- }
3451
-
3452
- /** @internal */
3453
- export type OneIn$Outbound = string | number | boolean;
3454
-
3455
- /** @internal */
3456
- export const OneIn$outboundSchema: z.ZodType<
3457
- OneIn$Outbound,
3458
- z.ZodTypeDef,
3459
- OneIn
3460
- > = z.union([z.string(), z.number(), z.boolean()]);
3461
-
3462
- export function oneInToJSON(oneIn: OneIn): string {
3463
- return JSON.stringify(OneIn$outboundSchema.parse(oneIn));
3464
- }
3465
-
3466
- /** @internal */
3467
- export type In$Outbound = {
3468
- in: Array<string | number | boolean>;
3469
- };
3470
-
3471
- /** @internal */
3472
- export const In$outboundSchema: z.ZodType<In$Outbound, z.ZodTypeDef, In> = z
3473
- .object({
3474
- in: z.array(z.union([z.string(), z.number(), z.boolean()])),
3475
- });
3476
-
3477
- export function inToJSON(value: In): string {
3478
- return JSON.stringify(In$outboundSchema.parse(value));
3479
- }
3480
-
3481
- /** @internal */
3482
- export type Lte$Outbound = {
3483
- lte: number;
3484
- };
3485
-
3486
- /** @internal */
3487
- export const Lte$outboundSchema: z.ZodType<Lte$Outbound, z.ZodTypeDef, Lte> = z
3488
- .object({
3489
- lte: z.number(),
3490
- });
3491
-
3492
- export function lteToJSON(lte: Lte): string {
3493
- return JSON.stringify(Lte$outboundSchema.parse(lte));
3494
- }
3495
-
3496
- /** @internal */
3497
- export type Lt$Outbound = {
3498
- lt: number;
3499
- };
3500
-
3501
- /** @internal */
3502
- export const Lt$outboundSchema: z.ZodType<Lt$Outbound, z.ZodTypeDef, Lt> = z
3503
- .object({
3504
- lt: z.number(),
3505
- });
3506
-
3507
- export function ltToJSON(lt: Lt): string {
3508
- return JSON.stringify(Lt$outboundSchema.parse(lt));
3509
- }
3510
-
3511
- /** @internal */
3512
- export type Gte$Outbound = {
3513
- gte: number;
3514
- };
3515
-
3516
- /** @internal */
3517
- export const Gte$outboundSchema: z.ZodType<Gte$Outbound, z.ZodTypeDef, Gte> = z
3518
- .object({
3519
- gte: z.number(),
3520
- });
3521
-
3522
- export function gteToJSON(gte: Gte): string {
3523
- return JSON.stringify(Gte$outboundSchema.parse(gte));
3524
- }
3525
-
3526
- /** @internal */
3527
- export type Gt$Outbound = {
3528
- gt: number;
3529
- };
3530
-
3531
- /** @internal */
3532
- export const Gt$outboundSchema: z.ZodType<Gt$Outbound, z.ZodTypeDef, Gt> = z
3533
- .object({
3534
- gt: z.number(),
3535
- });
3536
-
3537
- export function gtToJSON(gt: Gt): string {
3538
- return JSON.stringify(Gt$outboundSchema.parse(gt));
3539
- }
3540
-
3541
- /** @internal */
3542
- export type OneNe$Outbound = string | number | boolean;
3543
-
3544
- /** @internal */
3545
- export const OneNe$outboundSchema: z.ZodType<
3546
- OneNe$Outbound,
3547
- z.ZodTypeDef,
3548
- OneNe
3549
- > = z.union([z.string(), z.number(), z.boolean()]);
3550
-
3551
- export function oneNeToJSON(oneNe: OneNe): string {
3552
- return JSON.stringify(OneNe$outboundSchema.parse(oneNe));
3553
- }
3554
-
3555
- /** @internal */
3556
- export type Ne$Outbound = {
3557
- ne: string | number | boolean;
3558
- };
3559
-
3560
- /** @internal */
3561
- export const Ne$outboundSchema: z.ZodType<Ne$Outbound, z.ZodTypeDef, Ne> = z
3562
- .object({
3563
- ne: z.union([z.string(), z.number(), z.boolean()]),
3564
- });
3565
-
3566
- export function neToJSON(ne: Ne): string {
3567
- return JSON.stringify(Ne$outboundSchema.parse(ne));
3568
- }
3569
-
3570
- /** @internal */
3571
- export type OneEq$Outbound = string | number | boolean;
3572
-
3573
- /** @internal */
3574
- export const OneEq$outboundSchema: z.ZodType<
3575
- OneEq$Outbound,
3576
- z.ZodTypeDef,
3577
- OneEq
3578
- > = z.union([z.string(), z.number(), z.boolean()]);
3579
-
3580
- export function oneEqToJSON(oneEq: OneEq): string {
3581
- return JSON.stringify(OneEq$outboundSchema.parse(oneEq));
3582
- }
3583
-
3584
- /** @internal */
3585
- export type Eq$Outbound = {
3586
- eq: string | number | boolean;
3587
- };
3588
-
3589
- /** @internal */
3590
- export const Eq$outboundSchema: z.ZodType<Eq$Outbound, z.ZodTypeDef, Eq> = z
3591
- .object({
3592
- eq: z.union([z.string(), z.number(), z.boolean()]),
3593
- });
3594
-
3595
- export function eqToJSON(eq: Eq): string {
3596
- return JSON.stringify(Eq$outboundSchema.parse(eq));
3597
- }
3598
-
3599
- /** @internal */
3600
- export type KnowledgeFilter1$Outbound =
3601
- | Eq$Outbound
3602
- | Ne$Outbound
3603
- | Gt$Outbound
3604
- | Gte$Outbound
3605
- | Lt$Outbound
3606
- | Lte$Outbound
3607
- | In$Outbound
3608
- | Nin$Outbound
3609
- | Exists$Outbound;
3610
-
3611
- /** @internal */
3612
- export const KnowledgeFilter1$outboundSchema: z.ZodType<
3613
- KnowledgeFilter1$Outbound,
3614
- z.ZodTypeDef,
3615
- KnowledgeFilter1
3616
- > = z.union([
3617
- z.lazy(() => Eq$outboundSchema),
3618
- z.lazy(() => Ne$outboundSchema),
3619
- z.lazy(() => Gt$outboundSchema),
3620
- z.lazy(() => Gte$outboundSchema),
3621
- z.lazy(() => Lt$outboundSchema),
3622
- z.lazy(() => Lte$outboundSchema),
3623
- z.lazy(() => In$outboundSchema),
3624
- z.lazy(() => Nin$outboundSchema),
3625
- z.lazy(() => Exists$outboundSchema),
3626
- ]);
3627
-
3628
- export function knowledgeFilter1ToJSON(
3629
- knowledgeFilter1: KnowledgeFilter1,
3630
- ): string {
3631
- return JSON.stringify(
3632
- KnowledgeFilter1$outboundSchema.parse(knowledgeFilter1),
3633
- );
3634
- }
3635
-
3636
- /** @internal */
3637
- export type KnowledgeFilter$Outbound = And$Outbound | Or$Outbound | {
3638
- [k: string]:
3639
- | Eq$Outbound
3640
- | Ne$Outbound
3641
- | Gt$Outbound
3642
- | Gte$Outbound
3643
- | Lt$Outbound
3644
- | Lte$Outbound
3645
- | In$Outbound
3646
- | Nin$Outbound
3647
- | Exists$Outbound;
3648
- };
3649
-
3650
- /** @internal */
3651
- export const KnowledgeFilter$outboundSchema: z.ZodType<
3652
- KnowledgeFilter$Outbound,
3653
- z.ZodTypeDef,
3654
- KnowledgeFilter
3655
- > = z.union([
3656
- z.lazy(() => And$outboundSchema),
3657
- z.lazy(() => Or$outboundSchema),
3658
- z.record(z.union([
3659
- z.lazy(() => Eq$outboundSchema),
3660
- z.lazy(() => Ne$outboundSchema),
3661
- z.lazy(() => Gt$outboundSchema),
3662
- z.lazy(() => Gte$outboundSchema),
3663
- z.lazy(() => Lt$outboundSchema),
3664
- z.lazy(() => Lte$outboundSchema),
3665
- z.lazy(() => In$outboundSchema),
3666
- z.lazy(() => Nin$outboundSchema),
3667
- z.lazy(() => Exists$outboundSchema),
3668
- ])),
3669
- ]);
3670
-
3671
- export function knowledgeFilterToJSON(
3672
- knowledgeFilter: KnowledgeFilter,
3673
- ): string {
3674
- return JSON.stringify(KnowledgeFilter$outboundSchema.parse(knowledgeFilter));
3675
- }
3676
-
3677
- /** @internal */
3678
- export type DeploymentInvokeRequestBody$Outbound = {
3679
- key: string;
3680
- stream: boolean;
3681
- inputs?: { [k: string]: any } | undefined;
3682
- context?: { [k: string]: any } | undefined;
3683
- prefix_messages?:
3684
- | Array<
3685
- | SystemMessage$Outbound
3686
- | DeveloperMessage$Outbound
3687
- | UserMessage$Outbound
3688
- | AssistantMessage$Outbound
3689
- | ToolMessage$Outbound
3690
- >
3691
- | undefined;
3692
- messages?:
3693
- | Array<
3694
- | MessagesSystemMessage$Outbound
3695
- | MessagesDeveloperMessage$Outbound
3696
- | MessagesUserMessage$Outbound
3697
- | MessagesAssistantMessage$Outbound
3698
- | MessagesToolMessage$Outbound
3699
- >
3700
- | undefined;
3701
- identity?: components.PublicIdentity$Outbound | undefined;
3702
- file_ids?: Array<string> | undefined;
3703
- metadata?: { [k: string]: any } | undefined;
3704
- extra_params?: { [k: string]: any } | undefined;
3705
- documents?: Array<Documents$Outbound> | undefined;
3706
- invoke_options?: InvokeOptions$Outbound | undefined;
3707
- thread?: Thread$Outbound | undefined;
3708
- knowledge_filter?: And$Outbound | Or$Outbound | {
3709
- [k: string]:
3710
- | Eq$Outbound
3711
- | Ne$Outbound
3712
- | Gt$Outbound
3713
- | Gte$Outbound
3714
- | Lt$Outbound
3715
- | Lte$Outbound
3716
- | In$Outbound
3717
- | Nin$Outbound
3718
- | Exists$Outbound;
3719
- } | undefined;
3720
- };
3721
-
3722
- /** @internal */
3723
- export const DeploymentInvokeRequestBody$outboundSchema: z.ZodType<
3724
- DeploymentInvokeRequestBody$Outbound,
3725
- z.ZodTypeDef,
3726
- DeploymentInvokeRequestBody
3727
- > = z.object({
3728
- key: z.string(),
3729
- stream: z.boolean().default(false),
3730
- inputs: z.record(z.any()).optional(),
3731
- context: z.record(z.any()).optional(),
3732
- prefixMessages: z.array(
3733
- z.union([
3734
- z.lazy(() => SystemMessage$outboundSchema),
3735
- z.lazy(() => DeveloperMessage$outboundSchema),
3736
- z.lazy(() => UserMessage$outboundSchema),
3737
- z.lazy(() => AssistantMessage$outboundSchema),
3738
- z.lazy(() => ToolMessage$outboundSchema),
3739
- ]),
3740
- ).optional(),
3741
- messages: z.array(
3742
- z.union([
3743
- z.lazy(() => MessagesSystemMessage$outboundSchema),
3744
- z.lazy(() => MessagesDeveloperMessage$outboundSchema),
3745
- z.lazy(() => MessagesUserMessage$outboundSchema),
3746
- z.lazy(() => MessagesAssistantMessage$outboundSchema),
3747
- z.lazy(() => MessagesToolMessage$outboundSchema),
3748
- ]),
3749
- ).optional(),
3750
- identity: components.PublicIdentity$outboundSchema.optional(),
3751
- fileIds: z.array(z.string()).optional(),
3752
- metadata: z.record(z.any()).optional(),
3753
- extraParams: z.record(z.any()).optional(),
3754
- documents: z.array(z.lazy(() => Documents$outboundSchema)).optional(),
3755
- invokeOptions: z.lazy(() => InvokeOptions$outboundSchema).optional(),
3756
- thread: z.lazy(() => Thread$outboundSchema).optional(),
3757
- knowledgeFilter: z.union([
3758
- z.lazy(() => And$outboundSchema),
3759
- z.lazy(() => Or$outboundSchema),
3760
- z.record(z.union([
3761
- z.lazy(() => Eq$outboundSchema),
3762
- z.lazy(() => Ne$outboundSchema),
3763
- z.lazy(() => Gt$outboundSchema),
3764
- z.lazy(() => Gte$outboundSchema),
3765
- z.lazy(() => Lt$outboundSchema),
3766
- z.lazy(() => Lte$outboundSchema),
3767
- z.lazy(() => In$outboundSchema),
3768
- z.lazy(() => Nin$outboundSchema),
3769
- z.lazy(() => Exists$outboundSchema),
3770
- ])),
3771
- ]).optional(),
3772
- }).transform((v) => {
3773
- return remap$(v, {
3774
- prefixMessages: "prefix_messages",
3775
- fileIds: "file_ids",
3776
- extraParams: "extra_params",
3777
- invokeOptions: "invoke_options",
3778
- knowledgeFilter: "knowledge_filter",
3779
- });
3780
- });
3781
-
3782
- export function deploymentInvokeRequestBodyToJSON(
3783
- deploymentInvokeRequestBody: DeploymentInvokeRequestBody,
3784
- ): string {
3785
- return JSON.stringify(
3786
- DeploymentInvokeRequestBody$outboundSchema.parse(
3787
- deploymentInvokeRequestBody,
3788
- ),
3789
- );
3790
- }
3791
-
3792
339
  /** @internal */
3793
340
  export const DeploymentInvokeObject$inboundSchema: z.ZodNativeEnum<
3794
341
  typeof DeploymentInvokeObject