@orq-ai/node 4.14.4 → 4.14.7

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 (138) hide show
  1. package/jsr.json +1 -1
  2. package/lib/config.d.ts +2 -2
  3. package/lib/config.js +2 -2
  4. package/models/components/evaluatorresponsefunction.js +2 -2
  5. package/models/components/evaluatorresponsehttp.js +2 -2
  6. package/models/components/evaluatorresponsejsonschema.js +2 -2
  7. package/models/components/evaluatorresponsellm.js +2 -2
  8. package/models/components/evaluatorresponsepython.js +2 -2
  9. package/models/components/evaluatorresponseragas.js +2 -2
  10. package/models/components/evaluatorresponsetypescript.js +2 -2
  11. package/models/components/reasoningpart.js +1 -1
  12. package/models/operations/createannotationqueue.js +1 -1
  13. package/models/operations/createdataset.js +1 -1
  14. package/models/operations/createdatasetitem.js +5 -5
  15. package/models/operations/createtool.js +4 -4
  16. package/models/operations/getalltools.js +4 -4
  17. package/models/operations/geteval.js +16 -16
  18. package/models/operations/getv2humanevalsets.js +2 -2
  19. package/models/operations/getv2humanevalsetsid.js +2 -2
  20. package/models/operations/listannotationqueues.js +1 -1
  21. package/models/operations/listdatasetdatapoints.js +5 -5
  22. package/models/operations/listdatasets.js +1 -1
  23. package/models/operations/patchv2humanevalsetsid.js +2 -2
  24. package/models/operations/postv2feedbackevaluation.js +4 -4
  25. package/models/operations/postv2humanevalsets.js +2 -2
  26. package/models/operations/retrieveannotationqueue.js +1 -1
  27. package/models/operations/retrievedatapoint.js +5 -5
  28. package/models/operations/retrievedataset.js +1 -1
  29. package/models/operations/retrievetool.js +4 -4
  30. package/models/operations/runagent.js +1 -1
  31. package/models/operations/streamrunagent.js +1 -1
  32. package/models/operations/updateannotationqueue.js +1 -1
  33. package/models/operations/updatedatapoint.js +5 -5
  34. package/models/operations/updatedataset.js +1 -1
  35. package/models/operations/updatetool.js +4 -4
  36. package/package.json +6 -6
  37. package/packages/orq-rc/src/funcs/auditLogsQuery.ts +162 -0
  38. package/packages/orq-rc/src/funcs/knowledgePreviewChunks.ts +179 -0
  39. package/packages/orq-rc/src/funcs/workspacesGet.ts +168 -0
  40. package/packages/orq-rc/src/funcs/workspacesList.ts +170 -0
  41. package/packages/orq-rc/src/funcs/workspacesUpdate.ts +171 -0
  42. package/packages/orq-rc/src/lib/config.ts +3 -3
  43. package/packages/orq-rc/src/models/components/auditlog.ts +122 -0
  44. package/packages/orq-rc/src/models/components/auditlogfilter.ts +51 -0
  45. package/packages/orq-rc/src/models/components/auditlogfilterquery.ts +54 -0
  46. package/packages/orq-rc/src/models/components/auditlogpagination.ts +55 -0
  47. package/packages/orq-rc/src/models/components/auditlogsort.ts +39 -0
  48. package/packages/orq-rc/src/models/components/budgetmatch.ts +1 -7
  49. package/packages/orq-rc/src/models/components/budgetscope.ts +1 -21
  50. package/packages/orq-rc/src/models/components/budgetscopekind.ts +0 -1
  51. package/packages/orq-rc/src/models/components/budgetscoperestresponse.ts +1 -17
  52. package/packages/orq-rc/src/models/components/chunkingconfiguration.ts +432 -4
  53. package/packages/orq-rc/src/models/components/datasourcesservicepreviewchunksrequest.ts +48 -0
  54. package/packages/orq-rc/src/models/components/datasourcesservicepreviewchunksresponse.ts +44 -0
  55. package/packages/orq-rc/src/models/components/getuploadfileurlresponse.ts +5 -0
  56. package/packages/orq-rc/src/models/components/getworkspaceresponse.ts +32 -0
  57. package/packages/orq-rc/src/models/components/index.ts +20 -3
  58. package/packages/orq-rc/src/models/components/listworkspacesresponse.ts +41 -0
  59. package/packages/orq-rc/src/models/components/piiredactionconfig.ts +7 -9
  60. package/packages/orq-rc/src/models/components/previewchunk.ts +38 -0
  61. package/packages/orq-rc/src/models/components/previewchunksmetadata.ts +51 -0
  62. package/packages/orq-rc/src/models/components/queryauditlogsrequest.ts +64 -0
  63. package/packages/orq-rc/src/models/components/queryauditlogsresponse.ts +55 -0
  64. package/packages/orq-rc/src/models/components/reasoningpart.ts +1 -1
  65. package/packages/orq-rc/src/models/components/updateworkspacerequest.ts +81 -0
  66. package/packages/orq-rc/src/models/components/updateworkspaceresponse.ts +32 -0
  67. package/packages/orq-rc/src/models/components/updateworkspacesettingsrequest.ts +0 -9
  68. package/packages/orq-rc/src/models/components/upsertchunk.ts +11 -0
  69. package/packages/orq-rc/src/models/components/value.ts +24 -0
  70. package/packages/orq-rc/src/models/components/workspace.ts +116 -0
  71. package/packages/orq-rc/src/models/components/workspacecapabilities.ts +33 -0
  72. package/packages/orq-rc/src/models/components/workspaceorganization.ts +33 -0
  73. package/packages/orq-rc/src/models/components/workspacesettings.ts +0 -3
  74. package/packages/orq-rc/src/models/components/workspacesettingsfields.ts +135 -0
  75. package/packages/orq-rc/src/models/operations/createdataset.ts +1 -1
  76. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +5 -5
  77. package/packages/orq-rc/src/models/operations/createtool.ts +4 -4
  78. package/packages/orq-rc/src/models/operations/getalltools.ts +4 -4
  79. package/packages/orq-rc/src/models/operations/getv2humanevalsets.ts +2 -2
  80. package/packages/orq-rc/src/models/operations/getv2humanevalsetsid.ts +2 -2
  81. package/packages/orq-rc/src/models/operations/index.ts +4 -0
  82. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +5 -5
  83. package/packages/orq-rc/src/models/operations/listdatasets.ts +1 -1
  84. package/packages/orq-rc/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  85. package/packages/orq-rc/src/models/operations/postv2feedbackevaluation.ts +4 -4
  86. package/packages/orq-rc/src/models/operations/postv2humanevalsets.ts +2 -2
  87. package/packages/orq-rc/src/models/operations/previewdatasourcechunks.ts +47 -0
  88. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +5 -5
  89. package/packages/orq-rc/src/models/operations/retrievedataset.ts +1 -1
  90. package/packages/orq-rc/src/models/operations/retrievetool.ts +4 -4
  91. package/packages/orq-rc/src/models/operations/runagent.ts +1 -1
  92. package/packages/orq-rc/src/models/operations/streamrunagent.ts +1 -1
  93. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +5 -5
  94. package/packages/orq-rc/src/models/operations/updatedataset.ts +1 -1
  95. package/packages/orq-rc/src/models/operations/updatetool.ts +4 -4
  96. package/packages/orq-rc/src/models/operations/workspaceget.ts +31 -0
  97. package/packages/orq-rc/src/models/operations/workspacelist.ts +43 -0
  98. package/packages/orq-rc/src/models/operations/workspaceupdate.ts +40 -0
  99. package/packages/orq-rc/src/sdk/auditlogs.ts +27 -0
  100. package/packages/orq-rc/src/sdk/knowledge.ts +18 -0
  101. package/packages/orq-rc/src/sdk/sdk.ts +12 -0
  102. package/packages/orq-rc/src/sdk/workspaces.ts +64 -0
  103. package/src/lib/config.ts +2 -2
  104. package/src/models/components/evaluatorresponsefunction.ts +2 -2
  105. package/src/models/components/evaluatorresponsehttp.ts +2 -2
  106. package/src/models/components/evaluatorresponsejsonschema.ts +2 -2
  107. package/src/models/components/evaluatorresponsellm.ts +2 -2
  108. package/src/models/components/evaluatorresponsepython.ts +2 -2
  109. package/src/models/components/evaluatorresponseragas.ts +2 -2
  110. package/src/models/components/evaluatorresponsetypescript.ts +2 -2
  111. package/src/models/components/reasoningpart.ts +1 -1
  112. package/src/models/operations/createannotationqueue.ts +1 -1
  113. package/src/models/operations/createdataset.ts +1 -1
  114. package/src/models/operations/createdatasetitem.ts +5 -5
  115. package/src/models/operations/createtool.ts +4 -4
  116. package/src/models/operations/getalltools.ts +4 -4
  117. package/src/models/operations/geteval.ts +16 -16
  118. package/src/models/operations/getv2humanevalsets.ts +2 -2
  119. package/src/models/operations/getv2humanevalsetsid.ts +2 -2
  120. package/src/models/operations/listannotationqueues.ts +1 -1
  121. package/src/models/operations/listdatasetdatapoints.ts +5 -5
  122. package/src/models/operations/listdatasets.ts +1 -1
  123. package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  124. package/src/models/operations/postv2feedbackevaluation.ts +4 -4
  125. package/src/models/operations/postv2humanevalsets.ts +2 -2
  126. package/src/models/operations/retrieveannotationqueue.ts +1 -1
  127. package/src/models/operations/retrievedatapoint.ts +5 -5
  128. package/src/models/operations/retrievedataset.ts +1 -1
  129. package/src/models/operations/retrievetool.ts +4 -4
  130. package/src/models/operations/runagent.ts +1 -1
  131. package/src/models/operations/streamrunagent.ts +1 -1
  132. package/src/models/operations/updateannotationqueue.ts +1 -1
  133. package/src/models/operations/updatedatapoint.ts +5 -5
  134. package/src/models/operations/updatedataset.ts +1 -1
  135. package/src/models/operations/updatetool.ts +4 -4
  136. package/packages/orq-rc/src/models/components/factorybudgetscope.ts +0 -66
  137. package/packages/orq-rc/src/models/components/factorybudgetscoperestresponse.ts +0 -37
  138. package/packages/orq-rc/src/models/components/policyprofileidlist.ts +0 -31
@@ -13,12 +13,6 @@ import {
13
13
  ApiKeyBudgetScope$Outbound,
14
14
  ApiKeyBudgetScope$outboundSchema,
15
15
  } from "./apikeybudgetscope.js";
16
- import {
17
- FactoryBudgetScope,
18
- FactoryBudgetScope$inboundSchema,
19
- FactoryBudgetScope$Outbound,
20
- FactoryBudgetScope$outboundSchema,
21
- } from "./factorybudgetscope.js";
22
16
  import {
23
17
  IdentityBudgetScope,
24
18
  IdentityBudgetScope$inboundSchema,
@@ -51,11 +45,7 @@ import {
51
45
  } from "./workspacebudgetscope.js";
52
46
 
53
47
  /**
54
- * BudgetScope is a closed oneof. Exactly one variant must be set. The
55
- *
56
- * @remarks
57
- * variants are ordered by enforcement precedence (most specific to
58
- * most general) and mirror the BudgetScopeKind filter enum.
48
+ * Closed oneof of workspace, project, identity, api_key, provider, or model. Exactly one variant must be set. Variants are ordered by enforcement precedence (most specific to most general).
59
49
  */
60
50
  export type BudgetScope = {
61
51
  /**
@@ -95,13 +85,6 @@ export type BudgetScope = {
95
85
  * models), rather than an internal identifier.
96
86
  */
97
87
  model?: ModelBudgetScope | undefined;
98
- /**
99
- * Per-factory cap. Matches requests whose api key carries the label
100
- *
101
- * @remarks
102
- * `factory=<factory_id>` (keys minted for agent sessions of that factory).
103
- */
104
- factory?: FactoryBudgetScope | undefined;
105
88
  };
106
89
 
107
90
  /** @internal */
@@ -116,7 +99,6 @@ export const BudgetScope$inboundSchema: z.ZodType<
116
99
  api_key: ApiKeyBudgetScope$inboundSchema.optional(),
117
100
  provider: ProviderBudgetScope$inboundSchema.optional(),
118
101
  model: ModelBudgetScope$inboundSchema.optional(),
119
- factory: FactoryBudgetScope$inboundSchema.optional(),
120
102
  }).transform((v) => {
121
103
  return remap$(v, {
122
104
  "api_key": "apiKey",
@@ -130,7 +112,6 @@ export type BudgetScope$Outbound = {
130
112
  api_key?: ApiKeyBudgetScope$Outbound | undefined;
131
113
  provider?: ProviderBudgetScope$Outbound | undefined;
132
114
  model?: ModelBudgetScope$Outbound | undefined;
133
- factory?: FactoryBudgetScope$Outbound | undefined;
134
115
  };
135
116
 
136
117
  /** @internal */
@@ -145,7 +126,6 @@ export const BudgetScope$outboundSchema: z.ZodType<
145
126
  apiKey: ApiKeyBudgetScope$outboundSchema.optional(),
146
127
  provider: ProviderBudgetScope$outboundSchema.optional(),
147
128
  model: ModelBudgetScope$outboundSchema.optional(),
148
- factory: FactoryBudgetScope$outboundSchema.optional(),
149
129
  }).transform((v) => {
150
130
  return remap$(v, {
151
131
  apiKey: "api_key",
@@ -13,7 +13,6 @@ export const BudgetScopeKind = {
13
13
  BudgetScopeKindApiKey: "BUDGET_SCOPE_KIND_API_KEY",
14
14
  BudgetScopeKindProvider: "BUDGET_SCOPE_KIND_PROVIDER",
15
15
  BudgetScopeKindModel: "BUDGET_SCOPE_KIND_MODEL",
16
- BudgetScopeKindFactory: "BUDGET_SCOPE_KIND_FACTORY",
17
16
  } as const;
18
17
  export type BudgetScopeKind = ClosedEnum<typeof BudgetScopeKind>;
19
18
 
@@ -10,10 +10,6 @@ import {
10
10
  ApiKeyBudgetScopeRestResponse,
11
11
  ApiKeyBudgetScopeRestResponse$inboundSchema,
12
12
  } from "./apikeybudgetscoperestresponse.js";
13
- import {
14
- FactoryBudgetScopeRestResponse,
15
- FactoryBudgetScopeRestResponse$inboundSchema,
16
- } from "./factorybudgetscoperestresponse.js";
17
13
  import {
18
14
  IdentityBudgetScopeRestResponse,
19
15
  IdentityBudgetScopeRestResponse$inboundSchema,
@@ -36,11 +32,7 @@ import {
36
32
  } from "./workspacebudgetscope.js";
37
33
 
38
34
  /**
39
- * BudgetScope is a closed oneof. Exactly one variant must be set. The
40
- *
41
- * @remarks
42
- * variants are ordered by enforcement precedence (most specific to
43
- * most general) and mirror the BudgetScopeKind filter enum.
35
+ * Closed oneof of workspace, project, identity, api_key, provider, or model. Exactly one variant must be set. Variants are ordered by enforcement precedence (most specific to most general).
44
36
  */
45
37
  export type BudgetScopeRestResponse = {
46
38
  /**
@@ -80,13 +72,6 @@ export type BudgetScopeRestResponse = {
80
72
  * models), rather than an internal identifier.
81
73
  */
82
74
  model?: ModelBudgetScopeRestResponse | undefined;
83
- /**
84
- * Per-factory cap. Matches requests whose api key carries the label
85
- *
86
- * @remarks
87
- * `factory=<factory_id>` (keys minted for agent sessions of that factory).
88
- */
89
- factory?: FactoryBudgetScopeRestResponse | undefined;
90
75
  };
91
76
 
92
77
  /** @internal */
@@ -101,7 +86,6 @@ export const BudgetScopeRestResponse$inboundSchema: z.ZodType<
101
86
  apiKey: ApiKeyBudgetScopeRestResponse$inboundSchema.optional(),
102
87
  provider: ProviderBudgetScope$inboundSchema.optional(),
103
88
  model: ModelBudgetScopeRestResponse$inboundSchema.optional(),
104
- factory: FactoryBudgetScopeRestResponse$inboundSchema.optional(),
105
89
  });
106
90
 
107
91
  export function budgetScopeRestResponseFromJSON(
@@ -4,9 +4,195 @@
4
4
 
5
5
  import * as z from "zod/v3";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { ClosedEnum } from "../../types/enums.js";
7
8
 
8
9
  /**
9
- * Provides advanced settings for customizing chunking behavior, enabling fine-grained control to better meet specific data processing needs.
10
+ * Asks a model to choose the boundaries. Slowest and most expensive, best on documents with irregular structure. Makes paid model calls.
11
+ */
12
+ export type Nine = {
13
+ type: "agentic";
14
+ /**
15
+ * Maximum number of tokens per chunk.
16
+ */
17
+ chunkSize?: number | undefined;
18
+ /**
19
+ * Model that chooses the chunk boundaries.
20
+ */
21
+ model?: string | undefined;
22
+ /**
23
+ * Size of candidate splits offered to the model.
24
+ */
25
+ candidateSize?: number | undefined;
26
+ /**
27
+ * Minimum number of characters each chunk must contain.
28
+ */
29
+ minCharactersPerChunk?: number | undefined;
30
+ /**
31
+ * Custom system prompt for the boundary model.
32
+ */
33
+ systemPrompt?: string | undefined;
34
+ };
35
+
36
+ /**
37
+ * Embeds the document before splitting it recursively, so each chunk is embedded with the surrounding document in context. Makes paid embedding calls.
38
+ */
39
+ export type Eight = {
40
+ type: "late";
41
+ /**
42
+ * Maximum number of tokens per chunk.
43
+ */
44
+ chunkSize?: number | undefined;
45
+ /**
46
+ * Separator hierarchy to split on, tried in order. Defaults to paragraph, line, space, then character.
47
+ */
48
+ separators?: Array<string> | undefined;
49
+ /**
50
+ * Minimum number of characters each chunk must contain.
51
+ */
52
+ minCharactersPerChunk?: number | undefined;
53
+ /**
54
+ * Embedding model used to embed the document before it is split.
55
+ */
56
+ embeddingModel?: string | undefined;
57
+ /**
58
+ * Number of dimensions for the embedding output, when the model supports it.
59
+ */
60
+ dimensions?: number | undefined;
61
+ };
62
+
63
+ /**
64
+ * Comparison mode.
65
+ */
66
+ export const ChunkingConfigurationMode = {
67
+ Window: "window",
68
+ Sentence: "sentence",
69
+ } as const;
70
+ /**
71
+ * Comparison mode.
72
+ */
73
+ export type ChunkingConfigurationMode = ClosedEnum<
74
+ typeof ChunkingConfigurationMode
75
+ >;
76
+
77
+ /**
78
+ * Embeds the text and breaks where meaning shifts, so related passages stay together. Makes paid embedding calls.
79
+ */
80
+ export type Seven = {
81
+ type: "semantic";
82
+ /**
83
+ * Maximum number of tokens per chunk.
84
+ */
85
+ chunkSize?: number | undefined;
86
+ /**
87
+ * Embedding model used to detect semantic boundaries.
88
+ */
89
+ embeddingModel?: string | undefined;
90
+ /**
91
+ * Number of dimensions for the embedding output, when the model supports it.
92
+ */
93
+ dimensions?: number | undefined;
94
+ /**
95
+ * Similarity threshold from 0 through 1, or "auto".
96
+ */
97
+ threshold?: string | undefined;
98
+ /**
99
+ * Comparison mode.
100
+ */
101
+ mode?: ChunkingConfigurationMode | undefined;
102
+ /**
103
+ * Window size for similarity comparison.
104
+ */
105
+ similarityWindow?: number | undefined;
106
+ };
107
+
108
+ /**
109
+ * Splits on delimiters or a regular expression without tokenizing. Fastest option; chunk sizes vary with where delimiters fall.
110
+ */
111
+ export type Six = {
112
+ type: "fast";
113
+ /**
114
+ * Target chunk size in bytes.
115
+ */
116
+ targetSize?: number | undefined;
117
+ /**
118
+ * Single-byte characters to split on.
119
+ */
120
+ delimiters?: string | undefined;
121
+ /**
122
+ * Multi-byte split pattern. Takes precedence over delimiters when set.
123
+ */
124
+ pattern?: string | undefined;
125
+ /**
126
+ * Attach the delimiter to the start of the next chunk instead of the end of the previous one.
127
+ */
128
+ prefix?: boolean | undefined;
129
+ /**
130
+ * Split at the start of a run of consecutive delimiters rather than at each one.
131
+ */
132
+ consecutive?: boolean | undefined;
133
+ /**
134
+ * Search forward for a delimiter when searching backward finds none.
135
+ */
136
+ forwardFallback?: boolean | undefined;
137
+ };
138
+
139
+ /**
140
+ * Splits on a separator hierarchy, falling back through paragraph, line, sentence, and word boundaries until chunks fit. Respects document structure.
141
+ */
142
+ export type Five = {
143
+ type: "recursive";
144
+ /**
145
+ * Maximum number of tokens per chunk.
146
+ */
147
+ chunkSize?: number | undefined;
148
+ /**
149
+ * Separator hierarchy to split on, tried in order. Defaults to paragraph, line, space, then character.
150
+ */
151
+ separators?: Array<string> | undefined;
152
+ /**
153
+ * Minimum number of characters each chunk must contain.
154
+ */
155
+ minCharactersPerChunk?: number | undefined;
156
+ };
157
+
158
+ /**
159
+ * Groups whole sentences up to the chunk size, so chunks never cut a sentence in half.
160
+ */
161
+ export type Four = {
162
+ type: "sentence";
163
+ /**
164
+ * Maximum number of tokens per chunk.
165
+ */
166
+ chunkSize?: number | undefined;
167
+ /**
168
+ * Number of tokens to overlap between consecutive chunks. Helps preserve continuity across chunk boundaries.
169
+ */
170
+ chunkOverlap?: number | undefined;
171
+ /**
172
+ * Minimum number of sentences each chunk must contain.
173
+ */
174
+ minSentencesPerChunk?: number | undefined;
175
+ };
176
+
177
+ /**
178
+ * Splits text into fixed-size token windows with optional overlap. Predictable chunk sizes, no regard for sentence or paragraph boundaries.
179
+ */
180
+ export type Three = {
181
+ type: "token";
182
+ /**
183
+ * Maximum number of tokens per chunk.
184
+ */
185
+ chunkSize?: number | undefined;
186
+ /**
187
+ * Number of tokens to overlap between consecutive chunks. Helps preserve continuity across chunk boundaries.
188
+ */
189
+ chunkOverlap?: number | undefined;
190
+ };
191
+
192
+ /**
193
+ * Provides advanced settings for customizing chunking behavior, enabling fine-grained control to better meet specific data processing needs. Deprecated: use one of the named chunking strategies instead.
194
+ *
195
+ * @deprecated class: This will be removed in a future release, please migrate away from it as soon as possible.
10
196
  */
11
197
  export type ChunkingConfiguration2 = {
12
198
  type: "advanced";
@@ -21,7 +207,9 @@ export type ChunkingConfiguration2 = {
21
207
  };
22
208
 
23
209
  /**
24
- * Optimized chunking strategy focusing on speed and avoiding duplication of content chunks.
210
+ * Optimized chunking strategy focusing on speed and avoiding duplication of content chunks. Deprecated: use one of the named chunking strategies instead.
211
+ *
212
+ * @deprecated class: This will be removed in a future release, please migrate away from it as soon as possible.
25
213
  */
26
214
  export type ChunkingConfiguration1 = {
27
215
  type: "default";
@@ -32,7 +220,233 @@ export type ChunkingConfiguration1 = {
32
220
  */
33
221
  export type ChunkingConfiguration =
34
222
  | ChunkingConfiguration1
35
- | ChunkingConfiguration2;
223
+ | ChunkingConfiguration2
224
+ | Three
225
+ | Four
226
+ | Five
227
+ | Six
228
+ | Seven
229
+ | Eight
230
+ | Nine;
231
+
232
+ /** @internal */
233
+ export type Nine$Outbound = {
234
+ type: "agentic";
235
+ chunk_size: number;
236
+ model: string;
237
+ candidate_size: number;
238
+ min_characters_per_chunk: number;
239
+ system_prompt?: string | undefined;
240
+ };
241
+
242
+ /** @internal */
243
+ export const Nine$outboundSchema: z.ZodType<Nine$Outbound, z.ZodTypeDef, Nine> =
244
+ z.object({
245
+ type: z.literal("agentic"),
246
+ chunkSize: z.number().int().default(1024),
247
+ model: z.string().default("openai/gpt-4o"),
248
+ candidateSize: z.number().int().default(128),
249
+ minCharactersPerChunk: z.number().int().default(24),
250
+ systemPrompt: z.string().optional(),
251
+ }).transform((v) => {
252
+ return remap$(v, {
253
+ chunkSize: "chunk_size",
254
+ candidateSize: "candidate_size",
255
+ minCharactersPerChunk: "min_characters_per_chunk",
256
+ systemPrompt: "system_prompt",
257
+ });
258
+ });
259
+
260
+ export function nineToJSON(nine: Nine): string {
261
+ return JSON.stringify(Nine$outboundSchema.parse(nine));
262
+ }
263
+
264
+ /** @internal */
265
+ export type Eight$Outbound = {
266
+ type: "late";
267
+ chunk_size: number;
268
+ separators?: Array<string> | undefined;
269
+ min_characters_per_chunk: number;
270
+ embedding_model?: string | undefined;
271
+ dimensions?: number | undefined;
272
+ };
273
+
274
+ /** @internal */
275
+ export const Eight$outboundSchema: z.ZodType<
276
+ Eight$Outbound,
277
+ z.ZodTypeDef,
278
+ Eight
279
+ > = z.object({
280
+ type: z.literal("late"),
281
+ chunkSize: z.number().int().default(512),
282
+ separators: z.array(z.string()).optional(),
283
+ minCharactersPerChunk: z.number().int().default(24),
284
+ embeddingModel: z.string().optional(),
285
+ dimensions: z.number().int().optional(),
286
+ }).transform((v) => {
287
+ return remap$(v, {
288
+ chunkSize: "chunk_size",
289
+ minCharactersPerChunk: "min_characters_per_chunk",
290
+ embeddingModel: "embedding_model",
291
+ });
292
+ });
293
+
294
+ export function eightToJSON(eight: Eight): string {
295
+ return JSON.stringify(Eight$outboundSchema.parse(eight));
296
+ }
297
+
298
+ /** @internal */
299
+ export const ChunkingConfigurationMode$outboundSchema: z.ZodNativeEnum<
300
+ typeof ChunkingConfigurationMode
301
+ > = z.nativeEnum(ChunkingConfigurationMode);
302
+
303
+ /** @internal */
304
+ export type Seven$Outbound = {
305
+ type: "semantic";
306
+ chunk_size: number;
307
+ embedding_model?: string | undefined;
308
+ dimensions?: number | undefined;
309
+ threshold: string;
310
+ mode: string;
311
+ similarity_window: number;
312
+ };
313
+
314
+ /** @internal */
315
+ export const Seven$outboundSchema: z.ZodType<
316
+ Seven$Outbound,
317
+ z.ZodTypeDef,
318
+ Seven
319
+ > = z.object({
320
+ type: z.literal("semantic"),
321
+ chunkSize: z.number().int().default(512),
322
+ embeddingModel: z.string().optional(),
323
+ dimensions: z.number().int().optional(),
324
+ threshold: z.string().default("auto"),
325
+ mode: ChunkingConfigurationMode$outboundSchema.default("window"),
326
+ similarityWindow: z.number().int().default(1),
327
+ }).transform((v) => {
328
+ return remap$(v, {
329
+ chunkSize: "chunk_size",
330
+ embeddingModel: "embedding_model",
331
+ similarityWindow: "similarity_window",
332
+ });
333
+ });
334
+
335
+ export function sevenToJSON(seven: Seven): string {
336
+ return JSON.stringify(Seven$outboundSchema.parse(seven));
337
+ }
338
+
339
+ /** @internal */
340
+ export type Six$Outbound = {
341
+ type: "fast";
342
+ target_size: number;
343
+ delimiters: string;
344
+ pattern?: string | undefined;
345
+ prefix: boolean;
346
+ consecutive: boolean;
347
+ forward_fallback: boolean;
348
+ };
349
+
350
+ /** @internal */
351
+ export const Six$outboundSchema: z.ZodType<Six$Outbound, z.ZodTypeDef, Six> = z
352
+ .object({
353
+ type: z.literal("fast"),
354
+ targetSize: z.number().int().default(4096),
355
+ delimiters: z.string().default("\n.?"),
356
+ pattern: z.string().optional(),
357
+ prefix: z.boolean().default(false),
358
+ consecutive: z.boolean().default(false),
359
+ forwardFallback: z.boolean().default(false),
360
+ }).transform((v) => {
361
+ return remap$(v, {
362
+ targetSize: "target_size",
363
+ forwardFallback: "forward_fallback",
364
+ });
365
+ });
366
+
367
+ export function sixToJSON(six: Six): string {
368
+ return JSON.stringify(Six$outboundSchema.parse(six));
369
+ }
370
+
371
+ /** @internal */
372
+ export type Five$Outbound = {
373
+ type: "recursive";
374
+ chunk_size: number;
375
+ separators?: Array<string> | undefined;
376
+ min_characters_per_chunk: number;
377
+ };
378
+
379
+ /** @internal */
380
+ export const Five$outboundSchema: z.ZodType<Five$Outbound, z.ZodTypeDef, Five> =
381
+ z.object({
382
+ type: z.literal("recursive"),
383
+ chunkSize: z.number().int().default(512),
384
+ separators: z.array(z.string()).optional(),
385
+ minCharactersPerChunk: z.number().int().default(24),
386
+ }).transform((v) => {
387
+ return remap$(v, {
388
+ chunkSize: "chunk_size",
389
+ minCharactersPerChunk: "min_characters_per_chunk",
390
+ });
391
+ });
392
+
393
+ export function fiveToJSON(five: Five): string {
394
+ return JSON.stringify(Five$outboundSchema.parse(five));
395
+ }
396
+
397
+ /** @internal */
398
+ export type Four$Outbound = {
399
+ type: "sentence";
400
+ chunk_size: number;
401
+ chunk_overlap: number;
402
+ min_sentences_per_chunk: number;
403
+ };
404
+
405
+ /** @internal */
406
+ export const Four$outboundSchema: z.ZodType<Four$Outbound, z.ZodTypeDef, Four> =
407
+ z.object({
408
+ type: z.literal("sentence"),
409
+ chunkSize: z.number().int().default(512),
410
+ chunkOverlap: z.number().int().default(0),
411
+ minSentencesPerChunk: z.number().int().default(1),
412
+ }).transform((v) => {
413
+ return remap$(v, {
414
+ chunkSize: "chunk_size",
415
+ chunkOverlap: "chunk_overlap",
416
+ minSentencesPerChunk: "min_sentences_per_chunk",
417
+ });
418
+ });
419
+
420
+ export function fourToJSON(four: Four): string {
421
+ return JSON.stringify(Four$outboundSchema.parse(four));
422
+ }
423
+
424
+ /** @internal */
425
+ export type Three$Outbound = {
426
+ type: "token";
427
+ chunk_size: number;
428
+ chunk_overlap: number;
429
+ };
430
+
431
+ /** @internal */
432
+ export const Three$outboundSchema: z.ZodType<
433
+ Three$Outbound,
434
+ z.ZodTypeDef,
435
+ Three
436
+ > = z.object({
437
+ type: z.literal("token"),
438
+ chunkSize: z.number().int().default(512),
439
+ chunkOverlap: z.number().int().default(0),
440
+ }).transform((v) => {
441
+ return remap$(v, {
442
+ chunkSize: "chunk_size",
443
+ chunkOverlap: "chunk_overlap",
444
+ });
445
+ });
446
+
447
+ export function threeToJSON(three: Three): string {
448
+ return JSON.stringify(Three$outboundSchema.parse(three));
449
+ }
36
450
 
37
451
  /** @internal */
38
452
  export type ChunkingConfiguration2$Outbound = {
@@ -90,7 +504,14 @@ export function chunkingConfiguration1ToJSON(
90
504
  /** @internal */
91
505
  export type ChunkingConfiguration$Outbound =
92
506
  | ChunkingConfiguration1$Outbound
93
- | ChunkingConfiguration2$Outbound;
507
+ | ChunkingConfiguration2$Outbound
508
+ | Three$Outbound
509
+ | Four$Outbound
510
+ | Five$Outbound
511
+ | Six$Outbound
512
+ | Seven$Outbound
513
+ | Eight$Outbound
514
+ | Nine$Outbound;
94
515
 
95
516
  /** @internal */
96
517
  export const ChunkingConfiguration$outboundSchema: z.ZodType<
@@ -100,6 +521,13 @@ export const ChunkingConfiguration$outboundSchema: z.ZodType<
100
521
  > = z.union([
101
522
  z.lazy(() => ChunkingConfiguration1$outboundSchema),
102
523
  z.lazy(() => ChunkingConfiguration2$outboundSchema),
524
+ z.lazy(() => Three$outboundSchema),
525
+ z.lazy(() => Four$outboundSchema),
526
+ z.lazy(() => Five$outboundSchema),
527
+ z.lazy(() => Six$outboundSchema),
528
+ z.lazy(() => Seven$outboundSchema),
529
+ z.lazy(() => Eight$outboundSchema),
530
+ z.lazy(() => Nine$outboundSchema),
103
531
  ]);
104
532
 
105
533
  export function chunkingConfigurationToJSON(
@@ -0,0 +1,48 @@
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 {
8
+ DatasourceChunkingOptions,
9
+ DatasourceChunkingOptions$Outbound,
10
+ DatasourceChunkingOptions$outboundSchema,
11
+ } from "./datasourcechunkingoptions.js";
12
+
13
+ export type DatasourcesServicePreviewChunksRequest = {
14
+ fileId: string;
15
+ chunkingOptions?: DatasourceChunkingOptions | undefined;
16
+ };
17
+
18
+ /** @internal */
19
+ export type DatasourcesServicePreviewChunksRequest$Outbound = {
20
+ file_id: string;
21
+ chunking_options?: DatasourceChunkingOptions$Outbound | undefined;
22
+ };
23
+
24
+ /** @internal */
25
+ export const DatasourcesServicePreviewChunksRequest$outboundSchema: z.ZodType<
26
+ DatasourcesServicePreviewChunksRequest$Outbound,
27
+ z.ZodTypeDef,
28
+ DatasourcesServicePreviewChunksRequest
29
+ > = z.object({
30
+ fileId: z.string(),
31
+ chunkingOptions: DatasourceChunkingOptions$outboundSchema.optional(),
32
+ }).transform((v) => {
33
+ return remap$(v, {
34
+ fileId: "file_id",
35
+ chunkingOptions: "chunking_options",
36
+ });
37
+ });
38
+
39
+ export function datasourcesServicePreviewChunksRequestToJSON(
40
+ datasourcesServicePreviewChunksRequest:
41
+ DatasourcesServicePreviewChunksRequest,
42
+ ): string {
43
+ return JSON.stringify(
44
+ DatasourcesServicePreviewChunksRequest$outboundSchema.parse(
45
+ datasourcesServicePreviewChunksRequest,
46
+ ),
47
+ );
48
+ }
@@ -0,0 +1,44 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import { PreviewChunk, PreviewChunk$inboundSchema } from "./previewchunk.js";
10
+ import {
11
+ PreviewChunksMetadata,
12
+ PreviewChunksMetadata$inboundSchema,
13
+ } from "./previewchunksmetadata.js";
14
+
15
+ export type DatasourcesServicePreviewChunksResponse = {
16
+ chunks: Array<PreviewChunk>;
17
+ metadata: PreviewChunksMetadata;
18
+ };
19
+
20
+ /** @internal */
21
+ export const DatasourcesServicePreviewChunksResponse$inboundSchema: z.ZodType<
22
+ DatasourcesServicePreviewChunksResponse,
23
+ z.ZodTypeDef,
24
+ unknown
25
+ > = z.object({
26
+ chunks: z.array(PreviewChunk$inboundSchema),
27
+ metadata: PreviewChunksMetadata$inboundSchema,
28
+ });
29
+
30
+ export function datasourcesServicePreviewChunksResponseFromJSON(
31
+ jsonString: string,
32
+ ): SafeParseResult<
33
+ DatasourcesServicePreviewChunksResponse,
34
+ SDKValidationError
35
+ > {
36
+ return safeParse(
37
+ jsonString,
38
+ (x) =>
39
+ DatasourcesServicePreviewChunksResponse$inboundSchema.parse(
40
+ JSON.parse(x),
41
+ ),
42
+ `Failed to parse 'DatasourcesServicePreviewChunksResponse' from JSON`,
43
+ );
44
+ }
@@ -14,6 +14,10 @@ import {
14
14
  export type GetUploadFileUrlResponse = {
15
15
  objectName: string;
16
16
  postPolicy: UploadPostPolicy;
17
+ /**
18
+ * Identifier of the file record registered for this upload
19
+ */
20
+ fileId: string;
17
21
  };
18
22
 
19
23
  /** @internal */
@@ -24,6 +28,7 @@ export const GetUploadFileUrlResponse$inboundSchema: z.ZodType<
24
28
  > = z.object({
25
29
  objectName: z.string(),
26
30
  postPolicy: UploadPostPolicy$inboundSchema,
31
+ fileId: z.string(),
27
32
  });
28
33
 
29
34
  export function getUploadFileUrlResponseFromJSON(