@stack-spot/portal-network 0.184.0-beta.1 → 0.184.0

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 (151) hide show
  1. package/CHANGELOG.md +2412 -2431
  2. package/dist/api/account.js +1 -1
  3. package/dist/api/agent-tools.js +1 -1
  4. package/dist/api/agent.js +1 -1
  5. package/dist/api/ai.js +1 -1
  6. package/dist/api/apiManagement.js +1 -1
  7. package/dist/api/apiRuntime.js +1 -1
  8. package/dist/api/cloudAccount.js +1 -1
  9. package/dist/api/cloudPlatform.js +1 -1
  10. package/dist/api/cloudPlatformHorizon.js +1 -1
  11. package/dist/api/cloudRuntimes.js +1 -1
  12. package/dist/api/cloudServices.js +1 -1
  13. package/dist/api/codeShift.d.ts +4 -76
  14. package/dist/api/codeShift.d.ts.map +1 -1
  15. package/dist/api/codeShift.js +1 -14
  16. package/dist/api/codeShift.js.map +1 -1
  17. package/dist/api/content.js +1 -1
  18. package/dist/api/dataIntegration.js +1 -1
  19. package/dist/api/discover.js +1 -1
  20. package/dist/api/genAiInference.js +1 -1
  21. package/dist/api/insights.js +1 -1
  22. package/dist/api/notification.js +1 -1
  23. package/dist/api/secrets.js +1 -1
  24. package/dist/api/serviceCatalog.js +1 -1
  25. package/dist/api/workspace-ai.js +1 -1
  26. package/dist/api/workspace.js +1 -1
  27. package/dist/api/workspaceManager.d.ts +16 -10
  28. package/dist/api/workspaceManager.d.ts.map +1 -1
  29. package/dist/api/workspaceManager.js +11 -1
  30. package/dist/api/workspaceManager.js.map +1 -1
  31. package/dist/api/workspaceSearchEngine.js +1 -1
  32. package/dist/client/ai.d.ts.map +1 -1
  33. package/dist/client/ai.js +14 -84
  34. package/dist/client/ai.js.map +1 -1
  35. package/dist/client/code-shift.d.ts +0 -30
  36. package/dist/client/code-shift.d.ts.map +1 -1
  37. package/dist/client/code-shift.js +1 -37
  38. package/dist/client/code-shift.js.map +1 -1
  39. package/dist/client/types.d.ts +6 -26
  40. package/dist/client/types.d.ts.map +1 -1
  41. package/dist/client/workspace-manager.d.ts +6 -0
  42. package/dist/client/workspace-manager.d.ts.map +1 -1
  43. package/dist/client/workspace-manager.js +10 -1
  44. package/dist/client/workspace-manager.js.map +1 -1
  45. package/package.json +1 -1
  46. package/readme.md +1 -1
  47. package/scripts/generate-apis.ts +134 -134
  48. package/src/api/account.ts +8367 -8368
  49. package/src/api/agent-tools.ts +2169 -2172
  50. package/src/api/agent.ts +1083 -1085
  51. package/src/api/ai.ts +3388 -3388
  52. package/src/api/apiManagement.ts +570 -570
  53. package/src/api/apiRuntime.ts +2103 -2103
  54. package/src/api/cloudAccount.ts +1239 -1239
  55. package/src/api/cloudPlatform.ts +927 -927
  56. package/src/api/cloudPlatformHorizon.ts +2655 -2655
  57. package/src/api/cloudRuntimes.ts +2043 -2043
  58. package/src/api/cloudServices.ts +1445 -1445
  59. package/src/api/codeShift.ts +3481 -3580
  60. package/src/api/content.ts +9785 -9785
  61. package/src/api/dataIntegration.ts +1657 -1657
  62. package/src/api/discover.ts +435 -435
  63. package/src/api/eventBus.ts +171 -171
  64. package/src/api/genAiInference.ts +603 -603
  65. package/src/api/insights.ts +310 -310
  66. package/src/api/notification.ts +334 -336
  67. package/src/api/secrets.ts +342 -342
  68. package/src/api/serviceCatalog.ts +2908 -2908
  69. package/src/api/workflows.ts +1669 -1669
  70. package/src/api/workspace-ai.ts +677 -677
  71. package/src/api/workspace.ts +5889 -5889
  72. package/src/api/workspaceManager.ts +2951 -2936
  73. package/src/api/workspaceSearchEngine.ts +153 -153
  74. package/src/api-addresses.ts +120 -120
  75. package/src/apis-itau.json +225 -225
  76. package/src/apis.json +225 -225
  77. package/src/client/account.ts +902 -902
  78. package/src/client/agent-tools.ts +210 -210
  79. package/src/client/agent.ts +81 -81
  80. package/src/client/ai.ts +395 -469
  81. package/src/client/api-management.ts +40 -40
  82. package/src/client/cloud-account.ts +70 -70
  83. package/src/client/cloud-platform-horizon.ts +113 -113
  84. package/src/client/cloud-platform.ts +163 -163
  85. package/src/client/cloud-runtimes.ts +129 -129
  86. package/src/client/cloud-services.ts +94 -94
  87. package/src/client/code-shift.ts +349 -371
  88. package/src/client/content.ts +538 -538
  89. package/src/client/data-integration.ts +191 -191
  90. package/src/client/discover.ts +89 -89
  91. package/src/client/event-bus.ts +84 -84
  92. package/src/client/gen-ai-inference.ts +65 -65
  93. package/src/client/insights.ts +28 -28
  94. package/src/client/notification.ts +32 -32
  95. package/src/client/runtime-manager.ts +76 -76
  96. package/src/client/secrets.ts +60 -60
  97. package/src/client/types.ts +377 -398
  98. package/src/client/workflow.ts +83 -83
  99. package/src/client/workspace-ai.ts +191 -191
  100. package/src/client/workspace-manager.ts +564 -560
  101. package/src/client/workspace-search.ts +39 -39
  102. package/src/client/workspace.ts +480 -480
  103. package/src/error/DefaultAPIError.ts +151 -151
  104. package/src/error/FileUploadError.ts +18 -18
  105. package/src/error/IgnoredErrorCodes.ts +3 -3
  106. package/src/error/StackspotAPIError.ts +101 -101
  107. package/src/error/StreamCanceledError.ts +10 -10
  108. package/src/error/StreamError.ts +7 -7
  109. package/src/error/StreamJsonError.ts +10 -10
  110. package/src/error/dictionary/account.ts +58 -58
  111. package/src/error/dictionary/action-details.ts +20 -20
  112. package/src/error/dictionary/action.ts +211 -211
  113. package/src/error/dictionary/agent-tools.ts +75 -75
  114. package/src/error/dictionary/ai-inference.ts +28 -28
  115. package/src/error/dictionary/base.ts +22 -22
  116. package/src/error/dictionary/cloud-platform.ts +82 -82
  117. package/src/error/dictionary/cnt-fields.ts +14 -14
  118. package/src/error/dictionary/cnt.ts +103 -103
  119. package/src/error/dictionary/code-shift.ts +12 -12
  120. package/src/error/dictionary/rte.ts +24 -24
  121. package/src/error/dictionary/rtm.ts +10 -10
  122. package/src/error/dictionary/secrets.ts +14 -14
  123. package/src/error/dictionary/workspace-ai.ts +10 -10
  124. package/src/error/dictionary/workspace-details.ts +15 -15
  125. package/src/error/dictionary/workspace-fields.ts +10 -10
  126. package/src/error/dictionary/workspace.ts +209 -209
  127. package/src/error/types.ts +21 -21
  128. package/src/index.ts +43 -43
  129. package/src/network/AutoInfiniteQuery.ts +115 -115
  130. package/src/network/AutoMutation.ts +27 -27
  131. package/src/network/AutoOperation.ts +73 -73
  132. package/src/network/AutoQuery.ts +75 -75
  133. package/src/network/ManualInfiniteQuery.ts +95 -95
  134. package/src/network/ManualMutation.ts +40 -40
  135. package/src/network/ManualOperation.ts +52 -52
  136. package/src/network/ManualQuery.ts +82 -82
  137. package/src/network/NetworkClient.ts +167 -167
  138. package/src/network/ReactQueryNetworkClient.ts +312 -312
  139. package/src/network/react-query-client.ts +14 -14
  140. package/src/network/types.ts +294 -294
  141. package/src/types.ts +1 -1
  142. package/src/utils/StreamedArray.tsx +146 -146
  143. package/src/utils/StreamedJson.tsx +166 -166
  144. package/src/utils/remove-authorization-param.ts +6 -6
  145. package/src/utils/string.ts +19 -19
  146. package/src/utils/use-extended-list.ts +80 -80
  147. package/src/utils/use-streamed-array.ts +17 -17
  148. package/tsconfig.build.json +4 -4
  149. package/tsconfig.json +10 -10
  150. package/logs/simple-failure/01JBER7AWKACEC3Y1NF7M6PHFF/job_id_1.log +0 -3
  151. package/logs/simple-suspend/01JBEMQG94ADPT99MSZ7EJKGXZ/job_id_1.log +0 -5
@@ -1,603 +1,603 @@
1
- /**
2
- * FastAPI
3
- * 0.1.0
4
- * DO NOT MODIFY - This file has been generated using oazapfts.
5
- * See https://www.npmjs.com/package/oazapfts
6
- */
7
- import * as Oazapfts from "@oazapfts/runtime";
8
- import * as QS from "@oazapfts/runtime/query";
9
- export const defaults: Oazapfts.Defaults<Oazapfts.CustomHeaders> = {
10
- headers: {},
11
- baseUrl: "/",
12
- };
13
- const oazapfts = Oazapfts.runtime(defaults);
14
- export const servers = {};
15
- export type LlmRoles = "system" | "user" | "assistant" | "function" | "tool";
16
- export type SendMessage = {
17
- role: LlmRoles;
18
- content: string;
19
- };
20
- export type SendConversation = {
21
- model_name: string;
22
- messages: SendMessage[];
23
- temperature?: number | null;
24
- json_schema?: {
25
- [key: string]: any;
26
- } | null;
27
- is_azure?: boolean | null;
28
- max_tokens?: number | null;
29
- };
30
- export type MessageRepresentation = {
31
- /** The role of the sender of the message (e.g., 'user', 'assistant', 'system', 'tool'). */
32
- role: string;
33
- /** The content of the message. */
34
- content: string;
35
- /** The name of the sender, if applicable. */
36
- name?: string | null;
37
- /** A dictionary representing a function call, if applicable. */
38
- function_call?: {
39
- [key: string]: any;
40
- } | null;
41
- };
42
- export type ChoiceRepresentation = {
43
- message: MessageRepresentation;
44
- finish_reason: string;
45
- index: number;
46
- };
47
- export type UsageRepresentation = {
48
- prompt_tokens: number;
49
- completion_tokens: number;
50
- total_tokens: number;
51
- };
52
- export type MetricsRepresentation = {
53
- latency_ms: number;
54
- };
55
- export type ConversationRepresentation = {
56
- id: string;
57
- choices: ChoiceRepresentation[];
58
- created: string;
59
- model: string;
60
- "object"?: string;
61
- usage: UsageRepresentation;
62
- metrics?: MetricsRepresentation | null;
63
- };
64
- export type ValidationError = {
65
- loc: (string | number)[];
66
- msg: string;
67
- "type": string;
68
- };
69
- export type HttpValidationError = {
70
- detail?: ValidationError[];
71
- };
72
- export type ResourceName = "agents" | "deep_ks" | "autocomplete";
73
- export type LlmModelResourceRequest = {
74
- name: ResourceName;
75
- is_default?: boolean;
76
- };
77
- export type CreateLlmModelRequest = {
78
- display_name: string;
79
- provider_name: string;
80
- model_name: string;
81
- connection_params: {
82
- [key: string]: any;
83
- };
84
- resources: LlmModelResourceRequest[];
85
- };
86
- export type LlmProviderResponse = {
87
- name: string;
88
- provider_type: string;
89
- configuration_params?: {
90
- [key: string]: any;
91
- } | null;
92
- accepts_self_hosted?: boolean | null;
93
- };
94
- export type LlmModelConfigurationResponse = {
95
- provider: LlmProviderResponse;
96
- model_name: string;
97
- connection_params: {
98
- [key: string]: any;
99
- } | null;
100
- usage_params: {
101
- [key: string]: any;
102
- } | null;
103
- };
104
- export type LlmModelResourcesResponse = {
105
- id: string;
106
- name: string;
107
- is_default: boolean;
108
- };
109
- export type LlmModelsResponse = {
110
- id: string;
111
- active: boolean;
112
- display_name: string;
113
- self_hosted: boolean;
114
- model_configuration: LlmModelConfigurationResponse;
115
- resources: LlmModelResourcesResponse[];
116
- created_at: string;
117
- updated_at: string;
118
- updated_by: string;
119
- };
120
- export type OrderBy = "default" | "display_name" | "model_name" | "type" | "status";
121
- export type OrderDir = "asc" | "desc" | "stackspot_hosted" | "self_hosted" | "active" | "inactive";
122
- export type PaginatedResponseLlmModelsResponse = {
123
- total_pages: number;
124
- items: LlmModelsResponse[];
125
- };
126
- export type ToggleModelStatusRequest = {
127
- active: boolean;
128
- };
129
- export type UpdateLlmModelRequest = {
130
- display_name: string;
131
- model_name: string;
132
- connection_params: {
133
- [key: string]: any;
134
- };
135
- resources: LlmModelResourceRequest[];
136
- };
137
- export type UpdateLlmModelResourceRequest = {
138
- name: string;
139
- is_default?: boolean;
140
- };
141
- export type LlmSimpleProviderResponse = {
142
- name: string;
143
- provider_type: string;
144
- configuration_params: {
145
- [key: string]: any;
146
- };
147
- accepts_self_hosted: boolean;
148
- model_names: string[];
149
- };
150
- export type TextParam = {
151
- text: string;
152
- "type"?: "text";
153
- };
154
- export type UrlParam = {
155
- url: string;
156
- };
157
- export type ImageParam = {
158
- image_url: UrlParam;
159
- "type"?: "image_url";
160
- };
161
- export type FunctionCall = {
162
- /** The name of the function to call */
163
- name: string;
164
- /** A JSON string representing the function arguments */
165
- arguments: string;
166
- };
167
- export type Message = {
168
- /** The role of the message (system, user, assistant, or function) */
169
- role: LlmRoles;
170
- /** The content of the message, can be a string or a list of content blocks */
171
- content?: string | (TextParam | ImageParam)[];
172
- /** The name of the sender (optional) */
173
- name?: string | null;
174
- /** Details of a function call (optional) */
175
- function_call?: FunctionCall | null;
176
- /** Details of a function call (optional) */
177
- tool_calls?: {
178
- [key: string]: any;
179
- }[] | null;
180
- /** Tool id */
181
- tool_call_id?: string | null;
182
- };
183
- export type FunctionParameter = {
184
- /** The type of the parameter */
185
- "type": string;
186
- /** A description of the parameter (optional) */
187
- description?: string | null;
188
- /** A list of possible values for the parameter (optional) */
189
- "enum"?: string[] | null;
190
- /** A dictionary of properties for the parameter (optional) */
191
- properties?: {
192
- [key: string]: any;
193
- } | null;
194
- /** A list of required parameters (optional) */
195
- required?: string[] | null;
196
- /** Allow arbitrary data of specific typed */
197
- additionalProperties?: boolean;
198
- };
199
- export type Function = {
200
- /** The name of the function */
201
- name: string;
202
- /** A description of what the function does */
203
- description: string;
204
- /** The parameters required by the function */
205
- parameters: FunctionParameter;
206
- /** Strict specific schema response. Only `strict` function tools can be auto-parsed */
207
- strict: boolean;
208
- };
209
- export type ChatCompletion = {
210
- /** The model to be used for the chat completion */
211
- model: string;
212
- /** A list of messages that make up the conversation */
213
- messages: Message[];
214
- /** Sampling temperature; higher values make output more random */
215
- temperature?: number;
216
- /** Nucleus sampling probability; controls diversity */
217
- top_p?: number;
218
- /** Number of completions to generate */
219
- n?: number;
220
- /** Whether to stream the response */
221
- stream?: boolean;
222
- /** Stop sequences that will halt the generation */
223
- stop?: string | string[] | null;
224
- /** Maximum number of tokens to generate */
225
- max_tokens?: number | null;
226
- /** Penalty based on new tokens' presence in the text */
227
- presence_penalty?: number;
228
- /** Penalty based on new tokens' frequency in the text */
229
- frequency_penalty?: number;
230
- /** A dictionary to adjust the likelihood of specific tokens */
231
- logit_bias?: {
232
- [key: string]: number;
233
- } | null;
234
- /** An identifier for the user */
235
- user?: string | null;
236
- /** A list of functions that can be called during the chat */
237
- functions?: Function[] | null;
238
- /** Specifies function call behavior or parameters (for example, 'auto' or {'name': 'function_name'}) */
239
- function_call?: string | {
240
- [key: string]: string;
241
- } | null;
242
- };
243
- export type ChatRequest = {
244
- streaming: boolean;
245
- user_prompt: string;
246
- stackspot_knowledge?: boolean;
247
- return_ks_in_response?: boolean;
248
- upload_ids?: string[];
249
- };
250
- /**
251
- * Health Check
252
- */
253
- export function healthCheckHealthzGet(opts?: Oazapfts.RequestOpts) {
254
- return oazapfts.ok(oazapfts.fetchJson<{
255
- status: 200;
256
- data: any;
257
- } | {
258
- status: 404;
259
- }>("/healthz", {
260
- ...opts
261
- }));
262
- }
263
- /**
264
- * Readiness Check
265
- */
266
- export function readinessCheckReadyzGet(opts?: Oazapfts.RequestOpts) {
267
- return oazapfts.ok(oazapfts.fetchJson<{
268
- status: 200;
269
- data: any;
270
- } | {
271
- status: 404;
272
- }>("/readyz", {
273
- ...opts
274
- }));
275
- }
276
- /**
277
- * Handle conversation requests
278
- */
279
- export function converseV0ConversationPost({ xAccountId, authorization, sendConversation }: {
280
- xAccountId?: string | null;
281
- authorization: string;
282
- sendConversation: SendConversation;
283
- }, opts?: Oazapfts.RequestOpts) {
284
- return oazapfts.ok(oazapfts.fetchJson<{
285
- status: 200;
286
- data: ConversationRepresentation;
287
- } | {
288
- status: 404;
289
- } | {
290
- status: 422;
291
- data: HttpValidationError;
292
- }>("/v0/conversation", oazapfts.json({
293
- ...opts,
294
- method: "POST",
295
- body: sendConversation,
296
- headers: oazapfts.mergeHeaders(opts?.headers, {
297
- "x-account-id": xAccountId,
298
- authorization
299
- })
300
- })));
301
- }
302
- /**
303
- * Add Self Hosted Model
304
- */
305
- export function addSelfHostedModelV1LlmModelsPost({ xAccountId, authorization, createLlmModelRequest }: {
306
- xAccountId?: string | null;
307
- authorization: string;
308
- createLlmModelRequest: CreateLlmModelRequest;
309
- }, opts?: Oazapfts.RequestOpts) {
310
- return oazapfts.ok(oazapfts.fetchJson<{
311
- status: 200;
312
- data: LlmModelsResponse;
313
- } | {
314
- status: 404;
315
- } | {
316
- status: 422;
317
- data: HttpValidationError;
318
- }>("/v1/llm/models", oazapfts.json({
319
- ...opts,
320
- method: "POST",
321
- body: createLlmModelRequest,
322
- headers: oazapfts.mergeHeaders(opts?.headers, {
323
- "x-account-id": xAccountId,
324
- authorization
325
- })
326
- })));
327
- }
328
- /**
329
- * List Models
330
- */
331
- export function listModelsV1LlmModelsGet({ active, resource, $default, displayName, selfHosted, orderBy, orderDir, page, pageSize, xAccountId, authorization }: {
332
- active?: boolean | null;
333
- resource?: string | null;
334
- $default?: boolean | null;
335
- displayName?: string | null;
336
- selfHosted?: boolean | null;
337
- orderBy?: OrderBy;
338
- orderDir?: OrderDir;
339
- page?: number;
340
- pageSize?: number;
341
- xAccountId?: string | null;
342
- authorization: string;
343
- }, opts?: Oazapfts.RequestOpts) {
344
- return oazapfts.ok(oazapfts.fetchJson<{
345
- status: 200;
346
- data: PaginatedResponseLlmModelsResponse;
347
- } | {
348
- status: 404;
349
- } | {
350
- status: 422;
351
- data: HttpValidationError;
352
- }>(`/v1/llm/models${QS.query(QS.explode({
353
- active,
354
- resource,
355
- "default": $default,
356
- display_name: displayName,
357
- self_hosted: selfHosted,
358
- order_by: orderBy,
359
- order_dir: orderDir,
360
- page,
361
- page_size: pageSize
362
- }))}`, {
363
- ...opts,
364
- headers: oazapfts.mergeHeaders(opts?.headers, {
365
- "x-account-id": xAccountId,
366
- authorization
367
- })
368
- }));
369
- }
370
- /**
371
- * Get Model
372
- */
373
- export function getModelV1LlmModelsModelIdGet({ modelId, xAccountId, authorization }: {
374
- modelId: string;
375
- xAccountId?: string | null;
376
- authorization: string;
377
- }, opts?: Oazapfts.RequestOpts) {
378
- return oazapfts.ok(oazapfts.fetchJson<{
379
- status: 200;
380
- data: LlmModelsResponse;
381
- } | {
382
- status: 404;
383
- } | {
384
- status: 422;
385
- data: HttpValidationError;
386
- }>(`/v1/llm/models/${encodeURIComponent(modelId)}`, {
387
- ...opts,
388
- headers: oazapfts.mergeHeaders(opts?.headers, {
389
- "x-account-id": xAccountId,
390
- authorization
391
- })
392
- }));
393
- }
394
- /**
395
- * Toggle Model Status
396
- */
397
- export function toggleModelStatusV1LlmModelsModelIdPatch({ modelId, xAccountId, authorization, toggleModelStatusRequest }: {
398
- modelId: string;
399
- xAccountId?: string | null;
400
- authorization: string;
401
- toggleModelStatusRequest: ToggleModelStatusRequest;
402
- }, opts?: Oazapfts.RequestOpts) {
403
- return oazapfts.ok(oazapfts.fetchJson<{
404
- status: 200;
405
- data: LlmModelsResponse;
406
- } | {
407
- status: 404;
408
- } | {
409
- status: 422;
410
- data: HttpValidationError;
411
- }>(`/v1/llm/models/${encodeURIComponent(modelId)}`, oazapfts.json({
412
- ...opts,
413
- method: "PATCH",
414
- body: toggleModelStatusRequest,
415
- headers: oazapfts.mergeHeaders(opts?.headers, {
416
- "x-account-id": xAccountId,
417
- authorization
418
- })
419
- })));
420
- }
421
- /**
422
- * Update
423
- */
424
- export function updateV1LlmModelsModelIdPut({ modelId, xAccountId, authorization, updateLlmModelRequest }: {
425
- modelId: string;
426
- xAccountId?: string | null;
427
- authorization: string;
428
- updateLlmModelRequest: UpdateLlmModelRequest;
429
- }, opts?: Oazapfts.RequestOpts) {
430
- return oazapfts.ok(oazapfts.fetchJson<{
431
- status: 200;
432
- data: LlmModelsResponse;
433
- } | {
434
- status: 404;
435
- } | {
436
- status: 422;
437
- data: HttpValidationError;
438
- }>(`/v1/llm/models/${encodeURIComponent(modelId)}`, oazapfts.json({
439
- ...opts,
440
- method: "PUT",
441
- body: updateLlmModelRequest,
442
- headers: oazapfts.mergeHeaders(opts?.headers, {
443
- "x-account-id": xAccountId,
444
- authorization
445
- })
446
- })));
447
- }
448
- /**
449
- * Delete
450
- */
451
- export function deleteV1LlmModelsModelIdDelete({ modelId, xAccountId, authorization }: {
452
- modelId: string;
453
- xAccountId?: string | null;
454
- authorization: string;
455
- }, opts?: Oazapfts.RequestOpts) {
456
- return oazapfts.ok(oazapfts.fetchJson<{
457
- status: 204;
458
- } | {
459
- status: 404;
460
- } | {
461
- status: 422;
462
- data: HttpValidationError;
463
- }>(`/v1/llm/models/${encodeURIComponent(modelId)}`, {
464
- ...opts,
465
- method: "DELETE",
466
- headers: oazapfts.mergeHeaders(opts?.headers, {
467
- "x-account-id": xAccountId,
468
- authorization
469
- })
470
- }));
471
- }
472
- /**
473
- * Save Or Update Model Resources
474
- */
475
- export function saveOrUpdateModelResourcesV1LlmModelsModelIdResourcesPut({ modelId, xAccountId, authorization, body }: {
476
- modelId: string;
477
- xAccountId?: string | null;
478
- authorization: string;
479
- body: UpdateLlmModelResourceRequest[];
480
- }, opts?: Oazapfts.RequestOpts) {
481
- return oazapfts.ok(oazapfts.fetchJson<{
482
- status: 200;
483
- data: any;
484
- } | {
485
- status: 404;
486
- } | {
487
- status: 422;
488
- data: HttpValidationError;
489
- }>(`/v1/llm/models/${encodeURIComponent(modelId)}/resources`, oazapfts.json({
490
- ...opts,
491
- method: "PUT",
492
- body,
493
- headers: oazapfts.mergeHeaders(opts?.headers, {
494
- "x-account-id": xAccountId,
495
- authorization
496
- })
497
- })));
498
- }
499
- /**
500
- * Delete Model Resources
501
- */
502
- export function deleteModelResourcesV1LlmResourcesResourceIdDelete({ resourceId, xAccountId, authorization }: {
503
- resourceId: string;
504
- xAccountId?: string | null;
505
- authorization: string;
506
- }, opts?: Oazapfts.RequestOpts) {
507
- return oazapfts.ok(oazapfts.fetchJson<{
508
- status: 204;
509
- } | {
510
- status: 404;
511
- } | {
512
- status: 422;
513
- data: HttpValidationError;
514
- }>(`/v1/llm/resources/${encodeURIComponent(resourceId)}`, {
515
- ...opts,
516
- method: "DELETE",
517
- headers: oazapfts.mergeHeaders(opts?.headers, {
518
- "x-account-id": xAccountId,
519
- authorization
520
- })
521
- }));
522
- }
523
- /**
524
- * List Llm Providers
525
- */
526
- export function listLlmProvidersV1LlmProvidersGet({ acceptsSelfHosted, xAccountId, authorization }: {
527
- acceptsSelfHosted?: boolean;
528
- xAccountId?: string | null;
529
- authorization: string;
530
- }, opts?: Oazapfts.RequestOpts) {
531
- return oazapfts.ok(oazapfts.fetchJson<{
532
- status: 200;
533
- data: LlmSimpleProviderResponse[];
534
- } | {
535
- status: 404;
536
- } | {
537
- status: 422;
538
- data: HttpValidationError;
539
- }>(`/v1/llm/providers${QS.query(QS.explode({
540
- accepts_self_hosted: acceptsSelfHosted
541
- }))}`, {
542
- ...opts,
543
- headers: oazapfts.mergeHeaders(opts?.headers, {
544
- "x-account-id": xAccountId,
545
- authorization
546
- })
547
- }));
548
- }
549
- /**
550
- * Handle completions requests
551
- */
552
- export function createCompletionsV1ChatCompletionsPost({ xRequestOrigin, xAccountId, authorization, chatCompletion }: {
553
- xRequestOrigin?: string | null;
554
- xAccountId?: string | null;
555
- authorization: string;
556
- chatCompletion: ChatCompletion;
557
- }, opts?: Oazapfts.RequestOpts) {
558
- return oazapfts.ok(oazapfts.fetchJson<{
559
- status: 200;
560
- data: any;
561
- } | {
562
- status: 404;
563
- } | {
564
- status: 422;
565
- data: HttpValidationError;
566
- }>("/v1/chat/completions", oazapfts.json({
567
- ...opts,
568
- method: "POST",
569
- body: chatCompletion,
570
- headers: oazapfts.mergeHeaders(opts?.headers, {
571
- "x-request-origin": xRequestOrigin,
572
- "x-account-id": xAccountId,
573
- authorization
574
- })
575
- })));
576
- }
577
- /**
578
- * Agent Chat
579
- */
580
- export function agentChatV1AgentAgentIdChatPost({ agentId, xAccountId, authorization, chatRequest }: {
581
- agentId: string;
582
- xAccountId?: string | null;
583
- authorization: string;
584
- chatRequest: ChatRequest;
585
- }, opts?: Oazapfts.RequestOpts) {
586
- return oazapfts.ok(oazapfts.fetchJson<{
587
- status: 200;
588
- data: any;
589
- } | {
590
- status: 404;
591
- } | {
592
- status: 422;
593
- data: HttpValidationError;
594
- }>(`/v1/agent/${encodeURIComponent(agentId)}/chat`, oazapfts.json({
595
- ...opts,
596
- method: "POST",
597
- body: chatRequest,
598
- headers: oazapfts.mergeHeaders(opts?.headers, {
599
- "x-account-id": xAccountId,
600
- authorization
601
- })
602
- })));
603
- }
1
+ /**
2
+ * FastAPI
3
+ * 0.1.0
4
+ * DO NOT MODIFY - This file has been generated using oazapfts.
5
+ * See https://www.npmjs.com/package/oazapfts
6
+ */
7
+ import * as Oazapfts from "@oazapfts/runtime";
8
+ import * as QS from "@oazapfts/runtime/query";
9
+ export const defaults: Oazapfts.Defaults<Oazapfts.CustomHeaders> = {
10
+ headers: {},
11
+ baseUrl: "/",
12
+ };
13
+ const oazapfts = Oazapfts.runtime(defaults);
14
+ export const servers = {};
15
+ export type LlmRoles = "system" | "user" | "assistant" | "function" | "tool";
16
+ export type SendMessage = {
17
+ role: LlmRoles;
18
+ content: string;
19
+ };
20
+ export type SendConversation = {
21
+ model_name: string;
22
+ messages: SendMessage[];
23
+ temperature?: number | null;
24
+ json_schema?: {
25
+ [key: string]: any;
26
+ } | null;
27
+ is_azure?: boolean | null;
28
+ max_tokens?: number | null;
29
+ };
30
+ export type MessageRepresentation = {
31
+ /** The role of the sender of the message (e.g., 'user', 'assistant', 'system', 'tool'). */
32
+ role: string;
33
+ /** The content of the message. */
34
+ content: string;
35
+ /** The name of the sender, if applicable. */
36
+ name?: string | null;
37
+ /** A dictionary representing a function call, if applicable. */
38
+ function_call?: {
39
+ [key: string]: any;
40
+ } | null;
41
+ };
42
+ export type ChoiceRepresentation = {
43
+ message: MessageRepresentation;
44
+ finish_reason: string;
45
+ index: number;
46
+ };
47
+ export type UsageRepresentation = {
48
+ prompt_tokens: number;
49
+ completion_tokens: number;
50
+ total_tokens: number;
51
+ };
52
+ export type MetricsRepresentation = {
53
+ latency_ms: number;
54
+ };
55
+ export type ConversationRepresentation = {
56
+ id: string;
57
+ choices: ChoiceRepresentation[];
58
+ created: string;
59
+ model: string;
60
+ "object"?: string;
61
+ usage: UsageRepresentation;
62
+ metrics?: MetricsRepresentation | null;
63
+ };
64
+ export type ValidationError = {
65
+ loc: (string | number)[];
66
+ msg: string;
67
+ "type": string;
68
+ };
69
+ export type HttpValidationError = {
70
+ detail?: ValidationError[];
71
+ };
72
+ export type ResourceName = "agents" | "deep_ks" | "autocomplete";
73
+ export type LlmModelResourceRequest = {
74
+ name: ResourceName;
75
+ is_default?: boolean;
76
+ };
77
+ export type CreateLlmModelRequest = {
78
+ display_name: string;
79
+ provider_name: string;
80
+ model_name: string;
81
+ connection_params: {
82
+ [key: string]: any;
83
+ };
84
+ resources: LlmModelResourceRequest[];
85
+ };
86
+ export type LlmProviderResponse = {
87
+ name: string;
88
+ provider_type: string;
89
+ configuration_params?: {
90
+ [key: string]: any;
91
+ } | null;
92
+ accepts_self_hosted?: boolean | null;
93
+ };
94
+ export type LlmModelConfigurationResponse = {
95
+ provider: LlmProviderResponse;
96
+ model_name: string;
97
+ connection_params: {
98
+ [key: string]: any;
99
+ } | null;
100
+ usage_params: {
101
+ [key: string]: any;
102
+ } | null;
103
+ };
104
+ export type LlmModelResourcesResponse = {
105
+ id: string;
106
+ name: string;
107
+ is_default: boolean;
108
+ };
109
+ export type LlmModelsResponse = {
110
+ id: string;
111
+ active: boolean;
112
+ display_name: string;
113
+ self_hosted: boolean;
114
+ model_configuration: LlmModelConfigurationResponse;
115
+ resources: LlmModelResourcesResponse[];
116
+ created_at: string;
117
+ updated_at: string;
118
+ updated_by: string;
119
+ };
120
+ export type OrderBy = "default" | "display_name" | "model_name" | "type" | "status";
121
+ export type OrderDir = "asc" | "desc" | "stackspot_hosted" | "self_hosted" | "active" | "inactive";
122
+ export type PaginatedResponseLlmModelsResponse = {
123
+ total_pages: number;
124
+ items: LlmModelsResponse[];
125
+ };
126
+ export type ToggleModelStatusRequest = {
127
+ active: boolean;
128
+ };
129
+ export type UpdateLlmModelRequest = {
130
+ display_name: string;
131
+ model_name: string;
132
+ connection_params: {
133
+ [key: string]: any;
134
+ };
135
+ resources: LlmModelResourceRequest[];
136
+ };
137
+ export type UpdateLlmModelResourceRequest = {
138
+ name: string;
139
+ is_default?: boolean;
140
+ };
141
+ export type LlmSimpleProviderResponse = {
142
+ name: string;
143
+ provider_type: string;
144
+ configuration_params: {
145
+ [key: string]: any;
146
+ };
147
+ accepts_self_hosted: boolean;
148
+ model_names: string[];
149
+ };
150
+ export type TextParam = {
151
+ text: string;
152
+ "type"?: "text";
153
+ };
154
+ export type UrlParam = {
155
+ url: string;
156
+ };
157
+ export type ImageParam = {
158
+ image_url: UrlParam;
159
+ "type"?: "image_url";
160
+ };
161
+ export type FunctionCall = {
162
+ /** The name of the function to call */
163
+ name: string;
164
+ /** A JSON string representing the function arguments */
165
+ arguments: string;
166
+ };
167
+ export type Message = {
168
+ /** The role of the message (system, user, assistant, or function) */
169
+ role: LlmRoles;
170
+ /** The content of the message, can be a string or a list of content blocks */
171
+ content?: string | (TextParam | ImageParam)[];
172
+ /** The name of the sender (optional) */
173
+ name?: string | null;
174
+ /** Details of a function call (optional) */
175
+ function_call?: FunctionCall | null;
176
+ /** Details of a function call (optional) */
177
+ tool_calls?: {
178
+ [key: string]: any;
179
+ }[] | null;
180
+ /** Tool id */
181
+ tool_call_id?: string | null;
182
+ };
183
+ export type FunctionParameter = {
184
+ /** The type of the parameter */
185
+ "type": string;
186
+ /** A description of the parameter (optional) */
187
+ description?: string | null;
188
+ /** A list of possible values for the parameter (optional) */
189
+ "enum"?: string[] | null;
190
+ /** A dictionary of properties for the parameter (optional) */
191
+ properties?: {
192
+ [key: string]: any;
193
+ } | null;
194
+ /** A list of required parameters (optional) */
195
+ required?: string[] | null;
196
+ /** Allow arbitrary data of specific typed */
197
+ additionalProperties?: boolean;
198
+ };
199
+ export type Function = {
200
+ /** The name of the function */
201
+ name: string;
202
+ /** A description of what the function does */
203
+ description: string;
204
+ /** The parameters required by the function */
205
+ parameters: FunctionParameter;
206
+ /** Strict specific schema response. Only `strict` function tools can be auto-parsed */
207
+ strict: boolean;
208
+ };
209
+ export type ChatCompletion = {
210
+ /** The model to be used for the chat completion */
211
+ model: string;
212
+ /** A list of messages that make up the conversation */
213
+ messages: Message[];
214
+ /** Sampling temperature; higher values make output more random */
215
+ temperature?: number;
216
+ /** Nucleus sampling probability; controls diversity */
217
+ top_p?: number;
218
+ /** Number of completions to generate */
219
+ n?: number;
220
+ /** Whether to stream the response */
221
+ stream?: boolean;
222
+ /** Stop sequences that will halt the generation */
223
+ stop?: string | string[] | null;
224
+ /** Maximum number of tokens to generate */
225
+ max_tokens?: number | null;
226
+ /** Penalty based on new tokens' presence in the text */
227
+ presence_penalty?: number;
228
+ /** Penalty based on new tokens' frequency in the text */
229
+ frequency_penalty?: number;
230
+ /** A dictionary to adjust the likelihood of specific tokens */
231
+ logit_bias?: {
232
+ [key: string]: number;
233
+ } | null;
234
+ /** An identifier for the user */
235
+ user?: string | null;
236
+ /** A list of functions that can be called during the chat */
237
+ functions?: Function[] | null;
238
+ /** Specifies function call behavior or parameters (for example, 'auto' or {'name': 'function_name'}) */
239
+ function_call?: string | {
240
+ [key: string]: string;
241
+ } | null;
242
+ };
243
+ export type ChatRequest = {
244
+ streaming: boolean;
245
+ user_prompt: string;
246
+ stackspot_knowledge?: boolean;
247
+ return_ks_in_response?: boolean;
248
+ upload_ids?: string[];
249
+ };
250
+ /**
251
+ * Health Check
252
+ */
253
+ export function healthCheckHealthzGet(opts?: Oazapfts.RequestOpts) {
254
+ return oazapfts.ok(oazapfts.fetchJson<{
255
+ status: 200;
256
+ data: any;
257
+ } | {
258
+ status: 404;
259
+ }>("/healthz", {
260
+ ...opts
261
+ }));
262
+ }
263
+ /**
264
+ * Readiness Check
265
+ */
266
+ export function readinessCheckReadyzGet(opts?: Oazapfts.RequestOpts) {
267
+ return oazapfts.ok(oazapfts.fetchJson<{
268
+ status: 200;
269
+ data: any;
270
+ } | {
271
+ status: 404;
272
+ }>("/readyz", {
273
+ ...opts
274
+ }));
275
+ }
276
+ /**
277
+ * Handle conversation requests
278
+ */
279
+ export function converseV0ConversationPost({ xAccountId, authorization, sendConversation }: {
280
+ xAccountId?: string | null;
281
+ authorization: string;
282
+ sendConversation: SendConversation;
283
+ }, opts?: Oazapfts.RequestOpts) {
284
+ return oazapfts.ok(oazapfts.fetchJson<{
285
+ status: 200;
286
+ data: ConversationRepresentation;
287
+ } | {
288
+ status: 404;
289
+ } | {
290
+ status: 422;
291
+ data: HttpValidationError;
292
+ }>("/v0/conversation", oazapfts.json({
293
+ ...opts,
294
+ method: "POST",
295
+ body: sendConversation,
296
+ headers: oazapfts.mergeHeaders(opts?.headers, {
297
+ "x-account-id": xAccountId,
298
+ authorization
299
+ })
300
+ })));
301
+ }
302
+ /**
303
+ * Add Self Hosted Model
304
+ */
305
+ export function addSelfHostedModelV1LlmModelsPost({ xAccountId, authorization, createLlmModelRequest }: {
306
+ xAccountId?: string | null;
307
+ authorization: string;
308
+ createLlmModelRequest: CreateLlmModelRequest;
309
+ }, opts?: Oazapfts.RequestOpts) {
310
+ return oazapfts.ok(oazapfts.fetchJson<{
311
+ status: 200;
312
+ data: LlmModelsResponse;
313
+ } | {
314
+ status: 404;
315
+ } | {
316
+ status: 422;
317
+ data: HttpValidationError;
318
+ }>("/v1/llm/models", oazapfts.json({
319
+ ...opts,
320
+ method: "POST",
321
+ body: createLlmModelRequest,
322
+ headers: oazapfts.mergeHeaders(opts?.headers, {
323
+ "x-account-id": xAccountId,
324
+ authorization
325
+ })
326
+ })));
327
+ }
328
+ /**
329
+ * List Models
330
+ */
331
+ export function listModelsV1LlmModelsGet({ active, resource, $default, displayName, selfHosted, orderBy, orderDir, page, pageSize, xAccountId, authorization }: {
332
+ active?: boolean | null;
333
+ resource?: string | null;
334
+ $default?: boolean | null;
335
+ displayName?: string | null;
336
+ selfHosted?: boolean | null;
337
+ orderBy?: OrderBy;
338
+ orderDir?: OrderDir;
339
+ page?: number;
340
+ pageSize?: number;
341
+ xAccountId?: string | null;
342
+ authorization: string;
343
+ }, opts?: Oazapfts.RequestOpts) {
344
+ return oazapfts.ok(oazapfts.fetchJson<{
345
+ status: 200;
346
+ data: PaginatedResponseLlmModelsResponse;
347
+ } | {
348
+ status: 404;
349
+ } | {
350
+ status: 422;
351
+ data: HttpValidationError;
352
+ }>(`/v1/llm/models${QS.query(QS.explode({
353
+ active,
354
+ resource,
355
+ "default": $default,
356
+ display_name: displayName,
357
+ self_hosted: selfHosted,
358
+ order_by: orderBy,
359
+ order_dir: orderDir,
360
+ page,
361
+ page_size: pageSize
362
+ }))}`, {
363
+ ...opts,
364
+ headers: oazapfts.mergeHeaders(opts?.headers, {
365
+ "x-account-id": xAccountId,
366
+ authorization
367
+ })
368
+ }));
369
+ }
370
+ /**
371
+ * Get Model
372
+ */
373
+ export function getModelV1LlmModelsModelIdGet({ modelId, xAccountId, authorization }: {
374
+ modelId: string;
375
+ xAccountId?: string | null;
376
+ authorization: string;
377
+ }, opts?: Oazapfts.RequestOpts) {
378
+ return oazapfts.ok(oazapfts.fetchJson<{
379
+ status: 200;
380
+ data: LlmModelsResponse;
381
+ } | {
382
+ status: 404;
383
+ } | {
384
+ status: 422;
385
+ data: HttpValidationError;
386
+ }>(`/v1/llm/models/${encodeURIComponent(modelId)}`, {
387
+ ...opts,
388
+ headers: oazapfts.mergeHeaders(opts?.headers, {
389
+ "x-account-id": xAccountId,
390
+ authorization
391
+ })
392
+ }));
393
+ }
394
+ /**
395
+ * Toggle Model Status
396
+ */
397
+ export function toggleModelStatusV1LlmModelsModelIdPatch({ modelId, xAccountId, authorization, toggleModelStatusRequest }: {
398
+ modelId: string;
399
+ xAccountId?: string | null;
400
+ authorization: string;
401
+ toggleModelStatusRequest: ToggleModelStatusRequest;
402
+ }, opts?: Oazapfts.RequestOpts) {
403
+ return oazapfts.ok(oazapfts.fetchJson<{
404
+ status: 200;
405
+ data: LlmModelsResponse;
406
+ } | {
407
+ status: 404;
408
+ } | {
409
+ status: 422;
410
+ data: HttpValidationError;
411
+ }>(`/v1/llm/models/${encodeURIComponent(modelId)}`, oazapfts.json({
412
+ ...opts,
413
+ method: "PATCH",
414
+ body: toggleModelStatusRequest,
415
+ headers: oazapfts.mergeHeaders(opts?.headers, {
416
+ "x-account-id": xAccountId,
417
+ authorization
418
+ })
419
+ })));
420
+ }
421
+ /**
422
+ * Update
423
+ */
424
+ export function updateV1LlmModelsModelIdPut({ modelId, xAccountId, authorization, updateLlmModelRequest }: {
425
+ modelId: string;
426
+ xAccountId?: string | null;
427
+ authorization: string;
428
+ updateLlmModelRequest: UpdateLlmModelRequest;
429
+ }, opts?: Oazapfts.RequestOpts) {
430
+ return oazapfts.ok(oazapfts.fetchJson<{
431
+ status: 200;
432
+ data: LlmModelsResponse;
433
+ } | {
434
+ status: 404;
435
+ } | {
436
+ status: 422;
437
+ data: HttpValidationError;
438
+ }>(`/v1/llm/models/${encodeURIComponent(modelId)}`, oazapfts.json({
439
+ ...opts,
440
+ method: "PUT",
441
+ body: updateLlmModelRequest,
442
+ headers: oazapfts.mergeHeaders(opts?.headers, {
443
+ "x-account-id": xAccountId,
444
+ authorization
445
+ })
446
+ })));
447
+ }
448
+ /**
449
+ * Delete
450
+ */
451
+ export function deleteV1LlmModelsModelIdDelete({ modelId, xAccountId, authorization }: {
452
+ modelId: string;
453
+ xAccountId?: string | null;
454
+ authorization: string;
455
+ }, opts?: Oazapfts.RequestOpts) {
456
+ return oazapfts.ok(oazapfts.fetchJson<{
457
+ status: 204;
458
+ } | {
459
+ status: 404;
460
+ } | {
461
+ status: 422;
462
+ data: HttpValidationError;
463
+ }>(`/v1/llm/models/${encodeURIComponent(modelId)}`, {
464
+ ...opts,
465
+ method: "DELETE",
466
+ headers: oazapfts.mergeHeaders(opts?.headers, {
467
+ "x-account-id": xAccountId,
468
+ authorization
469
+ })
470
+ }));
471
+ }
472
+ /**
473
+ * Save Or Update Model Resources
474
+ */
475
+ export function saveOrUpdateModelResourcesV1LlmModelsModelIdResourcesPut({ modelId, xAccountId, authorization, body }: {
476
+ modelId: string;
477
+ xAccountId?: string | null;
478
+ authorization: string;
479
+ body: UpdateLlmModelResourceRequest[];
480
+ }, opts?: Oazapfts.RequestOpts) {
481
+ return oazapfts.ok(oazapfts.fetchJson<{
482
+ status: 200;
483
+ data: any;
484
+ } | {
485
+ status: 404;
486
+ } | {
487
+ status: 422;
488
+ data: HttpValidationError;
489
+ }>(`/v1/llm/models/${encodeURIComponent(modelId)}/resources`, oazapfts.json({
490
+ ...opts,
491
+ method: "PUT",
492
+ body,
493
+ headers: oazapfts.mergeHeaders(opts?.headers, {
494
+ "x-account-id": xAccountId,
495
+ authorization
496
+ })
497
+ })));
498
+ }
499
+ /**
500
+ * Delete Model Resources
501
+ */
502
+ export function deleteModelResourcesV1LlmResourcesResourceIdDelete({ resourceId, xAccountId, authorization }: {
503
+ resourceId: string;
504
+ xAccountId?: string | null;
505
+ authorization: string;
506
+ }, opts?: Oazapfts.RequestOpts) {
507
+ return oazapfts.ok(oazapfts.fetchJson<{
508
+ status: 204;
509
+ } | {
510
+ status: 404;
511
+ } | {
512
+ status: 422;
513
+ data: HttpValidationError;
514
+ }>(`/v1/llm/resources/${encodeURIComponent(resourceId)}`, {
515
+ ...opts,
516
+ method: "DELETE",
517
+ headers: oazapfts.mergeHeaders(opts?.headers, {
518
+ "x-account-id": xAccountId,
519
+ authorization
520
+ })
521
+ }));
522
+ }
523
+ /**
524
+ * List Llm Providers
525
+ */
526
+ export function listLlmProvidersV1LlmProvidersGet({ acceptsSelfHosted, xAccountId, authorization }: {
527
+ acceptsSelfHosted?: boolean;
528
+ xAccountId?: string | null;
529
+ authorization: string;
530
+ }, opts?: Oazapfts.RequestOpts) {
531
+ return oazapfts.ok(oazapfts.fetchJson<{
532
+ status: 200;
533
+ data: LlmSimpleProviderResponse[];
534
+ } | {
535
+ status: 404;
536
+ } | {
537
+ status: 422;
538
+ data: HttpValidationError;
539
+ }>(`/v1/llm/providers${QS.query(QS.explode({
540
+ accepts_self_hosted: acceptsSelfHosted
541
+ }))}`, {
542
+ ...opts,
543
+ headers: oazapfts.mergeHeaders(opts?.headers, {
544
+ "x-account-id": xAccountId,
545
+ authorization
546
+ })
547
+ }));
548
+ }
549
+ /**
550
+ * Handle completions requests
551
+ */
552
+ export function createCompletionsV1ChatCompletionsPost({ xRequestOrigin, xAccountId, authorization, chatCompletion }: {
553
+ xRequestOrigin?: string | null;
554
+ xAccountId?: string | null;
555
+ authorization: string;
556
+ chatCompletion: ChatCompletion;
557
+ }, opts?: Oazapfts.RequestOpts) {
558
+ return oazapfts.ok(oazapfts.fetchJson<{
559
+ status: 200;
560
+ data: any;
561
+ } | {
562
+ status: 404;
563
+ } | {
564
+ status: 422;
565
+ data: HttpValidationError;
566
+ }>("/v1/chat/completions", oazapfts.json({
567
+ ...opts,
568
+ method: "POST",
569
+ body: chatCompletion,
570
+ headers: oazapfts.mergeHeaders(opts?.headers, {
571
+ "x-request-origin": xRequestOrigin,
572
+ "x-account-id": xAccountId,
573
+ authorization
574
+ })
575
+ })));
576
+ }
577
+ /**
578
+ * Agent Chat
579
+ */
580
+ export function agentChatV1AgentAgentIdChatPost({ agentId, xAccountId, authorization, chatRequest }: {
581
+ agentId: string;
582
+ xAccountId?: string | null;
583
+ authorization: string;
584
+ chatRequest: ChatRequest;
585
+ }, opts?: Oazapfts.RequestOpts) {
586
+ return oazapfts.ok(oazapfts.fetchJson<{
587
+ status: 200;
588
+ data: any;
589
+ } | {
590
+ status: 404;
591
+ } | {
592
+ status: 422;
593
+ data: HttpValidationError;
594
+ }>(`/v1/agent/${encodeURIComponent(agentId)}/chat`, oazapfts.json({
595
+ ...opts,
596
+ method: "POST",
597
+ body: chatRequest,
598
+ headers: oazapfts.mergeHeaders(opts?.headers, {
599
+ "x-account-id": xAccountId,
600
+ authorization
601
+ })
602
+ })));
603
+ }