@stack-spot/portal-network 0.113.5 → 0.113.6
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.
- package/CHANGELOG.md +7 -0
- package/dist/api/genAiInference.d.ts +306 -0
- package/dist/api/genAiInference.d.ts.map +1 -0
- package/dist/api/genAiInference.js +138 -0
- package/dist/api/genAiInference.js.map +1 -0
- package/dist/apis.json +8 -0
- package/dist/client/gen-ai-inference.d.ts +54 -0
- package/dist/client/gen-ai-inference.d.ts.map +1 -0
- package/dist/client/gen-ai-inference.js +60 -0
- package/dist/client/gen-ai-inference.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/api/genAiInference.ts +467 -0
- package/src/apis.json +8 -0
- package/src/client/gen-ai-inference.ts +46 -0
- package/src/index.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.113.6](https://github.com/stack-spot/portal-commons/compare/portal-network@v0.113.5...portal-network@v0.113.6) (2025-04-05)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add ai inference api ([#897](https://github.com/stack-spot/portal-commons/issues/897)) ([d8daeb5](https://github.com/stack-spot/portal-commons/commit/d8daeb54fd0fab77a2fe4e3c2c94a2be7b97f28d))
|
|
9
|
+
|
|
3
10
|
## [0.113.5](https://github.com/stack-spot/portal-commons/compare/portal-network@v0.113.4...portal-network@v0.113.5) (2025-04-04)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -0,0 +1,306 @@
|
|
|
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
|
+
export declare const defaults: Oazapfts.Defaults<Oazapfts.CustomHeaders>;
|
|
9
|
+
export declare const servers: {};
|
|
10
|
+
export type LlmRoles = "system" | "user" | "assistant" | "function" | "tool";
|
|
11
|
+
export type SendMessage = {
|
|
12
|
+
role: LlmRoles;
|
|
13
|
+
content: string;
|
|
14
|
+
};
|
|
15
|
+
export type SendConversation = {
|
|
16
|
+
model_name: string;
|
|
17
|
+
messages: SendMessage[];
|
|
18
|
+
temperature?: number | null;
|
|
19
|
+
json_schema?: {
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
} | null;
|
|
22
|
+
is_azure?: boolean | null;
|
|
23
|
+
};
|
|
24
|
+
export type MessageRepresentation = {
|
|
25
|
+
/** The role of the sender of the message (e.g., 'user', 'assistant', 'system', 'tool'). */
|
|
26
|
+
role: string;
|
|
27
|
+
/** The content of the message. */
|
|
28
|
+
content: string;
|
|
29
|
+
/** The name of the sender, if applicable. */
|
|
30
|
+
name?: string | null;
|
|
31
|
+
/** A dictionary representing a function call, if applicable. */
|
|
32
|
+
function_call?: {
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
} | null;
|
|
35
|
+
};
|
|
36
|
+
export type ChoiceRepresentation = {
|
|
37
|
+
message: MessageRepresentation;
|
|
38
|
+
finish_reason: string;
|
|
39
|
+
index: number;
|
|
40
|
+
};
|
|
41
|
+
export type UsageRepresentation = {
|
|
42
|
+
prompt_tokens: number;
|
|
43
|
+
completion_tokens: number;
|
|
44
|
+
total_tokens: number;
|
|
45
|
+
};
|
|
46
|
+
export type MetricsRepresentation = {
|
|
47
|
+
latency_ms: number;
|
|
48
|
+
};
|
|
49
|
+
export type ConversationRepresentation = {
|
|
50
|
+
id: string;
|
|
51
|
+
choices: ChoiceRepresentation[];
|
|
52
|
+
created: string;
|
|
53
|
+
model: string;
|
|
54
|
+
"object"?: string;
|
|
55
|
+
usage: UsageRepresentation;
|
|
56
|
+
metrics?: MetricsRepresentation | null;
|
|
57
|
+
};
|
|
58
|
+
export type ValidationError = {
|
|
59
|
+
loc: (string | number)[];
|
|
60
|
+
msg: string;
|
|
61
|
+
"type": string;
|
|
62
|
+
};
|
|
63
|
+
export type HttpValidationError = {
|
|
64
|
+
detail?: ValidationError[];
|
|
65
|
+
};
|
|
66
|
+
export type FunctionCall = {
|
|
67
|
+
/** The name of the function to call */
|
|
68
|
+
name: string;
|
|
69
|
+
/** A JSON string representing the function arguments */
|
|
70
|
+
arguments: string;
|
|
71
|
+
};
|
|
72
|
+
export type Message = {
|
|
73
|
+
/** The role of the message (system, user, assistant, or function) */
|
|
74
|
+
role: LlmRoles;
|
|
75
|
+
/** The content of the message */
|
|
76
|
+
content: string;
|
|
77
|
+
/** The name of the sender (optional) */
|
|
78
|
+
name?: string | null;
|
|
79
|
+
/** Details of a function call (optional) */
|
|
80
|
+
function_call?: FunctionCall | null;
|
|
81
|
+
};
|
|
82
|
+
export type FunctionParameter = {
|
|
83
|
+
/** The type of the parameter */
|
|
84
|
+
"type": string;
|
|
85
|
+
/** A description of the parameter (optional) */
|
|
86
|
+
description?: string | null;
|
|
87
|
+
/** A list of possible values for the parameter (optional) */
|
|
88
|
+
"enum"?: string[] | null;
|
|
89
|
+
/** A dictionary of properties for the parameter (optional) */
|
|
90
|
+
properties?: {
|
|
91
|
+
[key: string]: any;
|
|
92
|
+
} | null;
|
|
93
|
+
/** A list of required parameters (optional) */
|
|
94
|
+
required?: string[] | null;
|
|
95
|
+
/** Allow arbitrary data of specific typed */
|
|
96
|
+
additionalProperties?: boolean;
|
|
97
|
+
};
|
|
98
|
+
export type Function = {
|
|
99
|
+
/** The name of the function */
|
|
100
|
+
name: string;
|
|
101
|
+
/** A description of what the function does */
|
|
102
|
+
description: string;
|
|
103
|
+
/** The parameters required by the function */
|
|
104
|
+
parameters: FunctionParameter;
|
|
105
|
+
/** Strict specific schema response. Only `strict` function tools can be auto-parsed */
|
|
106
|
+
strict: boolean;
|
|
107
|
+
};
|
|
108
|
+
export type ChatCompletion = {
|
|
109
|
+
/** The model to be used for the chat completion */
|
|
110
|
+
model: string;
|
|
111
|
+
/** A list of messages that make up the conversation */
|
|
112
|
+
messages: Message[];
|
|
113
|
+
/** Sampling temperature; higher values make output more random */
|
|
114
|
+
temperature?: number;
|
|
115
|
+
/** Nucleus sampling probability; controls diversity */
|
|
116
|
+
top_p?: number;
|
|
117
|
+
/** Number of completions to generate */
|
|
118
|
+
n?: number;
|
|
119
|
+
/** Whether to stream the response */
|
|
120
|
+
stream?: boolean;
|
|
121
|
+
/** Stop sequences that will halt the generation */
|
|
122
|
+
stop?: string | string[] | null;
|
|
123
|
+
/** Maximum number of tokens to generate */
|
|
124
|
+
max_tokens?: number | null;
|
|
125
|
+
/** Penalty based on new tokens' presence in the text */
|
|
126
|
+
presence_penalty?: number;
|
|
127
|
+
/** Penalty based on new tokens' frequency in the text */
|
|
128
|
+
frequency_penalty?: number;
|
|
129
|
+
/** A dictionary to adjust the likelihood of specific tokens */
|
|
130
|
+
logit_bias?: {
|
|
131
|
+
[key: string]: number;
|
|
132
|
+
} | null;
|
|
133
|
+
/** An identifier for the user */
|
|
134
|
+
user?: string | null;
|
|
135
|
+
/** A list of functions that can be called during the chat */
|
|
136
|
+
functions?: Function[] | null;
|
|
137
|
+
/** Specifies function call behavior or parameters (for example, 'auto' or {'name': 'function_name'}) */
|
|
138
|
+
function_call?: string | {
|
|
139
|
+
[key: string]: string;
|
|
140
|
+
} | null;
|
|
141
|
+
};
|
|
142
|
+
export type StateType = "chat" | "planning" | "step" | "final_answer" | "tool" | "used_tools";
|
|
143
|
+
export type StateAction = "start" | "end";
|
|
144
|
+
export type StepTool = {
|
|
145
|
+
/** Unique ULID identifier for the tool. LLM always sends null. */
|
|
146
|
+
agent_tool_id: string | null;
|
|
147
|
+
/** Unique ULID identifier for the tool. LLM always sends null. */
|
|
148
|
+
tool_id: string | null;
|
|
149
|
+
/** Unique ULID identifier for tool execution in a step. LLM always sends null. */
|
|
150
|
+
tool_execution_id: string | null;
|
|
151
|
+
/** Exact name of the function to execute. Must include a ULID and starting with 'agt_id__' */
|
|
152
|
+
name: string | null;
|
|
153
|
+
/** JSON string of arguments required to execute the tool. */
|
|
154
|
+
arguments: string | null;
|
|
155
|
+
};
|
|
156
|
+
export type Step = {
|
|
157
|
+
/** Unique ULID identifier for the step. LLM sends null by default. */
|
|
158
|
+
id: string | null;
|
|
159
|
+
/** Brief goal of the step. Use the same language provided by the user without repeating the prompt. Example.: Generate image in oil painting style */
|
|
160
|
+
goal: string;
|
|
161
|
+
/** List of tools to execute in parallel in this step. */
|
|
162
|
+
tools: StepTool[] | null;
|
|
163
|
+
};
|
|
164
|
+
export type Plan = {
|
|
165
|
+
/** Brief description of the expected action and the number of necessary steps (max 100 characters). */
|
|
166
|
+
plan_goal?: string | null;
|
|
167
|
+
/** Total number of steps, including the final response step. */
|
|
168
|
+
total_steps?: number | null;
|
|
169
|
+
/** List of steps to be executed, including the final user response step. */
|
|
170
|
+
steps?: Step[] | null;
|
|
171
|
+
};
|
|
172
|
+
export type Score = {
|
|
173
|
+
/** A score between 0.0 and 1.0 indicating how well the response met the user's requirements. */
|
|
174
|
+
score: number;
|
|
175
|
+
};
|
|
176
|
+
export type ToolInput = {
|
|
177
|
+
input?: {
|
|
178
|
+
[key: string]: any;
|
|
179
|
+
} | null;
|
|
180
|
+
attempt: number;
|
|
181
|
+
};
|
|
182
|
+
export type ToolOutput = {
|
|
183
|
+
output?: string | null;
|
|
184
|
+
attempt: number;
|
|
185
|
+
};
|
|
186
|
+
export type ProcessState = {
|
|
187
|
+
"type": StateType;
|
|
188
|
+
action: StateAction;
|
|
189
|
+
id?: string | null;
|
|
190
|
+
duration?: number | null;
|
|
191
|
+
data?: Plan | Score | ToolInput | ToolOutput | null;
|
|
192
|
+
};
|
|
193
|
+
export type LlmProviderResponse = {
|
|
194
|
+
id: string;
|
|
195
|
+
name: string;
|
|
196
|
+
provider_type: string;
|
|
197
|
+
};
|
|
198
|
+
export type LlmModelConfigurationResponse = {
|
|
199
|
+
id: string;
|
|
200
|
+
usage_params: {
|
|
201
|
+
[key: string]: any;
|
|
202
|
+
} | null;
|
|
203
|
+
model_name: string;
|
|
204
|
+
provider: LlmProviderResponse;
|
|
205
|
+
};
|
|
206
|
+
export type LlmModelResourcesResponse = {
|
|
207
|
+
id: string;
|
|
208
|
+
model_id: string;
|
|
209
|
+
resource_name: string;
|
|
210
|
+
is_default: boolean;
|
|
211
|
+
};
|
|
212
|
+
export type LlmModelsResponse = {
|
|
213
|
+
id: string;
|
|
214
|
+
active: boolean;
|
|
215
|
+
display_name: string;
|
|
216
|
+
self_hosted: boolean;
|
|
217
|
+
model_configuration: LlmModelConfigurationResponse;
|
|
218
|
+
resources: LlmModelResourcesResponse[];
|
|
219
|
+
created_at: string;
|
|
220
|
+
updated_at: string;
|
|
221
|
+
updated_by: string;
|
|
222
|
+
};
|
|
223
|
+
export type UpdateLlmModelRequest = {
|
|
224
|
+
active: boolean;
|
|
225
|
+
};
|
|
226
|
+
export type UpdateLlmModelResourceRequest = {
|
|
227
|
+
resource_name: string;
|
|
228
|
+
is_default?: boolean;
|
|
229
|
+
};
|
|
230
|
+
/**
|
|
231
|
+
* Health Check
|
|
232
|
+
*/
|
|
233
|
+
export declare function healthCheckHealthzGet(opts?: Oazapfts.RequestOpts): Promise<any>;
|
|
234
|
+
/**
|
|
235
|
+
* Handle conversation requests
|
|
236
|
+
*/
|
|
237
|
+
export declare function converseV0ConversationPost({ xAccountId, authorization, sendConversation }: {
|
|
238
|
+
xAccountId?: string | null;
|
|
239
|
+
authorization: string;
|
|
240
|
+
sendConversation: SendConversation;
|
|
241
|
+
}, opts?: Oazapfts.RequestOpts): Promise<ConversationRepresentation>;
|
|
242
|
+
/**
|
|
243
|
+
* Execute an agent with tool orchestration
|
|
244
|
+
*/
|
|
245
|
+
export declare function chatCompletionV1AgentAgentIdDetailModeChatCompletionsPost({ agentId, detailMode, chatCompletion }: {
|
|
246
|
+
agentId: string;
|
|
247
|
+
detailMode: boolean;
|
|
248
|
+
chatCompletion: ChatCompletion;
|
|
249
|
+
}, opts?: Oazapfts.RequestOpts): Promise<any>;
|
|
250
|
+
/**
|
|
251
|
+
* Fake For Doc
|
|
252
|
+
*/
|
|
253
|
+
export declare function fakeForDocV1FakeForDocOnlyGet(opts?: Oazapfts.RequestOpts): Promise<ProcessState | null>;
|
|
254
|
+
/**
|
|
255
|
+
* List Models
|
|
256
|
+
*/
|
|
257
|
+
export declare function listModelsV1LlmModelsGet({ active, resource, $default, xAccountId, authorization }: {
|
|
258
|
+
active?: boolean | null;
|
|
259
|
+
resource?: string | null;
|
|
260
|
+
$default?: boolean | null;
|
|
261
|
+
xAccountId?: string | null;
|
|
262
|
+
authorization: string;
|
|
263
|
+
}, opts?: Oazapfts.RequestOpts): Promise<LlmModelsResponse[]>;
|
|
264
|
+
/**
|
|
265
|
+
* Get Model
|
|
266
|
+
*/
|
|
267
|
+
export declare function getModelV1LlmModelsModelIdGet({ modelId, xAccountId, authorization }: {
|
|
268
|
+
modelId: string;
|
|
269
|
+
xAccountId?: string | null;
|
|
270
|
+
authorization: string;
|
|
271
|
+
}, opts?: Oazapfts.RequestOpts): Promise<LlmModelsResponse>;
|
|
272
|
+
/**
|
|
273
|
+
* Update Model
|
|
274
|
+
*/
|
|
275
|
+
export declare function updateModelV1LlmModelsModelIdPatch({ modelId, xAccountId, authorization, updateLlmModelRequest }: {
|
|
276
|
+
modelId: string;
|
|
277
|
+
xAccountId?: string | null;
|
|
278
|
+
authorization: string;
|
|
279
|
+
updateLlmModelRequest: UpdateLlmModelRequest;
|
|
280
|
+
}, opts?: Oazapfts.RequestOpts): Promise<LlmModelsResponse>;
|
|
281
|
+
/**
|
|
282
|
+
* Save Or Update Model Resources
|
|
283
|
+
*/
|
|
284
|
+
export declare function saveOrUpdateModelResourcesV1LlmModelsModelIdResourcesPut({ modelId, xAccountId, authorization, body }: {
|
|
285
|
+
modelId: string;
|
|
286
|
+
xAccountId?: string | null;
|
|
287
|
+
authorization: string;
|
|
288
|
+
body: UpdateLlmModelResourceRequest[];
|
|
289
|
+
}, opts?: Oazapfts.RequestOpts): Promise<any>;
|
|
290
|
+
/**
|
|
291
|
+
* Delete Model Resources
|
|
292
|
+
*/
|
|
293
|
+
export declare function deleteModelResourcesV1LlmResourcesResourceIdDelete({ resourceId, xAccountId, authorization }: {
|
|
294
|
+
resourceId: string;
|
|
295
|
+
xAccountId?: string | null;
|
|
296
|
+
authorization: string;
|
|
297
|
+
}, opts?: Oazapfts.RequestOpts): Promise<any>;
|
|
298
|
+
/**
|
|
299
|
+
* Handle completions requests
|
|
300
|
+
*/
|
|
301
|
+
export declare function createCompletionsV1ChatCompletionsPost({ xAccountId, authorization, chatCompletion }: {
|
|
302
|
+
xAccountId?: string | null;
|
|
303
|
+
authorization: string;
|
|
304
|
+
chatCompletion: ChatCompletion;
|
|
305
|
+
}, opts?: Oazapfts.RequestOpts): Promise<any>;
|
|
306
|
+
//# sourceMappingURL=genAiInference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genAiInference.d.ts","sourceRoot":"","sources":["../../src/api/genAiInference.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAE9C,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAG9D,CAAC;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC;AAC1B,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM,CAAC;AAC7E,MAAM,MAAM,WAAW,GAAG;IACtB,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC;AACF,MAAM,MAAM,gBAAgB,GAAG;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,WAAW,EA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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 = {
|
|
10
|
+
headers: {},
|
|
11
|
+
baseUrl: "/",
|
|
12
|
+
};
|
|
13
|
+
const oazapfts = Oazapfts.runtime(defaults);
|
|
14
|
+
export const servers = {};
|
|
15
|
+
/**
|
|
16
|
+
* Health Check
|
|
17
|
+
*/
|
|
18
|
+
export function healthCheckHealthzGet(opts) {
|
|
19
|
+
return oazapfts.ok(oazapfts.fetchJson("/healthz", {
|
|
20
|
+
...opts
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Handle conversation requests
|
|
25
|
+
*/
|
|
26
|
+
export function converseV0ConversationPost({ xAccountId, authorization, sendConversation }, opts) {
|
|
27
|
+
return oazapfts.ok(oazapfts.fetchJson("/v0/conversation", oazapfts.json({
|
|
28
|
+
...opts,
|
|
29
|
+
method: "POST",
|
|
30
|
+
body: sendConversation,
|
|
31
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
32
|
+
"x-account-id": xAccountId,
|
|
33
|
+
authorization
|
|
34
|
+
})
|
|
35
|
+
})));
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Execute an agent with tool orchestration
|
|
39
|
+
*/
|
|
40
|
+
export function chatCompletionV1AgentAgentIdDetailModeChatCompletionsPost({ agentId, detailMode, chatCompletion }, opts) {
|
|
41
|
+
return oazapfts.ok(oazapfts.fetchJson(`/v1/agent/${encodeURIComponent(agentId)}/${encodeURIComponent(detailMode)}/chat/completions`, oazapfts.json({
|
|
42
|
+
...opts,
|
|
43
|
+
method: "POST",
|
|
44
|
+
body: chatCompletion
|
|
45
|
+
})));
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Fake For Doc
|
|
49
|
+
*/
|
|
50
|
+
export function fakeForDocV1FakeForDocOnlyGet(opts) {
|
|
51
|
+
return oazapfts.ok(oazapfts.fetchJson("/v1/fake_for_doc_only", {
|
|
52
|
+
...opts
|
|
53
|
+
}));
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* List Models
|
|
57
|
+
*/
|
|
58
|
+
export function listModelsV1LlmModelsGet({ active, resource, $default, xAccountId, authorization }, opts) {
|
|
59
|
+
return oazapfts.ok(oazapfts.fetchJson(`/v1/llm/models${QS.query(QS.explode({
|
|
60
|
+
active,
|
|
61
|
+
resource,
|
|
62
|
+
"default": $default
|
|
63
|
+
}))}`, {
|
|
64
|
+
...opts,
|
|
65
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
66
|
+
"x-account-id": xAccountId,
|
|
67
|
+
authorization
|
|
68
|
+
})
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Get Model
|
|
73
|
+
*/
|
|
74
|
+
export function getModelV1LlmModelsModelIdGet({ modelId, xAccountId, authorization }, opts) {
|
|
75
|
+
return oazapfts.ok(oazapfts.fetchJson(`/v1/llm/models/${encodeURIComponent(modelId)}`, {
|
|
76
|
+
...opts,
|
|
77
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
78
|
+
"x-account-id": xAccountId,
|
|
79
|
+
authorization
|
|
80
|
+
})
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Update Model
|
|
85
|
+
*/
|
|
86
|
+
export function updateModelV1LlmModelsModelIdPatch({ modelId, xAccountId, authorization, updateLlmModelRequest }, opts) {
|
|
87
|
+
return oazapfts.ok(oazapfts.fetchJson(`/v1/llm/models/${encodeURIComponent(modelId)}`, oazapfts.json({
|
|
88
|
+
...opts,
|
|
89
|
+
method: "PATCH",
|
|
90
|
+
body: updateLlmModelRequest,
|
|
91
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
92
|
+
"x-account-id": xAccountId,
|
|
93
|
+
authorization
|
|
94
|
+
})
|
|
95
|
+
})));
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Save Or Update Model Resources
|
|
99
|
+
*/
|
|
100
|
+
export function saveOrUpdateModelResourcesV1LlmModelsModelIdResourcesPut({ modelId, xAccountId, authorization, body }, opts) {
|
|
101
|
+
return oazapfts.ok(oazapfts.fetchJson(`/v1/llm/models/${encodeURIComponent(modelId)}/resources`, oazapfts.json({
|
|
102
|
+
...opts,
|
|
103
|
+
method: "PUT",
|
|
104
|
+
body,
|
|
105
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
106
|
+
"x-account-id": xAccountId,
|
|
107
|
+
authorization
|
|
108
|
+
})
|
|
109
|
+
})));
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Delete Model Resources
|
|
113
|
+
*/
|
|
114
|
+
export function deleteModelResourcesV1LlmResourcesResourceIdDelete({ resourceId, xAccountId, authorization }, opts) {
|
|
115
|
+
return oazapfts.ok(oazapfts.fetchJson(`/v1/llm/resources/${encodeURIComponent(resourceId)}`, {
|
|
116
|
+
...opts,
|
|
117
|
+
method: "DELETE",
|
|
118
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
119
|
+
"x-account-id": xAccountId,
|
|
120
|
+
authorization
|
|
121
|
+
})
|
|
122
|
+
}));
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Handle completions requests
|
|
126
|
+
*/
|
|
127
|
+
export function createCompletionsV1ChatCompletionsPost({ xAccountId, authorization, chatCompletion }, opts) {
|
|
128
|
+
return oazapfts.ok(oazapfts.fetchJson("/v1/chat/completions", oazapfts.json({
|
|
129
|
+
...opts,
|
|
130
|
+
method: "POST",
|
|
131
|
+
body: chatCompletion,
|
|
132
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
133
|
+
"x-account-id": xAccountId,
|
|
134
|
+
authorization
|
|
135
|
+
})
|
|
136
|
+
})));
|
|
137
|
+
}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Q;QAChB,OAAO,EAAE,QAAQ,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE;YAC1C,cAAc,EAAE,UAAU;YAC1B,aAAa;SAChB,CAAC;KACL,CAAC,CAAC,CAAC;AACR,CAAC;AACD;;GAEG;AACH,MAAM,UAAU,sCAAsC,CAAC,EAAE,UAAU,EAAE,aAAa,EAAE,cAAc,EAIjG,EAAE,IAA2B;IAC1B,OAAO,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,SAAS,CAQlC,sBAAsB,EAAE,QAAQ,CAAC,IAAI,CAAC;QACrC,GAAG,IAAI;QACP,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE,QAAQ,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE;YAC1C,cAAc,EAAE,UAAU;YAC1B,aAAa;SAChB,CAAC;KACL,CAAC,CAAC,CAAC,CAAC;AACT,CAAC"}
|
package/dist/apis.json
CHANGED
|
@@ -197,5 +197,13 @@
|
|
|
197
197
|
"prd": "https://code-shift-api.stackspot.com"
|
|
198
198
|
},
|
|
199
199
|
"docs": "/openapi.json"
|
|
200
|
+
},
|
|
201
|
+
"genAiInference": {
|
|
202
|
+
"url": {
|
|
203
|
+
"dev": "https://genai-inference-app.dev.stackspot.com",
|
|
204
|
+
"stg": "https://genai-inference-app.stg.stackspot.com",
|
|
205
|
+
"prd": "https://genai-inference-app.stg.stackspot.com"
|
|
206
|
+
},
|
|
207
|
+
"docs": "/openapi.json"
|
|
200
208
|
}
|
|
201
209
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { HttpError } from '@oazapfts/runtime';
|
|
2
|
+
import { StackspotAPIError } from '../error/StackspotAPIError.js';
|
|
3
|
+
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient.js';
|
|
4
|
+
declare class GenAiInference extends ReactQueryNetworkClient {
|
|
5
|
+
constructor();
|
|
6
|
+
protected buildStackSpotError(error: HttpError): StackspotAPIError;
|
|
7
|
+
/**
|
|
8
|
+
* List all models.
|
|
9
|
+
*/
|
|
10
|
+
listModels: import("../network/types.js").QueryObject<Omit<{
|
|
11
|
+
active?: boolean | null | undefined;
|
|
12
|
+
resource?: string | null | undefined;
|
|
13
|
+
$default?: boolean | null | undefined;
|
|
14
|
+
xAccountId?: string | null | undefined;
|
|
15
|
+
authorization: string;
|
|
16
|
+
}, "authorization" | "jwtToken"> & {}, import("../api/genAiInference.js").LlmModelsResponse[]>;
|
|
17
|
+
/**
|
|
18
|
+
* Gets model by ID.
|
|
19
|
+
*/
|
|
20
|
+
getModel: import("../network/types.js").QueryObject<Omit<{
|
|
21
|
+
modelId: string;
|
|
22
|
+
xAccountId?: string | null | undefined;
|
|
23
|
+
authorization: string;
|
|
24
|
+
}, "authorization" | "jwtToken"> & {}, import("../api/genAiInference.js").LlmModelsResponse>;
|
|
25
|
+
/**
|
|
26
|
+
* Updates model by ID.
|
|
27
|
+
*/
|
|
28
|
+
updateModel: import("../network/types.js").MutationObject<Omit<{
|
|
29
|
+
modelId: string;
|
|
30
|
+
xAccountId?: string | null | undefined;
|
|
31
|
+
authorization: string;
|
|
32
|
+
updateLlmModelRequest: import("../api/genAiInference.js").UpdateLlmModelRequest;
|
|
33
|
+
}, "authorization" | "jwtToken"> & {}, import("../api/genAiInference.js").LlmModelsResponse>;
|
|
34
|
+
/**
|
|
35
|
+
* Updates resources for a specific model ID.
|
|
36
|
+
*/
|
|
37
|
+
updateModelResource: import("../network/types.js").MutationObject<Omit<{
|
|
38
|
+
modelId: string;
|
|
39
|
+
xAccountId?: string | null | undefined;
|
|
40
|
+
authorization: string;
|
|
41
|
+
body: import("../api/genAiInference.js").UpdateLlmModelResourceRequest[];
|
|
42
|
+
}, "authorization" | "jwtToken"> & {}, any>;
|
|
43
|
+
/**
|
|
44
|
+
* Deletes a specific model resource by resource ID.
|
|
45
|
+
*/
|
|
46
|
+
deleteModelResource: import("../network/types.js").MutationObject<Omit<{
|
|
47
|
+
resourceId: string;
|
|
48
|
+
xAccountId?: string | null | undefined;
|
|
49
|
+
authorization: string;
|
|
50
|
+
}, "authorization" | "jwtToken"> & {}, any>;
|
|
51
|
+
}
|
|
52
|
+
export declare const genAiInferenceClient: GenAiInference;
|
|
53
|
+
export {};
|
|
54
|
+
//# sourceMappingURL=gen-ai-inference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gen-ai-inference.d.ts","sourceRoot":"","sources":["../../src/client/gen-ai-inference.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAE7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAM5E,cAAM,cAAe,SAAQ,uBAAuB;;IAKlD,SAAS,CAAC,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,iBAAiB;IAIlE;;OAEG;IACH,UAAU;;;;;;gGAAkE;IAE5E;;OAEG;IACH,QAAQ;;;;8FAAuE;IAE/E;;OAEG;IACH,WAAW;;;;;8FAA+E;IAE1F;;OAEG;IACH,mBAAmB;;;;;gDAAqG;IAExH;;OAEG;IACH,mBAAmB;;;;gDAA+F;CACnH;AAED,eAAO,MAAM,oBAAoB,gBAAuB,CAAA"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import apis from '../apis.json';
|
|
2
|
+
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient.js';
|
|
3
|
+
import { defaults, deleteModelResourcesV1LlmResourcesResourceIdDelete, getModelV1LlmModelsModelIdGet, listModelsV1LlmModelsGet, saveOrUpdateModelResourcesV1LlmModelsModelIdResourcesPut, updateModelV1LlmModelsModelIdPatch } from '../api/genAiInference.js';
|
|
4
|
+
import { DefaultAPIError } from '../error/DefaultAPIError.js';
|
|
5
|
+
import { removeAuthorizationParam } from '../utils/remove-authorization-param.js';
|
|
6
|
+
class GenAiInference extends ReactQueryNetworkClient {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(apis.genAiInference.url, defaults);
|
|
9
|
+
/**
|
|
10
|
+
* List all models.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(this, "listModels", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
configurable: true,
|
|
15
|
+
writable: true,
|
|
16
|
+
value: this.query(removeAuthorizationParam(listModelsV1LlmModelsGet))
|
|
17
|
+
});
|
|
18
|
+
/**
|
|
19
|
+
* Gets model by ID.
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(this, "getModel", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
configurable: true,
|
|
24
|
+
writable: true,
|
|
25
|
+
value: this.query(removeAuthorizationParam(getModelV1LlmModelsModelIdGet))
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* Updates model by ID.
|
|
29
|
+
*/
|
|
30
|
+
Object.defineProperty(this, "updateModel", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
configurable: true,
|
|
33
|
+
writable: true,
|
|
34
|
+
value: this.mutation(removeAuthorizationParam(updateModelV1LlmModelsModelIdPatch))
|
|
35
|
+
});
|
|
36
|
+
/**
|
|
37
|
+
* Updates resources for a specific model ID.
|
|
38
|
+
*/
|
|
39
|
+
Object.defineProperty(this, "updateModelResource", {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
configurable: true,
|
|
42
|
+
writable: true,
|
|
43
|
+
value: this.mutation(removeAuthorizationParam(saveOrUpdateModelResourcesV1LlmModelsModelIdResourcesPut))
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* Deletes a specific model resource by resource ID.
|
|
47
|
+
*/
|
|
48
|
+
Object.defineProperty(this, "deleteModelResource", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
configurable: true,
|
|
51
|
+
writable: true,
|
|
52
|
+
value: this.mutation(removeAuthorizationParam(deleteModelResourcesV1LlmResourcesResourceIdDelete))
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
buildStackSpotError(error) {
|
|
56
|
+
return new DefaultAPIError(error.data, error.status, { pt: {}, en: {} }, error.headers);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
export const genAiInferenceClient = new GenAiInference();
|
|
60
|
+
//# sourceMappingURL=gen-ai-inference.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gen-ai-inference.js","sourceRoot":"","sources":["../../src/client/gen-ai-inference.ts"],"names":[],"mappings":"AAEA,OAAO,IAAI,MAAM,cAAc,CAAA;AAE/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAE5E,OAAO,EAAE,QAAQ,EAAE,kDAAkD,EAAE,6BAA6B,EAAE,wBAAwB,EAAE,wDAAwD,EAAE,kCAAkC,EAAE,MAAM,uBAAuB,CAAA;AAC3P,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAA;AAE9E,MAAM,cAAe,SAAQ,uBAAuB;IAClD;QACE,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;QAO1C;;WAEG;QACH;;;;mBAAa,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,wBAAwB,CAAC,CAAC;WAAC;QAE5E;;WAEG;QACH;;;;mBAAW,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,6BAA6B,CAAC,CAAC;WAAC;QAE/E;;WAEG;QACH;;;;mBAAc,IAAI,CAAC,QAAQ,CAAC,wBAAwB,CAAC,kCAAkC,CAAC,CAAC;WAAC;QAE1F;;WAEG;QACH;;;;mBAAsB,IAAI,CAAC,QAAQ,CAAC,wBAAwB,CAAC,wDAAwD,CAAC,CAAC;WAAC;QAExH;;WAEG;QACH;;;;mBAAsB,IAAI,CAAC,QAAQ,CAAC,wBAAwB,CAAC,kDAAkD,CAAC,CAAC;WAAC;IA7BlH,CAAC;IAES,mBAAmB,CAAC,KAAgB;QAC5C,OAAO,IAAI,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAC,EAAE,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;IACxF,CAAC;CA0BF;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,cAAc,EAAE,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export { cloudServicesClient } from './client/cloud-services.js';
|
|
|
12
12
|
export { codeShiftClient } from './client/code-shift.js';
|
|
13
13
|
export { contentClient } from './client/content.js';
|
|
14
14
|
export { eventBusClient } from './client/event-bus.js';
|
|
15
|
+
export { genAiInferenceClient } from './client/gen-ai-inference.js';
|
|
15
16
|
export { insightsClient } from './client/insights.js';
|
|
16
17
|
export { notificationClient } from './client/notification.js';
|
|
17
18
|
export { runtimeManagerClient } from './client/runtime-manager.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAA;AAC5E,OAAO,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AM,oBAAoB,CAAA;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAA;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAC5F,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,7 @@ export { cloudServicesClient } from './client/cloud-services.js';
|
|
|
12
12
|
export { codeShiftClient } from './client/code-shift.js';
|
|
13
13
|
export { contentClient } from './client/content.js';
|
|
14
14
|
export { eventBusClient } from './client/event-bus.js';
|
|
15
|
+
export { genAiInferenceClient } from './client/gen-ai-inference.js';
|
|
15
16
|
export { insightsClient } from './client/insights.js';
|
|
16
17
|
export { notificationClient } from './client/notification.js';
|
|
17
18
|
export { runtimeManagerClient } from './client/runtime-manager.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,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2BAA2B,CAAA;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,cAAc,gBAAgB,CAAA;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAA;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,467 @@
|
|
|
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
|
+
};
|
|
29
|
+
export type MessageRepresentation = {
|
|
30
|
+
/** The role of the sender of the message (e.g., 'user', 'assistant', 'system', 'tool'). */
|
|
31
|
+
role: string;
|
|
32
|
+
/** The content of the message. */
|
|
33
|
+
content: string;
|
|
34
|
+
/** The name of the sender, if applicable. */
|
|
35
|
+
name?: string | null;
|
|
36
|
+
/** A dictionary representing a function call, if applicable. */
|
|
37
|
+
function_call?: {
|
|
38
|
+
[key: string]: any;
|
|
39
|
+
} | null;
|
|
40
|
+
};
|
|
41
|
+
export type ChoiceRepresentation = {
|
|
42
|
+
message: MessageRepresentation;
|
|
43
|
+
finish_reason: string;
|
|
44
|
+
index: number;
|
|
45
|
+
};
|
|
46
|
+
export type UsageRepresentation = {
|
|
47
|
+
prompt_tokens: number;
|
|
48
|
+
completion_tokens: number;
|
|
49
|
+
total_tokens: number;
|
|
50
|
+
};
|
|
51
|
+
export type MetricsRepresentation = {
|
|
52
|
+
latency_ms: number;
|
|
53
|
+
};
|
|
54
|
+
export type ConversationRepresentation = {
|
|
55
|
+
id: string;
|
|
56
|
+
choices: ChoiceRepresentation[];
|
|
57
|
+
created: string;
|
|
58
|
+
model: string;
|
|
59
|
+
"object"?: string;
|
|
60
|
+
usage: UsageRepresentation;
|
|
61
|
+
metrics?: MetricsRepresentation | null;
|
|
62
|
+
};
|
|
63
|
+
export type ValidationError = {
|
|
64
|
+
loc: (string | number)[];
|
|
65
|
+
msg: string;
|
|
66
|
+
"type": string;
|
|
67
|
+
};
|
|
68
|
+
export type HttpValidationError = {
|
|
69
|
+
detail?: ValidationError[];
|
|
70
|
+
};
|
|
71
|
+
export type FunctionCall = {
|
|
72
|
+
/** The name of the function to call */
|
|
73
|
+
name: string;
|
|
74
|
+
/** A JSON string representing the function arguments */
|
|
75
|
+
arguments: string;
|
|
76
|
+
};
|
|
77
|
+
export type Message = {
|
|
78
|
+
/** The role of the message (system, user, assistant, or function) */
|
|
79
|
+
role: LlmRoles;
|
|
80
|
+
/** The content of the message */
|
|
81
|
+
content: string;
|
|
82
|
+
/** The name of the sender (optional) */
|
|
83
|
+
name?: string | null;
|
|
84
|
+
/** Details of a function call (optional) */
|
|
85
|
+
function_call?: FunctionCall | null;
|
|
86
|
+
};
|
|
87
|
+
export type FunctionParameter = {
|
|
88
|
+
/** The type of the parameter */
|
|
89
|
+
"type": string;
|
|
90
|
+
/** A description of the parameter (optional) */
|
|
91
|
+
description?: string | null;
|
|
92
|
+
/** A list of possible values for the parameter (optional) */
|
|
93
|
+
"enum"?: string[] | null;
|
|
94
|
+
/** A dictionary of properties for the parameter (optional) */
|
|
95
|
+
properties?: {
|
|
96
|
+
[key: string]: any;
|
|
97
|
+
} | null;
|
|
98
|
+
/** A list of required parameters (optional) */
|
|
99
|
+
required?: string[] | null;
|
|
100
|
+
/** Allow arbitrary data of specific typed */
|
|
101
|
+
additionalProperties?: boolean;
|
|
102
|
+
};
|
|
103
|
+
export type Function = {
|
|
104
|
+
/** The name of the function */
|
|
105
|
+
name: string;
|
|
106
|
+
/** A description of what the function does */
|
|
107
|
+
description: string;
|
|
108
|
+
/** The parameters required by the function */
|
|
109
|
+
parameters: FunctionParameter;
|
|
110
|
+
/** Strict specific schema response. Only `strict` function tools can be auto-parsed */
|
|
111
|
+
strict: boolean;
|
|
112
|
+
};
|
|
113
|
+
export type ChatCompletion = {
|
|
114
|
+
/** The model to be used for the chat completion */
|
|
115
|
+
model: string;
|
|
116
|
+
/** A list of messages that make up the conversation */
|
|
117
|
+
messages: Message[];
|
|
118
|
+
/** Sampling temperature; higher values make output more random */
|
|
119
|
+
temperature?: number;
|
|
120
|
+
/** Nucleus sampling probability; controls diversity */
|
|
121
|
+
top_p?: number;
|
|
122
|
+
/** Number of completions to generate */
|
|
123
|
+
n?: number;
|
|
124
|
+
/** Whether to stream the response */
|
|
125
|
+
stream?: boolean;
|
|
126
|
+
/** Stop sequences that will halt the generation */
|
|
127
|
+
stop?: string | string[] | null;
|
|
128
|
+
/** Maximum number of tokens to generate */
|
|
129
|
+
max_tokens?: number | null;
|
|
130
|
+
/** Penalty based on new tokens' presence in the text */
|
|
131
|
+
presence_penalty?: number;
|
|
132
|
+
/** Penalty based on new tokens' frequency in the text */
|
|
133
|
+
frequency_penalty?: number;
|
|
134
|
+
/** A dictionary to adjust the likelihood of specific tokens */
|
|
135
|
+
logit_bias?: {
|
|
136
|
+
[key: string]: number;
|
|
137
|
+
} | null;
|
|
138
|
+
/** An identifier for the user */
|
|
139
|
+
user?: string | null;
|
|
140
|
+
/** A list of functions that can be called during the chat */
|
|
141
|
+
functions?: Function[] | null;
|
|
142
|
+
/** Specifies function call behavior or parameters (for example, 'auto' or {'name': 'function_name'}) */
|
|
143
|
+
function_call?: string | {
|
|
144
|
+
[key: string]: string;
|
|
145
|
+
} | null;
|
|
146
|
+
};
|
|
147
|
+
export type StateType = "chat" | "planning" | "step" | "final_answer" | "tool" | "used_tools";
|
|
148
|
+
export type StateAction = "start" | "end";
|
|
149
|
+
export type StepTool = {
|
|
150
|
+
/** Unique ULID identifier for the tool. LLM always sends null. */
|
|
151
|
+
agent_tool_id: string | null;
|
|
152
|
+
/** Unique ULID identifier for the tool. LLM always sends null. */
|
|
153
|
+
tool_id: string | null;
|
|
154
|
+
/** Unique ULID identifier for tool execution in a step. LLM always sends null. */
|
|
155
|
+
tool_execution_id: string | null;
|
|
156
|
+
/** Exact name of the function to execute. Must include a ULID and starting with 'agt_id__' */
|
|
157
|
+
name: string | null;
|
|
158
|
+
/** JSON string of arguments required to execute the tool. */
|
|
159
|
+
arguments: string | null;
|
|
160
|
+
};
|
|
161
|
+
export type Step = {
|
|
162
|
+
/** Unique ULID identifier for the step. LLM sends null by default. */
|
|
163
|
+
id: string | null;
|
|
164
|
+
/** Brief goal of the step. Use the same language provided by the user without repeating the prompt. Example.: Generate image in oil painting style */
|
|
165
|
+
goal: string;
|
|
166
|
+
/** List of tools to execute in parallel in this step. */
|
|
167
|
+
tools: StepTool[] | null;
|
|
168
|
+
};
|
|
169
|
+
export type Plan = {
|
|
170
|
+
/** Brief description of the expected action and the number of necessary steps (max 100 characters). */
|
|
171
|
+
plan_goal?: string | null;
|
|
172
|
+
/** Total number of steps, including the final response step. */
|
|
173
|
+
total_steps?: number | null;
|
|
174
|
+
/** List of steps to be executed, including the final user response step. */
|
|
175
|
+
steps?: Step[] | null;
|
|
176
|
+
};
|
|
177
|
+
export type Score = {
|
|
178
|
+
/** A score between 0.0 and 1.0 indicating how well the response met the user's requirements. */
|
|
179
|
+
score: number;
|
|
180
|
+
};
|
|
181
|
+
export type ToolInput = {
|
|
182
|
+
input?: {
|
|
183
|
+
[key: string]: any;
|
|
184
|
+
} | null;
|
|
185
|
+
attempt: number;
|
|
186
|
+
};
|
|
187
|
+
export type ToolOutput = {
|
|
188
|
+
output?: string | null;
|
|
189
|
+
attempt: number;
|
|
190
|
+
};
|
|
191
|
+
export type ProcessState = {
|
|
192
|
+
"type": StateType;
|
|
193
|
+
action: StateAction;
|
|
194
|
+
id?: string | null;
|
|
195
|
+
duration?: number | null;
|
|
196
|
+
data?: Plan | Score | ToolInput | ToolOutput | null;
|
|
197
|
+
};
|
|
198
|
+
export type LlmProviderResponse = {
|
|
199
|
+
id: string;
|
|
200
|
+
name: string;
|
|
201
|
+
provider_type: string;
|
|
202
|
+
};
|
|
203
|
+
export type LlmModelConfigurationResponse = {
|
|
204
|
+
id: string;
|
|
205
|
+
usage_params: {
|
|
206
|
+
[key: string]: any;
|
|
207
|
+
} | null;
|
|
208
|
+
model_name: string;
|
|
209
|
+
provider: LlmProviderResponse;
|
|
210
|
+
};
|
|
211
|
+
export type LlmModelResourcesResponse = {
|
|
212
|
+
id: string;
|
|
213
|
+
model_id: string;
|
|
214
|
+
resource_name: string;
|
|
215
|
+
is_default: boolean;
|
|
216
|
+
};
|
|
217
|
+
export type LlmModelsResponse = {
|
|
218
|
+
id: string;
|
|
219
|
+
active: boolean;
|
|
220
|
+
display_name: string;
|
|
221
|
+
self_hosted: boolean;
|
|
222
|
+
model_configuration: LlmModelConfigurationResponse;
|
|
223
|
+
resources: LlmModelResourcesResponse[];
|
|
224
|
+
created_at: string;
|
|
225
|
+
updated_at: string;
|
|
226
|
+
updated_by: string;
|
|
227
|
+
};
|
|
228
|
+
export type UpdateLlmModelRequest = {
|
|
229
|
+
active: boolean;
|
|
230
|
+
};
|
|
231
|
+
export type UpdateLlmModelResourceRequest = {
|
|
232
|
+
resource_name: string;
|
|
233
|
+
is_default?: boolean;
|
|
234
|
+
};
|
|
235
|
+
/**
|
|
236
|
+
* Health Check
|
|
237
|
+
*/
|
|
238
|
+
export function healthCheckHealthzGet(opts?: Oazapfts.RequestOpts) {
|
|
239
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
240
|
+
status: 200;
|
|
241
|
+
data: any;
|
|
242
|
+
} | {
|
|
243
|
+
status: 404;
|
|
244
|
+
}>("/healthz", {
|
|
245
|
+
...opts
|
|
246
|
+
}));
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Handle conversation requests
|
|
250
|
+
*/
|
|
251
|
+
export function converseV0ConversationPost({ xAccountId, authorization, sendConversation }: {
|
|
252
|
+
xAccountId?: string | null;
|
|
253
|
+
authorization: string;
|
|
254
|
+
sendConversation: SendConversation;
|
|
255
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
256
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
257
|
+
status: 200;
|
|
258
|
+
data: ConversationRepresentation;
|
|
259
|
+
} | {
|
|
260
|
+
status: 404;
|
|
261
|
+
} | {
|
|
262
|
+
status: 422;
|
|
263
|
+
data: HttpValidationError;
|
|
264
|
+
}>("/v0/conversation", oazapfts.json({
|
|
265
|
+
...opts,
|
|
266
|
+
method: "POST",
|
|
267
|
+
body: sendConversation,
|
|
268
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
269
|
+
"x-account-id": xAccountId,
|
|
270
|
+
authorization
|
|
271
|
+
})
|
|
272
|
+
})));
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Execute an agent with tool orchestration
|
|
276
|
+
*/
|
|
277
|
+
export function chatCompletionV1AgentAgentIdDetailModeChatCompletionsPost({ agentId, detailMode, chatCompletion }: {
|
|
278
|
+
agentId: string;
|
|
279
|
+
detailMode: boolean;
|
|
280
|
+
chatCompletion: ChatCompletion;
|
|
281
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
282
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
283
|
+
status: 200;
|
|
284
|
+
data: any;
|
|
285
|
+
} | {
|
|
286
|
+
status: 404;
|
|
287
|
+
} | {
|
|
288
|
+
status: 422;
|
|
289
|
+
data: HttpValidationError;
|
|
290
|
+
}>(`/v1/agent/${encodeURIComponent(agentId)}/${encodeURIComponent(detailMode)}/chat/completions`, oazapfts.json({
|
|
291
|
+
...opts,
|
|
292
|
+
method: "POST",
|
|
293
|
+
body: chatCompletion
|
|
294
|
+
})));
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Fake For Doc
|
|
298
|
+
*/
|
|
299
|
+
export function fakeForDocV1FakeForDocOnlyGet(opts?: Oazapfts.RequestOpts) {
|
|
300
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
301
|
+
status: 200;
|
|
302
|
+
data: ProcessState | null;
|
|
303
|
+
} | {
|
|
304
|
+
status: 404;
|
|
305
|
+
}>("/v1/fake_for_doc_only", {
|
|
306
|
+
...opts
|
|
307
|
+
}));
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* List Models
|
|
311
|
+
*/
|
|
312
|
+
export function listModelsV1LlmModelsGet({ active, resource, $default, xAccountId, authorization }: {
|
|
313
|
+
active?: boolean | null;
|
|
314
|
+
resource?: string | null;
|
|
315
|
+
$default?: boolean | null;
|
|
316
|
+
xAccountId?: string | null;
|
|
317
|
+
authorization: string;
|
|
318
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
319
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
320
|
+
status: 200;
|
|
321
|
+
data: LlmModelsResponse[];
|
|
322
|
+
} | {
|
|
323
|
+
status: 404;
|
|
324
|
+
} | {
|
|
325
|
+
status: 422;
|
|
326
|
+
data: HttpValidationError;
|
|
327
|
+
}>(`/v1/llm/models${QS.query(QS.explode({
|
|
328
|
+
active,
|
|
329
|
+
resource,
|
|
330
|
+
"default": $default
|
|
331
|
+
}))}`, {
|
|
332
|
+
...opts,
|
|
333
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
334
|
+
"x-account-id": xAccountId,
|
|
335
|
+
authorization
|
|
336
|
+
})
|
|
337
|
+
}));
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Get Model
|
|
341
|
+
*/
|
|
342
|
+
export function getModelV1LlmModelsModelIdGet({ modelId, xAccountId, authorization }: {
|
|
343
|
+
modelId: string;
|
|
344
|
+
xAccountId?: string | null;
|
|
345
|
+
authorization: string;
|
|
346
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
347
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
348
|
+
status: 200;
|
|
349
|
+
data: LlmModelsResponse;
|
|
350
|
+
} | {
|
|
351
|
+
status: 404;
|
|
352
|
+
} | {
|
|
353
|
+
status: 422;
|
|
354
|
+
data: HttpValidationError;
|
|
355
|
+
}>(`/v1/llm/models/${encodeURIComponent(modelId)}`, {
|
|
356
|
+
...opts,
|
|
357
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
358
|
+
"x-account-id": xAccountId,
|
|
359
|
+
authorization
|
|
360
|
+
})
|
|
361
|
+
}));
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Update Model
|
|
365
|
+
*/
|
|
366
|
+
export function updateModelV1LlmModelsModelIdPatch({ modelId, xAccountId, authorization, updateLlmModelRequest }: {
|
|
367
|
+
modelId: string;
|
|
368
|
+
xAccountId?: string | null;
|
|
369
|
+
authorization: string;
|
|
370
|
+
updateLlmModelRequest: UpdateLlmModelRequest;
|
|
371
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
372
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
373
|
+
status: 200;
|
|
374
|
+
data: LlmModelsResponse;
|
|
375
|
+
} | {
|
|
376
|
+
status: 404;
|
|
377
|
+
} | {
|
|
378
|
+
status: 422;
|
|
379
|
+
data: HttpValidationError;
|
|
380
|
+
}>(`/v1/llm/models/${encodeURIComponent(modelId)}`, oazapfts.json({
|
|
381
|
+
...opts,
|
|
382
|
+
method: "PATCH",
|
|
383
|
+
body: updateLlmModelRequest,
|
|
384
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
385
|
+
"x-account-id": xAccountId,
|
|
386
|
+
authorization
|
|
387
|
+
})
|
|
388
|
+
})));
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Save Or Update Model Resources
|
|
392
|
+
*/
|
|
393
|
+
export function saveOrUpdateModelResourcesV1LlmModelsModelIdResourcesPut({ modelId, xAccountId, authorization, body }: {
|
|
394
|
+
modelId: string;
|
|
395
|
+
xAccountId?: string | null;
|
|
396
|
+
authorization: string;
|
|
397
|
+
body: UpdateLlmModelResourceRequest[];
|
|
398
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
399
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
400
|
+
status: 200;
|
|
401
|
+
data: any;
|
|
402
|
+
} | {
|
|
403
|
+
status: 404;
|
|
404
|
+
} | {
|
|
405
|
+
status: 422;
|
|
406
|
+
data: HttpValidationError;
|
|
407
|
+
}>(`/v1/llm/models/${encodeURIComponent(modelId)}/resources`, oazapfts.json({
|
|
408
|
+
...opts,
|
|
409
|
+
method: "PUT",
|
|
410
|
+
body,
|
|
411
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
412
|
+
"x-account-id": xAccountId,
|
|
413
|
+
authorization
|
|
414
|
+
})
|
|
415
|
+
})));
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Delete Model Resources
|
|
419
|
+
*/
|
|
420
|
+
export function deleteModelResourcesV1LlmResourcesResourceIdDelete({ resourceId, xAccountId, authorization }: {
|
|
421
|
+
resourceId: string;
|
|
422
|
+
xAccountId?: string | null;
|
|
423
|
+
authorization: string;
|
|
424
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
425
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
426
|
+
status: 200;
|
|
427
|
+
data: any;
|
|
428
|
+
} | {
|
|
429
|
+
status: 404;
|
|
430
|
+
} | {
|
|
431
|
+
status: 422;
|
|
432
|
+
data: HttpValidationError;
|
|
433
|
+
}>(`/v1/llm/resources/${encodeURIComponent(resourceId)}`, {
|
|
434
|
+
...opts,
|
|
435
|
+
method: "DELETE",
|
|
436
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
437
|
+
"x-account-id": xAccountId,
|
|
438
|
+
authorization
|
|
439
|
+
})
|
|
440
|
+
}));
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* Handle completions requests
|
|
444
|
+
*/
|
|
445
|
+
export function createCompletionsV1ChatCompletionsPost({ xAccountId, authorization, chatCompletion }: {
|
|
446
|
+
xAccountId?: string | null;
|
|
447
|
+
authorization: string;
|
|
448
|
+
chatCompletion: ChatCompletion;
|
|
449
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
450
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
451
|
+
status: 200;
|
|
452
|
+
data: any;
|
|
453
|
+
} | {
|
|
454
|
+
status: 404;
|
|
455
|
+
} | {
|
|
456
|
+
status: 422;
|
|
457
|
+
data: HttpValidationError;
|
|
458
|
+
}>("/v1/chat/completions", oazapfts.json({
|
|
459
|
+
...opts,
|
|
460
|
+
method: "POST",
|
|
461
|
+
body: chatCompletion,
|
|
462
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
463
|
+
"x-account-id": xAccountId,
|
|
464
|
+
authorization
|
|
465
|
+
})
|
|
466
|
+
})));
|
|
467
|
+
}
|
package/src/apis.json
CHANGED
|
@@ -197,5 +197,13 @@
|
|
|
197
197
|
"prd": "https://code-shift-api.stackspot.com"
|
|
198
198
|
},
|
|
199
199
|
"docs": "/openapi.json"
|
|
200
|
+
},
|
|
201
|
+
"genAiInference": {
|
|
202
|
+
"url": {
|
|
203
|
+
"dev": "https://genai-inference-app.dev.stackspot.com",
|
|
204
|
+
"stg": "https://genai-inference-app.stg.stackspot.com",
|
|
205
|
+
"prd": "https://genai-inference-app.stg.stackspot.com"
|
|
206
|
+
},
|
|
207
|
+
"docs": "/openapi.json"
|
|
200
208
|
}
|
|
201
209
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
|
|
2
|
+
import { HttpError } from '@oazapfts/runtime'
|
|
3
|
+
import apis from '../apis.json'
|
|
4
|
+
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
5
|
+
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
6
|
+
|
|
7
|
+
import { defaults, deleteModelResourcesV1LlmResourcesResourceIdDelete, getModelV1LlmModelsModelIdGet, listModelsV1LlmModelsGet, saveOrUpdateModelResourcesV1LlmModelsModelIdResourcesPut, updateModelV1LlmModelsModelIdPatch } from '../api/genAiInference'
|
|
8
|
+
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
9
|
+
import { removeAuthorizationParam } from '../utils/remove-authorization-param'
|
|
10
|
+
|
|
11
|
+
class GenAiInference extends ReactQueryNetworkClient {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(apis.genAiInference.url, defaults)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
protected buildStackSpotError(error: HttpError): StackspotAPIError {
|
|
17
|
+
return new DefaultAPIError(error.data, error.status, { pt: {}, en:{} }, error.headers)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* List all models.
|
|
22
|
+
*/
|
|
23
|
+
listModels = this.query(removeAuthorizationParam(listModelsV1LlmModelsGet));
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Gets model by ID.
|
|
27
|
+
*/
|
|
28
|
+
getModel = this.query(removeAuthorizationParam(getModelV1LlmModelsModelIdGet));
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Updates model by ID.
|
|
32
|
+
*/
|
|
33
|
+
updateModel = this.mutation(removeAuthorizationParam(updateModelV1LlmModelsModelIdPatch));
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Updates resources for a specific model ID.
|
|
37
|
+
*/
|
|
38
|
+
updateModelResource = this.mutation(removeAuthorizationParam(saveOrUpdateModelResourcesV1LlmModelsModelIdResourcesPut));
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Deletes a specific model resource by resource ID.
|
|
42
|
+
*/
|
|
43
|
+
deleteModelResource = this.mutation(removeAuthorizationParam(deleteModelResourcesV1LlmResourcesResourceIdDelete));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const genAiInferenceClient = new GenAiInference()
|
package/src/index.ts
CHANGED
|
@@ -12,6 +12,7 @@ export { cloudServicesClient } from './client/cloud-services'
|
|
|
12
12
|
export { codeShiftClient } from './client/code-shift'
|
|
13
13
|
export { contentClient } from './client/content'
|
|
14
14
|
export { eventBusClient } from './client/event-bus'
|
|
15
|
+
export { genAiInferenceClient } from './client/gen-ai-inference'
|
|
15
16
|
export { insightsClient } from './client/insights'
|
|
16
17
|
export { notificationClient } from './client/notification'
|
|
17
18
|
export { runtimeManagerClient } from './client/runtime-manager'
|