llama-stack-client 0.2.0 → 0.2.3-rc5
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/_shims/index.d.ts +2 -0
- package/_shims/index.js +5 -1
- package/_shims/index.mjs +5 -1
- package/core.d.ts +12 -1
- package/core.d.ts.map +1 -1
- package/core.js +8 -6
- package/core.js.map +1 -1
- package/core.mjs +9 -7
- package/core.mjs.map +1 -1
- package/index.d.mts +10 -7
- package/index.d.ts +10 -7
- package/index.d.ts.map +1 -1
- package/index.js +6 -3
- package/index.js.map +1 -1
- package/index.mjs +6 -3
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/chat/chat.d.ts +153 -0
- package/resources/chat/chat.d.ts.map +1 -0
- package/resources/chat/chat.js +39 -0
- package/resources/chat/chat.js.map +1 -0
- package/resources/chat/chat.mjs +12 -0
- package/resources/chat/chat.mjs.map +1 -0
- package/resources/chat/completions.d.ts +632 -0
- package/resources/chat/completions.d.ts.map +1 -0
- package/resources/chat/completions.js +16 -0
- package/resources/chat/completions.js.map +1 -0
- package/resources/chat/completions.mjs +12 -0
- package/resources/chat/completions.mjs.map +1 -0
- package/resources/chat/index.d.ts +3 -0
- package/resources/chat/index.d.ts.map +1 -0
- package/resources/chat/index.js +9 -0
- package/resources/chat/index.js.map +1 -0
- package/resources/chat/index.mjs +4 -0
- package/resources/chat/index.mjs.map +1 -0
- package/resources/chat.d.ts +2 -0
- package/resources/chat.d.ts.map +1 -0
- package/resources/chat.js +19 -0
- package/resources/chat.js.map +1 -0
- package/resources/chat.mjs +3 -0
- package/resources/chat.mjs.map +1 -0
- package/resources/completions.d.ts +193 -0
- package/resources/completions.d.ts.map +1 -0
- package/resources/completions.js +16 -0
- package/resources/completions.js.map +1 -0
- package/resources/completions.mjs +12 -0
- package/resources/completions.mjs.map +1 -0
- package/resources/datasets.d.ts +13 -6
- package/resources/datasets.d.ts.map +1 -1
- package/resources/datasets.js.map +1 -1
- package/resources/datasets.mjs.map +1 -1
- package/resources/eval/eval.d.ts +1 -1
- package/resources/eval/eval.d.ts.map +1 -1
- package/resources/index.d.ts +4 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -1
- package/resources/index.mjs.map +1 -1
- package/resources/inference.d.ts +86 -1
- package/resources/inference.d.ts.map +1 -1
- package/resources/inference.js +6 -0
- package/resources/inference.js.map +1 -1
- package/resources/inference.mjs +6 -0
- package/resources/inference.mjs.map +1 -1
- package/resources/inspect.d.ts +2 -1
- package/resources/inspect.d.ts.map +1 -1
- package/resources/post-training/job.d.ts +1 -1
- package/resources/post-training/job.d.ts.map +1 -1
- package/resources/post-training/post-training.d.ts +19 -19
- package/resources/post-training/post-training.d.ts.map +1 -1
- package/resources/shared.d.ts +40 -1
- package/resources/shared.d.ts.map +1 -1
- package/resources/tool-runtime/index.d.ts +1 -1
- package/resources/tool-runtime/index.d.ts.map +1 -1
- package/resources/tool-runtime/index.js.map +1 -1
- package/resources/tool-runtime/index.mjs.map +1 -1
- package/resources/tool-runtime/tool-runtime.d.ts +4 -4
- package/resources/tool-runtime/tool-runtime.d.ts.map +1 -1
- package/resources/tool-runtime/tool-runtime.js +1 -9
- package/resources/tool-runtime/tool-runtime.js.map +1 -1
- package/resources/tool-runtime/tool-runtime.mjs +1 -9
- package/resources/tool-runtime/tool-runtime.mjs.map +1 -1
- package/src/_shims/index.d.ts +2 -0
- package/src/_shims/index.js +5 -1
- package/src/_shims/index.mjs +5 -1
- package/src/core.ts +24 -5
- package/src/index.ts +30 -15
- package/src/resources/chat/chat.ts +206 -0
- package/src/resources/chat/completions.ts +890 -0
- package/src/resources/chat/index.ts +10 -0
- package/src/resources/chat.ts +3 -0
- package/src/resources/completions.ts +268 -0
- package/src/resources/datasets.ts +13 -6
- package/src/resources/eval/eval.ts +1 -1
- package/src/resources/index.ts +12 -6
- package/src/resources/inference.ts +121 -0
- package/src/resources/inspect.ts +3 -1
- package/src/resources/post-training/job.ts +1 -1
- package/src/resources/post-training/post-training.ts +32 -32
- package/src/resources/shared.ts +42 -1
- package/src/resources/tool-runtime/index.ts +1 -0
- package/src/resources/tool-runtime/tool-runtime.ts +11 -12
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/internal/decoders/jsonl.d.ts +0 -12
- package/internal/decoders/jsonl.d.ts.map +0 -1
- package/internal/decoders/jsonl.js +0 -35
- package/internal/decoders/jsonl.js.map +0 -1
- package/internal/decoders/jsonl.mjs +0 -31
- package/internal/decoders/jsonl.mjs.map +0 -1
- package/resources/batch-inference.d.ts +0 -66
- package/resources/batch-inference.d.ts.map +0 -1
- package/resources/batch-inference.js +0 -15
- package/resources/batch-inference.js.map +0 -1
- package/resources/batch-inference.mjs +0 -11
- package/resources/batch-inference.mjs.map +0 -1
- package/src/internal/decoders/jsonl.ts +0 -41
- package/src/resources/batch-inference.ts +0 -103
|
@@ -0,0 +1,632 @@
|
|
|
1
|
+
import { APIResource } from "../../resource.js";
|
|
2
|
+
import { APIPromise } from "../../core.js";
|
|
3
|
+
import * as Core from "../../core.js";
|
|
4
|
+
import * as CompletionsAPI from "./completions.js";
|
|
5
|
+
import * as ChatAPI from "./chat.js";
|
|
6
|
+
import { Stream } from "../../streaming.js";
|
|
7
|
+
export declare class Completions extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Generate an OpenAI-compatible chat completion for the given messages using the
|
|
10
|
+
* specified model.
|
|
11
|
+
*/
|
|
12
|
+
create(body: CompletionCreateParamsNonStreaming, options?: Core.RequestOptions): APIPromise<CompletionCreateResponse>;
|
|
13
|
+
create(body: CompletionCreateParamsStreaming, options?: Core.RequestOptions): APIPromise<Stream<ChatAPI.ChatCompletionChunk>>;
|
|
14
|
+
create(body: CompletionCreateParamsBase, options?: Core.RequestOptions): APIPromise<Stream<ChatAPI.ChatCompletionChunk> | CompletionCreateResponse>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Response from an OpenAI-compatible chat completion request.
|
|
18
|
+
*/
|
|
19
|
+
export type CompletionCreateResponse = CompletionCreateResponse.OpenAIChatCompletion | ChatAPI.ChatCompletionChunk;
|
|
20
|
+
export declare namespace CompletionCreateResponse {
|
|
21
|
+
/**
|
|
22
|
+
* Response from an OpenAI-compatible chat completion request.
|
|
23
|
+
*/
|
|
24
|
+
interface OpenAIChatCompletion {
|
|
25
|
+
/**
|
|
26
|
+
* The ID of the chat completion
|
|
27
|
+
*/
|
|
28
|
+
id: string;
|
|
29
|
+
/**
|
|
30
|
+
* List of choices
|
|
31
|
+
*/
|
|
32
|
+
choices: Array<OpenAIChatCompletion.Choice>;
|
|
33
|
+
/**
|
|
34
|
+
* The Unix timestamp in seconds when the chat completion was created
|
|
35
|
+
*/
|
|
36
|
+
created: number;
|
|
37
|
+
/**
|
|
38
|
+
* The model that was used to generate the chat completion
|
|
39
|
+
*/
|
|
40
|
+
model: string;
|
|
41
|
+
/**
|
|
42
|
+
* The object type, which will be "chat.completion"
|
|
43
|
+
*/
|
|
44
|
+
object: 'chat.completion';
|
|
45
|
+
}
|
|
46
|
+
namespace OpenAIChatCompletion {
|
|
47
|
+
/**
|
|
48
|
+
* A choice from an OpenAI-compatible chat completion response.
|
|
49
|
+
*/
|
|
50
|
+
interface Choice {
|
|
51
|
+
/**
|
|
52
|
+
* The reason the model stopped generating
|
|
53
|
+
*/
|
|
54
|
+
finish_reason: string;
|
|
55
|
+
/**
|
|
56
|
+
* The index of the choice
|
|
57
|
+
*/
|
|
58
|
+
index: number;
|
|
59
|
+
/**
|
|
60
|
+
* The message from the model
|
|
61
|
+
*/
|
|
62
|
+
message: Choice.OpenAIUserMessageParam | Choice.OpenAISystemMessageParam | Choice.OpenAIAssistantMessageParam | Choice.OpenAIToolMessageParam | Choice.OpenAIDeveloperMessageParam;
|
|
63
|
+
/**
|
|
64
|
+
* (Optional) The log probabilities for the tokens in the message
|
|
65
|
+
*/
|
|
66
|
+
logprobs?: Choice.Logprobs;
|
|
67
|
+
}
|
|
68
|
+
namespace Choice {
|
|
69
|
+
/**
|
|
70
|
+
* A message from the user in an OpenAI-compatible chat completion request.
|
|
71
|
+
*/
|
|
72
|
+
interface OpenAIUserMessageParam {
|
|
73
|
+
/**
|
|
74
|
+
* The content of the message, which can include text and other media
|
|
75
|
+
*/
|
|
76
|
+
content: string | Array<OpenAIUserMessageParam.OpenAIChatCompletionContentPartTextParam | OpenAIUserMessageParam.OpenAIChatCompletionContentPartImageParam>;
|
|
77
|
+
/**
|
|
78
|
+
* Must be "user" to identify this as a user message
|
|
79
|
+
*/
|
|
80
|
+
role: 'user';
|
|
81
|
+
/**
|
|
82
|
+
* (Optional) The name of the user message participant.
|
|
83
|
+
*/
|
|
84
|
+
name?: string;
|
|
85
|
+
}
|
|
86
|
+
namespace OpenAIUserMessageParam {
|
|
87
|
+
interface OpenAIChatCompletionContentPartTextParam {
|
|
88
|
+
text: string;
|
|
89
|
+
type: 'text';
|
|
90
|
+
}
|
|
91
|
+
interface OpenAIChatCompletionContentPartImageParam {
|
|
92
|
+
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
93
|
+
type: 'image_url';
|
|
94
|
+
}
|
|
95
|
+
namespace OpenAIChatCompletionContentPartImageParam {
|
|
96
|
+
interface ImageURL {
|
|
97
|
+
url: string;
|
|
98
|
+
detail?: string;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* A system message providing instructions or context to the model.
|
|
104
|
+
*/
|
|
105
|
+
interface OpenAISystemMessageParam {
|
|
106
|
+
/**
|
|
107
|
+
* The content of the "system prompt". If multiple system messages are provided,
|
|
108
|
+
* they are concatenated. The underlying Llama Stack code may also add other system
|
|
109
|
+
* messages (for example, for formatting tool definitions).
|
|
110
|
+
*/
|
|
111
|
+
content: string | Array<OpenAISystemMessageParam.OpenAIChatCompletionContentPartTextParam | OpenAISystemMessageParam.OpenAIChatCompletionContentPartImageParam>;
|
|
112
|
+
/**
|
|
113
|
+
* Must be "system" to identify this as a system message
|
|
114
|
+
*/
|
|
115
|
+
role: 'system';
|
|
116
|
+
/**
|
|
117
|
+
* (Optional) The name of the system message participant.
|
|
118
|
+
*/
|
|
119
|
+
name?: string;
|
|
120
|
+
}
|
|
121
|
+
namespace OpenAISystemMessageParam {
|
|
122
|
+
interface OpenAIChatCompletionContentPartTextParam {
|
|
123
|
+
text: string;
|
|
124
|
+
type: 'text';
|
|
125
|
+
}
|
|
126
|
+
interface OpenAIChatCompletionContentPartImageParam {
|
|
127
|
+
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
128
|
+
type: 'image_url';
|
|
129
|
+
}
|
|
130
|
+
namespace OpenAIChatCompletionContentPartImageParam {
|
|
131
|
+
interface ImageURL {
|
|
132
|
+
url: string;
|
|
133
|
+
detail?: string;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* A message containing the model's (assistant) response in an OpenAI-compatible
|
|
139
|
+
* chat completion request.
|
|
140
|
+
*/
|
|
141
|
+
interface OpenAIAssistantMessageParam {
|
|
142
|
+
/**
|
|
143
|
+
* Must be "assistant" to identify this as the model's response
|
|
144
|
+
*/
|
|
145
|
+
role: 'assistant';
|
|
146
|
+
/**
|
|
147
|
+
* The content of the model's response
|
|
148
|
+
*/
|
|
149
|
+
content?: string | Array<OpenAIAssistantMessageParam.OpenAIChatCompletionContentPartTextParam | OpenAIAssistantMessageParam.OpenAIChatCompletionContentPartImageParam>;
|
|
150
|
+
/**
|
|
151
|
+
* (Optional) The name of the assistant message participant.
|
|
152
|
+
*/
|
|
153
|
+
name?: string;
|
|
154
|
+
/**
|
|
155
|
+
* List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
|
|
156
|
+
*/
|
|
157
|
+
tool_calls?: Array<OpenAIAssistantMessageParam.ToolCall>;
|
|
158
|
+
}
|
|
159
|
+
namespace OpenAIAssistantMessageParam {
|
|
160
|
+
interface OpenAIChatCompletionContentPartTextParam {
|
|
161
|
+
text: string;
|
|
162
|
+
type: 'text';
|
|
163
|
+
}
|
|
164
|
+
interface OpenAIChatCompletionContentPartImageParam {
|
|
165
|
+
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
166
|
+
type: 'image_url';
|
|
167
|
+
}
|
|
168
|
+
namespace OpenAIChatCompletionContentPartImageParam {
|
|
169
|
+
interface ImageURL {
|
|
170
|
+
url: string;
|
|
171
|
+
detail?: string;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
interface ToolCall {
|
|
175
|
+
type: 'function';
|
|
176
|
+
id?: string;
|
|
177
|
+
function?: ToolCall.Function;
|
|
178
|
+
index?: number;
|
|
179
|
+
}
|
|
180
|
+
namespace ToolCall {
|
|
181
|
+
interface Function {
|
|
182
|
+
arguments?: string;
|
|
183
|
+
name?: string;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* A message representing the result of a tool invocation in an OpenAI-compatible
|
|
189
|
+
* chat completion request.
|
|
190
|
+
*/
|
|
191
|
+
interface OpenAIToolMessageParam {
|
|
192
|
+
/**
|
|
193
|
+
* The response content from the tool
|
|
194
|
+
*/
|
|
195
|
+
content: string | Array<OpenAIToolMessageParam.OpenAIChatCompletionContentPartTextParam | OpenAIToolMessageParam.OpenAIChatCompletionContentPartImageParam>;
|
|
196
|
+
/**
|
|
197
|
+
* Must be "tool" to identify this as a tool response
|
|
198
|
+
*/
|
|
199
|
+
role: 'tool';
|
|
200
|
+
/**
|
|
201
|
+
* Unique identifier for the tool call this response is for
|
|
202
|
+
*/
|
|
203
|
+
tool_call_id: string;
|
|
204
|
+
}
|
|
205
|
+
namespace OpenAIToolMessageParam {
|
|
206
|
+
interface OpenAIChatCompletionContentPartTextParam {
|
|
207
|
+
text: string;
|
|
208
|
+
type: 'text';
|
|
209
|
+
}
|
|
210
|
+
interface OpenAIChatCompletionContentPartImageParam {
|
|
211
|
+
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
212
|
+
type: 'image_url';
|
|
213
|
+
}
|
|
214
|
+
namespace OpenAIChatCompletionContentPartImageParam {
|
|
215
|
+
interface ImageURL {
|
|
216
|
+
url: string;
|
|
217
|
+
detail?: string;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* A message from the developer in an OpenAI-compatible chat completion request.
|
|
223
|
+
*/
|
|
224
|
+
interface OpenAIDeveloperMessageParam {
|
|
225
|
+
/**
|
|
226
|
+
* The content of the developer message
|
|
227
|
+
*/
|
|
228
|
+
content: string | Array<OpenAIDeveloperMessageParam.OpenAIChatCompletionContentPartTextParam | OpenAIDeveloperMessageParam.OpenAIChatCompletionContentPartImageParam>;
|
|
229
|
+
/**
|
|
230
|
+
* Must be "developer" to identify this as a developer message
|
|
231
|
+
*/
|
|
232
|
+
role: 'developer';
|
|
233
|
+
/**
|
|
234
|
+
* (Optional) The name of the developer message participant.
|
|
235
|
+
*/
|
|
236
|
+
name?: string;
|
|
237
|
+
}
|
|
238
|
+
namespace OpenAIDeveloperMessageParam {
|
|
239
|
+
interface OpenAIChatCompletionContentPartTextParam {
|
|
240
|
+
text: string;
|
|
241
|
+
type: 'text';
|
|
242
|
+
}
|
|
243
|
+
interface OpenAIChatCompletionContentPartImageParam {
|
|
244
|
+
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
245
|
+
type: 'image_url';
|
|
246
|
+
}
|
|
247
|
+
namespace OpenAIChatCompletionContentPartImageParam {
|
|
248
|
+
interface ImageURL {
|
|
249
|
+
url: string;
|
|
250
|
+
detail?: string;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* (Optional) The log probabilities for the tokens in the message
|
|
256
|
+
*/
|
|
257
|
+
interface Logprobs {
|
|
258
|
+
/**
|
|
259
|
+
* (Optional) The log probabilities for the tokens in the message
|
|
260
|
+
*/
|
|
261
|
+
content?: Array<Logprobs.Content>;
|
|
262
|
+
/**
|
|
263
|
+
* (Optional) The log probabilities for the tokens in the message
|
|
264
|
+
*/
|
|
265
|
+
refusal?: Array<Logprobs.Refusal>;
|
|
266
|
+
}
|
|
267
|
+
namespace Logprobs {
|
|
268
|
+
/**
|
|
269
|
+
* The log probability for a token from an OpenAI-compatible chat completion
|
|
270
|
+
* response.
|
|
271
|
+
*/
|
|
272
|
+
interface Content {
|
|
273
|
+
token: string;
|
|
274
|
+
logprob: number;
|
|
275
|
+
top_logprobs: Array<Content.TopLogprob>;
|
|
276
|
+
bytes?: Array<number>;
|
|
277
|
+
}
|
|
278
|
+
namespace Content {
|
|
279
|
+
/**
|
|
280
|
+
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
281
|
+
* response.
|
|
282
|
+
*/
|
|
283
|
+
interface TopLogprob {
|
|
284
|
+
token: string;
|
|
285
|
+
logprob: number;
|
|
286
|
+
bytes?: Array<number>;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* The log probability for a token from an OpenAI-compatible chat completion
|
|
291
|
+
* response.
|
|
292
|
+
*/
|
|
293
|
+
interface Refusal {
|
|
294
|
+
token: string;
|
|
295
|
+
logprob: number;
|
|
296
|
+
top_logprobs: Array<Refusal.TopLogprob>;
|
|
297
|
+
bytes?: Array<number>;
|
|
298
|
+
}
|
|
299
|
+
namespace Refusal {
|
|
300
|
+
/**
|
|
301
|
+
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
302
|
+
* response.
|
|
303
|
+
*/
|
|
304
|
+
interface TopLogprob {
|
|
305
|
+
token: string;
|
|
306
|
+
logprob: number;
|
|
307
|
+
bytes?: Array<number>;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
export type CompletionCreateParams = CompletionCreateParamsNonStreaming | CompletionCreateParamsStreaming;
|
|
315
|
+
export interface CompletionCreateParamsBase {
|
|
316
|
+
/**
|
|
317
|
+
* List of messages in the conversation
|
|
318
|
+
*/
|
|
319
|
+
messages: Array<CompletionCreateParams.OpenAIUserMessageParam | CompletionCreateParams.OpenAISystemMessageParam | CompletionCreateParams.OpenAIAssistantMessageParam | CompletionCreateParams.OpenAIToolMessageParam | CompletionCreateParams.OpenAIDeveloperMessageParam>;
|
|
320
|
+
/**
|
|
321
|
+
* The identifier of the model to use. The model must be registered with Llama
|
|
322
|
+
* Stack and available via the /models endpoint.
|
|
323
|
+
*/
|
|
324
|
+
model: string;
|
|
325
|
+
/**
|
|
326
|
+
* (Optional) The penalty for repeated tokens
|
|
327
|
+
*/
|
|
328
|
+
frequency_penalty?: number;
|
|
329
|
+
/**
|
|
330
|
+
* (Optional) The function call to use
|
|
331
|
+
*/
|
|
332
|
+
function_call?: string | Record<string, boolean | number | string | Array<unknown> | unknown | null>;
|
|
333
|
+
/**
|
|
334
|
+
* (Optional) List of functions to use
|
|
335
|
+
*/
|
|
336
|
+
functions?: Array<Record<string, boolean | number | string | Array<unknown> | unknown | null>>;
|
|
337
|
+
/**
|
|
338
|
+
* (Optional) The logit bias to use
|
|
339
|
+
*/
|
|
340
|
+
logit_bias?: Record<string, number>;
|
|
341
|
+
/**
|
|
342
|
+
* (Optional) The log probabilities to use
|
|
343
|
+
*/
|
|
344
|
+
logprobs?: boolean;
|
|
345
|
+
/**
|
|
346
|
+
* (Optional) The maximum number of tokens to generate
|
|
347
|
+
*/
|
|
348
|
+
max_completion_tokens?: number;
|
|
349
|
+
/**
|
|
350
|
+
* (Optional) The maximum number of tokens to generate
|
|
351
|
+
*/
|
|
352
|
+
max_tokens?: number;
|
|
353
|
+
/**
|
|
354
|
+
* (Optional) The number of completions to generate
|
|
355
|
+
*/
|
|
356
|
+
n?: number;
|
|
357
|
+
/**
|
|
358
|
+
* (Optional) Whether to parallelize tool calls
|
|
359
|
+
*/
|
|
360
|
+
parallel_tool_calls?: boolean;
|
|
361
|
+
/**
|
|
362
|
+
* (Optional) The penalty for repeated tokens
|
|
363
|
+
*/
|
|
364
|
+
presence_penalty?: number;
|
|
365
|
+
/**
|
|
366
|
+
* (Optional) The response format to use
|
|
367
|
+
*/
|
|
368
|
+
response_format?: CompletionCreateParams.OpenAIResponseFormatText | CompletionCreateParams.OpenAIResponseFormatJsonSchema | CompletionCreateParams.OpenAIResponseFormatJsonObject;
|
|
369
|
+
/**
|
|
370
|
+
* (Optional) The seed to use
|
|
371
|
+
*/
|
|
372
|
+
seed?: number;
|
|
373
|
+
/**
|
|
374
|
+
* (Optional) The stop tokens to use
|
|
375
|
+
*/
|
|
376
|
+
stop?: string | Array<string>;
|
|
377
|
+
/**
|
|
378
|
+
* (Optional) Whether to stream the response
|
|
379
|
+
*/
|
|
380
|
+
stream?: boolean;
|
|
381
|
+
/**
|
|
382
|
+
* (Optional) The stream options to use
|
|
383
|
+
*/
|
|
384
|
+
stream_options?: Record<string, boolean | number | string | Array<unknown> | unknown | null>;
|
|
385
|
+
/**
|
|
386
|
+
* (Optional) The temperature to use
|
|
387
|
+
*/
|
|
388
|
+
temperature?: number;
|
|
389
|
+
/**
|
|
390
|
+
* (Optional) The tool choice to use
|
|
391
|
+
*/
|
|
392
|
+
tool_choice?: string | Record<string, boolean | number | string | Array<unknown> | unknown | null>;
|
|
393
|
+
/**
|
|
394
|
+
* (Optional) The tools to use
|
|
395
|
+
*/
|
|
396
|
+
tools?: Array<Record<string, boolean | number | string | Array<unknown> | unknown | null>>;
|
|
397
|
+
/**
|
|
398
|
+
* (Optional) The top log probabilities to use
|
|
399
|
+
*/
|
|
400
|
+
top_logprobs?: number;
|
|
401
|
+
/**
|
|
402
|
+
* (Optional) The top p to use
|
|
403
|
+
*/
|
|
404
|
+
top_p?: number;
|
|
405
|
+
/**
|
|
406
|
+
* (Optional) The user to use
|
|
407
|
+
*/
|
|
408
|
+
user?: string;
|
|
409
|
+
}
|
|
410
|
+
export declare namespace CompletionCreateParams {
|
|
411
|
+
/**
|
|
412
|
+
* A message from the user in an OpenAI-compatible chat completion request.
|
|
413
|
+
*/
|
|
414
|
+
interface OpenAIUserMessageParam {
|
|
415
|
+
/**
|
|
416
|
+
* The content of the message, which can include text and other media
|
|
417
|
+
*/
|
|
418
|
+
content: string | Array<OpenAIUserMessageParam.OpenAIChatCompletionContentPartTextParam | OpenAIUserMessageParam.OpenAIChatCompletionContentPartImageParam>;
|
|
419
|
+
/**
|
|
420
|
+
* Must be "user" to identify this as a user message
|
|
421
|
+
*/
|
|
422
|
+
role: 'user';
|
|
423
|
+
/**
|
|
424
|
+
* (Optional) The name of the user message participant.
|
|
425
|
+
*/
|
|
426
|
+
name?: string;
|
|
427
|
+
}
|
|
428
|
+
namespace OpenAIUserMessageParam {
|
|
429
|
+
interface OpenAIChatCompletionContentPartTextParam {
|
|
430
|
+
text: string;
|
|
431
|
+
type: 'text';
|
|
432
|
+
}
|
|
433
|
+
interface OpenAIChatCompletionContentPartImageParam {
|
|
434
|
+
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
435
|
+
type: 'image_url';
|
|
436
|
+
}
|
|
437
|
+
namespace OpenAIChatCompletionContentPartImageParam {
|
|
438
|
+
interface ImageURL {
|
|
439
|
+
url: string;
|
|
440
|
+
detail?: string;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* A system message providing instructions or context to the model.
|
|
446
|
+
*/
|
|
447
|
+
interface OpenAISystemMessageParam {
|
|
448
|
+
/**
|
|
449
|
+
* The content of the "system prompt". If multiple system messages are provided,
|
|
450
|
+
* they are concatenated. The underlying Llama Stack code may also add other system
|
|
451
|
+
* messages (for example, for formatting tool definitions).
|
|
452
|
+
*/
|
|
453
|
+
content: string | Array<OpenAISystemMessageParam.OpenAIChatCompletionContentPartTextParam | OpenAISystemMessageParam.OpenAIChatCompletionContentPartImageParam>;
|
|
454
|
+
/**
|
|
455
|
+
* Must be "system" to identify this as a system message
|
|
456
|
+
*/
|
|
457
|
+
role: 'system';
|
|
458
|
+
/**
|
|
459
|
+
* (Optional) The name of the system message participant.
|
|
460
|
+
*/
|
|
461
|
+
name?: string;
|
|
462
|
+
}
|
|
463
|
+
namespace OpenAISystemMessageParam {
|
|
464
|
+
interface OpenAIChatCompletionContentPartTextParam {
|
|
465
|
+
text: string;
|
|
466
|
+
type: 'text';
|
|
467
|
+
}
|
|
468
|
+
interface OpenAIChatCompletionContentPartImageParam {
|
|
469
|
+
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
470
|
+
type: 'image_url';
|
|
471
|
+
}
|
|
472
|
+
namespace OpenAIChatCompletionContentPartImageParam {
|
|
473
|
+
interface ImageURL {
|
|
474
|
+
url: string;
|
|
475
|
+
detail?: string;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* A message containing the model's (assistant) response in an OpenAI-compatible
|
|
481
|
+
* chat completion request.
|
|
482
|
+
*/
|
|
483
|
+
interface OpenAIAssistantMessageParam {
|
|
484
|
+
/**
|
|
485
|
+
* Must be "assistant" to identify this as the model's response
|
|
486
|
+
*/
|
|
487
|
+
role: 'assistant';
|
|
488
|
+
/**
|
|
489
|
+
* The content of the model's response
|
|
490
|
+
*/
|
|
491
|
+
content?: string | Array<OpenAIAssistantMessageParam.OpenAIChatCompletionContentPartTextParam | OpenAIAssistantMessageParam.OpenAIChatCompletionContentPartImageParam>;
|
|
492
|
+
/**
|
|
493
|
+
* (Optional) The name of the assistant message participant.
|
|
494
|
+
*/
|
|
495
|
+
name?: string;
|
|
496
|
+
/**
|
|
497
|
+
* List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
|
|
498
|
+
*/
|
|
499
|
+
tool_calls?: Array<OpenAIAssistantMessageParam.ToolCall>;
|
|
500
|
+
}
|
|
501
|
+
namespace OpenAIAssistantMessageParam {
|
|
502
|
+
interface OpenAIChatCompletionContentPartTextParam {
|
|
503
|
+
text: string;
|
|
504
|
+
type: 'text';
|
|
505
|
+
}
|
|
506
|
+
interface OpenAIChatCompletionContentPartImageParam {
|
|
507
|
+
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
508
|
+
type: 'image_url';
|
|
509
|
+
}
|
|
510
|
+
namespace OpenAIChatCompletionContentPartImageParam {
|
|
511
|
+
interface ImageURL {
|
|
512
|
+
url: string;
|
|
513
|
+
detail?: string;
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
interface ToolCall {
|
|
517
|
+
type: 'function';
|
|
518
|
+
id?: string;
|
|
519
|
+
function?: ToolCall.Function;
|
|
520
|
+
index?: number;
|
|
521
|
+
}
|
|
522
|
+
namespace ToolCall {
|
|
523
|
+
interface Function {
|
|
524
|
+
arguments?: string;
|
|
525
|
+
name?: string;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* A message representing the result of a tool invocation in an OpenAI-compatible
|
|
531
|
+
* chat completion request.
|
|
532
|
+
*/
|
|
533
|
+
interface OpenAIToolMessageParam {
|
|
534
|
+
/**
|
|
535
|
+
* The response content from the tool
|
|
536
|
+
*/
|
|
537
|
+
content: string | Array<OpenAIToolMessageParam.OpenAIChatCompletionContentPartTextParam | OpenAIToolMessageParam.OpenAIChatCompletionContentPartImageParam>;
|
|
538
|
+
/**
|
|
539
|
+
* Must be "tool" to identify this as a tool response
|
|
540
|
+
*/
|
|
541
|
+
role: 'tool';
|
|
542
|
+
/**
|
|
543
|
+
* Unique identifier for the tool call this response is for
|
|
544
|
+
*/
|
|
545
|
+
tool_call_id: string;
|
|
546
|
+
}
|
|
547
|
+
namespace OpenAIToolMessageParam {
|
|
548
|
+
interface OpenAIChatCompletionContentPartTextParam {
|
|
549
|
+
text: string;
|
|
550
|
+
type: 'text';
|
|
551
|
+
}
|
|
552
|
+
interface OpenAIChatCompletionContentPartImageParam {
|
|
553
|
+
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
554
|
+
type: 'image_url';
|
|
555
|
+
}
|
|
556
|
+
namespace OpenAIChatCompletionContentPartImageParam {
|
|
557
|
+
interface ImageURL {
|
|
558
|
+
url: string;
|
|
559
|
+
detail?: string;
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* A message from the developer in an OpenAI-compatible chat completion request.
|
|
565
|
+
*/
|
|
566
|
+
interface OpenAIDeveloperMessageParam {
|
|
567
|
+
/**
|
|
568
|
+
* The content of the developer message
|
|
569
|
+
*/
|
|
570
|
+
content: string | Array<OpenAIDeveloperMessageParam.OpenAIChatCompletionContentPartTextParam | OpenAIDeveloperMessageParam.OpenAIChatCompletionContentPartImageParam>;
|
|
571
|
+
/**
|
|
572
|
+
* Must be "developer" to identify this as a developer message
|
|
573
|
+
*/
|
|
574
|
+
role: 'developer';
|
|
575
|
+
/**
|
|
576
|
+
* (Optional) The name of the developer message participant.
|
|
577
|
+
*/
|
|
578
|
+
name?: string;
|
|
579
|
+
}
|
|
580
|
+
namespace OpenAIDeveloperMessageParam {
|
|
581
|
+
interface OpenAIChatCompletionContentPartTextParam {
|
|
582
|
+
text: string;
|
|
583
|
+
type: 'text';
|
|
584
|
+
}
|
|
585
|
+
interface OpenAIChatCompletionContentPartImageParam {
|
|
586
|
+
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
587
|
+
type: 'image_url';
|
|
588
|
+
}
|
|
589
|
+
namespace OpenAIChatCompletionContentPartImageParam {
|
|
590
|
+
interface ImageURL {
|
|
591
|
+
url: string;
|
|
592
|
+
detail?: string;
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
interface OpenAIResponseFormatText {
|
|
597
|
+
type: 'text';
|
|
598
|
+
}
|
|
599
|
+
interface OpenAIResponseFormatJsonSchema {
|
|
600
|
+
json_schema: OpenAIResponseFormatJsonSchema.JsonSchema;
|
|
601
|
+
type: 'json_schema';
|
|
602
|
+
}
|
|
603
|
+
namespace OpenAIResponseFormatJsonSchema {
|
|
604
|
+
interface JsonSchema {
|
|
605
|
+
name: string;
|
|
606
|
+
description?: string;
|
|
607
|
+
schema?: Record<string, boolean | number | string | Array<unknown> | unknown | null>;
|
|
608
|
+
strict?: boolean;
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
interface OpenAIResponseFormatJsonObject {
|
|
612
|
+
type: 'json_object';
|
|
613
|
+
}
|
|
614
|
+
type CompletionCreateParamsNonStreaming = CompletionsAPI.CompletionCreateParamsNonStreaming;
|
|
615
|
+
type CompletionCreateParamsStreaming = CompletionsAPI.CompletionCreateParamsStreaming;
|
|
616
|
+
}
|
|
617
|
+
export interface CompletionCreateParamsNonStreaming extends CompletionCreateParamsBase {
|
|
618
|
+
/**
|
|
619
|
+
* (Optional) Whether to stream the response
|
|
620
|
+
*/
|
|
621
|
+
stream?: false;
|
|
622
|
+
}
|
|
623
|
+
export interface CompletionCreateParamsStreaming extends CompletionCreateParamsBase {
|
|
624
|
+
/**
|
|
625
|
+
* (Optional) Whether to stream the response
|
|
626
|
+
*/
|
|
627
|
+
stream: true;
|
|
628
|
+
}
|
|
629
|
+
export declare namespace Completions {
|
|
630
|
+
export { type CompletionCreateResponse as CompletionCreateResponse, type CompletionCreateParams as CompletionCreateParams, type CompletionCreateParamsNonStreaming as CompletionCreateParamsNonStreaming, type CompletionCreateParamsStreaming as CompletionCreateParamsStreaming, };
|
|
631
|
+
}
|
|
632
|
+
//# sourceMappingURL=completions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completions.d.ts","sourceRoot":"","sources":["../../src/resources/chat/completions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC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AgC,SAAQ,0BAA0B;IACjF;;OAEG;IACH,MAAM,EAAE,IAAI,CAAC;CACd;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,kCAAkC,IAAI,kCAAkC,EAC7E,KAAK,+BAA+B,IAAI,+BAA+B,GACxE,CAAC;CACH"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Completions = void 0;
|
|
5
|
+
const resource_1 = require("../../resource.js");
|
|
6
|
+
class Completions extends resource_1.APIResource {
|
|
7
|
+
create(body, options) {
|
|
8
|
+
return this._client.post('/v1/openai/v1/chat/completions', {
|
|
9
|
+
body,
|
|
10
|
+
...options,
|
|
11
|
+
stream: body.stream ?? false,
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.Completions = Completions;
|
|
16
|
+
//# sourceMappingURL=completions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completions.js","sourceRoot":"","sources":["../../src/resources/chat/completions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAO7C,MAAa,WAAY,SAAQ,sBAAW;IAiB1C,MAAM,CACJ,IAA4B,EAC5B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gCAAgC,EAAE;YACzD,IAAI;YACJ,GAAG,OAAO;YACV,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,KAAK;SAC7B,CAA2F,CAAC;IAC/F,CAAC;CACF;AA3BD,kCA2BC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../resource.mjs";
|
|
3
|
+
export class Completions extends APIResource {
|
|
4
|
+
create(body, options) {
|
|
5
|
+
return this._client.post('/v1/openai/v1/chat/completions', {
|
|
6
|
+
body,
|
|
7
|
+
...options,
|
|
8
|
+
stream: body.stream ?? false,
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=completions.mjs.map
|