@orq-ai/node 3.3.10 → 3.3.13

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 (182) hide show
  1. package/bin/mcp-server.js +39 -39
  2. package/bin/mcp-server.js.map +21 -21
  3. package/jsr.json +1 -1
  4. package/lib/config.d.ts +2 -2
  5. package/lib/config.js +2 -2
  6. package/mcp-server/mcp-server.js +1 -1
  7. package/mcp-server/server.js +1 -1
  8. package/models/operations/bulkcreatedatapoints.js +2 -2
  9. package/models/operations/createcontact.js +2 -2
  10. package/models/operations/createdataset.js +2 -2
  11. package/models/operations/createdatasetitem.js +2 -2
  12. package/models/operations/createdatasource.js +2 -2
  13. package/models/operations/fileget.js +2 -2
  14. package/models/operations/filelist.js +2 -2
  15. package/models/operations/fileupload.js +2 -2
  16. package/models/operations/listdatasetdatapoints.js +2 -2
  17. package/models/operations/listdatasets.js +2 -2
  18. package/models/operations/listdatasources.js +2 -2
  19. package/models/operations/retrievedatapoint.js +2 -2
  20. package/models/operations/retrievedataset.js +2 -2
  21. package/models/operations/retrievedatasource.js +2 -2
  22. package/models/operations/updatedatapoint.js +2 -2
  23. package/models/operations/updatedataset.js +2 -2
  24. package/models/operations/updatedatasource.js +2 -2
  25. package/package.json +1 -1
  26. package/packages/orq-rc/FUNCTIONS.md +2 -4
  27. package/packages/orq-rc/README.md +68 -17
  28. package/packages/orq-rc/docs/sdks/knowledge/README.md +0 -83
  29. package/packages/orq-rc/docs/sdks/memorystores/README.md +1211 -0
  30. package/packages/orq-rc/docs/sdks/orq/README.md +74 -0
  31. package/packages/orq-rc/docs/sdks/sessions/README.md +385 -0
  32. package/packages/orq-rc/docs/sdks/tools/README.md +425 -0
  33. package/packages/orq-rc/jsr.json +1 -1
  34. package/packages/orq-rc/package-lock.json +2 -2
  35. package/packages/orq-rc/package.json +1 -1
  36. package/packages/orq-rc/src/funcs/memoryStoresCreate.ts +165 -0
  37. package/packages/orq-rc/src/funcs/memoryStoresCreateDocument.ts +169 -0
  38. package/packages/orq-rc/src/funcs/memoryStoresCreateMemory.ts +164 -0
  39. package/packages/orq-rc/src/funcs/memoryStoresDelete.ts +162 -0
  40. package/packages/orq-rc/src/funcs/memoryStoresDeleteDocument.ts +178 -0
  41. package/packages/orq-rc/src/funcs/memoryStoresDeleteMemory.ts +173 -0
  42. package/packages/orq-rc/src/funcs/memoryStoresList.ts +172 -0
  43. package/packages/orq-rc/src/funcs/memoryStoresListDocuments.ts +175 -0
  44. package/packages/orq-rc/src/funcs/memoryStoresListMemories.ts +170 -0
  45. package/packages/orq-rc/src/funcs/memoryStoresRetrieve.ts +171 -0
  46. package/packages/orq-rc/src/funcs/memoryStoresRetrieveDocument.ts +172 -0
  47. package/packages/orq-rc/src/funcs/memoryStoresRetrieveMemory.ts +167 -0
  48. package/packages/orq-rc/src/funcs/memoryStoresUpdate.ts +162 -0
  49. package/packages/orq-rc/src/funcs/memoryStoresUpdateDocument.ts +173 -0
  50. package/packages/orq-rc/src/funcs/memoryStoresUpdateMemory.ts +168 -0
  51. package/packages/orq-rc/src/funcs/postV2TracesSessionsCount.ts +155 -0
  52. package/packages/orq-rc/src/funcs/sessionsCreate.ts +159 -0
  53. package/packages/orq-rc/src/funcs/sessionsDelete.ts +170 -0
  54. package/packages/orq-rc/src/funcs/sessionsGet.ts +169 -0
  55. package/packages/orq-rc/src/funcs/sessionsList.ts +157 -0
  56. package/packages/orq-rc/src/funcs/sessionsUpdate.ts +170 -0
  57. package/packages/orq-rc/src/funcs/toolsCreate.ts +157 -0
  58. package/packages/orq-rc/src/funcs/toolsDelete.ts +161 -0
  59. package/packages/orq-rc/src/funcs/toolsList.ts +170 -0
  60. package/packages/orq-rc/src/funcs/toolsRetrieve.ts +160 -0
  61. package/packages/orq-rc/src/funcs/{knowledgeSearch.ts → toolsUpdate.ts} +18 -15
  62. package/packages/orq-rc/src/lib/config.ts +3 -3
  63. package/packages/orq-rc/src/mcp-server/mcp-server.ts +1 -1
  64. package/packages/orq-rc/src/mcp-server/prompts.ts +8 -1
  65. package/packages/orq-rc/src/mcp-server/resources.ts +16 -2
  66. package/packages/orq-rc/src/mcp-server/server.ts +55 -5
  67. package/packages/orq-rc/src/mcp-server/tools/memoryStoresCreate.ts +35 -0
  68. package/packages/orq-rc/src/mcp-server/tools/memoryStoresCreateDocument.ts +37 -0
  69. package/packages/orq-rc/src/mcp-server/tools/memoryStoresCreateMemory.ts +37 -0
  70. package/packages/orq-rc/src/mcp-server/tools/memoryStoresDelete.ts +35 -0
  71. package/packages/orq-rc/src/mcp-server/tools/memoryStoresDeleteDocument.ts +40 -0
  72. package/packages/orq-rc/src/mcp-server/tools/memoryStoresDeleteMemory.ts +40 -0
  73. package/packages/orq-rc/src/mcp-server/tools/memoryStoresList.ts +37 -0
  74. package/packages/orq-rc/src/mcp-server/tools/memoryStoresListDocuments.ts +37 -0
  75. package/packages/orq-rc/src/mcp-server/tools/memoryStoresListMemories.ts +37 -0
  76. package/packages/orq-rc/src/mcp-server/tools/memoryStoresRetrieve.ts +37 -0
  77. package/packages/orq-rc/src/mcp-server/tools/memoryStoresRetrieveDocument.ts +37 -0
  78. package/packages/orq-rc/src/mcp-server/tools/memoryStoresRetrieveMemory.ts +37 -0
  79. package/packages/orq-rc/src/mcp-server/tools/memoryStoresUpdate.ts +37 -0
  80. package/packages/orq-rc/src/mcp-server/tools/memoryStoresUpdateDocument.ts +37 -0
  81. package/packages/orq-rc/src/mcp-server/tools/memoryStoresUpdateMemory.ts +37 -0
  82. package/packages/orq-rc/src/mcp-server/tools/postV2TracesSessionsCount.ts +36 -0
  83. package/packages/orq-rc/src/mcp-server/tools/sessionsCreate.ts +37 -0
  84. package/packages/orq-rc/src/mcp-server/tools/sessionsDelete.ts +35 -0
  85. package/packages/orq-rc/src/mcp-server/tools/{knowledgeSearch.ts → sessionsGet.ts} +8 -6
  86. package/packages/orq-rc/src/mcp-server/tools/sessionsList.ts +37 -0
  87. package/packages/orq-rc/src/mcp-server/tools/sessionsUpdate.ts +37 -0
  88. package/packages/orq-rc/src/mcp-server/tools/toolsCreate.ts +37 -0
  89. package/packages/orq-rc/src/mcp-server/tools/toolsDelete.ts +35 -0
  90. package/packages/orq-rc/src/mcp-server/tools/toolsList.ts +37 -0
  91. package/packages/orq-rc/src/mcp-server/tools/toolsRetrieve.ts +37 -0
  92. package/packages/orq-rc/src/mcp-server/tools/toolsUpdate.ts +37 -0
  93. package/packages/orq-rc/src/mcp-server/tools.ts +6 -3
  94. package/packages/orq-rc/src/models/components/deployments.ts +124 -29
  95. package/packages/orq-rc/src/models/operations/bulkcreatedatapoints.ts +2 -2
  96. package/packages/orq-rc/src/models/operations/createchunk.ts +99 -41
  97. package/packages/orq-rc/src/models/operations/createcontact.ts +2 -2
  98. package/packages/orq-rc/src/models/operations/createdataset.ts +2 -2
  99. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +2 -2
  100. package/packages/orq-rc/src/models/operations/createdatasource.ts +10 -10
  101. package/packages/orq-rc/src/models/operations/createknowledge.ts +175 -14
  102. package/packages/orq-rc/src/models/operations/creatememory.ts +265 -0
  103. package/packages/orq-rc/src/models/operations/creatememorydocument.ts +284 -0
  104. package/packages/orq-rc/src/models/operations/creatememorystore.ts +1619 -0
  105. package/packages/orq-rc/src/models/operations/createprompt.ts +6 -6
  106. package/packages/orq-rc/src/models/operations/createsession.ts +632 -0
  107. package/packages/orq-rc/src/models/operations/createtool.ts +2297 -0
  108. package/packages/orq-rc/src/models/operations/deletememory.ts +87 -0
  109. package/packages/orq-rc/src/models/operations/deletememorydocument.ts +98 -0
  110. package/packages/orq-rc/src/models/operations/deletememorystore.ts +78 -0
  111. package/packages/orq-rc/src/models/operations/deletesession.ts +78 -0
  112. package/packages/orq-rc/src/models/operations/deletetool.ts +75 -0
  113. package/packages/orq-rc/src/models/operations/deploymentcreatemetric.ts +57 -35
  114. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +124 -29
  115. package/packages/orq-rc/src/models/operations/deployments.ts +3 -3
  116. package/packages/orq-rc/src/models/operations/deploymentstream.ts +135 -30
  117. package/packages/orq-rc/src/models/operations/fileget.ts +2 -2
  118. package/packages/orq-rc/src/models/operations/filelist.ts +2 -2
  119. package/packages/orq-rc/src/models/operations/fileupload.ts +2 -2
  120. package/packages/orq-rc/src/models/operations/getallmemories.ts +315 -0
  121. package/packages/orq-rc/src/models/operations/getallmemorydocuments.ts +335 -0
  122. package/packages/orq-rc/src/models/operations/getallmemorystores.ts +1061 -0
  123. package/packages/orq-rc/src/models/operations/getallprompts.ts +3 -3
  124. package/packages/orq-rc/src/models/operations/getalltools.ts +1382 -0
  125. package/packages/orq-rc/src/models/operations/getonechunk.ts +8 -8
  126. package/packages/orq-rc/src/models/operations/getoneknowledge.ts +92 -8
  127. package/packages/orq-rc/src/models/operations/getoneprompt.ts +3 -3
  128. package/packages/orq-rc/src/models/operations/getpromptversion.ts +3 -3
  129. package/packages/orq-rc/src/models/operations/getsession.ts +400 -0
  130. package/packages/orq-rc/src/models/operations/index.ts +26 -1
  131. package/packages/orq-rc/src/models/operations/listchunks.ts +8 -8
  132. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +2 -2
  133. package/packages/orq-rc/src/models/operations/listdatasets.ts +2 -2
  134. package/packages/orq-rc/src/models/operations/listdatasources.ts +10 -10
  135. package/packages/orq-rc/src/models/operations/listknowledgebases.ts +94 -8
  136. package/packages/orq-rc/src/models/operations/listpromptversions.ts +3 -3
  137. package/packages/orq-rc/src/models/operations/listsessions.ts +6732 -0
  138. package/packages/orq-rc/src/models/operations/postv2tracessessionscount.ts +7043 -0
  139. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +2 -2
  140. package/packages/orq-rc/src/models/operations/retrievedataset.ts +2 -2
  141. package/packages/orq-rc/src/models/operations/retrievedatasource.ts +10 -10
  142. package/packages/orq-rc/src/models/operations/retrievememory.ts +198 -0
  143. package/packages/orq-rc/src/models/operations/retrievememorydocument.ts +217 -0
  144. package/packages/orq-rc/src/models/operations/retrievememorystore.ts +944 -0
  145. package/packages/orq-rc/src/models/operations/retrievetool.ts +1350 -0
  146. package/packages/orq-rc/src/models/operations/updatechunk.ts +10 -10
  147. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +2 -2
  148. package/packages/orq-rc/src/models/operations/updatedataset.ts +2 -2
  149. package/packages/orq-rc/src/models/operations/updatedatasource.ts +10 -10
  150. package/packages/orq-rc/src/models/operations/updateknowledge.ts +201 -20
  151. package/packages/orq-rc/src/models/operations/updatememory.ts +274 -0
  152. package/packages/orq-rc/src/models/operations/updatememorydocument.ts +293 -0
  153. package/packages/orq-rc/src/models/operations/updatememorystore.ts +1148 -0
  154. package/packages/orq-rc/src/models/operations/updateprompt.ts +6 -6
  155. package/packages/orq-rc/src/models/operations/updatesession.ts +731 -0
  156. package/packages/orq-rc/src/models/operations/updatetool.ts +2464 -0
  157. package/packages/orq-rc/src/sdk/knowledge.ts +0 -15
  158. package/packages/orq-rc/src/sdk/memorystores.ts +286 -0
  159. package/packages/orq-rc/src/sdk/sdk.ts +36 -1
  160. package/packages/orq-rc/src/sdk/sessions.ts +99 -0
  161. package/packages/orq-rc/src/sdk/tools.ts +99 -0
  162. package/src/lib/config.ts +2 -2
  163. package/src/mcp-server/mcp-server.ts +1 -1
  164. package/src/mcp-server/server.ts +1 -1
  165. package/src/models/operations/bulkcreatedatapoints.ts +2 -2
  166. package/src/models/operations/createcontact.ts +2 -2
  167. package/src/models/operations/createdataset.ts +2 -2
  168. package/src/models/operations/createdatasetitem.ts +2 -2
  169. package/src/models/operations/createdatasource.ts +2 -2
  170. package/src/models/operations/fileget.ts +2 -2
  171. package/src/models/operations/filelist.ts +2 -2
  172. package/src/models/operations/fileupload.ts +2 -2
  173. package/src/models/operations/listdatasetdatapoints.ts +2 -2
  174. package/src/models/operations/listdatasets.ts +2 -2
  175. package/src/models/operations/listdatasources.ts +2 -2
  176. package/src/models/operations/retrievedatapoint.ts +2 -2
  177. package/src/models/operations/retrievedataset.ts +2 -2
  178. package/src/models/operations/retrievedatasource.ts +2 -2
  179. package/src/models/operations/updatedatapoint.ts +2 -2
  180. package/src/models/operations/updatedataset.ts +2 -2
  181. package/src/models/operations/updatedatasource.ts +2 -2
  182. package/packages/orq-rc/src/models/operations/searchknowledge.ts +0 -1673
@@ -162,7 +162,11 @@ export type AssistantMessage = {
162
162
  /**
163
163
  * The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.
164
164
  */
165
- content?: string | Array<TextContentPart | RefusalContentPart> | undefined;
165
+ content?:
166
+ | string
167
+ | Array<TextContentPart | RefusalContentPart>
168
+ | null
169
+ | undefined;
166
170
  /**
167
171
  * The refusal message by the assistant.
168
172
  */
@@ -514,6 +518,7 @@ export type MessagesAssistantMessage = {
514
518
  content?:
515
519
  | string
516
520
  | Array<TwoTextContentPart | TwoRefusalContentPart>
521
+ | null
517
522
  | undefined;
518
523
  /**
519
524
  * The refusal message by the assistant.
@@ -750,6 +755,21 @@ export type InvokeOptions = {
750
755
  * Whether to include the retrieved knowledge chunks in the response.
751
756
  */
752
757
  includeRetrievals?: boolean | undefined;
758
+ /**
759
+ * 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.
760
+ */
761
+ mockResponse?: string | undefined;
762
+ };
763
+
764
+ export type Thread = {
765
+ /**
766
+ * Unique thread identifier to group related invocations.
767
+ */
768
+ id: string;
769
+ /**
770
+ * Optional tags to differentiate or categorize threads
771
+ */
772
+ tags?: Array<string> | undefined;
753
773
  };
754
774
 
755
775
  /**
@@ -809,6 +829,7 @@ export type Deployments = {
809
829
  */
810
830
  documents?: Array<Documents> | undefined;
811
831
  invokeOptions?: InvokeOptions | undefined;
832
+ thread?: Thread | undefined;
812
833
  };
813
834
 
814
835
  /** @internal */
@@ -1458,13 +1479,15 @@ export const AssistantMessage$inboundSchema: z.ZodType<
1458
1479
  z.ZodTypeDef,
1459
1480
  unknown
1460
1481
  > = z.object({
1461
- content: z.union([
1462
- z.string(),
1463
- z.array(z.union([
1464
- z.lazy(() => TextContentPart$inboundSchema),
1465
- z.lazy(() => RefusalContentPart$inboundSchema),
1466
- ])),
1467
- ]).optional(),
1482
+ content: z.nullable(
1483
+ z.union([
1484
+ z.string(),
1485
+ z.array(z.union([
1486
+ z.lazy(() => TextContentPart$inboundSchema),
1487
+ z.lazy(() => RefusalContentPart$inboundSchema),
1488
+ ])),
1489
+ ]),
1490
+ ).optional(),
1468
1491
  refusal: z.nullable(z.string()).optional(),
1469
1492
  role: DeploymentsPrefixMessages4Role$inboundSchema,
1470
1493
  name: z.string().optional(),
@@ -1481,6 +1504,7 @@ export type AssistantMessage$Outbound = {
1481
1504
  content?:
1482
1505
  | string
1483
1506
  | Array<TextContentPart$Outbound | RefusalContentPart$Outbound>
1507
+ | null
1484
1508
  | undefined;
1485
1509
  refusal?: string | null | undefined;
1486
1510
  role: string;
@@ -1495,13 +1519,17 @@ export const AssistantMessage$outboundSchema: z.ZodType<
1495
1519
  z.ZodTypeDef,
1496
1520
  AssistantMessage
1497
1521
  > = z.object({
1498
- content: z.union([
1499
- z.string(),
1500
- z.array(z.union([
1501
- z.lazy(() => TextContentPart$outboundSchema),
1502
- z.lazy(() => RefusalContentPart$outboundSchema),
1503
- ])),
1504
- ]).optional(),
1522
+ content: z.nullable(
1523
+ z.union([
1524
+ z.string(),
1525
+ z.array(
1526
+ z.union([
1527
+ z.lazy(() => TextContentPart$outboundSchema),
1528
+ z.lazy(() => RefusalContentPart$outboundSchema),
1529
+ ]),
1530
+ ),
1531
+ ]),
1532
+ ).optional(),
1505
1533
  refusal: z.nullable(z.string()).optional(),
1506
1534
  role: DeploymentsPrefixMessages4Role$outboundSchema,
1507
1535
  name: z.string().optional(),
@@ -2950,13 +2978,17 @@ export const MessagesAssistantMessage$inboundSchema: z.ZodType<
2950
2978
  z.ZodTypeDef,
2951
2979
  unknown
2952
2980
  > = z.object({
2953
- content: z.union([
2954
- z.string(),
2955
- z.array(z.union([
2956
- z.lazy(() => TwoTextContentPart$inboundSchema),
2957
- z.lazy(() => TwoRefusalContentPart$inboundSchema),
2958
- ])),
2959
- ]).optional(),
2981
+ content: z.nullable(
2982
+ z.union([
2983
+ z.string(),
2984
+ z.array(
2985
+ z.union([
2986
+ z.lazy(() => TwoTextContentPart$inboundSchema),
2987
+ z.lazy(() => TwoRefusalContentPart$inboundSchema),
2988
+ ]),
2989
+ ),
2990
+ ]),
2991
+ ).optional(),
2960
2992
  refusal: z.nullable(z.string()).optional(),
2961
2993
  role: DeploymentsMessages4Role$inboundSchema,
2962
2994
  name: z.string().optional(),
@@ -2973,6 +3005,7 @@ export type MessagesAssistantMessage$Outbound = {
2973
3005
  content?:
2974
3006
  | string
2975
3007
  | Array<TwoTextContentPart$Outbound | TwoRefusalContentPart$Outbound>
3008
+ | null
2976
3009
  | undefined;
2977
3010
  refusal?: string | null | undefined;
2978
3011
  role: string;
@@ -2987,13 +3020,17 @@ export const MessagesAssistantMessage$outboundSchema: z.ZodType<
2987
3020
  z.ZodTypeDef,
2988
3021
  MessagesAssistantMessage
2989
3022
  > = z.object({
2990
- content: z.union([
2991
- z.string(),
2992
- z.array(z.union([
2993
- z.lazy(() => TwoTextContentPart$outboundSchema),
2994
- z.lazy(() => TwoRefusalContentPart$outboundSchema),
2995
- ])),
2996
- ]).optional(),
3023
+ content: z.nullable(
3024
+ z.union([
3025
+ z.string(),
3026
+ z.array(
3027
+ z.union([
3028
+ z.lazy(() => TwoTextContentPart$outboundSchema),
3029
+ z.lazy(() => TwoRefusalContentPart$outboundSchema),
3030
+ ]),
3031
+ ),
3032
+ ]),
3033
+ ).optional(),
2997
3034
  refusal: z.nullable(z.string()).optional(),
2998
3035
  role: DeploymentsMessages4Role$outboundSchema,
2999
3036
  name: z.string().optional(),
@@ -3973,15 +4010,18 @@ export const InvokeOptions$inboundSchema: z.ZodType<
3973
4010
  unknown
3974
4011
  > = z.object({
3975
4012
  include_retrievals: z.boolean().default(false),
4013
+ mock_response: z.string().optional(),
3976
4014
  }).transform((v) => {
3977
4015
  return remap$(v, {
3978
4016
  "include_retrievals": "includeRetrievals",
4017
+ "mock_response": "mockResponse",
3979
4018
  });
3980
4019
  });
3981
4020
 
3982
4021
  /** @internal */
3983
4022
  export type InvokeOptions$Outbound = {
3984
4023
  include_retrievals: boolean;
4024
+ mock_response?: string | undefined;
3985
4025
  };
3986
4026
 
3987
4027
  /** @internal */
@@ -3991,9 +4031,11 @@ export const InvokeOptions$outboundSchema: z.ZodType<
3991
4031
  InvokeOptions
3992
4032
  > = z.object({
3993
4033
  includeRetrievals: z.boolean().default(false),
4034
+ mockResponse: z.string().optional(),
3994
4035
  }).transform((v) => {
3995
4036
  return remap$(v, {
3996
4037
  includeRetrievals: "include_retrievals",
4038
+ mockResponse: "mock_response",
3997
4039
  });
3998
4040
  });
3999
4041
 
@@ -4024,6 +4066,56 @@ export function invokeOptionsFromJSON(
4024
4066
  );
4025
4067
  }
4026
4068
 
4069
+ /** @internal */
4070
+ export const Thread$inboundSchema: z.ZodType<Thread, z.ZodTypeDef, unknown> = z
4071
+ .object({
4072
+ id: z.string(),
4073
+ tags: z.array(z.string()).optional(),
4074
+ });
4075
+
4076
+ /** @internal */
4077
+ export type Thread$Outbound = {
4078
+ id: string;
4079
+ tags?: Array<string> | undefined;
4080
+ };
4081
+
4082
+ /** @internal */
4083
+ export const Thread$outboundSchema: z.ZodType<
4084
+ Thread$Outbound,
4085
+ z.ZodTypeDef,
4086
+ Thread
4087
+ > = z.object({
4088
+ id: z.string(),
4089
+ tags: z.array(z.string()).optional(),
4090
+ });
4091
+
4092
+ /**
4093
+ * @internal
4094
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
4095
+ */
4096
+ export namespace Thread$ {
4097
+ /** @deprecated use `Thread$inboundSchema` instead. */
4098
+ export const inboundSchema = Thread$inboundSchema;
4099
+ /** @deprecated use `Thread$outboundSchema` instead. */
4100
+ export const outboundSchema = Thread$outboundSchema;
4101
+ /** @deprecated use `Thread$Outbound` instead. */
4102
+ export type Outbound = Thread$Outbound;
4103
+ }
4104
+
4105
+ export function threadToJSON(thread: Thread): string {
4106
+ return JSON.stringify(Thread$outboundSchema.parse(thread));
4107
+ }
4108
+
4109
+ export function threadFromJSON(
4110
+ jsonString: string,
4111
+ ): SafeParseResult<Thread, SDKValidationError> {
4112
+ return safeParse(
4113
+ jsonString,
4114
+ (x) => Thread$inboundSchema.parse(JSON.parse(x)),
4115
+ `Failed to parse 'Thread' from JSON`,
4116
+ );
4117
+ }
4118
+
4027
4119
  /** @internal */
4028
4120
  export const Deployments$inboundSchema: z.ZodType<
4029
4121
  Deployments,
@@ -4056,6 +4148,7 @@ export const Deployments$inboundSchema: z.ZodType<
4056
4148
  extra_params: z.record(z.any()).optional(),
4057
4149
  documents: z.array(z.lazy(() => Documents$inboundSchema)).optional(),
4058
4150
  invoke_options: z.lazy(() => InvokeOptions$inboundSchema).optional(),
4151
+ thread: z.lazy(() => Thread$inboundSchema).optional(),
4059
4152
  }).transform((v) => {
4060
4153
  return remap$(v, {
4061
4154
  "prefix_messages": "prefixMessages",
@@ -4093,6 +4186,7 @@ export type Deployments$Outbound = {
4093
4186
  extra_params?: { [k: string]: any } | undefined;
4094
4187
  documents?: Array<Documents$Outbound> | undefined;
4095
4188
  invoke_options?: InvokeOptions$Outbound | undefined;
4189
+ thread?: Thread$Outbound | undefined;
4096
4190
  };
4097
4191
 
4098
4192
  /** @internal */
@@ -4127,6 +4221,7 @@ export const Deployments$outboundSchema: z.ZodType<
4127
4221
  extraParams: z.record(z.any()).optional(),
4128
4222
  documents: z.array(z.lazy(() => Documents$outboundSchema)).optional(),
4129
4223
  invokeOptions: z.lazy(() => InvokeOptions$outboundSchema).optional(),
4224
+ thread: z.lazy(() => Thread$outboundSchema).optional(),
4130
4225
  }).transform((v) => {
4131
4226
  return remap$(v, {
4132
4227
  prefixMessages: "prefix_messages",
@@ -1731,7 +1731,7 @@ export const ResponseBody$inboundSchema: z.ZodType<
1731
1731
  created: z.string().datetime({ offset: true }).transform(v => new Date(v))
1732
1732
  .optional(),
1733
1733
  updated: z.string().datetime({ offset: true }).default(
1734
- "2025-04-03T20:49:20.627Z",
1734
+ "2025-04-14T11:15:16.490Z",
1735
1735
  ).transform(v => new Date(v)),
1736
1736
  }).transform((v) => {
1737
1737
  return remap$(v, {
@@ -1775,7 +1775,7 @@ export const ResponseBody$outboundSchema: z.ZodType<
1775
1775
  createdById: z.string().optional(),
1776
1776
  updatedById: z.string().optional(),
1777
1777
  created: z.date().transform(v => v.toISOString()).optional(),
1778
- updated: z.date().default(() => new Date("2025-04-03T20:49:20.627Z"))
1778
+ updated: z.date().default(() => new Date("2025-04-14T11:15:16.490Z"))
1779
1779
  .transform(v => v.toISOString()),
1780
1780
  }).transform((v) => {
1781
1781
  return remap$(v, {
@@ -19,7 +19,7 @@ export type CreateChunkMetadata = {
19
19
  pageNumber?: number | undefined;
20
20
  };
21
21
 
22
- export type RequestBody = {
22
+ export type Chunks = {
23
23
  /**
24
24
  * The text content of the chunk
25
25
  */
@@ -34,6 +34,13 @@ export type RequestBody = {
34
34
  metadata?: CreateChunkMetadata | undefined;
35
35
  };
36
36
 
37
+ export type CreateChunkRequestBody = {
38
+ /**
39
+ * Array of chunks to create. Maximum of 100 chunks per request.
40
+ */
41
+ chunks: Array<Chunks>;
42
+ };
43
+
37
44
  export type CreateChunkRequest = {
38
45
  /**
39
46
  * Unique identifier of the knowledge
@@ -43,7 +50,7 @@ export type CreateChunkRequest = {
43
50
  * Unique identifier of the datasource
44
51
  */
45
52
  datasourceId: string;
46
- requestBody?: Array<RequestBody> | undefined;
53
+ requestBody?: CreateChunkRequestBody | undefined;
47
54
  };
48
55
 
49
56
  /**
@@ -93,11 +100,11 @@ export type CreateChunkResponseBody = {
93
100
  /**
94
101
  * The unique identifier of the user who created the chunk
95
102
  */
96
- createdById?: string | undefined;
103
+ createdById?: string | null | undefined;
97
104
  /**
98
105
  * The unique identifier of the user who updated the chunk
99
106
  */
100
- updateById?: string | undefined;
107
+ updateById?: string | null | undefined;
101
108
  };
102
109
 
103
110
  /** @internal */
@@ -106,7 +113,7 @@ export const CreateChunkMetadata$inboundSchema: z.ZodType<
106
113
  z.ZodTypeDef,
107
114
  unknown
108
115
  > = z.object({
109
- page_number: z.number().optional(),
116
+ page_number: z.number().int().optional(),
110
117
  }).transform((v) => {
111
118
  return remap$(v, {
112
119
  "page_number": "pageNumber",
@@ -124,7 +131,7 @@ export const CreateChunkMetadata$outboundSchema: z.ZodType<
124
131
  z.ZodTypeDef,
125
132
  CreateChunkMetadata
126
133
  > = z.object({
127
- pageNumber: z.number().optional(),
134
+ pageNumber: z.number().int().optional(),
128
135
  }).transform((v) => {
129
136
  return remap$(v, {
130
137
  pageNumber: "page_number",
@@ -163,28 +170,25 @@ export function createChunkMetadataFromJSON(
163
170
  }
164
171
 
165
172
  /** @internal */
166
- export const RequestBody$inboundSchema: z.ZodType<
167
- RequestBody,
168
- z.ZodTypeDef,
169
- unknown
170
- > = z.object({
171
- text: z.string(),
172
- embedding: z.array(z.number()).optional(),
173
- metadata: z.lazy(() => CreateChunkMetadata$inboundSchema).optional(),
174
- });
173
+ export const Chunks$inboundSchema: z.ZodType<Chunks, z.ZodTypeDef, unknown> = z
174
+ .object({
175
+ text: z.string(),
176
+ embedding: z.array(z.number()).optional(),
177
+ metadata: z.lazy(() => CreateChunkMetadata$inboundSchema).optional(),
178
+ });
175
179
 
176
180
  /** @internal */
177
- export type RequestBody$Outbound = {
181
+ export type Chunks$Outbound = {
178
182
  text: string;
179
183
  embedding?: Array<number> | undefined;
180
184
  metadata?: CreateChunkMetadata$Outbound | undefined;
181
185
  };
182
186
 
183
187
  /** @internal */
184
- export const RequestBody$outboundSchema: z.ZodType<
185
- RequestBody$Outbound,
188
+ export const Chunks$outboundSchema: z.ZodType<
189
+ Chunks$Outbound,
186
190
  z.ZodTypeDef,
187
- RequestBody
191
+ Chunks
188
192
  > = z.object({
189
193
  text: z.string(),
190
194
  embedding: z.array(z.number()).optional(),
@@ -195,26 +199,80 @@ export const RequestBody$outboundSchema: z.ZodType<
195
199
  * @internal
196
200
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
197
201
  */
198
- export namespace RequestBody$ {
199
- /** @deprecated use `RequestBody$inboundSchema` instead. */
200
- export const inboundSchema = RequestBody$inboundSchema;
201
- /** @deprecated use `RequestBody$outboundSchema` instead. */
202
- export const outboundSchema = RequestBody$outboundSchema;
203
- /** @deprecated use `RequestBody$Outbound` instead. */
204
- export type Outbound = RequestBody$Outbound;
202
+ export namespace Chunks$ {
203
+ /** @deprecated use `Chunks$inboundSchema` instead. */
204
+ export const inboundSchema = Chunks$inboundSchema;
205
+ /** @deprecated use `Chunks$outboundSchema` instead. */
206
+ export const outboundSchema = Chunks$outboundSchema;
207
+ /** @deprecated use `Chunks$Outbound` instead. */
208
+ export type Outbound = Chunks$Outbound;
209
+ }
210
+
211
+ export function chunksToJSON(chunks: Chunks): string {
212
+ return JSON.stringify(Chunks$outboundSchema.parse(chunks));
213
+ }
214
+
215
+ export function chunksFromJSON(
216
+ jsonString: string,
217
+ ): SafeParseResult<Chunks, SDKValidationError> {
218
+ return safeParse(
219
+ jsonString,
220
+ (x) => Chunks$inboundSchema.parse(JSON.parse(x)),
221
+ `Failed to parse 'Chunks' from JSON`,
222
+ );
223
+ }
224
+
225
+ /** @internal */
226
+ export const CreateChunkRequestBody$inboundSchema: z.ZodType<
227
+ CreateChunkRequestBody,
228
+ z.ZodTypeDef,
229
+ unknown
230
+ > = z.object({
231
+ chunks: z.array(z.lazy(() => Chunks$inboundSchema)),
232
+ });
233
+
234
+ /** @internal */
235
+ export type CreateChunkRequestBody$Outbound = {
236
+ chunks: Array<Chunks$Outbound>;
237
+ };
238
+
239
+ /** @internal */
240
+ export const CreateChunkRequestBody$outboundSchema: z.ZodType<
241
+ CreateChunkRequestBody$Outbound,
242
+ z.ZodTypeDef,
243
+ CreateChunkRequestBody
244
+ > = z.object({
245
+ chunks: z.array(z.lazy(() => Chunks$outboundSchema)),
246
+ });
247
+
248
+ /**
249
+ * @internal
250
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
251
+ */
252
+ export namespace CreateChunkRequestBody$ {
253
+ /** @deprecated use `CreateChunkRequestBody$inboundSchema` instead. */
254
+ export const inboundSchema = CreateChunkRequestBody$inboundSchema;
255
+ /** @deprecated use `CreateChunkRequestBody$outboundSchema` instead. */
256
+ export const outboundSchema = CreateChunkRequestBody$outboundSchema;
257
+ /** @deprecated use `CreateChunkRequestBody$Outbound` instead. */
258
+ export type Outbound = CreateChunkRequestBody$Outbound;
205
259
  }
206
260
 
207
- export function requestBodyToJSON(requestBody: RequestBody): string {
208
- return JSON.stringify(RequestBody$outboundSchema.parse(requestBody));
261
+ export function createChunkRequestBodyToJSON(
262
+ createChunkRequestBody: CreateChunkRequestBody,
263
+ ): string {
264
+ return JSON.stringify(
265
+ CreateChunkRequestBody$outboundSchema.parse(createChunkRequestBody),
266
+ );
209
267
  }
210
268
 
211
- export function requestBodyFromJSON(
269
+ export function createChunkRequestBodyFromJSON(
212
270
  jsonString: string,
213
- ): SafeParseResult<RequestBody, SDKValidationError> {
271
+ ): SafeParseResult<CreateChunkRequestBody, SDKValidationError> {
214
272
  return safeParse(
215
273
  jsonString,
216
- (x) => RequestBody$inboundSchema.parse(JSON.parse(x)),
217
- `Failed to parse 'RequestBody' from JSON`,
274
+ (x) => CreateChunkRequestBody$inboundSchema.parse(JSON.parse(x)),
275
+ `Failed to parse 'CreateChunkRequestBody' from JSON`,
218
276
  );
219
277
  }
220
278
 
@@ -226,7 +284,7 @@ export const CreateChunkRequest$inboundSchema: z.ZodType<
226
284
  > = z.object({
227
285
  knowledge_id: z.string(),
228
286
  datasource_id: z.string(),
229
- RequestBody: z.array(z.lazy(() => RequestBody$inboundSchema)).optional(),
287
+ RequestBody: z.lazy(() => CreateChunkRequestBody$inboundSchema).optional(),
230
288
  }).transform((v) => {
231
289
  return remap$(v, {
232
290
  "knowledge_id": "knowledgeId",
@@ -239,7 +297,7 @@ export const CreateChunkRequest$inboundSchema: z.ZodType<
239
297
  export type CreateChunkRequest$Outbound = {
240
298
  knowledge_id: string;
241
299
  datasource_id: string;
242
- RequestBody?: Array<RequestBody$Outbound> | undefined;
300
+ RequestBody?: CreateChunkRequestBody$Outbound | undefined;
243
301
  };
244
302
 
245
303
  /** @internal */
@@ -250,7 +308,7 @@ export const CreateChunkRequest$outboundSchema: z.ZodType<
250
308
  > = z.object({
251
309
  knowledgeId: z.string(),
252
310
  datasourceId: z.string(),
253
- requestBody: z.array(z.lazy(() => RequestBody$outboundSchema)).optional(),
311
+ requestBody: z.lazy(() => CreateChunkRequestBody$outboundSchema).optional(),
254
312
  }).transform((v) => {
255
313
  return remap$(v, {
256
314
  knowledgeId: "knowledge_id",
@@ -324,8 +382,8 @@ export const CreateChunkResponseBody$inboundSchema: z.ZodType<
324
382
  status: CreateChunkStatus$inboundSchema,
325
383
  created: z.string(),
326
384
  updated: z.string(),
327
- created_by_id: z.string().optional(),
328
- update_by_id: z.string().optional(),
385
+ created_by_id: z.nullable(z.string()).optional(),
386
+ update_by_id: z.nullable(z.string()).optional(),
329
387
  }).transform((v) => {
330
388
  return remap$(v, {
331
389
  "_id": "id",
@@ -343,8 +401,8 @@ export type CreateChunkResponseBody$Outbound = {
343
401
  status: string;
344
402
  created: string;
345
403
  updated: string;
346
- created_by_id?: string | undefined;
347
- update_by_id?: string | undefined;
404
+ created_by_id?: string | null | undefined;
405
+ update_by_id?: string | null | undefined;
348
406
  };
349
407
 
350
408
  /** @internal */
@@ -360,8 +418,8 @@ export const CreateChunkResponseBody$outboundSchema: z.ZodType<
360
418
  status: CreateChunkStatus$outboundSchema,
361
419
  created: z.string(),
362
420
  updated: z.string(),
363
- createdById: z.string().optional(),
364
- updateById: z.string().optional(),
421
+ createdById: z.nullable(z.string()).optional(),
422
+ updateById: z.nullable(z.string()).optional(),
365
423
  }).transform((v) => {
366
424
  return remap$(v, {
367
425
  id: "_id",
@@ -177,7 +177,7 @@ export const CreateContactResponseBody$inboundSchema: z.ZodType<
177
177
  created: z.string().datetime({ offset: true }).transform(v => new Date(v))
178
178
  .optional(),
179
179
  updated: z.string().datetime({ offset: true }).default(
180
- "2025-04-03T20:49:20.627Z",
180
+ "2025-04-14T11:15:16.490Z",
181
181
  ).transform(v => new Date(v)),
182
182
  }).transform((v) => {
183
183
  return remap$(v, {
@@ -214,7 +214,7 @@ export const CreateContactResponseBody$outboundSchema: z.ZodType<
214
214
  tags: z.array(z.string()).optional(),
215
215
  metadata: z.record(z.any()).optional(),
216
216
  created: z.date().transform(v => v.toISOString()).optional(),
217
- updated: z.date().default(() => new Date("2025-04-03T20:49:20.627Z"))
217
+ updated: z.date().default(() => new Date("2025-04-14T11:15:16.490Z"))
218
218
  .transform(v => v.toISOString()),
219
219
  }).transform((v) => {
220
220
  return remap$(v, {
@@ -211,7 +211,7 @@ export const CreateDatasetResponseBody$inboundSchema: z.ZodType<
211
211
  created: z.string().datetime({ offset: true }).transform(v => new Date(v))
212
212
  .optional(),
213
213
  updated: z.string().datetime({ offset: true }).default(
214
- "2025-04-03T20:49:20.627Z",
214
+ "2025-04-14T11:15:16.490Z",
215
215
  ).transform(v => new Date(v)),
216
216
  }).transform((v) => {
217
217
  return remap$(v, {
@@ -251,7 +251,7 @@ export const CreateDatasetResponseBody$outboundSchema: z.ZodType<
251
251
  updatedById: z.string().optional(),
252
252
  metadata: z.lazy(() => CreateDatasetMetadata$outboundSchema),
253
253
  created: z.date().transform(v => v.toISOString()).optional(),
254
- updated: z.date().default(() => new Date("2025-04-03T20:49:20.627Z"))
254
+ updated: z.date().default(() => new Date("2025-04-14T11:15:16.490Z"))
255
255
  .transform(v => v.toISOString()),
256
256
  }).transform((v) => {
257
257
  return remap$(v, {
@@ -1649,7 +1649,7 @@ export const CreateDatasetItemResponseBody$inboundSchema: z.ZodType<
1649
1649
  created: z.string().datetime({ offset: true }).transform(v => new Date(v))
1650
1650
  .optional(),
1651
1651
  updated: z.string().datetime({ offset: true }).default(
1652
- "2025-04-03T20:49:20.627Z",
1652
+ "2025-04-14T11:15:16.490Z",
1653
1653
  ).transform(v => new Date(v)),
1654
1654
  }).transform((v) => {
1655
1655
  return remap$(v, {
@@ -1693,7 +1693,7 @@ export const CreateDatasetItemResponseBody$outboundSchema: z.ZodType<
1693
1693
  createdById: z.string().optional(),
1694
1694
  updatedById: z.string().optional(),
1695
1695
  created: z.date().transform(v => v.toISOString()).optional(),
1696
- updated: z.date().default(() => new Date("2025-04-03T20:49:20.627Z"))
1696
+ updated: z.date().default(() => new Date("2025-04-14T11:15:16.490Z"))
1697
1697
  .transform(v => v.toISOString()),
1698
1698
  }).transform((v) => {
1699
1699
  return remap$(v, {
@@ -171,11 +171,11 @@ export type CreateDatasourceResponseBody = {
171
171
  /**
172
172
  * The id of the resource
173
173
  */
174
- createdById?: string | undefined;
174
+ createdById?: string | null | undefined;
175
175
  /**
176
176
  * The id of the resource
177
177
  */
178
- updateById?: string | undefined;
178
+ updateById?: string | null | undefined;
179
179
  /**
180
180
  * The unique identifier of the knowledge base
181
181
  */
@@ -751,15 +751,15 @@ export const CreateDatasourceResponseBody$inboundSchema: z.ZodType<
751
751
  z.ZodTypeDef,
752
752
  unknown
753
753
  > = z.object({
754
- _id: z.string().default("01JQYPMWQHD57SBKSH17RQ7ZMQ"),
754
+ _id: z.string().default("01JRT05N46M2364S5Q24V1CN0Q"),
755
755
  display_name: z.string(),
756
756
  description: z.string().optional(),
757
757
  status: CreateDatasourceStatus$inboundSchema,
758
758
  file_id: z.nullable(z.string()).optional(),
759
759
  created: z.string(),
760
760
  updated: z.string(),
761
- created_by_id: z.string().optional(),
762
- update_by_id: z.string().optional(),
761
+ created_by_id: z.nullable(z.string()).optional(),
762
+ update_by_id: z.nullable(z.string()).optional(),
763
763
  knowledge_id: z.string(),
764
764
  chunks_count: z.number(),
765
765
  }).transform((v) => {
@@ -783,8 +783,8 @@ export type CreateDatasourceResponseBody$Outbound = {
783
783
  file_id?: string | null | undefined;
784
784
  created: string;
785
785
  updated: string;
786
- created_by_id?: string | undefined;
787
- update_by_id?: string | undefined;
786
+ created_by_id?: string | null | undefined;
787
+ update_by_id?: string | null | undefined;
788
788
  knowledge_id: string;
789
789
  chunks_count: number;
790
790
  };
@@ -795,15 +795,15 @@ export const CreateDatasourceResponseBody$outboundSchema: z.ZodType<
795
795
  z.ZodTypeDef,
796
796
  CreateDatasourceResponseBody
797
797
  > = z.object({
798
- id: z.string().default("01JQYPMWQHD57SBKSH17RQ7ZMQ"),
798
+ id: z.string().default("01JRT05N46M2364S5Q24V1CN0Q"),
799
799
  displayName: z.string(),
800
800
  description: z.string().optional(),
801
801
  status: CreateDatasourceStatus$outboundSchema,
802
802
  fileId: z.nullable(z.string()).optional(),
803
803
  created: z.string(),
804
804
  updated: z.string(),
805
- createdById: z.string().optional(),
806
- updateById: z.string().optional(),
805
+ createdById: z.nullable(z.string()).optional(),
806
+ updateById: z.nullable(z.string()).optional(),
807
807
  knowledgeId: z.string(),
808
808
  chunksCount: z.number(),
809
809
  }).transform((v) => {