llama-stack-client 0.4.4 → 0.4.5
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/.github/workflows/ci.yml +4 -4
- package/.github/workflows/release-doctor.yml +1 -1
- package/.release-please-manifest.json +1 -1
- package/.stats.yml +4 -4
- package/CHANGELOG.md +41 -0
- package/LICENSE +1 -1
- package/README.md +41 -27
- package/api.md +32 -25
- package/dist/CHANGELOG.md +41 -0
- package/dist/LICENSE +1 -1
- package/dist/README.md +41 -27
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +5 -0
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +5 -0
- package/dist/core.mjs.map +1 -1
- package/dist/index.d.mts +12 -6
- package/dist/index.d.ts +12 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/package.json +1 -1
- package/dist/resources/alpha/admin.d.ts +41 -0
- package/dist/resources/alpha/admin.d.ts.map +1 -0
- package/dist/resources/alpha/admin.js +46 -0
- package/dist/resources/alpha/admin.js.map +1 -0
- package/dist/resources/alpha/admin.mjs +42 -0
- package/dist/resources/alpha/admin.mjs.map +1 -0
- package/dist/resources/alpha/alpha.d.ts +8 -4
- package/dist/resources/alpha/alpha.d.ts.map +1 -1
- package/dist/resources/alpha/alpha.js +6 -2
- package/dist/resources/alpha/alpha.js.map +1 -1
- package/dist/resources/alpha/alpha.mjs +6 -2
- package/dist/resources/alpha/alpha.mjs.map +1 -1
- package/dist/resources/alpha/benchmarks.d.ts +37 -1
- package/dist/resources/alpha/benchmarks.d.ts.map +1 -1
- package/dist/resources/alpha/eval/eval.d.ts +28 -7
- package/dist/resources/alpha/eval/eval.d.ts.map +1 -1
- package/dist/resources/alpha/eval/eval.js.map +1 -1
- package/dist/resources/alpha/eval/eval.mjs.map +1 -1
- package/dist/resources/alpha/index.d.ts +2 -1
- package/dist/resources/alpha/index.d.ts.map +1 -1
- package/dist/resources/alpha/index.js +3 -1
- package/dist/resources/alpha/index.js.map +1 -1
- package/dist/resources/alpha/index.mjs +1 -0
- package/dist/resources/alpha/index.mjs.map +1 -1
- package/dist/resources/alpha/inference.d.ts +58 -7
- package/dist/resources/alpha/inference.d.ts.map +1 -1
- package/dist/resources/alpha/post-training/index.d.ts +2 -2
- package/dist/resources/alpha/post-training/index.d.ts.map +1 -1
- package/dist/resources/alpha/post-training/index.js.map +1 -1
- package/dist/resources/alpha/post-training/index.mjs +1 -1
- package/dist/resources/alpha/post-training/index.mjs.map +1 -1
- package/dist/resources/alpha/post-training/job.d.ts +4 -16
- package/dist/resources/alpha/post-training/job.d.ts.map +1 -1
- package/dist/resources/alpha/post-training/job.js +5 -6
- package/dist/resources/alpha/post-training/job.js.map +1 -1
- package/dist/resources/alpha/post-training/job.mjs +5 -6
- package/dist/resources/alpha/post-training/job.mjs.map +1 -1
- package/dist/resources/alpha/post-training/post-training.d.ts +38 -11
- package/dist/resources/alpha/post-training/post-training.d.ts.map +1 -1
- package/dist/resources/alpha/post-training/post-training.js.map +1 -1
- package/dist/resources/alpha/post-training/post-training.mjs +1 -1
- package/dist/resources/alpha/post-training/post-training.mjs.map +1 -1
- package/dist/resources/beta/datasets.d.ts +102 -8
- package/dist/resources/beta/datasets.d.ts.map +1 -1
- package/dist/resources/chat/chat.d.ts +119 -17
- package/dist/resources/chat/chat.d.ts.map +1 -1
- package/dist/resources/chat/chat.js.map +1 -1
- package/dist/resources/chat/chat.mjs.map +1 -1
- package/dist/resources/chat/completions.d.ts +1130 -73
- package/dist/resources/chat/completions.d.ts.map +1 -1
- package/dist/resources/chat/completions.js +0 -2
- package/dist/resources/chat/completions.js.map +1 -1
- package/dist/resources/chat/completions.mjs +0 -2
- package/dist/resources/chat/completions.mjs.map +1 -1
- package/dist/resources/completions.d.ts +135 -26
- package/dist/resources/completions.d.ts.map +1 -1
- package/dist/resources/completions.js.map +1 -1
- package/dist/resources/completions.mjs.map +1 -1
- package/dist/resources/conversations/conversations.d.ts +56 -12
- package/dist/resources/conversations/conversations.d.ts.map +1 -1
- package/dist/resources/conversations/conversations.js +0 -8
- package/dist/resources/conversations/conversations.js.map +1 -1
- package/dist/resources/conversations/conversations.mjs +0 -8
- package/dist/resources/conversations/conversations.mjs.map +1 -1
- package/dist/resources/conversations/items.d.ts +364 -81
- package/dist/resources/conversations/items.d.ts.map +1 -1
- package/dist/resources/conversations/items.js +0 -6
- package/dist/resources/conversations/items.js.map +1 -1
- package/dist/resources/conversations/items.mjs +0 -6
- package/dist/resources/conversations/items.mjs.map +1 -1
- package/dist/resources/embeddings.d.ts +46 -8
- package/dist/resources/embeddings.d.ts.map +1 -1
- package/dist/resources/embeddings.js +0 -2
- package/dist/resources/embeddings.js.map +1 -1
- package/dist/resources/embeddings.mjs +0 -2
- package/dist/resources/embeddings.mjs.map +1 -1
- package/dist/resources/files.d.ts +58 -31
- package/dist/resources/files.d.ts.map +1 -1
- package/dist/resources/files.js +4 -16
- package/dist/resources/files.js.map +1 -1
- package/dist/resources/files.mjs +4 -16
- package/dist/resources/files.mjs.map +1 -1
- package/dist/resources/index.d.ts +3 -3
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js.map +1 -1
- package/dist/resources/index.mjs.map +1 -1
- package/dist/resources/inspect.d.ts +3 -45
- package/dist/resources/inspect.d.ts.map +1 -1
- package/dist/resources/inspect.js +0 -4
- package/dist/resources/inspect.js.map +1 -1
- package/dist/resources/inspect.mjs +0 -4
- package/dist/resources/inspect.mjs.map +1 -1
- package/dist/resources/models/models.d.ts +21 -6
- package/dist/resources/models/models.d.ts.map +1 -1
- package/dist/resources/models/models.js +0 -6
- package/dist/resources/models/models.js.map +1 -1
- package/dist/resources/models/models.mjs +0 -6
- package/dist/resources/models/models.mjs.map +1 -1
- package/dist/resources/moderations.d.ts +38 -5
- package/dist/resources/moderations.d.ts.map +1 -1
- package/dist/resources/moderations.js +1 -3
- package/dist/resources/moderations.js.map +1 -1
- package/dist/resources/moderations.mjs +1 -3
- package/dist/resources/moderations.mjs.map +1 -1
- package/dist/resources/prompts/prompts.d.ts +24 -10
- package/dist/resources/prompts/prompts.d.ts.map +1 -1
- package/dist/resources/prompts/prompts.js +2 -10
- package/dist/resources/prompts/prompts.js.map +1 -1
- package/dist/resources/prompts/prompts.mjs +2 -10
- package/dist/resources/prompts/prompts.mjs.map +1 -1
- package/dist/resources/prompts/versions.d.ts +0 -2
- package/dist/resources/prompts/versions.d.ts.map +1 -1
- package/dist/resources/prompts/versions.js +0 -2
- package/dist/resources/prompts/versions.js.map +1 -1
- package/dist/resources/prompts/versions.mjs +0 -2
- package/dist/resources/prompts/versions.mjs.map +1 -1
- package/dist/resources/providers.d.ts +5 -12
- package/dist/resources/providers.d.ts.map +1 -1
- package/dist/resources/providers.js +0 -4
- package/dist/resources/providers.js.map +1 -1
- package/dist/resources/providers.mjs +0 -4
- package/dist/resources/providers.mjs.map +1 -1
- package/dist/resources/responses/input-items.d.ts +108 -9
- package/dist/resources/responses/input-items.d.ts.map +1 -1
- package/dist/resources/responses/responses.d.ts +881 -124
- package/dist/resources/responses/responses.d.ts.map +1 -1
- package/dist/resources/responses/responses.js.map +1 -1
- package/dist/resources/responses/responses.mjs.map +1 -1
- package/dist/resources/routes.d.ts +10 -9
- package/dist/resources/routes.d.ts.map +1 -1
- package/dist/resources/routes.js.map +1 -1
- package/dist/resources/routes.mjs.map +1 -1
- package/dist/resources/safety.d.ts +131 -9
- package/dist/resources/safety.d.ts.map +1 -1
- package/dist/resources/safety.js +1 -3
- package/dist/resources/safety.js.map +1 -1
- package/dist/resources/safety.mjs +1 -3
- package/dist/resources/safety.mjs.map +1 -1
- package/dist/resources/scoring-functions.d.ts +23 -1
- package/dist/resources/scoring-functions.d.ts.map +1 -1
- package/dist/resources/scoring.d.ts +24 -0
- package/dist/resources/scoring.d.ts.map +1 -1
- package/dist/resources/shared.d.ts +139 -7
- package/dist/resources/shared.d.ts.map +1 -1
- package/dist/resources/shields.d.ts +21 -0
- package/dist/resources/shields.d.ts.map +1 -1
- package/dist/resources/vector-io.d.ts +75 -58
- package/dist/resources/vector-io.d.ts.map +1 -1
- package/dist/resources/vector-io.js +1 -1
- package/dist/resources/vector-io.mjs +1 -1
- package/dist/resources/vector-stores/file-batches.d.ts +13 -7
- package/dist/resources/vector-stores/file-batches.d.ts.map +1 -1
- package/dist/resources/vector-stores/file-batches.js +3 -6
- package/dist/resources/vector-stores/file-batches.js.map +1 -1
- package/dist/resources/vector-stores/file-batches.mjs +3 -6
- package/dist/resources/vector-stores/file-batches.mjs.map +1 -1
- package/dist/resources/vector-stores/files.d.ts +31 -9
- package/dist/resources/vector-stores/files.d.ts.map +1 -1
- package/dist/resources/vector-stores/files.js +4 -4
- package/dist/resources/vector-stores/files.js.map +1 -1
- package/dist/resources/vector-stores/files.mjs +4 -4
- package/dist/resources/vector-stores/files.mjs.map +1 -1
- package/dist/resources/vector-stores/vector-stores.d.ts +87 -13
- package/dist/resources/vector-stores/vector-stores.d.ts.map +1 -1
- package/dist/resources/vector-stores/vector-stores.js +5 -10
- package/dist/resources/vector-stores/vector-stores.js.map +1 -1
- package/dist/resources/vector-stores/vector-stores.mjs +5 -10
- package/dist/resources/vector-stores/vector-stores.mjs.map +1 -1
- package/dist/src/core.ts +6 -0
- package/dist/src/index.ts +11 -16
- package/dist/src/resources/alpha/admin.ts +84 -0
- package/dist/src/resources/alpha/alpha.ts +16 -8
- package/dist/src/resources/alpha/benchmarks.ts +37 -1
- package/dist/src/resources/alpha/eval/eval.ts +28 -7
- package/dist/src/resources/alpha/index.ts +2 -0
- package/dist/src/resources/alpha/inference.ts +58 -7
- package/dist/src/resources/alpha/post-training/index.ts +2 -10
- package/dist/src/resources/alpha/post-training/job.ts +5 -26
- package/dist/src/resources/alpha/post-training/post-training.ts +38 -22
- package/dist/src/resources/beta/datasets.ts +103 -8
- package/dist/src/resources/chat/chat.ts +122 -20
- package/dist/src/resources/chat/completions.ts +1138 -79
- package/dist/src/resources/completions.ts +137 -28
- package/dist/src/resources/conversations/conversations.ts +67 -15
- package/dist/src/resources/conversations/items.ts +479 -110
- package/dist/src/resources/embeddings.ts +46 -8
- package/dist/src/resources/files.ts +58 -31
- package/dist/src/resources/index.ts +3 -3
- package/dist/src/resources/inspect.ts +3 -57
- package/dist/src/resources/models/models.ts +21 -6
- package/dist/src/resources/moderations.ts +38 -5
- package/dist/src/resources/prompts/prompts.ts +26 -12
- package/dist/src/resources/prompts/versions.ts +0 -2
- package/dist/src/resources/providers.ts +5 -16
- package/dist/src/resources/responses/input-items.ts +138 -15
- package/dist/src/resources/responses/responses.ts +1076 -196
- package/dist/src/resources/routes.ts +10 -14
- package/dist/src/resources/safety.ts +131 -8
- package/dist/src/resources/scoring-functions.ts +23 -1
- package/dist/src/resources/scoring.ts +24 -0
- package/dist/src/resources/shared.ts +148 -7
- package/dist/src/resources/shields.ts +21 -0
- package/dist/src/resources/vector-io.ts +95 -78
- package/dist/src/resources/vector-stores/file-batches.ts +13 -7
- package/dist/src/resources/vector-stores/files.ts +31 -11
- package/dist/src/resources/vector-stores/vector-stores.ts +89 -15
- package/dist/src/version.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +1 -1
- package/src/core.ts +6 -0
- package/src/index.ts +11 -16
- package/src/resources/alpha/admin.ts +84 -0
- package/src/resources/alpha/alpha.ts +16 -8
- package/src/resources/alpha/benchmarks.ts +37 -1
- package/src/resources/alpha/eval/eval.ts +28 -7
- package/src/resources/alpha/index.ts +2 -0
- package/src/resources/alpha/inference.ts +58 -7
- package/src/resources/alpha/post-training/index.ts +2 -10
- package/src/resources/alpha/post-training/job.ts +5 -26
- package/src/resources/alpha/post-training/post-training.ts +38 -22
- package/src/resources/beta/datasets.ts +103 -8
- package/src/resources/chat/chat.ts +122 -20
- package/src/resources/chat/completions.ts +1138 -79
- package/src/resources/completions.ts +137 -28
- package/src/resources/conversations/conversations.ts +67 -15
- package/src/resources/conversations/items.ts +479 -110
- package/src/resources/embeddings.ts +46 -8
- package/src/resources/files.ts +58 -31
- package/src/resources/index.ts +3 -3
- package/src/resources/inspect.ts +3 -57
- package/src/resources/models/models.ts +21 -6
- package/src/resources/moderations.ts +38 -5
- package/src/resources/prompts/prompts.ts +26 -12
- package/src/resources/prompts/versions.ts +0 -2
- package/src/resources/providers.ts +5 -16
- package/src/resources/responses/input-items.ts +138 -15
- package/src/resources/responses/responses.ts +1076 -196
- package/src/resources/routes.ts +10 -14
- package/src/resources/safety.ts +131 -8
- package/src/resources/scoring-functions.ts +23 -1
- package/src/resources/scoring.ts +24 -0
- package/src/resources/shared.ts +148 -7
- package/src/resources/shields.ts +21 -0
- package/src/resources/vector-io.ts +95 -78
- package/src/resources/vector-stores/file-batches.ts +13 -7
- package/src/resources/vector-stores/files.ts +31 -11
- package/src/resources/vector-stores/vector-stores.ts +89 -15
- package/src/version.ts +1 -1
- package/tests/api-resources/alpha/admin.test.ts +111 -0
- package/tests/api-resources/alpha/eval/eval.test.ts +40 -20
- package/tests/api-resources/alpha/inference.test.ts +1 -1
- package/tests/api-resources/alpha/post-training/job.test.ts +21 -12
- package/tests/api-resources/alpha/post-training/post-training.test.ts +12 -2
- package/tests/api-resources/beta/datasets.test.ts +9 -3
- package/tests/api-resources/chat/completions.test.ts +20 -7
- package/tests/api-resources/completions.test.ts +5 -5
- package/tests/api-resources/conversations/items.test.ts +22 -3
- package/tests/api-resources/embeddings.test.ts +2 -2
- package/tests/api-resources/files.test.ts +6 -1
- package/tests/api-resources/responses/input-items.test.ts +7 -1
- package/tests/api-resources/responses/responses.test.ts +19 -5
- package/tests/api-resources/safety.test.ts +9 -5
- package/tests/api-resources/tool-runtime.test.ts +9 -2
- package/tests/api-resources/vector-io.test.ts +13 -4
- package/tests/api-resources/vector-stores/file-batches.test.ts +7 -1
- package/tests/api-resources/vector-stores/files.test.ts +7 -1
- package/tests/api-resources/vector-stores/vector-stores.test.ts +14 -2
|
@@ -16,8 +16,6 @@ import { Stream } from '../../streaming';
|
|
|
16
16
|
|
|
17
17
|
export class Completions extends APIResource {
|
|
18
18
|
/**
|
|
19
|
-
* Create chat completions.
|
|
20
|
-
*
|
|
21
19
|
* Generate an OpenAI-compatible chat completion for the given messages using the
|
|
22
20
|
* specified model.
|
|
23
21
|
*/
|
|
@@ -43,8 +41,6 @@ export class Completions extends APIResource {
|
|
|
43
41
|
}
|
|
44
42
|
|
|
45
43
|
/**
|
|
46
|
-
* Get chat completion.
|
|
47
|
-
*
|
|
48
44
|
* Describe a chat completion by its ID.
|
|
49
45
|
*/
|
|
50
46
|
retrieve(completionId: string, options?: Core.RequestOptions): Core.APIPromise<CompletionRetrieveResponse> {
|
|
@@ -71,14 +67,29 @@ export class Completions extends APIResource {
|
|
|
71
67
|
* Response from an OpenAI-compatible chat completion request.
|
|
72
68
|
*/
|
|
73
69
|
export interface CompletionCreateResponse {
|
|
70
|
+
/**
|
|
71
|
+
* The ID of the chat completion.
|
|
72
|
+
*/
|
|
74
73
|
id: string;
|
|
75
74
|
|
|
75
|
+
/**
|
|
76
|
+
* List of choices.
|
|
77
|
+
*/
|
|
76
78
|
choices: Array<CompletionCreateResponse.Choice>;
|
|
77
79
|
|
|
80
|
+
/**
|
|
81
|
+
* The Unix timestamp in seconds when the chat completion was created.
|
|
82
|
+
*/
|
|
78
83
|
created: number;
|
|
79
84
|
|
|
85
|
+
/**
|
|
86
|
+
* The model that was used to generate the chat completion.
|
|
87
|
+
*/
|
|
80
88
|
model: string;
|
|
81
89
|
|
|
90
|
+
/**
|
|
91
|
+
* The object type.
|
|
92
|
+
*/
|
|
82
93
|
object?: 'chat.completion';
|
|
83
94
|
|
|
84
95
|
/**
|
|
@@ -92,12 +103,18 @@ export namespace CompletionCreateResponse {
|
|
|
92
103
|
* A choice from an OpenAI-compatible chat completion response.
|
|
93
104
|
*/
|
|
94
105
|
export interface Choice {
|
|
95
|
-
|
|
106
|
+
/**
|
|
107
|
+
* The reason the model stopped generating.
|
|
108
|
+
*/
|
|
109
|
+
finish_reason: 'stop' | 'length' | 'tool_calls' | 'content_filter' | 'function_call';
|
|
96
110
|
|
|
111
|
+
/**
|
|
112
|
+
* The index of the choice.
|
|
113
|
+
*/
|
|
97
114
|
index: number;
|
|
98
115
|
|
|
99
116
|
/**
|
|
100
|
-
*
|
|
117
|
+
* The message from the model.
|
|
101
118
|
*/
|
|
102
119
|
message:
|
|
103
120
|
| Choice.OpenAIUserMessageParamOutput
|
|
@@ -118,6 +135,9 @@ export namespace CompletionCreateResponse {
|
|
|
118
135
|
* A message from the user in an OpenAI-compatible chat completion request.
|
|
119
136
|
*/
|
|
120
137
|
export interface OpenAIUserMessageParamOutput {
|
|
138
|
+
/**
|
|
139
|
+
* The content of the message, which can include text and other media.
|
|
140
|
+
*/
|
|
121
141
|
content:
|
|
122
142
|
| string
|
|
123
143
|
| Array<
|
|
@@ -126,8 +146,14 @@ export namespace CompletionCreateResponse {
|
|
|
126
146
|
| OpenAIUserMessageParamOutput.OpenAIFile
|
|
127
147
|
>;
|
|
128
148
|
|
|
149
|
+
/**
|
|
150
|
+
* The name of the user message participant.
|
|
151
|
+
*/
|
|
129
152
|
name?: string | null;
|
|
130
153
|
|
|
154
|
+
/**
|
|
155
|
+
* Must be 'user' to identify this as a user message.
|
|
156
|
+
*/
|
|
131
157
|
role?: 'user';
|
|
132
158
|
}
|
|
133
159
|
|
|
@@ -136,8 +162,14 @@ export namespace CompletionCreateResponse {
|
|
|
136
162
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
137
163
|
*/
|
|
138
164
|
export interface OpenAIChatCompletionContentPartTextParam {
|
|
165
|
+
/**
|
|
166
|
+
* The text content of the message.
|
|
167
|
+
*/
|
|
139
168
|
text: string;
|
|
140
169
|
|
|
170
|
+
/**
|
|
171
|
+
* Must be 'text' to identify this as text content.
|
|
172
|
+
*/
|
|
141
173
|
type?: 'text';
|
|
142
174
|
}
|
|
143
175
|
|
|
@@ -146,36 +178,63 @@ export namespace CompletionCreateResponse {
|
|
|
146
178
|
*/
|
|
147
179
|
export interface OpenAIChatCompletionContentPartImageParam {
|
|
148
180
|
/**
|
|
149
|
-
* Image URL specification
|
|
181
|
+
* Image URL specification and processing details.
|
|
150
182
|
*/
|
|
151
183
|
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
152
184
|
|
|
185
|
+
/**
|
|
186
|
+
* Must be 'image_url' to identify this as image content.
|
|
187
|
+
*/
|
|
153
188
|
type?: 'image_url';
|
|
154
189
|
}
|
|
155
190
|
|
|
156
191
|
export namespace OpenAIChatCompletionContentPartImageParam {
|
|
157
192
|
/**
|
|
158
|
-
* Image URL specification
|
|
193
|
+
* Image URL specification and processing details.
|
|
159
194
|
*/
|
|
160
195
|
export interface ImageURL {
|
|
196
|
+
/**
|
|
197
|
+
* URL of the image to include in the message.
|
|
198
|
+
*/
|
|
161
199
|
url: string;
|
|
162
200
|
|
|
163
|
-
|
|
201
|
+
/**
|
|
202
|
+
* Level of detail for image processing. Can be 'low', 'high', or 'auto'.
|
|
203
|
+
*/
|
|
204
|
+
detail?: 'low' | 'high' | 'auto' | null;
|
|
164
205
|
}
|
|
165
206
|
}
|
|
166
207
|
|
|
167
208
|
export interface OpenAIFile {
|
|
209
|
+
/**
|
|
210
|
+
* File specification.
|
|
211
|
+
*/
|
|
168
212
|
file: OpenAIFile.File;
|
|
169
213
|
|
|
214
|
+
/**
|
|
215
|
+
* Must be 'file' to identify this as file content.
|
|
216
|
+
*/
|
|
170
217
|
type?: 'file';
|
|
171
218
|
}
|
|
172
219
|
|
|
173
220
|
export namespace OpenAIFile {
|
|
221
|
+
/**
|
|
222
|
+
* File specification.
|
|
223
|
+
*/
|
|
174
224
|
export interface File {
|
|
225
|
+
/**
|
|
226
|
+
* Base64-encoded file data.
|
|
227
|
+
*/
|
|
175
228
|
file_data?: string | null;
|
|
176
229
|
|
|
230
|
+
/**
|
|
231
|
+
* ID of an uploaded file.
|
|
232
|
+
*/
|
|
177
233
|
file_id?: string | null;
|
|
178
234
|
|
|
235
|
+
/**
|
|
236
|
+
* Name of the file.
|
|
237
|
+
*/
|
|
179
238
|
filename?: string | null;
|
|
180
239
|
}
|
|
181
240
|
}
|
|
@@ -185,10 +244,20 @@ export namespace CompletionCreateResponse {
|
|
|
185
244
|
* A system message providing instructions or context to the model.
|
|
186
245
|
*/
|
|
187
246
|
export interface OpenAISystemMessageParam {
|
|
247
|
+
/**
|
|
248
|
+
* The content of the 'system prompt'. If multiple system messages are provided,
|
|
249
|
+
* they are concatenated.
|
|
250
|
+
*/
|
|
188
251
|
content: string | Array<OpenAISystemMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
189
252
|
|
|
253
|
+
/**
|
|
254
|
+
* The name of the system message participant.
|
|
255
|
+
*/
|
|
190
256
|
name?: string | null;
|
|
191
257
|
|
|
258
|
+
/**
|
|
259
|
+
* Must be 'system' to identify this as a system message.
|
|
260
|
+
*/
|
|
192
261
|
role?: 'system';
|
|
193
262
|
}
|
|
194
263
|
|
|
@@ -197,8 +266,14 @@ export namespace CompletionCreateResponse {
|
|
|
197
266
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
198
267
|
*/
|
|
199
268
|
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
269
|
+
/**
|
|
270
|
+
* The text content of the message.
|
|
271
|
+
*/
|
|
200
272
|
text: string;
|
|
201
273
|
|
|
274
|
+
/**
|
|
275
|
+
* Must be 'text' to identify this as text content.
|
|
276
|
+
*/
|
|
202
277
|
type?: 'text';
|
|
203
278
|
}
|
|
204
279
|
}
|
|
@@ -208,15 +283,27 @@ export namespace CompletionCreateResponse {
|
|
|
208
283
|
* chat completion request.
|
|
209
284
|
*/
|
|
210
285
|
export interface OpenAIAssistantMessageParamOutput {
|
|
286
|
+
/**
|
|
287
|
+
* The content of the model's response.
|
|
288
|
+
*/
|
|
211
289
|
content?:
|
|
212
290
|
| string
|
|
213
291
|
| Array<OpenAIAssistantMessageParamOutput.ListOpenAIChatCompletionContentPartTextParam>
|
|
214
292
|
| null;
|
|
215
293
|
|
|
294
|
+
/**
|
|
295
|
+
* The name of the assistant message participant.
|
|
296
|
+
*/
|
|
216
297
|
name?: string | null;
|
|
217
298
|
|
|
299
|
+
/**
|
|
300
|
+
* Must be 'assistant' to identify this as the model's response.
|
|
301
|
+
*/
|
|
218
302
|
role?: 'assistant';
|
|
219
303
|
|
|
304
|
+
/**
|
|
305
|
+
* List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
|
|
306
|
+
*/
|
|
220
307
|
tool_calls?: Array<OpenAIAssistantMessageParamOutput.ToolCall> | null;
|
|
221
308
|
}
|
|
222
309
|
|
|
@@ -225,8 +312,14 @@ export namespace CompletionCreateResponse {
|
|
|
225
312
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
226
313
|
*/
|
|
227
314
|
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
315
|
+
/**
|
|
316
|
+
* The text content of the message.
|
|
317
|
+
*/
|
|
228
318
|
text: string;
|
|
229
319
|
|
|
320
|
+
/**
|
|
321
|
+
* Must be 'text' to identify this as text content.
|
|
322
|
+
*/
|
|
230
323
|
type?: 'text';
|
|
231
324
|
}
|
|
232
325
|
|
|
@@ -234,6 +327,9 @@ export namespace CompletionCreateResponse {
|
|
|
234
327
|
* Tool call specification for OpenAI-compatible chat completion responses.
|
|
235
328
|
*/
|
|
236
329
|
export interface ToolCall {
|
|
330
|
+
/**
|
|
331
|
+
* Unique identifier for the tool call.
|
|
332
|
+
*/
|
|
237
333
|
id?: string | null;
|
|
238
334
|
|
|
239
335
|
/**
|
|
@@ -241,8 +337,14 @@ export namespace CompletionCreateResponse {
|
|
|
241
337
|
*/
|
|
242
338
|
function?: ToolCall.Function | null;
|
|
243
339
|
|
|
340
|
+
/**
|
|
341
|
+
* Index of the tool call in the list.
|
|
342
|
+
*/
|
|
244
343
|
index?: number | null;
|
|
245
344
|
|
|
345
|
+
/**
|
|
346
|
+
* Must be 'function' to identify this as a function call.
|
|
347
|
+
*/
|
|
246
348
|
type?: 'function';
|
|
247
349
|
}
|
|
248
350
|
|
|
@@ -251,8 +353,14 @@ export namespace CompletionCreateResponse {
|
|
|
251
353
|
* Function call details for OpenAI-compatible tool calls.
|
|
252
354
|
*/
|
|
253
355
|
export interface Function {
|
|
356
|
+
/**
|
|
357
|
+
* Arguments to pass to the function as a JSON string.
|
|
358
|
+
*/
|
|
254
359
|
arguments?: string | null;
|
|
255
360
|
|
|
361
|
+
/**
|
|
362
|
+
* Name of the function to call.
|
|
363
|
+
*/
|
|
256
364
|
name?: string | null;
|
|
257
365
|
}
|
|
258
366
|
}
|
|
@@ -263,10 +371,19 @@ export namespace CompletionCreateResponse {
|
|
|
263
371
|
* chat completion request.
|
|
264
372
|
*/
|
|
265
373
|
export interface OpenAIToolMessageParam {
|
|
374
|
+
/**
|
|
375
|
+
* The response content from the tool.
|
|
376
|
+
*/
|
|
266
377
|
content: string | Array<OpenAIToolMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
267
378
|
|
|
379
|
+
/**
|
|
380
|
+
* Unique identifier for the tool call this response is for.
|
|
381
|
+
*/
|
|
268
382
|
tool_call_id: string;
|
|
269
383
|
|
|
384
|
+
/**
|
|
385
|
+
* Must be 'tool' to identify this as a tool response.
|
|
386
|
+
*/
|
|
270
387
|
role?: 'tool';
|
|
271
388
|
}
|
|
272
389
|
|
|
@@ -275,8 +392,14 @@ export namespace CompletionCreateResponse {
|
|
|
275
392
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
276
393
|
*/
|
|
277
394
|
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
395
|
+
/**
|
|
396
|
+
* The text content of the message.
|
|
397
|
+
*/
|
|
278
398
|
text: string;
|
|
279
399
|
|
|
400
|
+
/**
|
|
401
|
+
* Must be 'text' to identify this as text content.
|
|
402
|
+
*/
|
|
280
403
|
type?: 'text';
|
|
281
404
|
}
|
|
282
405
|
}
|
|
@@ -285,10 +408,19 @@ export namespace CompletionCreateResponse {
|
|
|
285
408
|
* A message from the developer in an OpenAI-compatible chat completion request.
|
|
286
409
|
*/
|
|
287
410
|
export interface OpenAIDeveloperMessageParam {
|
|
411
|
+
/**
|
|
412
|
+
* The content of the developer message.
|
|
413
|
+
*/
|
|
288
414
|
content: string | Array<OpenAIDeveloperMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
289
415
|
|
|
416
|
+
/**
|
|
417
|
+
* The name of the developer message participant.
|
|
418
|
+
*/
|
|
290
419
|
name?: string | null;
|
|
291
420
|
|
|
421
|
+
/**
|
|
422
|
+
* Must be 'developer' to identify this as a developer message.
|
|
423
|
+
*/
|
|
292
424
|
role?: 'developer';
|
|
293
425
|
}
|
|
294
426
|
|
|
@@ -297,8 +429,14 @@ export namespace CompletionCreateResponse {
|
|
|
297
429
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
298
430
|
*/
|
|
299
431
|
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
432
|
+
/**
|
|
433
|
+
* The text content of the message.
|
|
434
|
+
*/
|
|
300
435
|
text: string;
|
|
301
436
|
|
|
437
|
+
/**
|
|
438
|
+
* Must be 'text' to identify this as text content.
|
|
439
|
+
*/
|
|
302
440
|
type?: 'text';
|
|
303
441
|
}
|
|
304
442
|
}
|
|
@@ -308,8 +446,14 @@ export namespace CompletionCreateResponse {
|
|
|
308
446
|
* chat completion response.
|
|
309
447
|
*/
|
|
310
448
|
export interface Logprobs {
|
|
449
|
+
/**
|
|
450
|
+
* The log probabilities for the tokens in the message.
|
|
451
|
+
*/
|
|
311
452
|
content?: Array<Logprobs.Content> | null;
|
|
312
453
|
|
|
454
|
+
/**
|
|
455
|
+
* The log probabilities for the refusal tokens.
|
|
456
|
+
*/
|
|
313
457
|
refusal?: Array<Logprobs.Refusal> | null;
|
|
314
458
|
}
|
|
315
459
|
|
|
@@ -317,33 +461,48 @@ export namespace CompletionCreateResponse {
|
|
|
317
461
|
/**
|
|
318
462
|
* The log probability for a token from an OpenAI-compatible chat completion
|
|
319
463
|
* response.
|
|
320
|
-
*
|
|
321
|
-
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
322
|
-
* probability of the token :top_logprobs: The top log probabilities for the token
|
|
323
464
|
*/
|
|
324
465
|
export interface Content {
|
|
466
|
+
/**
|
|
467
|
+
* The token.
|
|
468
|
+
*/
|
|
325
469
|
token: string;
|
|
326
470
|
|
|
471
|
+
/**
|
|
472
|
+
* The log probability of the token.
|
|
473
|
+
*/
|
|
327
474
|
logprob: number;
|
|
328
475
|
|
|
329
|
-
|
|
330
|
-
|
|
476
|
+
/**
|
|
477
|
+
* The bytes for the token.
|
|
478
|
+
*/
|
|
331
479
|
bytes?: Array<number> | null;
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* The top log probabilities for the token.
|
|
483
|
+
*/
|
|
484
|
+
top_logprobs?: Array<Content.TopLogprob> | null;
|
|
332
485
|
}
|
|
333
486
|
|
|
334
487
|
export namespace Content {
|
|
335
488
|
/**
|
|
336
489
|
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
337
490
|
* response.
|
|
338
|
-
*
|
|
339
|
-
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
340
|
-
* probability of the token
|
|
341
491
|
*/
|
|
342
492
|
export interface TopLogprob {
|
|
493
|
+
/**
|
|
494
|
+
* The token.
|
|
495
|
+
*/
|
|
343
496
|
token: string;
|
|
344
497
|
|
|
498
|
+
/**
|
|
499
|
+
* The log probability of the token.
|
|
500
|
+
*/
|
|
345
501
|
logprob: number;
|
|
346
502
|
|
|
503
|
+
/**
|
|
504
|
+
* The bytes for the token.
|
|
505
|
+
*/
|
|
347
506
|
bytes?: Array<number> | null;
|
|
348
507
|
}
|
|
349
508
|
}
|
|
@@ -351,33 +510,48 @@ export namespace CompletionCreateResponse {
|
|
|
351
510
|
/**
|
|
352
511
|
* The log probability for a token from an OpenAI-compatible chat completion
|
|
353
512
|
* response.
|
|
354
|
-
*
|
|
355
|
-
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
356
|
-
* probability of the token :top_logprobs: The top log probabilities for the token
|
|
357
513
|
*/
|
|
358
514
|
export interface Refusal {
|
|
515
|
+
/**
|
|
516
|
+
* The token.
|
|
517
|
+
*/
|
|
359
518
|
token: string;
|
|
360
519
|
|
|
520
|
+
/**
|
|
521
|
+
* The log probability of the token.
|
|
522
|
+
*/
|
|
361
523
|
logprob: number;
|
|
362
524
|
|
|
363
|
-
|
|
364
|
-
|
|
525
|
+
/**
|
|
526
|
+
* The bytes for the token.
|
|
527
|
+
*/
|
|
365
528
|
bytes?: Array<number> | null;
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* The top log probabilities for the token.
|
|
532
|
+
*/
|
|
533
|
+
top_logprobs?: Array<Refusal.TopLogprob> | null;
|
|
366
534
|
}
|
|
367
535
|
|
|
368
536
|
export namespace Refusal {
|
|
369
537
|
/**
|
|
370
538
|
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
371
539
|
* response.
|
|
372
|
-
*
|
|
373
|
-
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
374
|
-
* probability of the token
|
|
375
540
|
*/
|
|
376
541
|
export interface TopLogprob {
|
|
542
|
+
/**
|
|
543
|
+
* The token.
|
|
544
|
+
*/
|
|
377
545
|
token: string;
|
|
378
546
|
|
|
547
|
+
/**
|
|
548
|
+
* The log probability of the token.
|
|
549
|
+
*/
|
|
379
550
|
logprob: number;
|
|
380
551
|
|
|
552
|
+
/**
|
|
553
|
+
* The bytes for the token.
|
|
554
|
+
*/
|
|
381
555
|
bytes?: Array<number> | null;
|
|
382
556
|
}
|
|
383
557
|
}
|
|
@@ -388,10 +562,19 @@ export namespace CompletionCreateResponse {
|
|
|
388
562
|
* Usage information for OpenAI chat completion.
|
|
389
563
|
*/
|
|
390
564
|
export interface Usage {
|
|
565
|
+
/**
|
|
566
|
+
* Number of tokens in the completion.
|
|
567
|
+
*/
|
|
391
568
|
completion_tokens: number;
|
|
392
569
|
|
|
570
|
+
/**
|
|
571
|
+
* Number of tokens in the prompt.
|
|
572
|
+
*/
|
|
393
573
|
prompt_tokens: number;
|
|
394
574
|
|
|
575
|
+
/**
|
|
576
|
+
* Total tokens used (prompt + completion).
|
|
577
|
+
*/
|
|
395
578
|
total_tokens: number;
|
|
396
579
|
|
|
397
580
|
/**
|
|
@@ -410,6 +593,9 @@ export namespace CompletionCreateResponse {
|
|
|
410
593
|
* Token details for output tokens in OpenAI chat completion usage.
|
|
411
594
|
*/
|
|
412
595
|
export interface CompletionTokensDetails {
|
|
596
|
+
/**
|
|
597
|
+
* Number of tokens used for reasoning (o1/o3 models).
|
|
598
|
+
*/
|
|
413
599
|
reasoning_tokens?: number | null;
|
|
414
600
|
}
|
|
415
601
|
|
|
@@ -417,18 +603,33 @@ export namespace CompletionCreateResponse {
|
|
|
417
603
|
* Token details for prompt tokens in OpenAI chat completion usage.
|
|
418
604
|
*/
|
|
419
605
|
export interface PromptTokensDetails {
|
|
606
|
+
/**
|
|
607
|
+
* Number of tokens retrieved from cache.
|
|
608
|
+
*/
|
|
420
609
|
cached_tokens?: number | null;
|
|
421
610
|
}
|
|
422
611
|
}
|
|
423
612
|
}
|
|
424
613
|
|
|
425
614
|
export interface CompletionRetrieveResponse {
|
|
615
|
+
/**
|
|
616
|
+
* The ID of the chat completion.
|
|
617
|
+
*/
|
|
426
618
|
id: string;
|
|
427
619
|
|
|
620
|
+
/**
|
|
621
|
+
* List of choices.
|
|
622
|
+
*/
|
|
428
623
|
choices: Array<CompletionRetrieveResponse.Choice>;
|
|
429
624
|
|
|
625
|
+
/**
|
|
626
|
+
* The Unix timestamp in seconds when the chat completion was created.
|
|
627
|
+
*/
|
|
430
628
|
created: number;
|
|
431
629
|
|
|
630
|
+
/**
|
|
631
|
+
* The input messages used to generate this completion.
|
|
632
|
+
*/
|
|
432
633
|
input_messages: Array<
|
|
433
634
|
| CompletionRetrieveResponse.OpenAIUserMessageParamOutput
|
|
434
635
|
| CompletionRetrieveResponse.OpenAISystemMessageParam
|
|
@@ -437,8 +638,14 @@ export interface CompletionRetrieveResponse {
|
|
|
437
638
|
| CompletionRetrieveResponse.OpenAIDeveloperMessageParam
|
|
438
639
|
>;
|
|
439
640
|
|
|
641
|
+
/**
|
|
642
|
+
* The model that was used to generate the chat completion.
|
|
643
|
+
*/
|
|
440
644
|
model: string;
|
|
441
645
|
|
|
646
|
+
/**
|
|
647
|
+
* The object type.
|
|
648
|
+
*/
|
|
442
649
|
object?: 'chat.completion';
|
|
443
650
|
|
|
444
651
|
/**
|
|
@@ -452,12 +659,18 @@ export namespace CompletionRetrieveResponse {
|
|
|
452
659
|
* A choice from an OpenAI-compatible chat completion response.
|
|
453
660
|
*/
|
|
454
661
|
export interface Choice {
|
|
455
|
-
|
|
662
|
+
/**
|
|
663
|
+
* The reason the model stopped generating.
|
|
664
|
+
*/
|
|
665
|
+
finish_reason: 'stop' | 'length' | 'tool_calls' | 'content_filter' | 'function_call';
|
|
456
666
|
|
|
667
|
+
/**
|
|
668
|
+
* The index of the choice.
|
|
669
|
+
*/
|
|
457
670
|
index: number;
|
|
458
671
|
|
|
459
672
|
/**
|
|
460
|
-
*
|
|
673
|
+
* The message from the model.
|
|
461
674
|
*/
|
|
462
675
|
message:
|
|
463
676
|
| Choice.OpenAIUserMessageParamOutput
|
|
@@ -478,6 +691,9 @@ export namespace CompletionRetrieveResponse {
|
|
|
478
691
|
* A message from the user in an OpenAI-compatible chat completion request.
|
|
479
692
|
*/
|
|
480
693
|
export interface OpenAIUserMessageParamOutput {
|
|
694
|
+
/**
|
|
695
|
+
* The content of the message, which can include text and other media.
|
|
696
|
+
*/
|
|
481
697
|
content:
|
|
482
698
|
| string
|
|
483
699
|
| Array<
|
|
@@ -486,8 +702,14 @@ export namespace CompletionRetrieveResponse {
|
|
|
486
702
|
| OpenAIUserMessageParamOutput.OpenAIFile
|
|
487
703
|
>;
|
|
488
704
|
|
|
705
|
+
/**
|
|
706
|
+
* The name of the user message participant.
|
|
707
|
+
*/
|
|
489
708
|
name?: string | null;
|
|
490
709
|
|
|
710
|
+
/**
|
|
711
|
+
* Must be 'user' to identify this as a user message.
|
|
712
|
+
*/
|
|
491
713
|
role?: 'user';
|
|
492
714
|
}
|
|
493
715
|
|
|
@@ -496,8 +718,14 @@ export namespace CompletionRetrieveResponse {
|
|
|
496
718
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
497
719
|
*/
|
|
498
720
|
export interface OpenAIChatCompletionContentPartTextParam {
|
|
721
|
+
/**
|
|
722
|
+
* The text content of the message.
|
|
723
|
+
*/
|
|
499
724
|
text: string;
|
|
500
725
|
|
|
726
|
+
/**
|
|
727
|
+
* Must be 'text' to identify this as text content.
|
|
728
|
+
*/
|
|
501
729
|
type?: 'text';
|
|
502
730
|
}
|
|
503
731
|
|
|
@@ -506,36 +734,63 @@ export namespace CompletionRetrieveResponse {
|
|
|
506
734
|
*/
|
|
507
735
|
export interface OpenAIChatCompletionContentPartImageParam {
|
|
508
736
|
/**
|
|
509
|
-
* Image URL specification
|
|
737
|
+
* Image URL specification and processing details.
|
|
510
738
|
*/
|
|
511
739
|
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
512
740
|
|
|
741
|
+
/**
|
|
742
|
+
* Must be 'image_url' to identify this as image content.
|
|
743
|
+
*/
|
|
513
744
|
type?: 'image_url';
|
|
514
745
|
}
|
|
515
746
|
|
|
516
747
|
export namespace OpenAIChatCompletionContentPartImageParam {
|
|
517
748
|
/**
|
|
518
|
-
* Image URL specification
|
|
749
|
+
* Image URL specification and processing details.
|
|
519
750
|
*/
|
|
520
751
|
export interface ImageURL {
|
|
752
|
+
/**
|
|
753
|
+
* URL of the image to include in the message.
|
|
754
|
+
*/
|
|
521
755
|
url: string;
|
|
522
756
|
|
|
523
|
-
|
|
757
|
+
/**
|
|
758
|
+
* Level of detail for image processing. Can be 'low', 'high', or 'auto'.
|
|
759
|
+
*/
|
|
760
|
+
detail?: 'low' | 'high' | 'auto' | null;
|
|
524
761
|
}
|
|
525
762
|
}
|
|
526
763
|
|
|
527
764
|
export interface OpenAIFile {
|
|
765
|
+
/**
|
|
766
|
+
* File specification.
|
|
767
|
+
*/
|
|
528
768
|
file: OpenAIFile.File;
|
|
529
769
|
|
|
770
|
+
/**
|
|
771
|
+
* Must be 'file' to identify this as file content.
|
|
772
|
+
*/
|
|
530
773
|
type?: 'file';
|
|
531
774
|
}
|
|
532
775
|
|
|
533
776
|
export namespace OpenAIFile {
|
|
777
|
+
/**
|
|
778
|
+
* File specification.
|
|
779
|
+
*/
|
|
534
780
|
export interface File {
|
|
781
|
+
/**
|
|
782
|
+
* Base64-encoded file data.
|
|
783
|
+
*/
|
|
535
784
|
file_data?: string | null;
|
|
536
785
|
|
|
786
|
+
/**
|
|
787
|
+
* ID of an uploaded file.
|
|
788
|
+
*/
|
|
537
789
|
file_id?: string | null;
|
|
538
790
|
|
|
791
|
+
/**
|
|
792
|
+
* Name of the file.
|
|
793
|
+
*/
|
|
539
794
|
filename?: string | null;
|
|
540
795
|
}
|
|
541
796
|
}
|
|
@@ -545,10 +800,20 @@ export namespace CompletionRetrieveResponse {
|
|
|
545
800
|
* A system message providing instructions or context to the model.
|
|
546
801
|
*/
|
|
547
802
|
export interface OpenAISystemMessageParam {
|
|
803
|
+
/**
|
|
804
|
+
* The content of the 'system prompt'. If multiple system messages are provided,
|
|
805
|
+
* they are concatenated.
|
|
806
|
+
*/
|
|
548
807
|
content: string | Array<OpenAISystemMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
549
808
|
|
|
809
|
+
/**
|
|
810
|
+
* The name of the system message participant.
|
|
811
|
+
*/
|
|
550
812
|
name?: string | null;
|
|
551
813
|
|
|
814
|
+
/**
|
|
815
|
+
* Must be 'system' to identify this as a system message.
|
|
816
|
+
*/
|
|
552
817
|
role?: 'system';
|
|
553
818
|
}
|
|
554
819
|
|
|
@@ -557,8 +822,14 @@ export namespace CompletionRetrieveResponse {
|
|
|
557
822
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
558
823
|
*/
|
|
559
824
|
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
825
|
+
/**
|
|
826
|
+
* The text content of the message.
|
|
827
|
+
*/
|
|
560
828
|
text: string;
|
|
561
829
|
|
|
830
|
+
/**
|
|
831
|
+
* Must be 'text' to identify this as text content.
|
|
832
|
+
*/
|
|
562
833
|
type?: 'text';
|
|
563
834
|
}
|
|
564
835
|
}
|
|
@@ -568,15 +839,27 @@ export namespace CompletionRetrieveResponse {
|
|
|
568
839
|
* chat completion request.
|
|
569
840
|
*/
|
|
570
841
|
export interface OpenAIAssistantMessageParamOutput {
|
|
842
|
+
/**
|
|
843
|
+
* The content of the model's response.
|
|
844
|
+
*/
|
|
571
845
|
content?:
|
|
572
846
|
| string
|
|
573
847
|
| Array<OpenAIAssistantMessageParamOutput.ListOpenAIChatCompletionContentPartTextParam>
|
|
574
848
|
| null;
|
|
575
849
|
|
|
850
|
+
/**
|
|
851
|
+
* The name of the assistant message participant.
|
|
852
|
+
*/
|
|
576
853
|
name?: string | null;
|
|
577
854
|
|
|
855
|
+
/**
|
|
856
|
+
* Must be 'assistant' to identify this as the model's response.
|
|
857
|
+
*/
|
|
578
858
|
role?: 'assistant';
|
|
579
859
|
|
|
860
|
+
/**
|
|
861
|
+
* List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
|
|
862
|
+
*/
|
|
580
863
|
tool_calls?: Array<OpenAIAssistantMessageParamOutput.ToolCall> | null;
|
|
581
864
|
}
|
|
582
865
|
|
|
@@ -585,8 +868,14 @@ export namespace CompletionRetrieveResponse {
|
|
|
585
868
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
586
869
|
*/
|
|
587
870
|
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
871
|
+
/**
|
|
872
|
+
* The text content of the message.
|
|
873
|
+
*/
|
|
588
874
|
text: string;
|
|
589
875
|
|
|
876
|
+
/**
|
|
877
|
+
* Must be 'text' to identify this as text content.
|
|
878
|
+
*/
|
|
590
879
|
type?: 'text';
|
|
591
880
|
}
|
|
592
881
|
|
|
@@ -594,6 +883,9 @@ export namespace CompletionRetrieveResponse {
|
|
|
594
883
|
* Tool call specification for OpenAI-compatible chat completion responses.
|
|
595
884
|
*/
|
|
596
885
|
export interface ToolCall {
|
|
886
|
+
/**
|
|
887
|
+
* Unique identifier for the tool call.
|
|
888
|
+
*/
|
|
597
889
|
id?: string | null;
|
|
598
890
|
|
|
599
891
|
/**
|
|
@@ -601,8 +893,14 @@ export namespace CompletionRetrieveResponse {
|
|
|
601
893
|
*/
|
|
602
894
|
function?: ToolCall.Function | null;
|
|
603
895
|
|
|
896
|
+
/**
|
|
897
|
+
* Index of the tool call in the list.
|
|
898
|
+
*/
|
|
604
899
|
index?: number | null;
|
|
605
900
|
|
|
901
|
+
/**
|
|
902
|
+
* Must be 'function' to identify this as a function call.
|
|
903
|
+
*/
|
|
606
904
|
type?: 'function';
|
|
607
905
|
}
|
|
608
906
|
|
|
@@ -611,8 +909,14 @@ export namespace CompletionRetrieveResponse {
|
|
|
611
909
|
* Function call details for OpenAI-compatible tool calls.
|
|
612
910
|
*/
|
|
613
911
|
export interface Function {
|
|
912
|
+
/**
|
|
913
|
+
* Arguments to pass to the function as a JSON string.
|
|
914
|
+
*/
|
|
614
915
|
arguments?: string | null;
|
|
615
916
|
|
|
917
|
+
/**
|
|
918
|
+
* Name of the function to call.
|
|
919
|
+
*/
|
|
616
920
|
name?: string | null;
|
|
617
921
|
}
|
|
618
922
|
}
|
|
@@ -623,10 +927,19 @@ export namespace CompletionRetrieveResponse {
|
|
|
623
927
|
* chat completion request.
|
|
624
928
|
*/
|
|
625
929
|
export interface OpenAIToolMessageParam {
|
|
930
|
+
/**
|
|
931
|
+
* The response content from the tool.
|
|
932
|
+
*/
|
|
626
933
|
content: string | Array<OpenAIToolMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
627
934
|
|
|
935
|
+
/**
|
|
936
|
+
* Unique identifier for the tool call this response is for.
|
|
937
|
+
*/
|
|
628
938
|
tool_call_id: string;
|
|
629
939
|
|
|
940
|
+
/**
|
|
941
|
+
* Must be 'tool' to identify this as a tool response.
|
|
942
|
+
*/
|
|
630
943
|
role?: 'tool';
|
|
631
944
|
}
|
|
632
945
|
|
|
@@ -635,8 +948,14 @@ export namespace CompletionRetrieveResponse {
|
|
|
635
948
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
636
949
|
*/
|
|
637
950
|
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
951
|
+
/**
|
|
952
|
+
* The text content of the message.
|
|
953
|
+
*/
|
|
638
954
|
text: string;
|
|
639
955
|
|
|
956
|
+
/**
|
|
957
|
+
* Must be 'text' to identify this as text content.
|
|
958
|
+
*/
|
|
640
959
|
type?: 'text';
|
|
641
960
|
}
|
|
642
961
|
}
|
|
@@ -645,10 +964,19 @@ export namespace CompletionRetrieveResponse {
|
|
|
645
964
|
* A message from the developer in an OpenAI-compatible chat completion request.
|
|
646
965
|
*/
|
|
647
966
|
export interface OpenAIDeveloperMessageParam {
|
|
967
|
+
/**
|
|
968
|
+
* The content of the developer message.
|
|
969
|
+
*/
|
|
648
970
|
content: string | Array<OpenAIDeveloperMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
649
971
|
|
|
972
|
+
/**
|
|
973
|
+
* The name of the developer message participant.
|
|
974
|
+
*/
|
|
650
975
|
name?: string | null;
|
|
651
976
|
|
|
977
|
+
/**
|
|
978
|
+
* Must be 'developer' to identify this as a developer message.
|
|
979
|
+
*/
|
|
652
980
|
role?: 'developer';
|
|
653
981
|
}
|
|
654
982
|
|
|
@@ -657,8 +985,14 @@ export namespace CompletionRetrieveResponse {
|
|
|
657
985
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
658
986
|
*/
|
|
659
987
|
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
988
|
+
/**
|
|
989
|
+
* The text content of the message.
|
|
990
|
+
*/
|
|
660
991
|
text: string;
|
|
661
992
|
|
|
993
|
+
/**
|
|
994
|
+
* Must be 'text' to identify this as text content.
|
|
995
|
+
*/
|
|
662
996
|
type?: 'text';
|
|
663
997
|
}
|
|
664
998
|
}
|
|
@@ -668,8 +1002,14 @@ export namespace CompletionRetrieveResponse {
|
|
|
668
1002
|
* chat completion response.
|
|
669
1003
|
*/
|
|
670
1004
|
export interface Logprobs {
|
|
1005
|
+
/**
|
|
1006
|
+
* The log probabilities for the tokens in the message.
|
|
1007
|
+
*/
|
|
671
1008
|
content?: Array<Logprobs.Content> | null;
|
|
672
1009
|
|
|
1010
|
+
/**
|
|
1011
|
+
* The log probabilities for the refusal tokens.
|
|
1012
|
+
*/
|
|
673
1013
|
refusal?: Array<Logprobs.Refusal> | null;
|
|
674
1014
|
}
|
|
675
1015
|
|
|
@@ -677,33 +1017,48 @@ export namespace CompletionRetrieveResponse {
|
|
|
677
1017
|
/**
|
|
678
1018
|
* The log probability for a token from an OpenAI-compatible chat completion
|
|
679
1019
|
* response.
|
|
680
|
-
*
|
|
681
|
-
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
682
|
-
* probability of the token :top_logprobs: The top log probabilities for the token
|
|
683
1020
|
*/
|
|
684
1021
|
export interface Content {
|
|
1022
|
+
/**
|
|
1023
|
+
* The token.
|
|
1024
|
+
*/
|
|
685
1025
|
token: string;
|
|
686
1026
|
|
|
1027
|
+
/**
|
|
1028
|
+
* The log probability of the token.
|
|
1029
|
+
*/
|
|
687
1030
|
logprob: number;
|
|
688
1031
|
|
|
689
|
-
|
|
690
|
-
|
|
1032
|
+
/**
|
|
1033
|
+
* The bytes for the token.
|
|
1034
|
+
*/
|
|
691
1035
|
bytes?: Array<number> | null;
|
|
1036
|
+
|
|
1037
|
+
/**
|
|
1038
|
+
* The top log probabilities for the token.
|
|
1039
|
+
*/
|
|
1040
|
+
top_logprobs?: Array<Content.TopLogprob> | null;
|
|
692
1041
|
}
|
|
693
1042
|
|
|
694
1043
|
export namespace Content {
|
|
695
1044
|
/**
|
|
696
1045
|
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
697
1046
|
* response.
|
|
698
|
-
*
|
|
699
|
-
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
700
|
-
* probability of the token
|
|
701
1047
|
*/
|
|
702
1048
|
export interface TopLogprob {
|
|
1049
|
+
/**
|
|
1050
|
+
* The token.
|
|
1051
|
+
*/
|
|
703
1052
|
token: string;
|
|
704
1053
|
|
|
1054
|
+
/**
|
|
1055
|
+
* The log probability of the token.
|
|
1056
|
+
*/
|
|
705
1057
|
logprob: number;
|
|
706
1058
|
|
|
1059
|
+
/**
|
|
1060
|
+
* The bytes for the token.
|
|
1061
|
+
*/
|
|
707
1062
|
bytes?: Array<number> | null;
|
|
708
1063
|
}
|
|
709
1064
|
}
|
|
@@ -711,33 +1066,48 @@ export namespace CompletionRetrieveResponse {
|
|
|
711
1066
|
/**
|
|
712
1067
|
* The log probability for a token from an OpenAI-compatible chat completion
|
|
713
1068
|
* response.
|
|
714
|
-
*
|
|
715
|
-
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
716
|
-
* probability of the token :top_logprobs: The top log probabilities for the token
|
|
717
1069
|
*/
|
|
718
1070
|
export interface Refusal {
|
|
1071
|
+
/**
|
|
1072
|
+
* The token.
|
|
1073
|
+
*/
|
|
719
1074
|
token: string;
|
|
720
1075
|
|
|
1076
|
+
/**
|
|
1077
|
+
* The log probability of the token.
|
|
1078
|
+
*/
|
|
721
1079
|
logprob: number;
|
|
722
1080
|
|
|
723
|
-
|
|
724
|
-
|
|
1081
|
+
/**
|
|
1082
|
+
* The bytes for the token.
|
|
1083
|
+
*/
|
|
725
1084
|
bytes?: Array<number> | null;
|
|
1085
|
+
|
|
1086
|
+
/**
|
|
1087
|
+
* The top log probabilities for the token.
|
|
1088
|
+
*/
|
|
1089
|
+
top_logprobs?: Array<Refusal.TopLogprob> | null;
|
|
726
1090
|
}
|
|
727
1091
|
|
|
728
1092
|
export namespace Refusal {
|
|
729
1093
|
/**
|
|
730
1094
|
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
731
1095
|
* response.
|
|
732
|
-
*
|
|
733
|
-
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
734
|
-
* probability of the token
|
|
735
1096
|
*/
|
|
736
1097
|
export interface TopLogprob {
|
|
1098
|
+
/**
|
|
1099
|
+
* The token.
|
|
1100
|
+
*/
|
|
737
1101
|
token: string;
|
|
738
1102
|
|
|
1103
|
+
/**
|
|
1104
|
+
* The log probability of the token.
|
|
1105
|
+
*/
|
|
739
1106
|
logprob: number;
|
|
740
1107
|
|
|
1108
|
+
/**
|
|
1109
|
+
* The bytes for the token.
|
|
1110
|
+
*/
|
|
741
1111
|
bytes?: Array<number> | null;
|
|
742
1112
|
}
|
|
743
1113
|
}
|
|
@@ -748,6 +1118,9 @@ export namespace CompletionRetrieveResponse {
|
|
|
748
1118
|
* A message from the user in an OpenAI-compatible chat completion request.
|
|
749
1119
|
*/
|
|
750
1120
|
export interface OpenAIUserMessageParamOutput {
|
|
1121
|
+
/**
|
|
1122
|
+
* The content of the message, which can include text and other media.
|
|
1123
|
+
*/
|
|
751
1124
|
content:
|
|
752
1125
|
| string
|
|
753
1126
|
| Array<
|
|
@@ -756,8 +1129,14 @@ export namespace CompletionRetrieveResponse {
|
|
|
756
1129
|
| OpenAIUserMessageParamOutput.OpenAIFile
|
|
757
1130
|
>;
|
|
758
1131
|
|
|
1132
|
+
/**
|
|
1133
|
+
* The name of the user message participant.
|
|
1134
|
+
*/
|
|
759
1135
|
name?: string | null;
|
|
760
1136
|
|
|
1137
|
+
/**
|
|
1138
|
+
* Must be 'user' to identify this as a user message.
|
|
1139
|
+
*/
|
|
761
1140
|
role?: 'user';
|
|
762
1141
|
}
|
|
763
1142
|
|
|
@@ -766,8 +1145,14 @@ export namespace CompletionRetrieveResponse {
|
|
|
766
1145
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
767
1146
|
*/
|
|
768
1147
|
export interface OpenAIChatCompletionContentPartTextParam {
|
|
1148
|
+
/**
|
|
1149
|
+
* The text content of the message.
|
|
1150
|
+
*/
|
|
769
1151
|
text: string;
|
|
770
1152
|
|
|
1153
|
+
/**
|
|
1154
|
+
* Must be 'text' to identify this as text content.
|
|
1155
|
+
*/
|
|
771
1156
|
type?: 'text';
|
|
772
1157
|
}
|
|
773
1158
|
|
|
@@ -776,36 +1161,63 @@ export namespace CompletionRetrieveResponse {
|
|
|
776
1161
|
*/
|
|
777
1162
|
export interface OpenAIChatCompletionContentPartImageParam {
|
|
778
1163
|
/**
|
|
779
|
-
* Image URL specification
|
|
1164
|
+
* Image URL specification and processing details.
|
|
780
1165
|
*/
|
|
781
1166
|
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
782
1167
|
|
|
1168
|
+
/**
|
|
1169
|
+
* Must be 'image_url' to identify this as image content.
|
|
1170
|
+
*/
|
|
783
1171
|
type?: 'image_url';
|
|
784
1172
|
}
|
|
785
1173
|
|
|
786
1174
|
export namespace OpenAIChatCompletionContentPartImageParam {
|
|
787
1175
|
/**
|
|
788
|
-
* Image URL specification
|
|
1176
|
+
* Image URL specification and processing details.
|
|
789
1177
|
*/
|
|
790
1178
|
export interface ImageURL {
|
|
1179
|
+
/**
|
|
1180
|
+
* URL of the image to include in the message.
|
|
1181
|
+
*/
|
|
791
1182
|
url: string;
|
|
792
1183
|
|
|
793
|
-
|
|
1184
|
+
/**
|
|
1185
|
+
* Level of detail for image processing. Can be 'low', 'high', or 'auto'.
|
|
1186
|
+
*/
|
|
1187
|
+
detail?: 'low' | 'high' | 'auto' | null;
|
|
794
1188
|
}
|
|
795
1189
|
}
|
|
796
1190
|
|
|
797
1191
|
export interface OpenAIFile {
|
|
1192
|
+
/**
|
|
1193
|
+
* File specification.
|
|
1194
|
+
*/
|
|
798
1195
|
file: OpenAIFile.File;
|
|
799
1196
|
|
|
1197
|
+
/**
|
|
1198
|
+
* Must be 'file' to identify this as file content.
|
|
1199
|
+
*/
|
|
800
1200
|
type?: 'file';
|
|
801
1201
|
}
|
|
802
1202
|
|
|
803
1203
|
export namespace OpenAIFile {
|
|
1204
|
+
/**
|
|
1205
|
+
* File specification.
|
|
1206
|
+
*/
|
|
804
1207
|
export interface File {
|
|
1208
|
+
/**
|
|
1209
|
+
* Base64-encoded file data.
|
|
1210
|
+
*/
|
|
805
1211
|
file_data?: string | null;
|
|
806
1212
|
|
|
1213
|
+
/**
|
|
1214
|
+
* ID of an uploaded file.
|
|
1215
|
+
*/
|
|
807
1216
|
file_id?: string | null;
|
|
808
1217
|
|
|
1218
|
+
/**
|
|
1219
|
+
* Name of the file.
|
|
1220
|
+
*/
|
|
809
1221
|
filename?: string | null;
|
|
810
1222
|
}
|
|
811
1223
|
}
|
|
@@ -815,10 +1227,20 @@ export namespace CompletionRetrieveResponse {
|
|
|
815
1227
|
* A system message providing instructions or context to the model.
|
|
816
1228
|
*/
|
|
817
1229
|
export interface OpenAISystemMessageParam {
|
|
1230
|
+
/**
|
|
1231
|
+
* The content of the 'system prompt'. If multiple system messages are provided,
|
|
1232
|
+
* they are concatenated.
|
|
1233
|
+
*/
|
|
818
1234
|
content: string | Array<OpenAISystemMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
819
1235
|
|
|
1236
|
+
/**
|
|
1237
|
+
* The name of the system message participant.
|
|
1238
|
+
*/
|
|
820
1239
|
name?: string | null;
|
|
821
1240
|
|
|
1241
|
+
/**
|
|
1242
|
+
* Must be 'system' to identify this as a system message.
|
|
1243
|
+
*/
|
|
822
1244
|
role?: 'system';
|
|
823
1245
|
}
|
|
824
1246
|
|
|
@@ -827,8 +1249,14 @@ export namespace CompletionRetrieveResponse {
|
|
|
827
1249
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
828
1250
|
*/
|
|
829
1251
|
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
1252
|
+
/**
|
|
1253
|
+
* The text content of the message.
|
|
1254
|
+
*/
|
|
830
1255
|
text: string;
|
|
831
1256
|
|
|
1257
|
+
/**
|
|
1258
|
+
* Must be 'text' to identify this as text content.
|
|
1259
|
+
*/
|
|
832
1260
|
type?: 'text';
|
|
833
1261
|
}
|
|
834
1262
|
}
|
|
@@ -838,15 +1266,27 @@ export namespace CompletionRetrieveResponse {
|
|
|
838
1266
|
* chat completion request.
|
|
839
1267
|
*/
|
|
840
1268
|
export interface OpenAIAssistantMessageParamOutput {
|
|
1269
|
+
/**
|
|
1270
|
+
* The content of the model's response.
|
|
1271
|
+
*/
|
|
841
1272
|
content?:
|
|
842
1273
|
| string
|
|
843
1274
|
| Array<OpenAIAssistantMessageParamOutput.ListOpenAIChatCompletionContentPartTextParam>
|
|
844
1275
|
| null;
|
|
845
1276
|
|
|
1277
|
+
/**
|
|
1278
|
+
* The name of the assistant message participant.
|
|
1279
|
+
*/
|
|
846
1280
|
name?: string | null;
|
|
847
1281
|
|
|
1282
|
+
/**
|
|
1283
|
+
* Must be 'assistant' to identify this as the model's response.
|
|
1284
|
+
*/
|
|
848
1285
|
role?: 'assistant';
|
|
849
1286
|
|
|
1287
|
+
/**
|
|
1288
|
+
* List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
|
|
1289
|
+
*/
|
|
850
1290
|
tool_calls?: Array<OpenAIAssistantMessageParamOutput.ToolCall> | null;
|
|
851
1291
|
}
|
|
852
1292
|
|
|
@@ -855,8 +1295,14 @@ export namespace CompletionRetrieveResponse {
|
|
|
855
1295
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
856
1296
|
*/
|
|
857
1297
|
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
1298
|
+
/**
|
|
1299
|
+
* The text content of the message.
|
|
1300
|
+
*/
|
|
858
1301
|
text: string;
|
|
859
1302
|
|
|
1303
|
+
/**
|
|
1304
|
+
* Must be 'text' to identify this as text content.
|
|
1305
|
+
*/
|
|
860
1306
|
type?: 'text';
|
|
861
1307
|
}
|
|
862
1308
|
|
|
@@ -864,6 +1310,9 @@ export namespace CompletionRetrieveResponse {
|
|
|
864
1310
|
* Tool call specification for OpenAI-compatible chat completion responses.
|
|
865
1311
|
*/
|
|
866
1312
|
export interface ToolCall {
|
|
1313
|
+
/**
|
|
1314
|
+
* Unique identifier for the tool call.
|
|
1315
|
+
*/
|
|
867
1316
|
id?: string | null;
|
|
868
1317
|
|
|
869
1318
|
/**
|
|
@@ -871,8 +1320,14 @@ export namespace CompletionRetrieveResponse {
|
|
|
871
1320
|
*/
|
|
872
1321
|
function?: ToolCall.Function | null;
|
|
873
1322
|
|
|
1323
|
+
/**
|
|
1324
|
+
* Index of the tool call in the list.
|
|
1325
|
+
*/
|
|
874
1326
|
index?: number | null;
|
|
875
1327
|
|
|
1328
|
+
/**
|
|
1329
|
+
* Must be 'function' to identify this as a function call.
|
|
1330
|
+
*/
|
|
876
1331
|
type?: 'function';
|
|
877
1332
|
}
|
|
878
1333
|
|
|
@@ -881,8 +1336,14 @@ export namespace CompletionRetrieveResponse {
|
|
|
881
1336
|
* Function call details for OpenAI-compatible tool calls.
|
|
882
1337
|
*/
|
|
883
1338
|
export interface Function {
|
|
1339
|
+
/**
|
|
1340
|
+
* Arguments to pass to the function as a JSON string.
|
|
1341
|
+
*/
|
|
884
1342
|
arguments?: string | null;
|
|
885
1343
|
|
|
1344
|
+
/**
|
|
1345
|
+
* Name of the function to call.
|
|
1346
|
+
*/
|
|
886
1347
|
name?: string | null;
|
|
887
1348
|
}
|
|
888
1349
|
}
|
|
@@ -893,10 +1354,19 @@ export namespace CompletionRetrieveResponse {
|
|
|
893
1354
|
* chat completion request.
|
|
894
1355
|
*/
|
|
895
1356
|
export interface OpenAIToolMessageParam {
|
|
1357
|
+
/**
|
|
1358
|
+
* The response content from the tool.
|
|
1359
|
+
*/
|
|
896
1360
|
content: string | Array<OpenAIToolMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
897
1361
|
|
|
1362
|
+
/**
|
|
1363
|
+
* Unique identifier for the tool call this response is for.
|
|
1364
|
+
*/
|
|
898
1365
|
tool_call_id: string;
|
|
899
1366
|
|
|
1367
|
+
/**
|
|
1368
|
+
* Must be 'tool' to identify this as a tool response.
|
|
1369
|
+
*/
|
|
900
1370
|
role?: 'tool';
|
|
901
1371
|
}
|
|
902
1372
|
|
|
@@ -905,8 +1375,14 @@ export namespace CompletionRetrieveResponse {
|
|
|
905
1375
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
906
1376
|
*/
|
|
907
1377
|
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
1378
|
+
/**
|
|
1379
|
+
* The text content of the message.
|
|
1380
|
+
*/
|
|
908
1381
|
text: string;
|
|
909
1382
|
|
|
1383
|
+
/**
|
|
1384
|
+
* Must be 'text' to identify this as text content.
|
|
1385
|
+
*/
|
|
910
1386
|
type?: 'text';
|
|
911
1387
|
}
|
|
912
1388
|
}
|
|
@@ -915,10 +1391,19 @@ export namespace CompletionRetrieveResponse {
|
|
|
915
1391
|
* A message from the developer in an OpenAI-compatible chat completion request.
|
|
916
1392
|
*/
|
|
917
1393
|
export interface OpenAIDeveloperMessageParam {
|
|
1394
|
+
/**
|
|
1395
|
+
* The content of the developer message.
|
|
1396
|
+
*/
|
|
918
1397
|
content: string | Array<OpenAIDeveloperMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
919
1398
|
|
|
1399
|
+
/**
|
|
1400
|
+
* The name of the developer message participant.
|
|
1401
|
+
*/
|
|
920
1402
|
name?: string | null;
|
|
921
1403
|
|
|
1404
|
+
/**
|
|
1405
|
+
* Must be 'developer' to identify this as a developer message.
|
|
1406
|
+
*/
|
|
922
1407
|
role?: 'developer';
|
|
923
1408
|
}
|
|
924
1409
|
|
|
@@ -927,8 +1412,14 @@ export namespace CompletionRetrieveResponse {
|
|
|
927
1412
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
928
1413
|
*/
|
|
929
1414
|
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
1415
|
+
/**
|
|
1416
|
+
* The text content of the message.
|
|
1417
|
+
*/
|
|
930
1418
|
text: string;
|
|
931
1419
|
|
|
1420
|
+
/**
|
|
1421
|
+
* Must be 'text' to identify this as text content.
|
|
1422
|
+
*/
|
|
932
1423
|
type?: 'text';
|
|
933
1424
|
}
|
|
934
1425
|
}
|
|
@@ -937,10 +1428,19 @@ export namespace CompletionRetrieveResponse {
|
|
|
937
1428
|
* Usage information for OpenAI chat completion.
|
|
938
1429
|
*/
|
|
939
1430
|
export interface Usage {
|
|
1431
|
+
/**
|
|
1432
|
+
* Number of tokens in the completion.
|
|
1433
|
+
*/
|
|
940
1434
|
completion_tokens: number;
|
|
941
1435
|
|
|
1436
|
+
/**
|
|
1437
|
+
* Number of tokens in the prompt.
|
|
1438
|
+
*/
|
|
942
1439
|
prompt_tokens: number;
|
|
943
1440
|
|
|
1441
|
+
/**
|
|
1442
|
+
* Total tokens used (prompt + completion).
|
|
1443
|
+
*/
|
|
944
1444
|
total_tokens: number;
|
|
945
1445
|
|
|
946
1446
|
/**
|
|
@@ -959,6 +1459,9 @@ export namespace CompletionRetrieveResponse {
|
|
|
959
1459
|
* Token details for output tokens in OpenAI chat completion usage.
|
|
960
1460
|
*/
|
|
961
1461
|
export interface CompletionTokensDetails {
|
|
1462
|
+
/**
|
|
1463
|
+
* Number of tokens used for reasoning (o1/o3 models).
|
|
1464
|
+
*/
|
|
962
1465
|
reasoning_tokens?: number | null;
|
|
963
1466
|
}
|
|
964
1467
|
|
|
@@ -966,6 +1469,9 @@ export namespace CompletionRetrieveResponse {
|
|
|
966
1469
|
* Token details for prompt tokens in OpenAI chat completion usage.
|
|
967
1470
|
*/
|
|
968
1471
|
export interface PromptTokensDetails {
|
|
1472
|
+
/**
|
|
1473
|
+
* Number of tokens retrieved from cache.
|
|
1474
|
+
*/
|
|
969
1475
|
cached_tokens?: number | null;
|
|
970
1476
|
}
|
|
971
1477
|
}
|
|
@@ -975,25 +1481,52 @@ export namespace CompletionRetrieveResponse {
|
|
|
975
1481
|
* Response from listing OpenAI-compatible chat completions.
|
|
976
1482
|
*/
|
|
977
1483
|
export interface CompletionListResponse {
|
|
1484
|
+
/**
|
|
1485
|
+
* List of chat completion objects with their input messages.
|
|
1486
|
+
*/
|
|
978
1487
|
data: Array<CompletionListResponse.Data>;
|
|
979
1488
|
|
|
1489
|
+
/**
|
|
1490
|
+
* ID of the first completion in this list.
|
|
1491
|
+
*/
|
|
980
1492
|
first_id: string;
|
|
981
1493
|
|
|
1494
|
+
/**
|
|
1495
|
+
* Whether there are more completions available beyond this list.
|
|
1496
|
+
*/
|
|
982
1497
|
has_more: boolean;
|
|
983
1498
|
|
|
1499
|
+
/**
|
|
1500
|
+
* ID of the last completion in this list.
|
|
1501
|
+
*/
|
|
984
1502
|
last_id: string;
|
|
985
1503
|
|
|
1504
|
+
/**
|
|
1505
|
+
* Must be 'list' to identify this as a list response.
|
|
1506
|
+
*/
|
|
986
1507
|
object?: 'list';
|
|
987
1508
|
}
|
|
988
1509
|
|
|
989
1510
|
export namespace CompletionListResponse {
|
|
990
1511
|
export interface Data {
|
|
1512
|
+
/**
|
|
1513
|
+
* The ID of the chat completion.
|
|
1514
|
+
*/
|
|
991
1515
|
id: string;
|
|
992
1516
|
|
|
1517
|
+
/**
|
|
1518
|
+
* List of choices.
|
|
1519
|
+
*/
|
|
993
1520
|
choices: Array<Data.Choice>;
|
|
994
1521
|
|
|
1522
|
+
/**
|
|
1523
|
+
* The Unix timestamp in seconds when the chat completion was created.
|
|
1524
|
+
*/
|
|
995
1525
|
created: number;
|
|
996
1526
|
|
|
1527
|
+
/**
|
|
1528
|
+
* The input messages used to generate this completion.
|
|
1529
|
+
*/
|
|
997
1530
|
input_messages: Array<
|
|
998
1531
|
| Data.OpenAIUserMessageParamOutput
|
|
999
1532
|
| Data.OpenAISystemMessageParam
|
|
@@ -1002,8 +1535,14 @@ export namespace CompletionListResponse {
|
|
|
1002
1535
|
| Data.OpenAIDeveloperMessageParam
|
|
1003
1536
|
>;
|
|
1004
1537
|
|
|
1538
|
+
/**
|
|
1539
|
+
* The model that was used to generate the chat completion.
|
|
1540
|
+
*/
|
|
1005
1541
|
model: string;
|
|
1006
1542
|
|
|
1543
|
+
/**
|
|
1544
|
+
* The object type.
|
|
1545
|
+
*/
|
|
1007
1546
|
object?: 'chat.completion';
|
|
1008
1547
|
|
|
1009
1548
|
/**
|
|
@@ -1017,12 +1556,18 @@ export namespace CompletionListResponse {
|
|
|
1017
1556
|
* A choice from an OpenAI-compatible chat completion response.
|
|
1018
1557
|
*/
|
|
1019
1558
|
export interface Choice {
|
|
1020
|
-
|
|
1559
|
+
/**
|
|
1560
|
+
* The reason the model stopped generating.
|
|
1561
|
+
*/
|
|
1562
|
+
finish_reason: 'stop' | 'length' | 'tool_calls' | 'content_filter' | 'function_call';
|
|
1021
1563
|
|
|
1564
|
+
/**
|
|
1565
|
+
* The index of the choice.
|
|
1566
|
+
*/
|
|
1022
1567
|
index: number;
|
|
1023
1568
|
|
|
1024
1569
|
/**
|
|
1025
|
-
*
|
|
1570
|
+
* The message from the model.
|
|
1026
1571
|
*/
|
|
1027
1572
|
message:
|
|
1028
1573
|
| Choice.OpenAIUserMessageParamOutput
|
|
@@ -1043,6 +1588,9 @@ export namespace CompletionListResponse {
|
|
|
1043
1588
|
* A message from the user in an OpenAI-compatible chat completion request.
|
|
1044
1589
|
*/
|
|
1045
1590
|
export interface OpenAIUserMessageParamOutput {
|
|
1591
|
+
/**
|
|
1592
|
+
* The content of the message, which can include text and other media.
|
|
1593
|
+
*/
|
|
1046
1594
|
content:
|
|
1047
1595
|
| string
|
|
1048
1596
|
| Array<
|
|
@@ -1051,8 +1599,14 @@ export namespace CompletionListResponse {
|
|
|
1051
1599
|
| OpenAIUserMessageParamOutput.OpenAIFile
|
|
1052
1600
|
>;
|
|
1053
1601
|
|
|
1602
|
+
/**
|
|
1603
|
+
* The name of the user message participant.
|
|
1604
|
+
*/
|
|
1054
1605
|
name?: string | null;
|
|
1055
1606
|
|
|
1607
|
+
/**
|
|
1608
|
+
* Must be 'user' to identify this as a user message.
|
|
1609
|
+
*/
|
|
1056
1610
|
role?: 'user';
|
|
1057
1611
|
}
|
|
1058
1612
|
|
|
@@ -1061,8 +1615,14 @@ export namespace CompletionListResponse {
|
|
|
1061
1615
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
1062
1616
|
*/
|
|
1063
1617
|
export interface OpenAIChatCompletionContentPartTextParam {
|
|
1618
|
+
/**
|
|
1619
|
+
* The text content of the message.
|
|
1620
|
+
*/
|
|
1064
1621
|
text: string;
|
|
1065
1622
|
|
|
1623
|
+
/**
|
|
1624
|
+
* Must be 'text' to identify this as text content.
|
|
1625
|
+
*/
|
|
1066
1626
|
type?: 'text';
|
|
1067
1627
|
}
|
|
1068
1628
|
|
|
@@ -1071,36 +1631,63 @@ export namespace CompletionListResponse {
|
|
|
1071
1631
|
*/
|
|
1072
1632
|
export interface OpenAIChatCompletionContentPartImageParam {
|
|
1073
1633
|
/**
|
|
1074
|
-
* Image URL specification
|
|
1634
|
+
* Image URL specification and processing details.
|
|
1075
1635
|
*/
|
|
1076
1636
|
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
1077
1637
|
|
|
1638
|
+
/**
|
|
1639
|
+
* Must be 'image_url' to identify this as image content.
|
|
1640
|
+
*/
|
|
1078
1641
|
type?: 'image_url';
|
|
1079
1642
|
}
|
|
1080
1643
|
|
|
1081
1644
|
export namespace OpenAIChatCompletionContentPartImageParam {
|
|
1082
1645
|
/**
|
|
1083
|
-
* Image URL specification
|
|
1646
|
+
* Image URL specification and processing details.
|
|
1084
1647
|
*/
|
|
1085
1648
|
export interface ImageURL {
|
|
1649
|
+
/**
|
|
1650
|
+
* URL of the image to include in the message.
|
|
1651
|
+
*/
|
|
1086
1652
|
url: string;
|
|
1087
1653
|
|
|
1088
|
-
|
|
1654
|
+
/**
|
|
1655
|
+
* Level of detail for image processing. Can be 'low', 'high', or 'auto'.
|
|
1656
|
+
*/
|
|
1657
|
+
detail?: 'low' | 'high' | 'auto' | null;
|
|
1089
1658
|
}
|
|
1090
1659
|
}
|
|
1091
1660
|
|
|
1092
1661
|
export interface OpenAIFile {
|
|
1662
|
+
/**
|
|
1663
|
+
* File specification.
|
|
1664
|
+
*/
|
|
1093
1665
|
file: OpenAIFile.File;
|
|
1094
1666
|
|
|
1667
|
+
/**
|
|
1668
|
+
* Must be 'file' to identify this as file content.
|
|
1669
|
+
*/
|
|
1095
1670
|
type?: 'file';
|
|
1096
1671
|
}
|
|
1097
1672
|
|
|
1098
1673
|
export namespace OpenAIFile {
|
|
1674
|
+
/**
|
|
1675
|
+
* File specification.
|
|
1676
|
+
*/
|
|
1099
1677
|
export interface File {
|
|
1678
|
+
/**
|
|
1679
|
+
* Base64-encoded file data.
|
|
1680
|
+
*/
|
|
1100
1681
|
file_data?: string | null;
|
|
1101
1682
|
|
|
1683
|
+
/**
|
|
1684
|
+
* ID of an uploaded file.
|
|
1685
|
+
*/
|
|
1102
1686
|
file_id?: string | null;
|
|
1103
1687
|
|
|
1688
|
+
/**
|
|
1689
|
+
* Name of the file.
|
|
1690
|
+
*/
|
|
1104
1691
|
filename?: string | null;
|
|
1105
1692
|
}
|
|
1106
1693
|
}
|
|
@@ -1110,10 +1697,20 @@ export namespace CompletionListResponse {
|
|
|
1110
1697
|
* A system message providing instructions or context to the model.
|
|
1111
1698
|
*/
|
|
1112
1699
|
export interface OpenAISystemMessageParam {
|
|
1700
|
+
/**
|
|
1701
|
+
* The content of the 'system prompt'. If multiple system messages are provided,
|
|
1702
|
+
* they are concatenated.
|
|
1703
|
+
*/
|
|
1113
1704
|
content: string | Array<OpenAISystemMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
1114
1705
|
|
|
1706
|
+
/**
|
|
1707
|
+
* The name of the system message participant.
|
|
1708
|
+
*/
|
|
1115
1709
|
name?: string | null;
|
|
1116
1710
|
|
|
1711
|
+
/**
|
|
1712
|
+
* Must be 'system' to identify this as a system message.
|
|
1713
|
+
*/
|
|
1117
1714
|
role?: 'system';
|
|
1118
1715
|
}
|
|
1119
1716
|
|
|
@@ -1122,8 +1719,14 @@ export namespace CompletionListResponse {
|
|
|
1122
1719
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
1123
1720
|
*/
|
|
1124
1721
|
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
1722
|
+
/**
|
|
1723
|
+
* The text content of the message.
|
|
1724
|
+
*/
|
|
1125
1725
|
text: string;
|
|
1126
1726
|
|
|
1727
|
+
/**
|
|
1728
|
+
* Must be 'text' to identify this as text content.
|
|
1729
|
+
*/
|
|
1127
1730
|
type?: 'text';
|
|
1128
1731
|
}
|
|
1129
1732
|
}
|
|
@@ -1133,15 +1736,27 @@ export namespace CompletionListResponse {
|
|
|
1133
1736
|
* chat completion request.
|
|
1134
1737
|
*/
|
|
1135
1738
|
export interface OpenAIAssistantMessageParamOutput {
|
|
1739
|
+
/**
|
|
1740
|
+
* The content of the model's response.
|
|
1741
|
+
*/
|
|
1136
1742
|
content?:
|
|
1137
1743
|
| string
|
|
1138
1744
|
| Array<OpenAIAssistantMessageParamOutput.ListOpenAIChatCompletionContentPartTextParam>
|
|
1139
1745
|
| null;
|
|
1140
1746
|
|
|
1747
|
+
/**
|
|
1748
|
+
* The name of the assistant message participant.
|
|
1749
|
+
*/
|
|
1141
1750
|
name?: string | null;
|
|
1142
1751
|
|
|
1752
|
+
/**
|
|
1753
|
+
* Must be 'assistant' to identify this as the model's response.
|
|
1754
|
+
*/
|
|
1143
1755
|
role?: 'assistant';
|
|
1144
1756
|
|
|
1757
|
+
/**
|
|
1758
|
+
* List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
|
|
1759
|
+
*/
|
|
1145
1760
|
tool_calls?: Array<OpenAIAssistantMessageParamOutput.ToolCall> | null;
|
|
1146
1761
|
}
|
|
1147
1762
|
|
|
@@ -1150,8 +1765,14 @@ export namespace CompletionListResponse {
|
|
|
1150
1765
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
1151
1766
|
*/
|
|
1152
1767
|
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
1768
|
+
/**
|
|
1769
|
+
* The text content of the message.
|
|
1770
|
+
*/
|
|
1153
1771
|
text: string;
|
|
1154
1772
|
|
|
1773
|
+
/**
|
|
1774
|
+
* Must be 'text' to identify this as text content.
|
|
1775
|
+
*/
|
|
1155
1776
|
type?: 'text';
|
|
1156
1777
|
}
|
|
1157
1778
|
|
|
@@ -1159,6 +1780,9 @@ export namespace CompletionListResponse {
|
|
|
1159
1780
|
* Tool call specification for OpenAI-compatible chat completion responses.
|
|
1160
1781
|
*/
|
|
1161
1782
|
export interface ToolCall {
|
|
1783
|
+
/**
|
|
1784
|
+
* Unique identifier for the tool call.
|
|
1785
|
+
*/
|
|
1162
1786
|
id?: string | null;
|
|
1163
1787
|
|
|
1164
1788
|
/**
|
|
@@ -1166,8 +1790,14 @@ export namespace CompletionListResponse {
|
|
|
1166
1790
|
*/
|
|
1167
1791
|
function?: ToolCall.Function | null;
|
|
1168
1792
|
|
|
1793
|
+
/**
|
|
1794
|
+
* Index of the tool call in the list.
|
|
1795
|
+
*/
|
|
1169
1796
|
index?: number | null;
|
|
1170
1797
|
|
|
1798
|
+
/**
|
|
1799
|
+
* Must be 'function' to identify this as a function call.
|
|
1800
|
+
*/
|
|
1171
1801
|
type?: 'function';
|
|
1172
1802
|
}
|
|
1173
1803
|
|
|
@@ -1176,8 +1806,14 @@ export namespace CompletionListResponse {
|
|
|
1176
1806
|
* Function call details for OpenAI-compatible tool calls.
|
|
1177
1807
|
*/
|
|
1178
1808
|
export interface Function {
|
|
1809
|
+
/**
|
|
1810
|
+
* Arguments to pass to the function as a JSON string.
|
|
1811
|
+
*/
|
|
1179
1812
|
arguments?: string | null;
|
|
1180
1813
|
|
|
1814
|
+
/**
|
|
1815
|
+
* Name of the function to call.
|
|
1816
|
+
*/
|
|
1181
1817
|
name?: string | null;
|
|
1182
1818
|
}
|
|
1183
1819
|
}
|
|
@@ -1188,10 +1824,19 @@ export namespace CompletionListResponse {
|
|
|
1188
1824
|
* chat completion request.
|
|
1189
1825
|
*/
|
|
1190
1826
|
export interface OpenAIToolMessageParam {
|
|
1827
|
+
/**
|
|
1828
|
+
* The response content from the tool.
|
|
1829
|
+
*/
|
|
1191
1830
|
content: string | Array<OpenAIToolMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
1192
1831
|
|
|
1832
|
+
/**
|
|
1833
|
+
* Unique identifier for the tool call this response is for.
|
|
1834
|
+
*/
|
|
1193
1835
|
tool_call_id: string;
|
|
1194
1836
|
|
|
1837
|
+
/**
|
|
1838
|
+
* Must be 'tool' to identify this as a tool response.
|
|
1839
|
+
*/
|
|
1195
1840
|
role?: 'tool';
|
|
1196
1841
|
}
|
|
1197
1842
|
|
|
@@ -1200,8 +1845,14 @@ export namespace CompletionListResponse {
|
|
|
1200
1845
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
1201
1846
|
*/
|
|
1202
1847
|
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
1848
|
+
/**
|
|
1849
|
+
* The text content of the message.
|
|
1850
|
+
*/
|
|
1203
1851
|
text: string;
|
|
1204
1852
|
|
|
1853
|
+
/**
|
|
1854
|
+
* Must be 'text' to identify this as text content.
|
|
1855
|
+
*/
|
|
1205
1856
|
type?: 'text';
|
|
1206
1857
|
}
|
|
1207
1858
|
}
|
|
@@ -1210,10 +1861,19 @@ export namespace CompletionListResponse {
|
|
|
1210
1861
|
* A message from the developer in an OpenAI-compatible chat completion request.
|
|
1211
1862
|
*/
|
|
1212
1863
|
export interface OpenAIDeveloperMessageParam {
|
|
1864
|
+
/**
|
|
1865
|
+
* The content of the developer message.
|
|
1866
|
+
*/
|
|
1213
1867
|
content: string | Array<OpenAIDeveloperMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
1214
1868
|
|
|
1869
|
+
/**
|
|
1870
|
+
* The name of the developer message participant.
|
|
1871
|
+
*/
|
|
1215
1872
|
name?: string | null;
|
|
1216
1873
|
|
|
1874
|
+
/**
|
|
1875
|
+
* Must be 'developer' to identify this as a developer message.
|
|
1876
|
+
*/
|
|
1217
1877
|
role?: 'developer';
|
|
1218
1878
|
}
|
|
1219
1879
|
|
|
@@ -1222,8 +1882,14 @@ export namespace CompletionListResponse {
|
|
|
1222
1882
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
1223
1883
|
*/
|
|
1224
1884
|
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
1885
|
+
/**
|
|
1886
|
+
* The text content of the message.
|
|
1887
|
+
*/
|
|
1225
1888
|
text: string;
|
|
1226
1889
|
|
|
1890
|
+
/**
|
|
1891
|
+
* Must be 'text' to identify this as text content.
|
|
1892
|
+
*/
|
|
1227
1893
|
type?: 'text';
|
|
1228
1894
|
}
|
|
1229
1895
|
}
|
|
@@ -1233,8 +1899,14 @@ export namespace CompletionListResponse {
|
|
|
1233
1899
|
* chat completion response.
|
|
1234
1900
|
*/
|
|
1235
1901
|
export interface Logprobs {
|
|
1902
|
+
/**
|
|
1903
|
+
* The log probabilities for the tokens in the message.
|
|
1904
|
+
*/
|
|
1236
1905
|
content?: Array<Logprobs.Content> | null;
|
|
1237
1906
|
|
|
1907
|
+
/**
|
|
1908
|
+
* The log probabilities for the refusal tokens.
|
|
1909
|
+
*/
|
|
1238
1910
|
refusal?: Array<Logprobs.Refusal> | null;
|
|
1239
1911
|
}
|
|
1240
1912
|
|
|
@@ -1242,33 +1914,48 @@ export namespace CompletionListResponse {
|
|
|
1242
1914
|
/**
|
|
1243
1915
|
* The log probability for a token from an OpenAI-compatible chat completion
|
|
1244
1916
|
* response.
|
|
1245
|
-
*
|
|
1246
|
-
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
1247
|
-
* probability of the token :top_logprobs: The top log probabilities for the token
|
|
1248
1917
|
*/
|
|
1249
1918
|
export interface Content {
|
|
1919
|
+
/**
|
|
1920
|
+
* The token.
|
|
1921
|
+
*/
|
|
1250
1922
|
token: string;
|
|
1251
1923
|
|
|
1924
|
+
/**
|
|
1925
|
+
* The log probability of the token.
|
|
1926
|
+
*/
|
|
1252
1927
|
logprob: number;
|
|
1253
1928
|
|
|
1254
|
-
|
|
1255
|
-
|
|
1929
|
+
/**
|
|
1930
|
+
* The bytes for the token.
|
|
1931
|
+
*/
|
|
1256
1932
|
bytes?: Array<number> | null;
|
|
1933
|
+
|
|
1934
|
+
/**
|
|
1935
|
+
* The top log probabilities for the token.
|
|
1936
|
+
*/
|
|
1937
|
+
top_logprobs?: Array<Content.TopLogprob> | null;
|
|
1257
1938
|
}
|
|
1258
1939
|
|
|
1259
1940
|
export namespace Content {
|
|
1260
1941
|
/**
|
|
1261
1942
|
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
1262
1943
|
* response.
|
|
1263
|
-
*
|
|
1264
|
-
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
1265
|
-
* probability of the token
|
|
1266
1944
|
*/
|
|
1267
1945
|
export interface TopLogprob {
|
|
1946
|
+
/**
|
|
1947
|
+
* The token.
|
|
1948
|
+
*/
|
|
1268
1949
|
token: string;
|
|
1269
1950
|
|
|
1951
|
+
/**
|
|
1952
|
+
* The log probability of the token.
|
|
1953
|
+
*/
|
|
1270
1954
|
logprob: number;
|
|
1271
1955
|
|
|
1956
|
+
/**
|
|
1957
|
+
* The bytes for the token.
|
|
1958
|
+
*/
|
|
1272
1959
|
bytes?: Array<number> | null;
|
|
1273
1960
|
}
|
|
1274
1961
|
}
|
|
@@ -1276,33 +1963,48 @@ export namespace CompletionListResponse {
|
|
|
1276
1963
|
/**
|
|
1277
1964
|
* The log probability for a token from an OpenAI-compatible chat completion
|
|
1278
1965
|
* response.
|
|
1279
|
-
*
|
|
1280
|
-
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
1281
|
-
* probability of the token :top_logprobs: The top log probabilities for the token
|
|
1282
1966
|
*/
|
|
1283
1967
|
export interface Refusal {
|
|
1968
|
+
/**
|
|
1969
|
+
* The token.
|
|
1970
|
+
*/
|
|
1284
1971
|
token: string;
|
|
1285
1972
|
|
|
1973
|
+
/**
|
|
1974
|
+
* The log probability of the token.
|
|
1975
|
+
*/
|
|
1286
1976
|
logprob: number;
|
|
1287
1977
|
|
|
1288
|
-
|
|
1289
|
-
|
|
1978
|
+
/**
|
|
1979
|
+
* The bytes for the token.
|
|
1980
|
+
*/
|
|
1290
1981
|
bytes?: Array<number> | null;
|
|
1982
|
+
|
|
1983
|
+
/**
|
|
1984
|
+
* The top log probabilities for the token.
|
|
1985
|
+
*/
|
|
1986
|
+
top_logprobs?: Array<Refusal.TopLogprob> | null;
|
|
1291
1987
|
}
|
|
1292
1988
|
|
|
1293
1989
|
export namespace Refusal {
|
|
1294
1990
|
/**
|
|
1295
1991
|
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
1296
1992
|
* response.
|
|
1297
|
-
*
|
|
1298
|
-
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
1299
|
-
* probability of the token
|
|
1300
1993
|
*/
|
|
1301
1994
|
export interface TopLogprob {
|
|
1995
|
+
/**
|
|
1996
|
+
* The token.
|
|
1997
|
+
*/
|
|
1302
1998
|
token: string;
|
|
1303
1999
|
|
|
2000
|
+
/**
|
|
2001
|
+
* The log probability of the token.
|
|
2002
|
+
*/
|
|
1304
2003
|
logprob: number;
|
|
1305
2004
|
|
|
2005
|
+
/**
|
|
2006
|
+
* The bytes for the token.
|
|
2007
|
+
*/
|
|
1306
2008
|
bytes?: Array<number> | null;
|
|
1307
2009
|
}
|
|
1308
2010
|
}
|
|
@@ -1313,6 +2015,9 @@ export namespace CompletionListResponse {
|
|
|
1313
2015
|
* A message from the user in an OpenAI-compatible chat completion request.
|
|
1314
2016
|
*/
|
|
1315
2017
|
export interface OpenAIUserMessageParamOutput {
|
|
2018
|
+
/**
|
|
2019
|
+
* The content of the message, which can include text and other media.
|
|
2020
|
+
*/
|
|
1316
2021
|
content:
|
|
1317
2022
|
| string
|
|
1318
2023
|
| Array<
|
|
@@ -1321,8 +2026,14 @@ export namespace CompletionListResponse {
|
|
|
1321
2026
|
| OpenAIUserMessageParamOutput.OpenAIFile
|
|
1322
2027
|
>;
|
|
1323
2028
|
|
|
2029
|
+
/**
|
|
2030
|
+
* The name of the user message participant.
|
|
2031
|
+
*/
|
|
1324
2032
|
name?: string | null;
|
|
1325
2033
|
|
|
2034
|
+
/**
|
|
2035
|
+
* Must be 'user' to identify this as a user message.
|
|
2036
|
+
*/
|
|
1326
2037
|
role?: 'user';
|
|
1327
2038
|
}
|
|
1328
2039
|
|
|
@@ -1331,8 +2042,14 @@ export namespace CompletionListResponse {
|
|
|
1331
2042
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
1332
2043
|
*/
|
|
1333
2044
|
export interface OpenAIChatCompletionContentPartTextParam {
|
|
2045
|
+
/**
|
|
2046
|
+
* The text content of the message.
|
|
2047
|
+
*/
|
|
1334
2048
|
text: string;
|
|
1335
2049
|
|
|
2050
|
+
/**
|
|
2051
|
+
* Must be 'text' to identify this as text content.
|
|
2052
|
+
*/
|
|
1336
2053
|
type?: 'text';
|
|
1337
2054
|
}
|
|
1338
2055
|
|
|
@@ -1341,36 +2058,63 @@ export namespace CompletionListResponse {
|
|
|
1341
2058
|
*/
|
|
1342
2059
|
export interface OpenAIChatCompletionContentPartImageParam {
|
|
1343
2060
|
/**
|
|
1344
|
-
* Image URL specification
|
|
2061
|
+
* Image URL specification and processing details.
|
|
1345
2062
|
*/
|
|
1346
2063
|
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
1347
2064
|
|
|
2065
|
+
/**
|
|
2066
|
+
* Must be 'image_url' to identify this as image content.
|
|
2067
|
+
*/
|
|
1348
2068
|
type?: 'image_url';
|
|
1349
2069
|
}
|
|
1350
2070
|
|
|
1351
2071
|
export namespace OpenAIChatCompletionContentPartImageParam {
|
|
1352
2072
|
/**
|
|
1353
|
-
* Image URL specification
|
|
2073
|
+
* Image URL specification and processing details.
|
|
1354
2074
|
*/
|
|
1355
2075
|
export interface ImageURL {
|
|
2076
|
+
/**
|
|
2077
|
+
* URL of the image to include in the message.
|
|
2078
|
+
*/
|
|
1356
2079
|
url: string;
|
|
1357
2080
|
|
|
1358
|
-
|
|
2081
|
+
/**
|
|
2082
|
+
* Level of detail for image processing. Can be 'low', 'high', or 'auto'.
|
|
2083
|
+
*/
|
|
2084
|
+
detail?: 'low' | 'high' | 'auto' | null;
|
|
1359
2085
|
}
|
|
1360
2086
|
}
|
|
1361
2087
|
|
|
1362
2088
|
export interface OpenAIFile {
|
|
2089
|
+
/**
|
|
2090
|
+
* File specification.
|
|
2091
|
+
*/
|
|
1363
2092
|
file: OpenAIFile.File;
|
|
1364
2093
|
|
|
2094
|
+
/**
|
|
2095
|
+
* Must be 'file' to identify this as file content.
|
|
2096
|
+
*/
|
|
1365
2097
|
type?: 'file';
|
|
1366
2098
|
}
|
|
1367
2099
|
|
|
1368
2100
|
export namespace OpenAIFile {
|
|
2101
|
+
/**
|
|
2102
|
+
* File specification.
|
|
2103
|
+
*/
|
|
1369
2104
|
export interface File {
|
|
2105
|
+
/**
|
|
2106
|
+
* Base64-encoded file data.
|
|
2107
|
+
*/
|
|
1370
2108
|
file_data?: string | null;
|
|
1371
2109
|
|
|
2110
|
+
/**
|
|
2111
|
+
* ID of an uploaded file.
|
|
2112
|
+
*/
|
|
1372
2113
|
file_id?: string | null;
|
|
1373
2114
|
|
|
2115
|
+
/**
|
|
2116
|
+
* Name of the file.
|
|
2117
|
+
*/
|
|
1374
2118
|
filename?: string | null;
|
|
1375
2119
|
}
|
|
1376
2120
|
}
|
|
@@ -1380,10 +2124,20 @@ export namespace CompletionListResponse {
|
|
|
1380
2124
|
* A system message providing instructions or context to the model.
|
|
1381
2125
|
*/
|
|
1382
2126
|
export interface OpenAISystemMessageParam {
|
|
2127
|
+
/**
|
|
2128
|
+
* The content of the 'system prompt'. If multiple system messages are provided,
|
|
2129
|
+
* they are concatenated.
|
|
2130
|
+
*/
|
|
1383
2131
|
content: string | Array<OpenAISystemMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
1384
2132
|
|
|
2133
|
+
/**
|
|
2134
|
+
* The name of the system message participant.
|
|
2135
|
+
*/
|
|
1385
2136
|
name?: string | null;
|
|
1386
2137
|
|
|
2138
|
+
/**
|
|
2139
|
+
* Must be 'system' to identify this as a system message.
|
|
2140
|
+
*/
|
|
1387
2141
|
role?: 'system';
|
|
1388
2142
|
}
|
|
1389
2143
|
|
|
@@ -1392,8 +2146,14 @@ export namespace CompletionListResponse {
|
|
|
1392
2146
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
1393
2147
|
*/
|
|
1394
2148
|
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
2149
|
+
/**
|
|
2150
|
+
* The text content of the message.
|
|
2151
|
+
*/
|
|
1395
2152
|
text: string;
|
|
1396
2153
|
|
|
2154
|
+
/**
|
|
2155
|
+
* Must be 'text' to identify this as text content.
|
|
2156
|
+
*/
|
|
1397
2157
|
type?: 'text';
|
|
1398
2158
|
}
|
|
1399
2159
|
}
|
|
@@ -1403,15 +2163,27 @@ export namespace CompletionListResponse {
|
|
|
1403
2163
|
* chat completion request.
|
|
1404
2164
|
*/
|
|
1405
2165
|
export interface OpenAIAssistantMessageParamOutput {
|
|
2166
|
+
/**
|
|
2167
|
+
* The content of the model's response.
|
|
2168
|
+
*/
|
|
1406
2169
|
content?:
|
|
1407
2170
|
| string
|
|
1408
2171
|
| Array<OpenAIAssistantMessageParamOutput.ListOpenAIChatCompletionContentPartTextParam>
|
|
1409
2172
|
| null;
|
|
1410
2173
|
|
|
2174
|
+
/**
|
|
2175
|
+
* The name of the assistant message participant.
|
|
2176
|
+
*/
|
|
1411
2177
|
name?: string | null;
|
|
1412
2178
|
|
|
2179
|
+
/**
|
|
2180
|
+
* Must be 'assistant' to identify this as the model's response.
|
|
2181
|
+
*/
|
|
1413
2182
|
role?: 'assistant';
|
|
1414
2183
|
|
|
2184
|
+
/**
|
|
2185
|
+
* List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
|
|
2186
|
+
*/
|
|
1415
2187
|
tool_calls?: Array<OpenAIAssistantMessageParamOutput.ToolCall> | null;
|
|
1416
2188
|
}
|
|
1417
2189
|
|
|
@@ -1420,8 +2192,14 @@ export namespace CompletionListResponse {
|
|
|
1420
2192
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
1421
2193
|
*/
|
|
1422
2194
|
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
2195
|
+
/**
|
|
2196
|
+
* The text content of the message.
|
|
2197
|
+
*/
|
|
1423
2198
|
text: string;
|
|
1424
2199
|
|
|
2200
|
+
/**
|
|
2201
|
+
* Must be 'text' to identify this as text content.
|
|
2202
|
+
*/
|
|
1425
2203
|
type?: 'text';
|
|
1426
2204
|
}
|
|
1427
2205
|
|
|
@@ -1429,6 +2207,9 @@ export namespace CompletionListResponse {
|
|
|
1429
2207
|
* Tool call specification for OpenAI-compatible chat completion responses.
|
|
1430
2208
|
*/
|
|
1431
2209
|
export interface ToolCall {
|
|
2210
|
+
/**
|
|
2211
|
+
* Unique identifier for the tool call.
|
|
2212
|
+
*/
|
|
1432
2213
|
id?: string | null;
|
|
1433
2214
|
|
|
1434
2215
|
/**
|
|
@@ -1436,8 +2217,14 @@ export namespace CompletionListResponse {
|
|
|
1436
2217
|
*/
|
|
1437
2218
|
function?: ToolCall.Function | null;
|
|
1438
2219
|
|
|
2220
|
+
/**
|
|
2221
|
+
* Index of the tool call in the list.
|
|
2222
|
+
*/
|
|
1439
2223
|
index?: number | null;
|
|
1440
2224
|
|
|
2225
|
+
/**
|
|
2226
|
+
* Must be 'function' to identify this as a function call.
|
|
2227
|
+
*/
|
|
1441
2228
|
type?: 'function';
|
|
1442
2229
|
}
|
|
1443
2230
|
|
|
@@ -1446,8 +2233,14 @@ export namespace CompletionListResponse {
|
|
|
1446
2233
|
* Function call details for OpenAI-compatible tool calls.
|
|
1447
2234
|
*/
|
|
1448
2235
|
export interface Function {
|
|
2236
|
+
/**
|
|
2237
|
+
* Arguments to pass to the function as a JSON string.
|
|
2238
|
+
*/
|
|
1449
2239
|
arguments?: string | null;
|
|
1450
2240
|
|
|
2241
|
+
/**
|
|
2242
|
+
* Name of the function to call.
|
|
2243
|
+
*/
|
|
1451
2244
|
name?: string | null;
|
|
1452
2245
|
}
|
|
1453
2246
|
}
|
|
@@ -1458,10 +2251,19 @@ export namespace CompletionListResponse {
|
|
|
1458
2251
|
* chat completion request.
|
|
1459
2252
|
*/
|
|
1460
2253
|
export interface OpenAIToolMessageParam {
|
|
2254
|
+
/**
|
|
2255
|
+
* The response content from the tool.
|
|
2256
|
+
*/
|
|
1461
2257
|
content: string | Array<OpenAIToolMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
1462
2258
|
|
|
2259
|
+
/**
|
|
2260
|
+
* Unique identifier for the tool call this response is for.
|
|
2261
|
+
*/
|
|
1463
2262
|
tool_call_id: string;
|
|
1464
2263
|
|
|
2264
|
+
/**
|
|
2265
|
+
* Must be 'tool' to identify this as a tool response.
|
|
2266
|
+
*/
|
|
1465
2267
|
role?: 'tool';
|
|
1466
2268
|
}
|
|
1467
2269
|
|
|
@@ -1470,8 +2272,14 @@ export namespace CompletionListResponse {
|
|
|
1470
2272
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
1471
2273
|
*/
|
|
1472
2274
|
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
2275
|
+
/**
|
|
2276
|
+
* The text content of the message.
|
|
2277
|
+
*/
|
|
1473
2278
|
text: string;
|
|
1474
2279
|
|
|
2280
|
+
/**
|
|
2281
|
+
* Must be 'text' to identify this as text content.
|
|
2282
|
+
*/
|
|
1475
2283
|
type?: 'text';
|
|
1476
2284
|
}
|
|
1477
2285
|
}
|
|
@@ -1480,10 +2288,19 @@ export namespace CompletionListResponse {
|
|
|
1480
2288
|
* A message from the developer in an OpenAI-compatible chat completion request.
|
|
1481
2289
|
*/
|
|
1482
2290
|
export interface OpenAIDeveloperMessageParam {
|
|
2291
|
+
/**
|
|
2292
|
+
* The content of the developer message.
|
|
2293
|
+
*/
|
|
1483
2294
|
content: string | Array<OpenAIDeveloperMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
1484
2295
|
|
|
2296
|
+
/**
|
|
2297
|
+
* The name of the developer message participant.
|
|
2298
|
+
*/
|
|
1485
2299
|
name?: string | null;
|
|
1486
2300
|
|
|
2301
|
+
/**
|
|
2302
|
+
* Must be 'developer' to identify this as a developer message.
|
|
2303
|
+
*/
|
|
1487
2304
|
role?: 'developer';
|
|
1488
2305
|
}
|
|
1489
2306
|
|
|
@@ -1492,8 +2309,14 @@ export namespace CompletionListResponse {
|
|
|
1492
2309
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
1493
2310
|
*/
|
|
1494
2311
|
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
2312
|
+
/**
|
|
2313
|
+
* The text content of the message.
|
|
2314
|
+
*/
|
|
1495
2315
|
text: string;
|
|
1496
2316
|
|
|
2317
|
+
/**
|
|
2318
|
+
* Must be 'text' to identify this as text content.
|
|
2319
|
+
*/
|
|
1497
2320
|
type?: 'text';
|
|
1498
2321
|
}
|
|
1499
2322
|
}
|
|
@@ -1502,10 +2325,19 @@ export namespace CompletionListResponse {
|
|
|
1502
2325
|
* Usage information for OpenAI chat completion.
|
|
1503
2326
|
*/
|
|
1504
2327
|
export interface Usage {
|
|
2328
|
+
/**
|
|
2329
|
+
* Number of tokens in the completion.
|
|
2330
|
+
*/
|
|
1505
2331
|
completion_tokens: number;
|
|
1506
2332
|
|
|
2333
|
+
/**
|
|
2334
|
+
* Number of tokens in the prompt.
|
|
2335
|
+
*/
|
|
1507
2336
|
prompt_tokens: number;
|
|
1508
2337
|
|
|
2338
|
+
/**
|
|
2339
|
+
* Total tokens used (prompt + completion).
|
|
2340
|
+
*/
|
|
1509
2341
|
total_tokens: number;
|
|
1510
2342
|
|
|
1511
2343
|
/**
|
|
@@ -1524,6 +2356,9 @@ export namespace CompletionListResponse {
|
|
|
1524
2356
|
* Token details for output tokens in OpenAI chat completion usage.
|
|
1525
2357
|
*/
|
|
1526
2358
|
export interface CompletionTokensDetails {
|
|
2359
|
+
/**
|
|
2360
|
+
* Number of tokens used for reasoning (o1/o3 models).
|
|
2361
|
+
*/
|
|
1527
2362
|
reasoning_tokens?: number | null;
|
|
1528
2363
|
}
|
|
1529
2364
|
|
|
@@ -1531,6 +2366,9 @@ export namespace CompletionListResponse {
|
|
|
1531
2366
|
* Token details for prompt tokens in OpenAI chat completion usage.
|
|
1532
2367
|
*/
|
|
1533
2368
|
export interface PromptTokensDetails {
|
|
2369
|
+
/**
|
|
2370
|
+
* Number of tokens retrieved from cache.
|
|
2371
|
+
*/
|
|
1534
2372
|
cached_tokens?: number | null;
|
|
1535
2373
|
}
|
|
1536
2374
|
}
|
|
@@ -1540,6 +2378,9 @@ export namespace CompletionListResponse {
|
|
|
1540
2378
|
export type CompletionCreateParams = CompletionCreateParamsNonStreaming | CompletionCreateParamsStreaming;
|
|
1541
2379
|
|
|
1542
2380
|
export interface CompletionCreateParamsBase {
|
|
2381
|
+
/**
|
|
2382
|
+
* List of messages in the conversation.
|
|
2383
|
+
*/
|
|
1543
2384
|
messages: Array<
|
|
1544
2385
|
| CompletionCreateParams.OpenAIUserMessageParamInput
|
|
1545
2386
|
| CompletionCreateParams.OpenAISystemMessageParam
|
|
@@ -1548,30 +2389,68 @@ export interface CompletionCreateParamsBase {
|
|
|
1548
2389
|
| CompletionCreateParams.OpenAIDeveloperMessageParam
|
|
1549
2390
|
>;
|
|
1550
2391
|
|
|
2392
|
+
/**
|
|
2393
|
+
* The identifier of the model to use.
|
|
2394
|
+
*/
|
|
1551
2395
|
model: string;
|
|
1552
2396
|
|
|
2397
|
+
/**
|
|
2398
|
+
* The penalty for repeated tokens.
|
|
2399
|
+
*/
|
|
1553
2400
|
frequency_penalty?: number | null;
|
|
1554
2401
|
|
|
2402
|
+
/**
|
|
2403
|
+
* The function call to use.
|
|
2404
|
+
*/
|
|
1555
2405
|
function_call?: string | { [key: string]: unknown } | null;
|
|
1556
2406
|
|
|
2407
|
+
/**
|
|
2408
|
+
* List of functions to use.
|
|
2409
|
+
*/
|
|
1557
2410
|
functions?: Array<{ [key: string]: unknown }> | null;
|
|
1558
2411
|
|
|
2412
|
+
/**
|
|
2413
|
+
* The logit bias to use.
|
|
2414
|
+
*/
|
|
1559
2415
|
logit_bias?: { [key: string]: number } | null;
|
|
1560
2416
|
|
|
2417
|
+
/**
|
|
2418
|
+
* The log probabilities to use.
|
|
2419
|
+
*/
|
|
1561
2420
|
logprobs?: boolean | null;
|
|
1562
2421
|
|
|
2422
|
+
/**
|
|
2423
|
+
* The maximum number of tokens to generate.
|
|
2424
|
+
*/
|
|
1563
2425
|
max_completion_tokens?: number | null;
|
|
1564
2426
|
|
|
2427
|
+
/**
|
|
2428
|
+
* The maximum number of tokens to generate.
|
|
2429
|
+
*/
|
|
1565
2430
|
max_tokens?: number | null;
|
|
1566
2431
|
|
|
2432
|
+
/**
|
|
2433
|
+
* The number of completions to generate.
|
|
2434
|
+
*/
|
|
1567
2435
|
n?: number | null;
|
|
1568
2436
|
|
|
2437
|
+
/**
|
|
2438
|
+
* Whether to parallelize tool calls.
|
|
2439
|
+
*/
|
|
1569
2440
|
parallel_tool_calls?: boolean | null;
|
|
1570
2441
|
|
|
2442
|
+
/**
|
|
2443
|
+
* The penalty for repeated tokens.
|
|
2444
|
+
*/
|
|
1571
2445
|
presence_penalty?: number | null;
|
|
1572
2446
|
|
|
1573
2447
|
/**
|
|
1574
|
-
*
|
|
2448
|
+
* The effort level for reasoning models.
|
|
2449
|
+
*/
|
|
2450
|
+
reasoning_effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | null;
|
|
2451
|
+
|
|
2452
|
+
/**
|
|
2453
|
+
* The response format to use.
|
|
1575
2454
|
*/
|
|
1576
2455
|
response_format?:
|
|
1577
2456
|
| CompletionCreateParams.OpenAIResponseFormatText
|
|
@@ -1579,24 +2458,59 @@ export interface CompletionCreateParamsBase {
|
|
|
1579
2458
|
| CompletionCreateParams.OpenAIResponseFormatJsonObject
|
|
1580
2459
|
| null;
|
|
1581
2460
|
|
|
2461
|
+
/**
|
|
2462
|
+
* A stable identifier used for safety monitoring and abuse detection.
|
|
2463
|
+
*/
|
|
2464
|
+
safety_identifier?: string | null;
|
|
2465
|
+
|
|
2466
|
+
/**
|
|
2467
|
+
* The seed to use.
|
|
2468
|
+
*/
|
|
1582
2469
|
seed?: number | null;
|
|
1583
2470
|
|
|
2471
|
+
/**
|
|
2472
|
+
* The stop tokens to use.
|
|
2473
|
+
*/
|
|
1584
2474
|
stop?: string | Array<string> | null;
|
|
1585
2475
|
|
|
2476
|
+
/**
|
|
2477
|
+
* Whether to stream the response.
|
|
2478
|
+
*/
|
|
1586
2479
|
stream?: boolean | null;
|
|
1587
2480
|
|
|
2481
|
+
/**
|
|
2482
|
+
* The stream options to use.
|
|
2483
|
+
*/
|
|
1588
2484
|
stream_options?: { [key: string]: unknown } | null;
|
|
1589
2485
|
|
|
2486
|
+
/**
|
|
2487
|
+
* The temperature to use.
|
|
2488
|
+
*/
|
|
1590
2489
|
temperature?: number | null;
|
|
1591
2490
|
|
|
2491
|
+
/**
|
|
2492
|
+
* The tool choice to use.
|
|
2493
|
+
*/
|
|
1592
2494
|
tool_choice?: string | { [key: string]: unknown } | null;
|
|
1593
2495
|
|
|
2496
|
+
/**
|
|
2497
|
+
* The tools to use.
|
|
2498
|
+
*/
|
|
1594
2499
|
tools?: Array<{ [key: string]: unknown }> | null;
|
|
1595
2500
|
|
|
2501
|
+
/**
|
|
2502
|
+
* The top log probabilities to use.
|
|
2503
|
+
*/
|
|
1596
2504
|
top_logprobs?: number | null;
|
|
1597
2505
|
|
|
2506
|
+
/**
|
|
2507
|
+
* The top p to use.
|
|
2508
|
+
*/
|
|
1598
2509
|
top_p?: number | null;
|
|
1599
2510
|
|
|
2511
|
+
/**
|
|
2512
|
+
* The user to use.
|
|
2513
|
+
*/
|
|
1600
2514
|
user?: string | null;
|
|
1601
2515
|
|
|
1602
2516
|
[k: string]: unknown;
|
|
@@ -1607,6 +2521,9 @@ export namespace CompletionCreateParams {
|
|
|
1607
2521
|
* A message from the user in an OpenAI-compatible chat completion request.
|
|
1608
2522
|
*/
|
|
1609
2523
|
export interface OpenAIUserMessageParamInput {
|
|
2524
|
+
/**
|
|
2525
|
+
* The content of the message, which can include text and other media.
|
|
2526
|
+
*/
|
|
1610
2527
|
content:
|
|
1611
2528
|
| string
|
|
1612
2529
|
| Array<
|
|
@@ -1615,8 +2532,14 @@ export namespace CompletionCreateParams {
|
|
|
1615
2532
|
| OpenAIUserMessageParamInput.OpenAIFile
|
|
1616
2533
|
>;
|
|
1617
2534
|
|
|
2535
|
+
/**
|
|
2536
|
+
* The name of the user message participant.
|
|
2537
|
+
*/
|
|
1618
2538
|
name?: string | null;
|
|
1619
2539
|
|
|
2540
|
+
/**
|
|
2541
|
+
* Must be 'user' to identify this as a user message.
|
|
2542
|
+
*/
|
|
1620
2543
|
role?: 'user';
|
|
1621
2544
|
}
|
|
1622
2545
|
|
|
@@ -1625,8 +2548,14 @@ export namespace CompletionCreateParams {
|
|
|
1625
2548
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
1626
2549
|
*/
|
|
1627
2550
|
export interface OpenAIChatCompletionContentPartTextParam {
|
|
2551
|
+
/**
|
|
2552
|
+
* The text content of the message.
|
|
2553
|
+
*/
|
|
1628
2554
|
text: string;
|
|
1629
2555
|
|
|
2556
|
+
/**
|
|
2557
|
+
* Must be 'text' to identify this as text content.
|
|
2558
|
+
*/
|
|
1630
2559
|
type?: 'text';
|
|
1631
2560
|
}
|
|
1632
2561
|
|
|
@@ -1635,36 +2564,63 @@ export namespace CompletionCreateParams {
|
|
|
1635
2564
|
*/
|
|
1636
2565
|
export interface OpenAIChatCompletionContentPartImageParam {
|
|
1637
2566
|
/**
|
|
1638
|
-
* Image URL specification
|
|
2567
|
+
* Image URL specification and processing details.
|
|
1639
2568
|
*/
|
|
1640
2569
|
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
1641
2570
|
|
|
2571
|
+
/**
|
|
2572
|
+
* Must be 'image_url' to identify this as image content.
|
|
2573
|
+
*/
|
|
1642
2574
|
type?: 'image_url';
|
|
1643
2575
|
}
|
|
1644
2576
|
|
|
1645
2577
|
export namespace OpenAIChatCompletionContentPartImageParam {
|
|
1646
2578
|
/**
|
|
1647
|
-
* Image URL specification
|
|
2579
|
+
* Image URL specification and processing details.
|
|
1648
2580
|
*/
|
|
1649
2581
|
export interface ImageURL {
|
|
2582
|
+
/**
|
|
2583
|
+
* URL of the image to include in the message.
|
|
2584
|
+
*/
|
|
1650
2585
|
url: string;
|
|
1651
2586
|
|
|
1652
|
-
|
|
2587
|
+
/**
|
|
2588
|
+
* Level of detail for image processing. Can be 'low', 'high', or 'auto'.
|
|
2589
|
+
*/
|
|
2590
|
+
detail?: 'low' | 'high' | 'auto' | null;
|
|
1653
2591
|
}
|
|
1654
2592
|
}
|
|
1655
2593
|
|
|
1656
2594
|
export interface OpenAIFile {
|
|
2595
|
+
/**
|
|
2596
|
+
* File specification.
|
|
2597
|
+
*/
|
|
1657
2598
|
file: OpenAIFile.File;
|
|
1658
2599
|
|
|
2600
|
+
/**
|
|
2601
|
+
* Must be 'file' to identify this as file content.
|
|
2602
|
+
*/
|
|
1659
2603
|
type?: 'file';
|
|
1660
2604
|
}
|
|
1661
2605
|
|
|
1662
2606
|
export namespace OpenAIFile {
|
|
2607
|
+
/**
|
|
2608
|
+
* File specification.
|
|
2609
|
+
*/
|
|
1663
2610
|
export interface File {
|
|
2611
|
+
/**
|
|
2612
|
+
* Base64-encoded file data.
|
|
2613
|
+
*/
|
|
1664
2614
|
file_data?: string | null;
|
|
1665
2615
|
|
|
2616
|
+
/**
|
|
2617
|
+
* ID of an uploaded file.
|
|
2618
|
+
*/
|
|
1666
2619
|
file_id?: string | null;
|
|
1667
2620
|
|
|
2621
|
+
/**
|
|
2622
|
+
* Name of the file.
|
|
2623
|
+
*/
|
|
1668
2624
|
filename?: string | null;
|
|
1669
2625
|
}
|
|
1670
2626
|
}
|
|
@@ -1674,10 +2630,20 @@ export namespace CompletionCreateParams {
|
|
|
1674
2630
|
* A system message providing instructions or context to the model.
|
|
1675
2631
|
*/
|
|
1676
2632
|
export interface OpenAISystemMessageParam {
|
|
2633
|
+
/**
|
|
2634
|
+
* The content of the 'system prompt'. If multiple system messages are provided,
|
|
2635
|
+
* they are concatenated.
|
|
2636
|
+
*/
|
|
1677
2637
|
content: string | Array<OpenAISystemMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
1678
2638
|
|
|
2639
|
+
/**
|
|
2640
|
+
* The name of the system message participant.
|
|
2641
|
+
*/
|
|
1679
2642
|
name?: string | null;
|
|
1680
2643
|
|
|
2644
|
+
/**
|
|
2645
|
+
* Must be 'system' to identify this as a system message.
|
|
2646
|
+
*/
|
|
1681
2647
|
role?: 'system';
|
|
1682
2648
|
}
|
|
1683
2649
|
|
|
@@ -1686,8 +2652,14 @@ export namespace CompletionCreateParams {
|
|
|
1686
2652
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
1687
2653
|
*/
|
|
1688
2654
|
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
2655
|
+
/**
|
|
2656
|
+
* The text content of the message.
|
|
2657
|
+
*/
|
|
1689
2658
|
text: string;
|
|
1690
2659
|
|
|
2660
|
+
/**
|
|
2661
|
+
* Must be 'text' to identify this as text content.
|
|
2662
|
+
*/
|
|
1691
2663
|
type?: 'text';
|
|
1692
2664
|
}
|
|
1693
2665
|
}
|
|
@@ -1697,15 +2669,27 @@ export namespace CompletionCreateParams {
|
|
|
1697
2669
|
* chat completion request.
|
|
1698
2670
|
*/
|
|
1699
2671
|
export interface OpenAIAssistantMessageParamInput {
|
|
2672
|
+
/**
|
|
2673
|
+
* The content of the model's response.
|
|
2674
|
+
*/
|
|
1700
2675
|
content?:
|
|
1701
2676
|
| string
|
|
1702
2677
|
| Array<OpenAIAssistantMessageParamInput.ListOpenAIChatCompletionContentPartTextParam>
|
|
1703
2678
|
| null;
|
|
1704
2679
|
|
|
2680
|
+
/**
|
|
2681
|
+
* The name of the assistant message participant.
|
|
2682
|
+
*/
|
|
1705
2683
|
name?: string | null;
|
|
1706
2684
|
|
|
2685
|
+
/**
|
|
2686
|
+
* Must be 'assistant' to identify this as the model's response.
|
|
2687
|
+
*/
|
|
1707
2688
|
role?: 'assistant';
|
|
1708
2689
|
|
|
2690
|
+
/**
|
|
2691
|
+
* List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
|
|
2692
|
+
*/
|
|
1709
2693
|
tool_calls?: Array<OpenAIAssistantMessageParamInput.ToolCall> | null;
|
|
1710
2694
|
}
|
|
1711
2695
|
|
|
@@ -1714,8 +2698,14 @@ export namespace CompletionCreateParams {
|
|
|
1714
2698
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
1715
2699
|
*/
|
|
1716
2700
|
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
2701
|
+
/**
|
|
2702
|
+
* The text content of the message.
|
|
2703
|
+
*/
|
|
1717
2704
|
text: string;
|
|
1718
2705
|
|
|
2706
|
+
/**
|
|
2707
|
+
* Must be 'text' to identify this as text content.
|
|
2708
|
+
*/
|
|
1719
2709
|
type?: 'text';
|
|
1720
2710
|
}
|
|
1721
2711
|
|
|
@@ -1723,6 +2713,9 @@ export namespace CompletionCreateParams {
|
|
|
1723
2713
|
* Tool call specification for OpenAI-compatible chat completion responses.
|
|
1724
2714
|
*/
|
|
1725
2715
|
export interface ToolCall {
|
|
2716
|
+
/**
|
|
2717
|
+
* Unique identifier for the tool call.
|
|
2718
|
+
*/
|
|
1726
2719
|
id?: string | null;
|
|
1727
2720
|
|
|
1728
2721
|
/**
|
|
@@ -1730,8 +2723,14 @@ export namespace CompletionCreateParams {
|
|
|
1730
2723
|
*/
|
|
1731
2724
|
function?: ToolCall.Function | null;
|
|
1732
2725
|
|
|
2726
|
+
/**
|
|
2727
|
+
* Index of the tool call in the list.
|
|
2728
|
+
*/
|
|
1733
2729
|
index?: number | null;
|
|
1734
2730
|
|
|
2731
|
+
/**
|
|
2732
|
+
* Must be 'function' to identify this as a function call.
|
|
2733
|
+
*/
|
|
1735
2734
|
type?: 'function';
|
|
1736
2735
|
}
|
|
1737
2736
|
|
|
@@ -1740,8 +2739,14 @@ export namespace CompletionCreateParams {
|
|
|
1740
2739
|
* Function call details for OpenAI-compatible tool calls.
|
|
1741
2740
|
*/
|
|
1742
2741
|
export interface Function {
|
|
2742
|
+
/**
|
|
2743
|
+
* Arguments to pass to the function as a JSON string.
|
|
2744
|
+
*/
|
|
1743
2745
|
arguments?: string | null;
|
|
1744
2746
|
|
|
2747
|
+
/**
|
|
2748
|
+
* Name of the function to call.
|
|
2749
|
+
*/
|
|
1745
2750
|
name?: string | null;
|
|
1746
2751
|
}
|
|
1747
2752
|
}
|
|
@@ -1752,10 +2757,19 @@ export namespace CompletionCreateParams {
|
|
|
1752
2757
|
* chat completion request.
|
|
1753
2758
|
*/
|
|
1754
2759
|
export interface OpenAIToolMessageParam {
|
|
2760
|
+
/**
|
|
2761
|
+
* The response content from the tool.
|
|
2762
|
+
*/
|
|
1755
2763
|
content: string | Array<OpenAIToolMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
1756
2764
|
|
|
2765
|
+
/**
|
|
2766
|
+
* Unique identifier for the tool call this response is for.
|
|
2767
|
+
*/
|
|
1757
2768
|
tool_call_id: string;
|
|
1758
2769
|
|
|
2770
|
+
/**
|
|
2771
|
+
* Must be 'tool' to identify this as a tool response.
|
|
2772
|
+
*/
|
|
1759
2773
|
role?: 'tool';
|
|
1760
2774
|
}
|
|
1761
2775
|
|
|
@@ -1764,8 +2778,14 @@ export namespace CompletionCreateParams {
|
|
|
1764
2778
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
1765
2779
|
*/
|
|
1766
2780
|
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
2781
|
+
/**
|
|
2782
|
+
* The text content of the message.
|
|
2783
|
+
*/
|
|
1767
2784
|
text: string;
|
|
1768
2785
|
|
|
2786
|
+
/**
|
|
2787
|
+
* Must be 'text' to identify this as text content.
|
|
2788
|
+
*/
|
|
1769
2789
|
type?: 'text';
|
|
1770
2790
|
}
|
|
1771
2791
|
}
|
|
@@ -1774,10 +2794,19 @@ export namespace CompletionCreateParams {
|
|
|
1774
2794
|
* A message from the developer in an OpenAI-compatible chat completion request.
|
|
1775
2795
|
*/
|
|
1776
2796
|
export interface OpenAIDeveloperMessageParam {
|
|
2797
|
+
/**
|
|
2798
|
+
* The content of the developer message.
|
|
2799
|
+
*/
|
|
1777
2800
|
content: string | Array<OpenAIDeveloperMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
1778
2801
|
|
|
2802
|
+
/**
|
|
2803
|
+
* The name of the developer message participant.
|
|
2804
|
+
*/
|
|
1779
2805
|
name?: string | null;
|
|
1780
2806
|
|
|
2807
|
+
/**
|
|
2808
|
+
* Must be 'developer' to identify this as a developer message.
|
|
2809
|
+
*/
|
|
1781
2810
|
role?: 'developer';
|
|
1782
2811
|
}
|
|
1783
2812
|
|
|
@@ -1786,8 +2815,14 @@ export namespace CompletionCreateParams {
|
|
|
1786
2815
|
* Text content part for OpenAI-compatible chat completion messages.
|
|
1787
2816
|
*/
|
|
1788
2817
|
export interface ListOpenAIChatCompletionContentPartTextParam {
|
|
2818
|
+
/**
|
|
2819
|
+
* The text content of the message.
|
|
2820
|
+
*/
|
|
1789
2821
|
text: string;
|
|
1790
2822
|
|
|
2823
|
+
/**
|
|
2824
|
+
* Must be 'text' to identify this as text content.
|
|
2825
|
+
*/
|
|
1791
2826
|
type?: 'text';
|
|
1792
2827
|
}
|
|
1793
2828
|
}
|
|
@@ -1796,6 +2831,9 @@ export namespace CompletionCreateParams {
|
|
|
1796
2831
|
* Text response format for OpenAI-compatible chat completion requests.
|
|
1797
2832
|
*/
|
|
1798
2833
|
export interface OpenAIResponseFormatText {
|
|
2834
|
+
/**
|
|
2835
|
+
* Must be 'text' to indicate plain text response format.
|
|
2836
|
+
*/
|
|
1799
2837
|
type?: 'text';
|
|
1800
2838
|
}
|
|
1801
2839
|
|
|
@@ -1804,16 +2842,19 @@ export namespace CompletionCreateParams {
|
|
|
1804
2842
|
*/
|
|
1805
2843
|
export interface OpenAIResponseFormatJsonSchema {
|
|
1806
2844
|
/**
|
|
1807
|
-
* JSON schema specification for
|
|
2845
|
+
* The JSON schema specification for the response.
|
|
1808
2846
|
*/
|
|
1809
2847
|
json_schema: OpenAIResponseFormatJsonSchema.JsonSchema;
|
|
1810
2848
|
|
|
2849
|
+
/**
|
|
2850
|
+
* Must be 'json_schema' to indicate structured JSON response format.
|
|
2851
|
+
*/
|
|
1811
2852
|
type?: 'json_schema';
|
|
1812
2853
|
}
|
|
1813
2854
|
|
|
1814
2855
|
export namespace OpenAIResponseFormatJsonSchema {
|
|
1815
2856
|
/**
|
|
1816
|
-
* JSON schema specification for
|
|
2857
|
+
* The JSON schema specification for the response.
|
|
1817
2858
|
*/
|
|
1818
2859
|
export interface JsonSchema {
|
|
1819
2860
|
description?: string | null;
|
|
@@ -1830,6 +2871,9 @@ export namespace CompletionCreateParams {
|
|
|
1830
2871
|
* JSON object response format for OpenAI-compatible chat completion requests.
|
|
1831
2872
|
*/
|
|
1832
2873
|
export interface OpenAIResponseFormatJsonObject {
|
|
2874
|
+
/**
|
|
2875
|
+
* Must be 'json_object' to indicate generic JSON object response format.
|
|
2876
|
+
*/
|
|
1833
2877
|
type?: 'json_object';
|
|
1834
2878
|
}
|
|
1835
2879
|
|
|
@@ -1838,22 +2882,37 @@ export namespace CompletionCreateParams {
|
|
|
1838
2882
|
}
|
|
1839
2883
|
|
|
1840
2884
|
export interface CompletionCreateParamsNonStreaming extends CompletionCreateParamsBase {
|
|
2885
|
+
/**
|
|
2886
|
+
* Whether to stream the response.
|
|
2887
|
+
*/
|
|
1841
2888
|
stream?: false | null;
|
|
1842
2889
|
|
|
1843
2890
|
[k: string]: unknown;
|
|
1844
2891
|
}
|
|
1845
2892
|
|
|
1846
2893
|
export interface CompletionCreateParamsStreaming extends CompletionCreateParamsBase {
|
|
2894
|
+
/**
|
|
2895
|
+
* Whether to stream the response.
|
|
2896
|
+
*/
|
|
1847
2897
|
stream: true;
|
|
1848
2898
|
|
|
1849
2899
|
[k: string]: unknown;
|
|
1850
2900
|
}
|
|
1851
2901
|
|
|
1852
2902
|
export interface CompletionListParams {
|
|
2903
|
+
/**
|
|
2904
|
+
* The ID of the last chat completion to return.
|
|
2905
|
+
*/
|
|
1853
2906
|
after?: string | null;
|
|
1854
2907
|
|
|
2908
|
+
/**
|
|
2909
|
+
* The maximum number of chat completions to return.
|
|
2910
|
+
*/
|
|
1855
2911
|
limit?: number | null;
|
|
1856
2912
|
|
|
2913
|
+
/**
|
|
2914
|
+
* The model to filter by.
|
|
2915
|
+
*/
|
|
1857
2916
|
model?: string | null;
|
|
1858
2917
|
|
|
1859
2918
|
/**
|