@orq-ai/node 4.15.0-rc.53 → 4.15.0-rc.55

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 (278) hide show
  1. package/FUNCTIONS.md +38 -3
  2. package/README.md +259 -72
  3. package/examples/deploymentsInvoke.example.ts +62 -0
  4. package/funcs/datasetsList.js +1 -0
  5. package/funcs/datasetsList.js.map +1 -1
  6. package/funcs/deploymentsInvoke.d.ts +18 -0
  7. package/funcs/deploymentsInvoke.d.ts.map +1 -0
  8. package/funcs/deploymentsInvoke.js +116 -0
  9. package/funcs/deploymentsInvoke.js.map +1 -0
  10. package/funcs/deploymentsStream.d.ts +18 -0
  11. package/funcs/deploymentsStream.d.ts.map +1 -0
  12. package/funcs/deploymentsStream.js +129 -0
  13. package/funcs/deploymentsStream.js.map +1 -0
  14. package/funcs/evalsAll.d.ts +2 -2
  15. package/funcs/evalsAll.d.ts.map +1 -1
  16. package/funcs/evalsAll.js +5 -2
  17. package/funcs/evalsAll.js.map +1 -1
  18. package/funcs/evalsCreate.d.ts +2 -1
  19. package/funcs/evalsCreate.d.ts.map +1 -1
  20. package/funcs/evalsCreate.js +19 -4
  21. package/funcs/evalsCreate.js.map +1 -1
  22. package/funcs/evalsDelete.d.ts +2 -2
  23. package/funcs/evalsDelete.d.ts.map +1 -1
  24. package/funcs/evalsDelete.js +6 -2
  25. package/funcs/evalsDelete.js.map +1 -1
  26. package/funcs/evalsGet.d.ts +2 -1
  27. package/funcs/evalsGet.d.ts.map +1 -1
  28. package/funcs/evalsGet.js +5 -1
  29. package/funcs/evalsGet.js.map +1 -1
  30. package/funcs/evalsUpdate.d.ts +2 -1
  31. package/funcs/evalsUpdate.d.ts.map +1 -1
  32. package/funcs/evalsUpdate.js +5 -1
  33. package/funcs/evalsUpdate.js.map +1 -1
  34. package/funcs/skillsUpdate.d.ts +1 -1
  35. package/funcs/skillsUpdate.js +1 -1
  36. package/jsr.json +1 -1
  37. package/lib/config.d.ts +2 -2
  38. package/lib/config.js +2 -2
  39. package/models/components/agentresponserequest.d.ts +8 -8
  40. package/models/components/agentresponserequest.d.ts.map +1 -1
  41. package/models/components/agentresponserequest.js +10 -9
  42. package/models/components/agentresponserequest.js.map +1 -1
  43. package/models/components/agentthoughtstreamingevent.d.ts +12 -12
  44. package/models/components/agentthoughtstreamingevent.d.ts.map +1 -1
  45. package/models/components/agentthoughtstreamingevent.js +17 -17
  46. package/models/components/agentthoughtstreamingevent.js.map +1 -1
  47. package/models/components/chunkingconfiguration.d.ts +30 -30
  48. package/models/components/chunkingconfiguration.d.ts.map +1 -1
  49. package/models/components/chunkingconfiguration.js +36 -37
  50. package/models/components/chunkingconfiguration.js.map +1 -1
  51. package/models/components/evaluatorresponsefunction.d.ts +230 -0
  52. package/models/components/evaluatorresponsefunction.d.ts.map +1 -0
  53. package/models/components/evaluatorresponsefunction.js +420 -0
  54. package/models/components/evaluatorresponsefunction.js.map +1 -0
  55. package/models/components/evaluatorresponsehttp.d.ts +37 -0
  56. package/models/components/evaluatorresponsehttp.d.ts.map +1 -0
  57. package/models/components/evaluatorresponsehttp.js +77 -0
  58. package/models/components/evaluatorresponsehttp.js.map +1 -0
  59. package/models/components/evaluatorresponsejsonschema.d.ts +22 -0
  60. package/models/components/evaluatorresponsejsonschema.d.ts.map +1 -0
  61. package/models/components/{listevaluatorsresponse.js → evaluatorresponsejsonschema.js} +20 -16
  62. package/models/components/evaluatorresponsejsonschema.js.map +1 -0
  63. package/models/components/evaluatorresponsellm.d.ts +101 -0
  64. package/models/components/evaluatorresponsellm.d.ts.map +1 -0
  65. package/models/components/evaluatorresponsellm.js +181 -0
  66. package/models/components/evaluatorresponsellm.js.map +1 -0
  67. package/models/components/evaluatorresponsepython.d.ts +22 -0
  68. package/models/components/evaluatorresponsepython.d.ts.map +1 -0
  69. package/models/components/evaluatorresponsepython.js +67 -0
  70. package/models/components/evaluatorresponsepython.js.map +1 -0
  71. package/models/components/evaluatorresponseragas.d.ts +41 -0
  72. package/models/components/evaluatorresponseragas.d.ts.map +1 -0
  73. package/models/components/evaluatorresponseragas.js +86 -0
  74. package/models/components/evaluatorresponseragas.js.map +1 -0
  75. package/models/components/evaluatorresponsetypescript.d.ts +22 -0
  76. package/models/components/evaluatorresponsetypescript.d.ts.map +1 -0
  77. package/models/components/evaluatorresponsetypescript.js +67 -0
  78. package/models/components/evaluatorresponsetypescript.js.map +1 -0
  79. package/models/components/index.d.ts +8 -2
  80. package/models/components/index.d.ts.map +1 -1
  81. package/models/components/index.js +8 -2
  82. package/models/components/index.js.map +1 -1
  83. package/models/components/invokedeploymentrequest.d.ts +1544 -0
  84. package/models/components/invokedeploymentrequest.d.ts.map +1 -0
  85. package/models/components/invokedeploymentrequest.js +1109 -0
  86. package/models/components/invokedeploymentrequest.js.map +1 -0
  87. package/models/components/queryreportrequest.d.ts +5 -5
  88. package/models/components/queryreportrequest.d.ts.map +1 -1
  89. package/models/components/queryreportrequest.js +6 -6
  90. package/models/components/queryreportrequest.js.map +1 -1
  91. package/models/components/reasoningpart.js +1 -1
  92. package/models/components/searchknowledgerequest.d.ts +176 -176
  93. package/models/components/searchknowledgerequest.d.ts.map +1 -1
  94. package/models/components/searchknowledgerequest.js +211 -222
  95. package/models/components/searchknowledgerequest.js.map +1 -1
  96. package/models/components/updatememorystorerequest.d.ts +5 -0
  97. package/models/components/updatememorystorerequest.d.ts.map +1 -1
  98. package/models/components/updatememorystorerequest.js +6 -0
  99. package/models/components/updatememorystorerequest.js.map +1 -1
  100. package/models/components/updateskillrequest.d.ts +1 -1
  101. package/models/errors/createeval.d.ts +23 -0
  102. package/models/errors/createeval.d.ts.map +1 -0
  103. package/models/errors/createeval.js +68 -0
  104. package/models/errors/createeval.js.map +1 -0
  105. package/models/errors/deleteeval.d.ts +43 -0
  106. package/models/errors/deleteeval.d.ts.map +1 -0
  107. package/models/errors/deleteeval.js +94 -0
  108. package/models/errors/deleteeval.js.map +1 -0
  109. package/models/errors/geteval.d.ts +23 -0
  110. package/models/errors/geteval.d.ts.map +1 -0
  111. package/models/errors/geteval.js +68 -0
  112. package/models/errors/geteval.js.map +1 -0
  113. package/models/errors/getevals.d.ts +23 -0
  114. package/models/errors/getevals.d.ts.map +1 -0
  115. package/models/{components/deleteevaluatorresponse.js → errors/getevals.js} +28 -8
  116. package/models/errors/getevals.js.map +1 -0
  117. package/models/errors/index.d.ts +5 -0
  118. package/models/errors/index.d.ts.map +1 -1
  119. package/models/errors/index.js +5 -0
  120. package/models/errors/index.js.map +1 -1
  121. package/models/errors/updateeval.d.ts +23 -0
  122. package/models/errors/updateeval.d.ts.map +1 -0
  123. package/models/errors/updateeval.js +68 -0
  124. package/models/errors/updateeval.js.map +1 -0
  125. package/models/operations/createchatcompletion.d.ts +58 -58
  126. package/models/operations/createchatcompletion.d.ts.map +1 -1
  127. package/models/operations/createchatcompletion.js +81 -80
  128. package/models/operations/createchatcompletion.js.map +1 -1
  129. package/models/operations/createdataset.js +1 -1
  130. package/models/operations/createdatasetitem.js +5 -5
  131. package/models/operations/createeval.d.ts +305 -4
  132. package/models/operations/createeval.d.ts.map +1 -1
  133. package/models/operations/createeval.js +258 -3
  134. package/models/operations/createeval.js.map +1 -1
  135. package/models/operations/createprompt.d.ts +4 -4
  136. package/models/operations/createprompt.d.ts.map +1 -1
  137. package/models/operations/createprompt.js +5 -6
  138. package/models/operations/createprompt.js.map +1 -1
  139. package/models/operations/createtool.d.ts +4 -4
  140. package/models/operations/createtool.d.ts.map +1 -1
  141. package/models/operations/createtool.js +9 -9
  142. package/models/operations/createtool.js.map +1 -1
  143. package/models/operations/deploymentgetconfig.d.ts +442 -442
  144. package/models/operations/deploymentgetconfig.d.ts.map +1 -1
  145. package/models/operations/deploymentgetconfig.js +481 -485
  146. package/models/operations/deploymentgetconfig.js.map +1 -1
  147. package/models/operations/deploymentinvoke.d.ts +367 -0
  148. package/models/operations/deploymentinvoke.d.ts.map +1 -0
  149. package/models/operations/deploymentinvoke.js +373 -0
  150. package/models/operations/deploymentinvoke.js.map +1 -0
  151. package/models/operations/deployments.d.ts +16 -16
  152. package/models/operations/deployments.d.ts.map +1 -1
  153. package/models/operations/deployments.js +16 -18
  154. package/models/operations/deployments.js.map +1 -1
  155. package/models/operations/deploymentstream.d.ts +1899 -0
  156. package/models/operations/deploymentstream.d.ts.map +1 -0
  157. package/models/operations/deploymentstream.js +1488 -0
  158. package/models/operations/deploymentstream.js.map +1 -0
  159. package/models/operations/getalltools.js +4 -4
  160. package/models/operations/geteval.d.ts +804 -2
  161. package/models/operations/geteval.d.ts.map +1 -1
  162. package/models/operations/geteval.js +1244 -2
  163. package/models/operations/geteval.js.map +1 -1
  164. package/models/operations/getevals.d.ts +41 -3
  165. package/models/operations/getevals.d.ts.map +1 -1
  166. package/models/operations/getevals.js +52 -3
  167. package/models/operations/getevals.js.map +1 -1
  168. package/models/operations/getv2humanevalsets.js +2 -2
  169. package/models/operations/getv2humanevalsetsid.js +2 -2
  170. package/models/operations/index.d.ts +2 -0
  171. package/models/operations/index.d.ts.map +1 -1
  172. package/models/operations/index.js +2 -0
  173. package/models/operations/index.js.map +1 -1
  174. package/models/operations/listdatasetdatapoints.js +5 -5
  175. package/models/operations/listdatasets.d.ts +5 -0
  176. package/models/operations/listdatasets.d.ts.map +1 -1
  177. package/models/operations/listdatasets.js +3 -1
  178. package/models/operations/listdatasets.js.map +1 -1
  179. package/models/operations/patchv2humanevalsetsid.js +2 -2
  180. package/models/operations/postv2feedbackevaluation.js +4 -4
  181. package/models/operations/postv2humanevalsets.js +2 -2
  182. package/models/operations/retrievedatapoint.js +5 -5
  183. package/models/operations/retrievedataset.js +1 -1
  184. package/models/operations/retrievetool.js +4 -4
  185. package/models/operations/runagent.js +1 -1
  186. package/models/operations/streamrunagent.js +1 -1
  187. package/models/operations/updatedatapoint.js +5 -5
  188. package/models/operations/updatedataset.js +1 -1
  189. package/models/operations/updateeval.d.ts +194 -6
  190. package/models/operations/updateeval.d.ts.map +1 -1
  191. package/models/operations/updateeval.js +155 -4
  192. package/models/operations/updateeval.js.map +1 -1
  193. package/models/operations/updatetool.js +4 -4
  194. package/package.json +7 -7
  195. package/sdk/deployments.d.ts +16 -0
  196. package/sdk/deployments.d.ts.map +1 -1
  197. package/sdk/deployments.js +20 -0
  198. package/sdk/deployments.js.map +1 -1
  199. package/sdk/evals.d.ts +3 -3
  200. package/sdk/evals.d.ts.map +1 -1
  201. package/sdk/evals.js.map +1 -1
  202. package/sdk/skills.d.ts +1 -1
  203. package/sdk/skills.js +1 -1
  204. package/src/funcs/datasetsList.ts +1 -0
  205. package/src/funcs/deploymentsInvoke.ts +170 -0
  206. package/src/funcs/deploymentsStream.ts +180 -0
  207. package/src/funcs/evalsAll.ts +14 -6
  208. package/src/funcs/evalsCreate.ts +31 -5
  209. package/src/funcs/evalsDelete.ts +19 -6
  210. package/src/funcs/evalsGet.ts +10 -1
  211. package/src/funcs/evalsUpdate.ts +10 -1
  212. package/src/funcs/skillsUpdate.ts +1 -1
  213. package/src/lib/config.ts +2 -2
  214. package/src/models/components/agentresponserequest.ts +17 -12
  215. package/src/models/components/agentthoughtstreamingevent.ts +55 -43
  216. package/src/models/components/chunkingconfiguration.ts +150 -110
  217. package/src/models/components/evaluatorresponsefunction.ts +928 -0
  218. package/src/models/components/evaluatorresponsehttp.ts +77 -0
  219. package/src/models/components/evaluatorresponsejsonschema.ts +60 -0
  220. package/src/models/components/evaluatorresponsellm.ts +310 -0
  221. package/src/models/components/evaluatorresponsepython.ts +60 -0
  222. package/src/models/components/evaluatorresponseragas.ts +84 -0
  223. package/src/models/components/evaluatorresponsetypescript.ts +60 -0
  224. package/src/models/components/index.ts +8 -2
  225. package/src/models/components/invokedeploymentrequest.ts +3444 -0
  226. package/src/models/components/queryreportrequest.ts +11 -10
  227. package/src/models/components/reasoningpart.ts +1 -1
  228. package/src/models/components/searchknowledgerequest.ts +680 -469
  229. package/src/models/components/updatememorystorerequest.ts +11 -0
  230. package/src/models/components/updateskillrequest.ts +1 -1
  231. package/src/models/errors/createeval.ts +51 -0
  232. package/src/models/errors/deleteeval.ts +96 -0
  233. package/src/models/errors/geteval.ts +51 -0
  234. package/src/models/errors/getevals.ts +51 -0
  235. package/src/models/errors/index.ts +5 -0
  236. package/src/models/errors/updateeval.ts +51 -0
  237. package/src/models/operations/createchatcompletion.ts +313 -248
  238. package/src/models/operations/createdataset.ts +1 -1
  239. package/src/models/operations/createdatasetitem.ts +5 -5
  240. package/src/models/operations/createeval.ts +628 -6
  241. package/src/models/operations/createprompt.ts +7 -6
  242. package/src/models/operations/createtool.ts +13 -11
  243. package/src/models/operations/deploymentgetconfig.ts +1631 -1141
  244. package/src/models/operations/deploymentinvoke.ts +732 -0
  245. package/src/models/operations/deployments.ts +46 -42
  246. package/src/models/operations/deploymentstream.ts +4102 -0
  247. package/src/models/operations/getalltools.ts +4 -4
  248. package/src/models/operations/geteval.ts +2751 -3
  249. package/src/models/operations/getevals.ts +123 -5
  250. package/src/models/operations/getv2humanevalsets.ts +2 -2
  251. package/src/models/operations/getv2humanevalsetsid.ts +2 -2
  252. package/src/models/operations/index.ts +2 -0
  253. package/src/models/operations/listdatasetdatapoints.ts +5 -5
  254. package/src/models/operations/listdatasets.ts +8 -1
  255. package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  256. package/src/models/operations/postv2feedbackevaluation.ts +4 -4
  257. package/src/models/operations/postv2humanevalsets.ts +2 -2
  258. package/src/models/operations/retrievedatapoint.ts +5 -5
  259. package/src/models/operations/retrievedataset.ts +1 -1
  260. package/src/models/operations/retrievetool.ts +4 -4
  261. package/src/models/operations/runagent.ts +1 -1
  262. package/src/models/operations/streamrunagent.ts +1 -1
  263. package/src/models/operations/updatedatapoint.ts +5 -5
  264. package/src/models/operations/updatedataset.ts +1 -1
  265. package/src/models/operations/updateeval.ts +393 -9
  266. package/src/models/operations/updatetool.ts +4 -4
  267. package/src/sdk/deployments.ts +38 -0
  268. package/src/sdk/evals.ts +3 -3
  269. package/src/sdk/skills.ts +1 -1
  270. package/examples/deploymentsList.example.ts +0 -26
  271. package/models/components/deleteevaluatorresponse.d.ts +0 -8
  272. package/models/components/deleteevaluatorresponse.d.ts.map +0 -1
  273. package/models/components/deleteevaluatorresponse.js.map +0 -1
  274. package/models/components/listevaluatorsresponse.d.ts +0 -16
  275. package/models/components/listevaluatorsresponse.d.ts.map +0 -1
  276. package/models/components/listevaluatorsresponse.js.map +0 -1
  277. package/src/models/components/deleteevaluatorresponse.ts +0 -27
  278. package/src/models/components/listevaluatorsresponse.ts +0 -59
@@ -0,0 +1,732 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { ClosedEnum } from "../../types/enums.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ /**
13
+ * Indicates the type of model used to generate the response
14
+ */
15
+ export const ObjectT = {
16
+ Chat: "chat",
17
+ Completion: "completion",
18
+ Image: "image",
19
+ } as const;
20
+ /**
21
+ * Indicates the type of model used to generate the response
22
+ */
23
+ export type ObjectT = ClosedEnum<typeof ObjectT>;
24
+
25
+ /**
26
+ * The provider used to generate the response
27
+ */
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
+ Moonshotai: "moonshotai",
52
+ Zai: "zai",
53
+ Minimax: "minimax",
54
+ Xai: "xai",
55
+ Alibaba: "alibaba",
56
+ Tensorix: "tensorix",
57
+ Scaleway: "scaleway",
58
+ Hcompany: "hcompany",
59
+ Inceptron: "inceptron",
60
+ Wafer: "wafer",
61
+ Poolside: "poolside",
62
+ Tencent: "tencent",
63
+ Nebius: "nebius",
64
+ Fireworks: "fireworks",
65
+ Baseten: "baseten",
66
+ Reson8: "reson8",
67
+ Meta: "meta",
68
+ Greenpt: "greenpt",
69
+ Slack: "slack",
70
+ Orq: "orq",
71
+ } as const;
72
+ /**
73
+ * The provider used to generate the response
74
+ */
75
+ export type Provider = ClosedEnum<typeof Provider>;
76
+
77
+ export type Telemetry = {
78
+ /**
79
+ * The trace id for the request that generated this response
80
+ */
81
+ traceId: string;
82
+ /**
83
+ * The span id for the request that generated this response
84
+ */
85
+ spanId: string;
86
+ };
87
+
88
+ /**
89
+ * Metadata of the retrieved chunk from the knowledge base
90
+ */
91
+ export type DeploymentInvokeMetadata = {
92
+ /**
93
+ * Name of the file
94
+ */
95
+ fileName: string;
96
+ /**
97
+ * Page number of the chunk
98
+ */
99
+ pageNumber: number | null;
100
+ /**
101
+ * Type of the file
102
+ */
103
+ fileType: string;
104
+ /**
105
+ * 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
106
+ */
107
+ rerankScore?: number | undefined;
108
+ /**
109
+ * 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.
110
+ */
111
+ searchScore: number;
112
+ };
113
+
114
+ export type Retrievals = {
115
+ /**
116
+ * Content of the retrieved chunk from the knowledge base
117
+ */
118
+ document: string;
119
+ /**
120
+ * Metadata of the retrieved chunk from the knowledge base
121
+ */
122
+ metadata: DeploymentInvokeMetadata;
123
+ };
124
+
125
+ export type PromptTokensDetails = {
126
+ cachedTokens?: number | null | undefined;
127
+ };
128
+
129
+ export type CompletionTokensDetails = {
130
+ reasoningTokens?: number | null | undefined;
131
+ };
132
+
133
+ /**
134
+ * Usage metrics for the response
135
+ */
136
+ export type Usage = {
137
+ totalTokens?: number | undefined;
138
+ promptTokens?: number | undefined;
139
+ completionTokens?: number | undefined;
140
+ promptTokensDetails?: PromptTokensDetails | undefined;
141
+ completionTokensDetails?: CompletionTokensDetails | null | undefined;
142
+ };
143
+
144
+ /**
145
+ * The role of the prompt message
146
+ */
147
+ export const DeploymentInvokeMessageRole = {
148
+ System: "system",
149
+ Developer: "developer",
150
+ Assistant: "assistant",
151
+ User: "user",
152
+ Exception: "exception",
153
+ Tool: "tool",
154
+ Prompt: "prompt",
155
+ Correction: "correction",
156
+ ExpectedOutput: "expected_output",
157
+ } as const;
158
+ /**
159
+ * The role of the prompt message
160
+ */
161
+ export type DeploymentInvokeMessageRole = ClosedEnum<
162
+ typeof DeploymentInvokeMessageRole
163
+ >;
164
+
165
+ export type Message3 = {
166
+ type: "image";
167
+ /**
168
+ * The role of the prompt message
169
+ */
170
+ role: DeploymentInvokeMessageRole;
171
+ url: string;
172
+ };
173
+
174
+ /**
175
+ * The role of the prompt message
176
+ */
177
+ export const MessageRole = {
178
+ System: "system",
179
+ Developer: "developer",
180
+ Assistant: "assistant",
181
+ User: "user",
182
+ Exception: "exception",
183
+ Tool: "tool",
184
+ Prompt: "prompt",
185
+ Correction: "correction",
186
+ ExpectedOutput: "expected_output",
187
+ } as const;
188
+ /**
189
+ * The role of the prompt message
190
+ */
191
+ export type MessageRole = ClosedEnum<typeof MessageRole>;
192
+
193
+ export type Message2 = {
194
+ type: "content";
195
+ /**
196
+ * The role of the prompt message
197
+ */
198
+ role: MessageRole;
199
+ content: string | null;
200
+ /**
201
+ * Internal thought process of the model
202
+ */
203
+ reasoning?: string | undefined;
204
+ /**
205
+ * 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`.
206
+ */
207
+ reasoningSignature?: string | undefined;
208
+ /**
209
+ * 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.
210
+ */
211
+ redactedReasoning?: string | undefined;
212
+ };
213
+
214
+ /**
215
+ * The role of the prompt message
216
+ */
217
+ export const DeploymentInvokeMessageDeploymentsRole = {
218
+ System: "system",
219
+ Developer: "developer",
220
+ Assistant: "assistant",
221
+ User: "user",
222
+ Exception: "exception",
223
+ Tool: "tool",
224
+ Prompt: "prompt",
225
+ Correction: "correction",
226
+ ExpectedOutput: "expected_output",
227
+ } as const;
228
+ /**
229
+ * The role of the prompt message
230
+ */
231
+ export type DeploymentInvokeMessageDeploymentsRole = ClosedEnum<
232
+ typeof DeploymentInvokeMessageDeploymentsRole
233
+ >;
234
+
235
+ export const DeploymentInvokeMessageDeploymentsResponseType = {
236
+ Function: "function",
237
+ } as const;
238
+ export type DeploymentInvokeMessageDeploymentsResponseType = ClosedEnum<
239
+ typeof DeploymentInvokeMessageDeploymentsResponseType
240
+ >;
241
+
242
+ export type MessageFunction = {
243
+ name: string;
244
+ /**
245
+ * JSON string arguments for the functions
246
+ */
247
+ arguments: string;
248
+ };
249
+
250
+ export type MessageToolCalls = {
251
+ id?: string | undefined;
252
+ index?: number | undefined;
253
+ type: DeploymentInvokeMessageDeploymentsResponseType;
254
+ function: MessageFunction;
255
+ };
256
+
257
+ export type Message1 = {
258
+ type: "tool_calls";
259
+ /**
260
+ * The role of the prompt message
261
+ */
262
+ role: DeploymentInvokeMessageDeploymentsRole;
263
+ content?: string | null | undefined;
264
+ toolCalls: Array<MessageToolCalls>;
265
+ /**
266
+ * Internal thought process of the model
267
+ */
268
+ reasoning?: string | undefined;
269
+ /**
270
+ * 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`.
271
+ */
272
+ reasoningSignature?: string | undefined;
273
+ /**
274
+ * 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.
275
+ */
276
+ redactedReasoning?: string | undefined;
277
+ };
278
+
279
+ export type Message = Message1 | Message2 | Message3;
280
+
281
+ export type Choices = {
282
+ index: number;
283
+ message: Message1 | Message2 | Message3;
284
+ finishReason?: string | null | undefined;
285
+ };
286
+
287
+ /**
288
+ * Successful operation
289
+ */
290
+ export type DeploymentInvokeResponseBody = {
291
+ /**
292
+ * A unique identifier for the response. Can be used to add metrics to the transaction.
293
+ */
294
+ id: string;
295
+ /**
296
+ * A timestamp indicating when the object was created. Usually in a standardized format like ISO 8601
297
+ */
298
+ created: Date;
299
+ /**
300
+ * Indicates the type of model used to generate the response
301
+ */
302
+ object: ObjectT;
303
+ /**
304
+ * The model used to generate the response
305
+ */
306
+ model: string;
307
+ /**
308
+ * The provider used to generate the response
309
+ */
310
+ provider: Provider;
311
+ /**
312
+ * Indicates if the response is the final response
313
+ */
314
+ isFinal: boolean;
315
+ /**
316
+ * Indicates integration id used to generate the response
317
+ */
318
+ integrationId?: string | undefined;
319
+ telemetry: Telemetry;
320
+ /**
321
+ * A timestamp indicating when the object was finalized. Usually in a standardized format like ISO 8601
322
+ */
323
+ finalized?: Date | undefined;
324
+ /**
325
+ * Provider backed system fingerprint.
326
+ */
327
+ systemFingerprint?: string | null | undefined;
328
+ /**
329
+ * 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`.
330
+ */
331
+ retrievals?: Array<Retrievals> | undefined;
332
+ /**
333
+ * 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`.
334
+ */
335
+ providerResponse?: any | undefined;
336
+ /**
337
+ * Usage metrics for the response
338
+ */
339
+ usage?: Usage | null | undefined;
340
+ /**
341
+ * A list of choices generated by the model
342
+ */
343
+ choices: Array<Choices>;
344
+ };
345
+
346
+ /** @internal */
347
+ export const ObjectT$inboundSchema: z.ZodNativeEnum<typeof ObjectT> = z
348
+ .nativeEnum(ObjectT);
349
+
350
+ /** @internal */
351
+ export const Provider$inboundSchema: z.ZodNativeEnum<typeof Provider> = z
352
+ .nativeEnum(Provider);
353
+
354
+ /** @internal */
355
+ export const Telemetry$inboundSchema: z.ZodType<
356
+ Telemetry,
357
+ z.ZodTypeDef,
358
+ unknown
359
+ > = z.object({
360
+ trace_id: z.string(),
361
+ span_id: z.string(),
362
+ }).transform((v) => {
363
+ return remap$(v, {
364
+ "trace_id": "traceId",
365
+ "span_id": "spanId",
366
+ });
367
+ });
368
+
369
+ export function telemetryFromJSON(
370
+ jsonString: string,
371
+ ): SafeParseResult<Telemetry, SDKValidationError> {
372
+ return safeParse(
373
+ jsonString,
374
+ (x) => Telemetry$inboundSchema.parse(JSON.parse(x)),
375
+ `Failed to parse 'Telemetry' from JSON`,
376
+ );
377
+ }
378
+
379
+ /** @internal */
380
+ export const DeploymentInvokeMetadata$inboundSchema: z.ZodType<
381
+ DeploymentInvokeMetadata,
382
+ z.ZodTypeDef,
383
+ unknown
384
+ > = z.object({
385
+ file_name: z.string(),
386
+ page_number: z.nullable(z.number()),
387
+ file_type: z.string(),
388
+ rerank_score: z.number().optional(),
389
+ search_score: z.number(),
390
+ }).transform((v) => {
391
+ return remap$(v, {
392
+ "file_name": "fileName",
393
+ "page_number": "pageNumber",
394
+ "file_type": "fileType",
395
+ "rerank_score": "rerankScore",
396
+ "search_score": "searchScore",
397
+ });
398
+ });
399
+
400
+ export function deploymentInvokeMetadataFromJSON(
401
+ jsonString: string,
402
+ ): SafeParseResult<DeploymentInvokeMetadata, SDKValidationError> {
403
+ return safeParse(
404
+ jsonString,
405
+ (x) => DeploymentInvokeMetadata$inboundSchema.parse(JSON.parse(x)),
406
+ `Failed to parse 'DeploymentInvokeMetadata' from JSON`,
407
+ );
408
+ }
409
+
410
+ /** @internal */
411
+ export const Retrievals$inboundSchema: z.ZodType<
412
+ Retrievals,
413
+ z.ZodTypeDef,
414
+ unknown
415
+ > = z.object({
416
+ document: z.string(),
417
+ metadata: z.lazy(() => DeploymentInvokeMetadata$inboundSchema),
418
+ });
419
+
420
+ export function retrievalsFromJSON(
421
+ jsonString: string,
422
+ ): SafeParseResult<Retrievals, SDKValidationError> {
423
+ return safeParse(
424
+ jsonString,
425
+ (x) => Retrievals$inboundSchema.parse(JSON.parse(x)),
426
+ `Failed to parse 'Retrievals' from JSON`,
427
+ );
428
+ }
429
+
430
+ /** @internal */
431
+ export const PromptTokensDetails$inboundSchema: z.ZodType<
432
+ PromptTokensDetails,
433
+ z.ZodTypeDef,
434
+ unknown
435
+ > = z.object({
436
+ cached_tokens: z.nullable(z.number()).optional(),
437
+ }).transform((v) => {
438
+ return remap$(v, {
439
+ "cached_tokens": "cachedTokens",
440
+ });
441
+ });
442
+
443
+ export function promptTokensDetailsFromJSON(
444
+ jsonString: string,
445
+ ): SafeParseResult<PromptTokensDetails, SDKValidationError> {
446
+ return safeParse(
447
+ jsonString,
448
+ (x) => PromptTokensDetails$inboundSchema.parse(JSON.parse(x)),
449
+ `Failed to parse 'PromptTokensDetails' from JSON`,
450
+ );
451
+ }
452
+
453
+ /** @internal */
454
+ export const CompletionTokensDetails$inboundSchema: z.ZodType<
455
+ CompletionTokensDetails,
456
+ z.ZodTypeDef,
457
+ unknown
458
+ > = z.object({
459
+ reasoning_tokens: z.nullable(z.number()).optional(),
460
+ }).transform((v) => {
461
+ return remap$(v, {
462
+ "reasoning_tokens": "reasoningTokens",
463
+ });
464
+ });
465
+
466
+ export function completionTokensDetailsFromJSON(
467
+ jsonString: string,
468
+ ): SafeParseResult<CompletionTokensDetails, SDKValidationError> {
469
+ return safeParse(
470
+ jsonString,
471
+ (x) => CompletionTokensDetails$inboundSchema.parse(JSON.parse(x)),
472
+ `Failed to parse 'CompletionTokensDetails' from JSON`,
473
+ );
474
+ }
475
+
476
+ /** @internal */
477
+ export const Usage$inboundSchema: z.ZodType<Usage, z.ZodTypeDef, unknown> = z
478
+ .object({
479
+ total_tokens: z.number().optional(),
480
+ prompt_tokens: z.number().optional(),
481
+ completion_tokens: z.number().optional(),
482
+ prompt_tokens_details: z.lazy(() => PromptTokensDetails$inboundSchema)
483
+ .optional(),
484
+ completion_tokens_details: z.nullable(
485
+ z.lazy(() => CompletionTokensDetails$inboundSchema),
486
+ ).optional(),
487
+ }).transform((v) => {
488
+ return remap$(v, {
489
+ "total_tokens": "totalTokens",
490
+ "prompt_tokens": "promptTokens",
491
+ "completion_tokens": "completionTokens",
492
+ "prompt_tokens_details": "promptTokensDetails",
493
+ "completion_tokens_details": "completionTokensDetails",
494
+ });
495
+ });
496
+
497
+ export function usageFromJSON(
498
+ jsonString: string,
499
+ ): SafeParseResult<Usage, SDKValidationError> {
500
+ return safeParse(
501
+ jsonString,
502
+ (x) => Usage$inboundSchema.parse(JSON.parse(x)),
503
+ `Failed to parse 'Usage' from JSON`,
504
+ );
505
+ }
506
+
507
+ /** @internal */
508
+ export const DeploymentInvokeMessageRole$inboundSchema: z.ZodNativeEnum<
509
+ typeof DeploymentInvokeMessageRole
510
+ > = z.nativeEnum(DeploymentInvokeMessageRole);
511
+
512
+ /** @internal */
513
+ export const Message3$inboundSchema: z.ZodType<
514
+ Message3,
515
+ z.ZodTypeDef,
516
+ unknown
517
+ > = z.object({
518
+ type: z.literal("image"),
519
+ role: DeploymentInvokeMessageRole$inboundSchema,
520
+ url: z.string(),
521
+ });
522
+
523
+ export function message3FromJSON(
524
+ jsonString: string,
525
+ ): SafeParseResult<Message3, SDKValidationError> {
526
+ return safeParse(
527
+ jsonString,
528
+ (x) => Message3$inboundSchema.parse(JSON.parse(x)),
529
+ `Failed to parse 'Message3' from JSON`,
530
+ );
531
+ }
532
+
533
+ /** @internal */
534
+ export const MessageRole$inboundSchema: z.ZodNativeEnum<typeof MessageRole> = z
535
+ .nativeEnum(MessageRole);
536
+
537
+ /** @internal */
538
+ export const Message2$inboundSchema: z.ZodType<
539
+ Message2,
540
+ z.ZodTypeDef,
541
+ unknown
542
+ > = z.object({
543
+ type: z.literal("content"),
544
+ role: MessageRole$inboundSchema,
545
+ content: z.nullable(z.string()),
546
+ reasoning: z.string().optional(),
547
+ reasoning_signature: z.string().optional(),
548
+ redacted_reasoning: z.string().optional(),
549
+ }).transform((v) => {
550
+ return remap$(v, {
551
+ "reasoning_signature": "reasoningSignature",
552
+ "redacted_reasoning": "redactedReasoning",
553
+ });
554
+ });
555
+
556
+ export function message2FromJSON(
557
+ jsonString: string,
558
+ ): SafeParseResult<Message2, SDKValidationError> {
559
+ return safeParse(
560
+ jsonString,
561
+ (x) => Message2$inboundSchema.parse(JSON.parse(x)),
562
+ `Failed to parse 'Message2' from JSON`,
563
+ );
564
+ }
565
+
566
+ /** @internal */
567
+ export const DeploymentInvokeMessageDeploymentsRole$inboundSchema:
568
+ z.ZodNativeEnum<typeof DeploymentInvokeMessageDeploymentsRole> = z.nativeEnum(
569
+ DeploymentInvokeMessageDeploymentsRole,
570
+ );
571
+
572
+ /** @internal */
573
+ export const DeploymentInvokeMessageDeploymentsResponseType$inboundSchema:
574
+ z.ZodNativeEnum<typeof DeploymentInvokeMessageDeploymentsResponseType> = z
575
+ .nativeEnum(DeploymentInvokeMessageDeploymentsResponseType);
576
+
577
+ /** @internal */
578
+ export const MessageFunction$inboundSchema: z.ZodType<
579
+ MessageFunction,
580
+ z.ZodTypeDef,
581
+ unknown
582
+ > = z.object({
583
+ name: z.string(),
584
+ arguments: z.string(),
585
+ });
586
+
587
+ export function messageFunctionFromJSON(
588
+ jsonString: string,
589
+ ): SafeParseResult<MessageFunction, SDKValidationError> {
590
+ return safeParse(
591
+ jsonString,
592
+ (x) => MessageFunction$inboundSchema.parse(JSON.parse(x)),
593
+ `Failed to parse 'MessageFunction' from JSON`,
594
+ );
595
+ }
596
+
597
+ /** @internal */
598
+ export const MessageToolCalls$inboundSchema: z.ZodType<
599
+ MessageToolCalls,
600
+ z.ZodTypeDef,
601
+ unknown
602
+ > = z.object({
603
+ id: z.string().optional(),
604
+ index: z.number().optional(),
605
+ type: DeploymentInvokeMessageDeploymentsResponseType$inboundSchema,
606
+ function: z.lazy(() => MessageFunction$inboundSchema),
607
+ });
608
+
609
+ export function messageToolCallsFromJSON(
610
+ jsonString: string,
611
+ ): SafeParseResult<MessageToolCalls, SDKValidationError> {
612
+ return safeParse(
613
+ jsonString,
614
+ (x) => MessageToolCalls$inboundSchema.parse(JSON.parse(x)),
615
+ `Failed to parse 'MessageToolCalls' from JSON`,
616
+ );
617
+ }
618
+
619
+ /** @internal */
620
+ export const Message1$inboundSchema: z.ZodType<
621
+ Message1,
622
+ z.ZodTypeDef,
623
+ unknown
624
+ > = z.object({
625
+ type: z.literal("tool_calls"),
626
+ role: DeploymentInvokeMessageDeploymentsRole$inboundSchema,
627
+ content: z.nullable(z.string()).optional(),
628
+ tool_calls: z.array(z.lazy(() => MessageToolCalls$inboundSchema)),
629
+ reasoning: z.string().optional(),
630
+ reasoning_signature: z.string().optional(),
631
+ redacted_reasoning: z.string().optional(),
632
+ }).transform((v) => {
633
+ return remap$(v, {
634
+ "tool_calls": "toolCalls",
635
+ "reasoning_signature": "reasoningSignature",
636
+ "redacted_reasoning": "redactedReasoning",
637
+ });
638
+ });
639
+
640
+ export function message1FromJSON(
641
+ jsonString: string,
642
+ ): SafeParseResult<Message1, SDKValidationError> {
643
+ return safeParse(
644
+ jsonString,
645
+ (x) => Message1$inboundSchema.parse(JSON.parse(x)),
646
+ `Failed to parse 'Message1' from JSON`,
647
+ );
648
+ }
649
+
650
+ /** @internal */
651
+ export const Message$inboundSchema: z.ZodType<Message, z.ZodTypeDef, unknown> =
652
+ z.union([
653
+ z.lazy(() => Message1$inboundSchema),
654
+ z.lazy(() => Message2$inboundSchema),
655
+ z.lazy(() => Message3$inboundSchema),
656
+ ]);
657
+
658
+ export function messageFromJSON(
659
+ jsonString: string,
660
+ ): SafeParseResult<Message, SDKValidationError> {
661
+ return safeParse(
662
+ jsonString,
663
+ (x) => Message$inboundSchema.parse(JSON.parse(x)),
664
+ `Failed to parse 'Message' from JSON`,
665
+ );
666
+ }
667
+
668
+ /** @internal */
669
+ export const Choices$inboundSchema: z.ZodType<Choices, z.ZodTypeDef, unknown> =
670
+ z.object({
671
+ index: z.number(),
672
+ message: z.union([
673
+ z.lazy(() => Message1$inboundSchema),
674
+ z.lazy(() => Message2$inboundSchema),
675
+ z.lazy(() => Message3$inboundSchema),
676
+ ]),
677
+ finish_reason: z.nullable(z.string()).optional(),
678
+ }).transform((v) => {
679
+ return remap$(v, {
680
+ "finish_reason": "finishReason",
681
+ });
682
+ });
683
+
684
+ export function choicesFromJSON(
685
+ jsonString: string,
686
+ ): SafeParseResult<Choices, SDKValidationError> {
687
+ return safeParse(
688
+ jsonString,
689
+ (x) => Choices$inboundSchema.parse(JSON.parse(x)),
690
+ `Failed to parse 'Choices' from JSON`,
691
+ );
692
+ }
693
+
694
+ /** @internal */
695
+ export const DeploymentInvokeResponseBody$inboundSchema: z.ZodType<
696
+ DeploymentInvokeResponseBody,
697
+ z.ZodTypeDef,
698
+ unknown
699
+ > = z.object({
700
+ id: z.string(),
701
+ created: z.string().datetime({ offset: true }).transform(v => new Date(v)),
702
+ object: ObjectT$inboundSchema,
703
+ model: z.string(),
704
+ provider: Provider$inboundSchema,
705
+ is_final: z.boolean(),
706
+ integration_id: z.string().optional(),
707
+ telemetry: z.lazy(() => Telemetry$inboundSchema),
708
+ finalized: z.string().datetime({ offset: true }).transform(v => new Date(v))
709
+ .optional(),
710
+ system_fingerprint: z.nullable(z.string()).optional(),
711
+ retrievals: z.array(z.lazy(() => Retrievals$inboundSchema)).optional(),
712
+ provider_response: z.any().optional(),
713
+ usage: z.nullable(z.lazy(() => Usage$inboundSchema)).optional(),
714
+ choices: z.array(z.lazy(() => Choices$inboundSchema)),
715
+ }).transform((v) => {
716
+ return remap$(v, {
717
+ "is_final": "isFinal",
718
+ "integration_id": "integrationId",
719
+ "system_fingerprint": "systemFingerprint",
720
+ "provider_response": "providerResponse",
721
+ });
722
+ });
723
+
724
+ export function deploymentInvokeResponseBodyFromJSON(
725
+ jsonString: string,
726
+ ): SafeParseResult<DeploymentInvokeResponseBody, SDKValidationError> {
727
+ return safeParse(
728
+ jsonString,
729
+ (x) => DeploymentInvokeResponseBody$inboundSchema.parse(JSON.parse(x)),
730
+ `Failed to parse 'DeploymentInvokeResponseBody' from JSON`,
731
+ );
732
+ }