llama-stack-client 0.7.0 → 0.7.2
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 +16 -10
- package/.gitignore +1 -0
- package/.release-please-manifest.json +1 -1
- package/.stats.yml +4 -4
- package/CHANGELOG.md +80 -0
- package/CONTRIBUTING.md +2 -2
- package/README.md +22 -0
- package/api.md +1 -71
- package/dist/CHANGELOG.md +80 -0
- package/dist/README.md +22 -0
- package/dist/core.d.ts +1 -1
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +8 -17
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +8 -17
- package/dist/core.mjs.map +1 -1
- package/dist/index.d.mts +51 -12
- package/dist/index.d.ts +51 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +50 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +50 -11
- package/dist/index.mjs.map +1 -1
- package/dist/internal/utils/query.d.ts +2 -0
- package/dist/internal/utils/query.d.ts.map +1 -0
- package/dist/{resources/alpha/post-training/post-training.js → internal/utils/query.js} +6 -24
- package/dist/internal/utils/query.js.map +1 -0
- package/dist/{resources/alpha/post-training.mjs → internal/utils/query.mjs} +5 -2
- package/dist/internal/utils/query.mjs.map +1 -0
- package/dist/package.json +1 -1
- package/dist/resources/alpha/alpha.d.ts +0 -4
- package/dist/resources/alpha/alpha.d.ts.map +1 -1
- package/dist/resources/alpha/alpha.js +0 -4
- package/dist/resources/alpha/alpha.js.map +1 -1
- package/dist/resources/alpha/alpha.mjs +0 -4
- package/dist/resources/alpha/alpha.mjs.map +1 -1
- package/dist/resources/alpha/eval/eval.d.ts +3 -0
- package/dist/resources/alpha/eval/eval.d.ts.map +1 -1
- package/dist/resources/alpha/eval/eval.js +3 -0
- package/dist/resources/alpha/eval/eval.js.map +1 -1
- package/dist/resources/alpha/eval/eval.mjs +3 -0
- package/dist/resources/alpha/eval/eval.mjs.map +1 -1
- package/dist/resources/alpha/eval/jobs.d.ts +3 -0
- package/dist/resources/alpha/eval/jobs.d.ts.map +1 -1
- package/dist/resources/alpha/eval/jobs.js +3 -0
- package/dist/resources/alpha/eval/jobs.js.map +1 -1
- package/dist/resources/alpha/eval/jobs.mjs +3 -0
- package/dist/resources/alpha/eval/jobs.mjs.map +1 -1
- package/dist/resources/alpha/index.d.ts +0 -1
- package/dist/resources/alpha/index.d.ts.map +1 -1
- package/dist/resources/alpha/index.js +1 -3
- package/dist/resources/alpha/index.js.map +1 -1
- package/dist/resources/alpha/index.mjs +0 -1
- package/dist/resources/alpha/index.mjs.map +1 -1
- package/dist/resources/alpha/inference.d.ts +8 -0
- package/dist/resources/alpha/inference.d.ts.map +1 -1
- package/dist/resources/alpha/inference.js +8 -0
- package/dist/resources/alpha/inference.js.map +1 -1
- package/dist/resources/alpha/inference.mjs +8 -0
- package/dist/resources/alpha/inference.mjs.map +1 -1
- package/dist/resources/batches.d.ts +8 -0
- package/dist/resources/batches.d.ts.map +1 -1
- package/dist/resources/batches.js +8 -0
- package/dist/resources/batches.js.map +1 -1
- package/dist/resources/batches.mjs +8 -0
- package/dist/resources/batches.mjs.map +1 -1
- package/dist/resources/beta/datasets.d.ts +4 -8
- package/dist/resources/beta/datasets.d.ts.map +1 -1
- package/dist/resources/chat/chat.d.ts +34 -32
- 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 +321 -713
- package/dist/resources/chat/completions.d.ts.map +1 -1
- package/dist/resources/chat/completions.js +8 -0
- package/dist/resources/chat/completions.js.map +1 -1
- package/dist/resources/chat/completions.mjs +8 -0
- package/dist/resources/chat/completions.mjs.map +1 -1
- package/dist/resources/completions.d.ts +10 -4
- package/dist/resources/completions.d.ts.map +1 -1
- package/dist/resources/completions.js +8 -0
- package/dist/resources/completions.js.map +1 -1
- package/dist/resources/completions.mjs +8 -0
- package/dist/resources/completions.mjs.map +1 -1
- package/dist/resources/conversations/conversations.d.ts +95 -2
- package/dist/resources/conversations/conversations.d.ts.map +1 -1
- package/dist/resources/conversations/conversations.js +3 -0
- package/dist/resources/conversations/conversations.js.map +1 -1
- package/dist/resources/conversations/conversations.mjs +3 -0
- package/dist/resources/conversations/conversations.mjs.map +1 -1
- package/dist/resources/conversations/items.d.ts +371 -8
- package/dist/resources/conversations/items.d.ts.map +1 -1
- package/dist/resources/conversations/items.js +3 -0
- package/dist/resources/conversations/items.js.map +1 -1
- package/dist/resources/conversations/items.mjs +3 -0
- package/dist/resources/conversations/items.mjs.map +1 -1
- package/dist/resources/embeddings.d.ts +8 -0
- package/dist/resources/embeddings.d.ts.map +1 -1
- package/dist/resources/embeddings.js +8 -0
- package/dist/resources/embeddings.js.map +1 -1
- package/dist/resources/embeddings.mjs +8 -0
- package/dist/resources/embeddings.mjs.map +1 -1
- package/dist/resources/files.d.ts +11 -8
- package/dist/resources/files.d.ts.map +1 -1
- package/dist/resources/files.js +3 -0
- package/dist/resources/files.js.map +1 -1
- package/dist/resources/files.mjs +3 -0
- package/dist/resources/files.mjs.map +1 -1
- package/dist/resources/index.d.ts +1 -4
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js +1 -7
- package/dist/resources/index.js.map +1 -1
- package/dist/resources/index.mjs +0 -3
- package/dist/resources/index.mjs.map +1 -1
- package/dist/resources/inspect.d.ts +3 -0
- package/dist/resources/inspect.d.ts.map +1 -1
- package/dist/resources/inspect.js +3 -0
- package/dist/resources/inspect.js.map +1 -1
- package/dist/resources/inspect.mjs +3 -0
- package/dist/resources/inspect.mjs.map +1 -1
- package/dist/resources/models/index.d.ts +1 -1
- package/dist/resources/models/index.d.ts.map +1 -1
- package/dist/resources/models/index.js.map +1 -1
- package/dist/resources/models/index.mjs.map +1 -1
- package/dist/resources/models/models.d.ts +7 -65
- package/dist/resources/models/models.d.ts.map +1 -1
- package/dist/resources/models/models.js +0 -19
- package/dist/resources/models/models.js.map +1 -1
- package/dist/resources/models/models.mjs +0 -19
- package/dist/resources/models/models.mjs.map +1 -1
- package/dist/resources/moderations.d.ts +3 -0
- package/dist/resources/moderations.d.ts.map +1 -1
- package/dist/resources/moderations.js +3 -0
- package/dist/resources/moderations.js.map +1 -1
- package/dist/resources/moderations.mjs +3 -0
- package/dist/resources/moderations.mjs.map +1 -1
- package/dist/resources/prompts/prompts.d.ts +3 -0
- package/dist/resources/prompts/prompts.d.ts.map +1 -1
- package/dist/resources/prompts/prompts.js +3 -0
- package/dist/resources/prompts/prompts.js.map +1 -1
- package/dist/resources/prompts/prompts.mjs +3 -0
- package/dist/resources/prompts/prompts.mjs.map +1 -1
- package/dist/resources/prompts/versions.d.ts +3 -0
- package/dist/resources/prompts/versions.d.ts.map +1 -1
- package/dist/resources/prompts/versions.js +3 -0
- package/dist/resources/prompts/versions.js.map +1 -1
- package/dist/resources/prompts/versions.mjs +3 -0
- package/dist/resources/prompts/versions.mjs.map +1 -1
- package/dist/resources/providers.d.ts +3 -0
- package/dist/resources/providers.d.ts.map +1 -1
- package/dist/resources/providers.js +3 -0
- package/dist/resources/providers.js.map +1 -1
- package/dist/resources/providers.mjs +3 -0
- package/dist/resources/providers.mjs.map +1 -1
- package/dist/resources/responses/input-items.d.ts +102 -3
- package/dist/resources/responses/input-items.d.ts.map +1 -1
- package/dist/resources/responses/responses.d.ts +582 -11
- 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 +3 -0
- package/dist/resources/routes.d.ts.map +1 -1
- package/dist/resources/routes.js +3 -0
- package/dist/resources/routes.js.map +1 -1
- package/dist/resources/routes.mjs +3 -0
- package/dist/resources/routes.mjs.map +1 -1
- package/dist/resources/safety.d.ts +14 -11
- package/dist/resources/safety.d.ts.map +1 -1
- package/dist/resources/safety.js +3 -0
- package/dist/resources/safety.js.map +1 -1
- package/dist/resources/safety.mjs +3 -0
- package/dist/resources/safety.mjs.map +1 -1
- package/dist/resources/vector-io.d.ts +4 -4
- package/dist/resources/vector-stores/file-batches.d.ts +49 -1
- package/dist/resources/vector-stores/file-batches.d.ts.map +1 -1
- package/dist/resources/vector-stores/file-batches.js.map +1 -1
- package/dist/resources/vector-stores/file-batches.mjs.map +1 -1
- package/dist/resources/vector-stores/files.d.ts +100 -4
- package/dist/resources/vector-stores/files.d.ts.map +1 -1
- package/dist/resources/vector-stores/files.js.map +1 -1
- package/dist/resources/vector-stores/files.mjs.map +1 -1
- package/dist/resources/vector-stores/vector-stores.d.ts +51 -3
- package/dist/resources/vector-stores/vector-stores.d.ts.map +1 -1
- package/dist/resources/vector-stores/vector-stores.js.map +1 -1
- package/dist/resources/vector-stores/vector-stores.mjs.map +1 -1
- package/dist/src/core.ts +10 -21
- package/dist/src/index.ts +51 -48
- package/{src/resources/alpha/post-training.ts → dist/src/internal/utils/query.ts} +5 -1
- package/dist/src/resources/alpha/alpha.ts +0 -20
- package/dist/src/resources/alpha/eval/eval.ts +3 -0
- package/dist/src/resources/alpha/eval/jobs.ts +3 -0
- package/dist/src/resources/alpha/index.ts +0 -8
- package/dist/src/resources/alpha/inference.ts +8 -0
- package/dist/src/resources/batches.ts +8 -0
- package/dist/src/resources/beta/datasets.ts +4 -9
- package/dist/src/resources/chat/chat.ts +36 -33
- package/dist/src/resources/chat/completions.ts +307 -811
- package/dist/src/resources/completions.ts +10 -4
- package/dist/src/resources/conversations/conversations.ts +121 -1
- package/dist/src/resources/conversations/items.ts +477 -6
- package/dist/src/resources/embeddings.ts +8 -0
- package/dist/src/resources/files.ts +12 -9
- package/dist/src/resources/index.ts +0 -18
- package/dist/src/resources/inspect.ts +3 -0
- package/dist/src/resources/models/index.ts +0 -2
- package/dist/src/resources/models/models.ts +7 -82
- package/dist/src/resources/moderations.ts +3 -0
- package/dist/src/resources/prompts/prompts.ts +3 -0
- package/dist/src/resources/prompts/versions.ts +3 -0
- package/dist/src/resources/providers.ts +3 -0
- package/dist/src/resources/responses/input-items.ts +128 -2
- package/dist/src/resources/responses/responses.ts +706 -7
- package/dist/src/resources/routes.ts +3 -0
- package/dist/src/resources/safety.ts +15 -12
- package/dist/src/resources/vector-io.ts +4 -4
- package/dist/src/resources/vector-stores/file-batches.ts +57 -0
- package/dist/src/resources/vector-stores/files.ts +117 -3
- package/dist/src/resources/vector-stores/vector-stores.ts +59 -2
- package/dist/src/streaming.ts +24 -6
- package/dist/src/version.ts +1 -1
- package/dist/streaming.d.ts.map +1 -1
- package/dist/streaming.js +21 -6
- package/dist/streaming.js.map +1 -1
- package/dist/streaming.mjs +21 -6
- package/dist/streaming.mjs.map +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/scripts/mock +21 -10
- package/scripts/test +8 -8
- package/src/core.ts +10 -21
- package/src/index.ts +51 -48
- package/{dist/src/resources/alpha/post-training.ts → src/internal/utils/query.ts} +5 -1
- package/src/resources/alpha/alpha.ts +0 -20
- package/src/resources/alpha/eval/eval.ts +3 -0
- package/src/resources/alpha/eval/jobs.ts +3 -0
- package/src/resources/alpha/index.ts +0 -8
- package/src/resources/alpha/inference.ts +8 -0
- package/src/resources/batches.ts +8 -0
- package/src/resources/beta/datasets.ts +4 -9
- package/src/resources/chat/chat.ts +36 -33
- package/src/resources/chat/completions.ts +307 -811
- package/src/resources/completions.ts +10 -4
- package/src/resources/conversations/conversations.ts +121 -1
- package/src/resources/conversations/items.ts +477 -6
- package/src/resources/embeddings.ts +8 -0
- package/src/resources/files.ts +12 -9
- package/src/resources/index.ts +0 -18
- package/src/resources/inspect.ts +3 -0
- package/src/resources/models/index.ts +0 -2
- package/src/resources/models/models.ts +7 -82
- package/src/resources/moderations.ts +3 -0
- package/src/resources/prompts/prompts.ts +3 -0
- package/src/resources/prompts/versions.ts +3 -0
- package/src/resources/providers.ts +3 -0
- package/src/resources/responses/input-items.ts +128 -2
- package/src/resources/responses/responses.ts +706 -7
- package/src/resources/routes.ts +3 -0
- package/src/resources/safety.ts +15 -12
- package/src/resources/vector-io.ts +4 -4
- package/src/resources/vector-stores/file-batches.ts +57 -0
- package/src/resources/vector-stores/files.ts +117 -3
- package/src/resources/vector-stores/vector-stores.ts +59 -2
- package/src/streaming.ts +24 -6
- package/src/version.ts +1 -1
- package/tests/api-resources/beta/datasets.test.ts +4 -10
- package/tests/api-resources/chat/completions.test.ts +2 -0
- package/tests/api-resources/files.test.ts +2 -2
- package/tests/api-resources/models/models.test.ts +0 -39
- package/tests/api-resources/responses/responses.test.ts +10 -1
- package/tests/api-resources/vector-stores/file-batches.test.ts +1 -1
- package/tests/api-resources/vector-stores/files.test.ts +1 -1
- package/tests/api-resources/vector-stores/vector-stores.test.ts +1 -1
- package/tests/stringifyQuery.test.ts +2 -4
- package/dist/resources/alpha/post-training/index.d.ts +0 -3
- package/dist/resources/alpha/post-training/index.d.ts.map +0 -1
- package/dist/resources/alpha/post-training/index.js +0 -15
- package/dist/resources/alpha/post-training/index.js.map +0 -1
- package/dist/resources/alpha/post-training/index.mjs +0 -10
- package/dist/resources/alpha/post-training/index.mjs.map +0 -1
- package/dist/resources/alpha/post-training/job.d.ts +0 -104
- package/dist/resources/alpha/post-training/job.d.ts.map +0 -1
- package/dist/resources/alpha/post-training/job.js +0 -42
- package/dist/resources/alpha/post-training/job.js.map +0 -1
- package/dist/resources/alpha/post-training/job.mjs +0 -38
- package/dist/resources/alpha/post-training/job.mjs.map +0 -1
- package/dist/resources/alpha/post-training/post-training.d.ts +0 -269
- package/dist/resources/alpha/post-training/post-training.d.ts.map +0 -1
- package/dist/resources/alpha/post-training/post-training.js.map +0 -1
- package/dist/resources/alpha/post-training/post-training.mjs +0 -30
- package/dist/resources/alpha/post-training/post-training.mjs.map +0 -1
- package/dist/resources/alpha/post-training.d.ts +0 -2
- package/dist/resources/alpha/post-training.d.ts.map +0 -1
- package/dist/resources/alpha/post-training.js +0 -25
- package/dist/resources/alpha/post-training.js.map +0 -1
- package/dist/resources/alpha/post-training.mjs.map +0 -1
- package/dist/resources/tool-runtime.d.ts +0 -152
- package/dist/resources/tool-runtime.d.ts.map +0 -1
- package/dist/resources/tool-runtime.js +0 -30
- package/dist/resources/tool-runtime.js.map +0 -1
- package/dist/resources/tool-runtime.mjs +0 -26
- package/dist/resources/tool-runtime.mjs.map +0 -1
- package/dist/resources/toolgroups.d.ts +0 -91
- package/dist/resources/toolgroups.d.ts.map +0 -1
- package/dist/resources/toolgroups.js +0 -54
- package/dist/resources/toolgroups.js.map +0 -1
- package/dist/resources/toolgroups.mjs +0 -50
- package/dist/resources/toolgroups.mjs.map +0 -1
- package/dist/resources/tools.d.ts +0 -26
- package/dist/resources/tools.d.ts.map +0 -1
- package/dist/resources/tools.js +0 -30
- package/dist/resources/tools.js.map +0 -1
- package/dist/resources/tools.mjs +0 -26
- package/dist/resources/tools.mjs.map +0 -1
- package/dist/src/resources/alpha/post-training/index.ts +0 -17
- package/dist/src/resources/alpha/post-training/job.ts +0 -161
- package/dist/src/resources/alpha/post-training/post-training.ts +0 -385
- package/dist/src/resources/tool-runtime.ts +0 -217
- package/dist/src/resources/toolgroups.ts +0 -135
- package/dist/src/resources/tools.ts +0 -52
- package/src/resources/alpha/post-training/index.ts +0 -17
- package/src/resources/alpha/post-training/job.ts +0 -161
- package/src/resources/alpha/post-training/post-training.ts +0 -385
- package/src/resources/tool-runtime.ts +0 -217
- package/src/resources/toolgroups.ts +0 -135
- package/src/resources/tools.ts +0 -52
- package/tests/api-resources/alpha/post-training/job.test.ts +0 -86
- package/tests/api-resources/alpha/post-training/post-training.test.ts +0 -134
- package/tests/api-resources/tool-runtime.test.ts +0 -68
- package/tests/api-resources/toolgroups.test.ts +0 -91
- package/tests/api-resources/tools.test.ts +0 -57
|
@@ -4,6 +4,14 @@ import * as Core from "../../core.js";
|
|
|
4
4
|
import * as CompletionsAPI from "./completions.js";
|
|
5
5
|
import * as ChatAPI from "./chat.js";
|
|
6
6
|
import { Stream } from "../../streaming.js";
|
|
7
|
+
/**
|
|
8
|
+
* Llama Stack Inference API for generating completions, chat completions, and embeddings.
|
|
9
|
+
*
|
|
10
|
+
* This API provides the raw interface to the underlying models. Three kinds of models are supported:
|
|
11
|
+
* - LLM models: these models generate "raw" and "chat" (conversational) completions.
|
|
12
|
+
* - Embedding models: these models generate embeddings to be used for semantic search.
|
|
13
|
+
* - Rerank models: these models reorder the documents based on their relevance to a query.
|
|
14
|
+
*/
|
|
7
15
|
export declare class Completions extends APIResource {
|
|
8
16
|
/**
|
|
9
17
|
* Generate an OpenAI-compatible chat completion for the given messages using the
|
|
@@ -47,7 +55,15 @@ export interface CompletionCreateResponse {
|
|
|
47
55
|
*/
|
|
48
56
|
object?: 'chat.completion';
|
|
49
57
|
/**
|
|
50
|
-
*
|
|
58
|
+
* The service tier that was used for this response.
|
|
59
|
+
*/
|
|
60
|
+
service_tier?: string | null;
|
|
61
|
+
/**
|
|
62
|
+
* System fingerprint for this completion.
|
|
63
|
+
*/
|
|
64
|
+
system_fingerprint?: string | null;
|
|
65
|
+
/**
|
|
66
|
+
* Token usage information for the completion.
|
|
51
67
|
*/
|
|
52
68
|
usage?: CompletionCreateResponse.Usage | null;
|
|
53
69
|
}
|
|
@@ -67,277 +83,131 @@ export declare namespace CompletionCreateResponse {
|
|
|
67
83
|
/**
|
|
68
84
|
* The message from the model.
|
|
69
85
|
*/
|
|
70
|
-
message: Choice.
|
|
86
|
+
message: Choice.Message;
|
|
71
87
|
/**
|
|
72
|
-
* The log probabilities for the tokens in the message
|
|
73
|
-
* chat completion response.
|
|
88
|
+
* The log probabilities for the tokens in the message.
|
|
74
89
|
*/
|
|
75
90
|
logprobs?: Choice.Logprobs | null;
|
|
76
91
|
}
|
|
77
92
|
namespace Choice {
|
|
78
93
|
/**
|
|
79
|
-
*
|
|
80
|
-
*/
|
|
81
|
-
interface OpenAIUserMessageParamOutput {
|
|
82
|
-
/**
|
|
83
|
-
* The content of the message, which can include text and other media.
|
|
84
|
-
*/
|
|
85
|
-
content: string | Array<OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartTextParam | OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartImageParam | OpenAIUserMessageParamOutput.OpenAIFile>;
|
|
86
|
-
/**
|
|
87
|
-
* The name of the user message participant.
|
|
88
|
-
*/
|
|
89
|
-
name?: string | null;
|
|
90
|
-
/**
|
|
91
|
-
* Must be 'user' to identify this as a user message.
|
|
92
|
-
*/
|
|
93
|
-
role?: 'user';
|
|
94
|
-
}
|
|
95
|
-
namespace OpenAIUserMessageParamOutput {
|
|
96
|
-
/**
|
|
97
|
-
* Text content part for OpenAI-compatible chat completion messages.
|
|
98
|
-
*/
|
|
99
|
-
interface OpenAIChatCompletionContentPartTextParam {
|
|
100
|
-
/**
|
|
101
|
-
* The text content of the message.
|
|
102
|
-
*/
|
|
103
|
-
text: string;
|
|
104
|
-
/**
|
|
105
|
-
* Must be 'text' to identify this as text content.
|
|
106
|
-
*/
|
|
107
|
-
type?: 'text';
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Image content part for OpenAI-compatible chat completion messages.
|
|
111
|
-
*/
|
|
112
|
-
interface OpenAIChatCompletionContentPartImageParam {
|
|
113
|
-
/**
|
|
114
|
-
* Image URL specification and processing details.
|
|
115
|
-
*/
|
|
116
|
-
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
117
|
-
/**
|
|
118
|
-
* Must be 'image_url' to identify this as image content.
|
|
119
|
-
*/
|
|
120
|
-
type?: 'image_url';
|
|
121
|
-
}
|
|
122
|
-
namespace OpenAIChatCompletionContentPartImageParam {
|
|
123
|
-
/**
|
|
124
|
-
* Image URL specification and processing details.
|
|
125
|
-
*/
|
|
126
|
-
interface ImageURL {
|
|
127
|
-
/**
|
|
128
|
-
* URL of the image to include in the message.
|
|
129
|
-
*/
|
|
130
|
-
url: string;
|
|
131
|
-
/**
|
|
132
|
-
* Level of detail for image processing. Can be 'low', 'high', or 'auto'.
|
|
133
|
-
*/
|
|
134
|
-
detail?: 'low' | 'high' | 'auto' | null;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
interface OpenAIFile {
|
|
138
|
-
/**
|
|
139
|
-
* File specification.
|
|
140
|
-
*/
|
|
141
|
-
file: OpenAIFile.File;
|
|
142
|
-
/**
|
|
143
|
-
* Must be 'file' to identify this as file content.
|
|
144
|
-
*/
|
|
145
|
-
type?: 'file';
|
|
146
|
-
}
|
|
147
|
-
namespace OpenAIFile {
|
|
148
|
-
/**
|
|
149
|
-
* File specification.
|
|
150
|
-
*/
|
|
151
|
-
interface File {
|
|
152
|
-
/**
|
|
153
|
-
* Base64-encoded file data.
|
|
154
|
-
*/
|
|
155
|
-
file_data?: string | null;
|
|
156
|
-
/**
|
|
157
|
-
* ID of an uploaded file.
|
|
158
|
-
*/
|
|
159
|
-
file_id?: string | null;
|
|
160
|
-
/**
|
|
161
|
-
* Name of the file.
|
|
162
|
-
*/
|
|
163
|
-
filename?: string | null;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* A system message providing instructions or context to the model.
|
|
94
|
+
* The message from the model.
|
|
169
95
|
*/
|
|
170
|
-
interface
|
|
96
|
+
interface Message {
|
|
171
97
|
/**
|
|
172
|
-
*
|
|
173
|
-
* they are concatenated.
|
|
98
|
+
* Annotations for the message, when applicable.
|
|
174
99
|
*/
|
|
175
|
-
|
|
100
|
+
annotations?: Array<{
|
|
101
|
+
[key: string]: unknown;
|
|
102
|
+
}>;
|
|
176
103
|
/**
|
|
177
|
-
*
|
|
104
|
+
* Audio response data when using audio output modality.
|
|
178
105
|
*/
|
|
179
|
-
|
|
106
|
+
audio?: {
|
|
107
|
+
[key: string]: unknown;
|
|
108
|
+
} | null;
|
|
180
109
|
/**
|
|
181
|
-
*
|
|
110
|
+
* The content of the message.
|
|
182
111
|
*/
|
|
183
|
-
|
|
184
|
-
}
|
|
185
|
-
namespace OpenAISystemMessageParam {
|
|
112
|
+
content?: string | null;
|
|
186
113
|
/**
|
|
187
|
-
*
|
|
114
|
+
* Deprecated: the name and arguments of a function that should be called.
|
|
188
115
|
*/
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* The text content of the message.
|
|
192
|
-
*/
|
|
193
|
-
text: string;
|
|
194
|
-
/**
|
|
195
|
-
* Must be 'text' to identify this as text content.
|
|
196
|
-
*/
|
|
197
|
-
type?: 'text';
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* A message containing the model's (assistant) response in an OpenAI-compatible
|
|
202
|
-
* chat completion request.
|
|
203
|
-
*/
|
|
204
|
-
interface OpenAIAssistantMessageParamOutput {
|
|
205
|
-
/**
|
|
206
|
-
* The content of the model's response.
|
|
207
|
-
*/
|
|
208
|
-
content?: string | Array<OpenAIAssistantMessageParamOutput.ListOpenAIChatCompletionContentPartTextParam> | null;
|
|
116
|
+
function_call?: Message.FunctionCall;
|
|
209
117
|
/**
|
|
210
|
-
* The
|
|
118
|
+
* The refusal message generated by the model.
|
|
211
119
|
*/
|
|
212
|
-
|
|
120
|
+
refusal?: string | null;
|
|
213
121
|
/**
|
|
214
|
-
*
|
|
122
|
+
* The role of the message author, always 'assistant' in responses.
|
|
215
123
|
*/
|
|
216
124
|
role?: 'assistant';
|
|
217
125
|
/**
|
|
218
|
-
*
|
|
126
|
+
* The tool calls generated by the model.
|
|
219
127
|
*/
|
|
220
|
-
tool_calls?: Array<
|
|
128
|
+
tool_calls?: Array<Message.Function | Message.Custom>;
|
|
221
129
|
}
|
|
222
|
-
namespace
|
|
130
|
+
namespace Message {
|
|
223
131
|
/**
|
|
224
|
-
*
|
|
132
|
+
* Deprecated: the name and arguments of a function that should be called.
|
|
225
133
|
*/
|
|
226
|
-
interface
|
|
134
|
+
interface FunctionCall {
|
|
227
135
|
/**
|
|
228
|
-
*
|
|
136
|
+
* Arguments to pass to the function as a JSON string.
|
|
229
137
|
*/
|
|
230
|
-
|
|
138
|
+
arguments: string;
|
|
231
139
|
/**
|
|
232
|
-
*
|
|
140
|
+
* Name of the function to call.
|
|
233
141
|
*/
|
|
234
|
-
|
|
142
|
+
name: string;
|
|
235
143
|
}
|
|
236
144
|
/**
|
|
237
145
|
* Tool call specification for OpenAI-compatible chat completion responses.
|
|
238
146
|
*/
|
|
239
|
-
interface
|
|
147
|
+
interface Function {
|
|
240
148
|
/**
|
|
241
149
|
* Unique identifier for the tool call.
|
|
242
150
|
*/
|
|
243
|
-
id
|
|
244
|
-
/**
|
|
245
|
-
* Function call details for OpenAI-compatible tool calls.
|
|
246
|
-
*/
|
|
247
|
-
function?: ToolCall.Function | null;
|
|
151
|
+
id: string;
|
|
248
152
|
/**
|
|
249
|
-
*
|
|
153
|
+
* Function call details.
|
|
250
154
|
*/
|
|
251
|
-
|
|
155
|
+
function: Function.Function;
|
|
252
156
|
/**
|
|
253
157
|
* Must be 'function' to identify this as a function call.
|
|
254
158
|
*/
|
|
255
|
-
type
|
|
159
|
+
type: 'function';
|
|
256
160
|
}
|
|
257
|
-
namespace
|
|
161
|
+
namespace Function {
|
|
258
162
|
/**
|
|
259
|
-
* Function call details
|
|
163
|
+
* Function call details.
|
|
260
164
|
*/
|
|
261
165
|
interface Function {
|
|
262
166
|
/**
|
|
263
167
|
* Arguments to pass to the function as a JSON string.
|
|
264
168
|
*/
|
|
265
|
-
arguments
|
|
169
|
+
arguments: string;
|
|
266
170
|
/**
|
|
267
171
|
* Name of the function to call.
|
|
268
172
|
*/
|
|
269
|
-
name
|
|
173
|
+
name: string;
|
|
270
174
|
}
|
|
271
175
|
}
|
|
272
|
-
}
|
|
273
|
-
/**
|
|
274
|
-
* A message representing the result of a tool invocation in an OpenAI-compatible
|
|
275
|
-
* chat completion request.
|
|
276
|
-
*/
|
|
277
|
-
interface OpenAIToolMessageParam {
|
|
278
|
-
/**
|
|
279
|
-
* The response content from the tool.
|
|
280
|
-
*/
|
|
281
|
-
content: string | Array<OpenAIToolMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
282
176
|
/**
|
|
283
|
-
*
|
|
177
|
+
* A call to a custom tool created by the model.
|
|
284
178
|
*/
|
|
285
|
-
|
|
286
|
-
/**
|
|
287
|
-
* Must be 'tool' to identify this as a tool response.
|
|
288
|
-
*/
|
|
289
|
-
role?: 'tool';
|
|
290
|
-
}
|
|
291
|
-
namespace OpenAIToolMessageParam {
|
|
292
|
-
/**
|
|
293
|
-
* Text content part for OpenAI-compatible chat completion messages.
|
|
294
|
-
*/
|
|
295
|
-
interface ListOpenAIChatCompletionContentPartTextParam {
|
|
179
|
+
interface Custom {
|
|
296
180
|
/**
|
|
297
|
-
* The
|
|
181
|
+
* The ID of the tool call.
|
|
298
182
|
*/
|
|
299
|
-
|
|
183
|
+
id: string;
|
|
300
184
|
/**
|
|
301
|
-
*
|
|
185
|
+
* The custom tool that the model called.
|
|
302
186
|
*/
|
|
303
|
-
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
/**
|
|
307
|
-
* A message from the developer in an OpenAI-compatible chat completion request.
|
|
308
|
-
*/
|
|
309
|
-
interface OpenAIDeveloperMessageParam {
|
|
310
|
-
/**
|
|
311
|
-
* The content of the developer message.
|
|
312
|
-
*/
|
|
313
|
-
content: string | Array<OpenAIDeveloperMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
314
|
-
/**
|
|
315
|
-
* The name of the developer message participant.
|
|
316
|
-
*/
|
|
317
|
-
name?: string | null;
|
|
318
|
-
/**
|
|
319
|
-
* Must be 'developer' to identify this as a developer message.
|
|
320
|
-
*/
|
|
321
|
-
role?: 'developer';
|
|
322
|
-
}
|
|
323
|
-
namespace OpenAIDeveloperMessageParam {
|
|
324
|
-
/**
|
|
325
|
-
* Text content part for OpenAI-compatible chat completion messages.
|
|
326
|
-
*/
|
|
327
|
-
interface ListOpenAIChatCompletionContentPartTextParam {
|
|
187
|
+
custom: Custom.Custom;
|
|
328
188
|
/**
|
|
329
|
-
* The
|
|
189
|
+
* The type of the tool. Always 'custom'.
|
|
330
190
|
*/
|
|
331
|
-
|
|
191
|
+
type: 'custom';
|
|
192
|
+
}
|
|
193
|
+
namespace Custom {
|
|
332
194
|
/**
|
|
333
|
-
*
|
|
195
|
+
* The custom tool that the model called.
|
|
334
196
|
*/
|
|
335
|
-
|
|
197
|
+
interface Custom {
|
|
198
|
+
/**
|
|
199
|
+
* The input for the custom tool call generated by the model.
|
|
200
|
+
*/
|
|
201
|
+
input: string;
|
|
202
|
+
/**
|
|
203
|
+
* The name of the custom tool to call.
|
|
204
|
+
*/
|
|
205
|
+
name: string;
|
|
206
|
+
}
|
|
336
207
|
}
|
|
337
208
|
}
|
|
338
209
|
/**
|
|
339
|
-
* The log probabilities for the tokens in the message
|
|
340
|
-
* chat completion response.
|
|
210
|
+
* The log probabilities for the tokens in the message.
|
|
341
211
|
*/
|
|
342
212
|
interface Logprobs {
|
|
343
213
|
/**
|
|
@@ -437,51 +307,54 @@ export declare namespace CompletionCreateResponse {
|
|
|
437
307
|
}
|
|
438
308
|
}
|
|
439
309
|
/**
|
|
440
|
-
*
|
|
310
|
+
* Token usage information for the completion.
|
|
441
311
|
*/
|
|
442
312
|
interface Usage {
|
|
443
313
|
/**
|
|
444
314
|
* Number of tokens in the completion.
|
|
445
315
|
*/
|
|
446
|
-
completion_tokens
|
|
316
|
+
completion_tokens?: number;
|
|
447
317
|
/**
|
|
448
|
-
*
|
|
318
|
+
* Detailed breakdown of output token usage.
|
|
449
319
|
*/
|
|
450
|
-
|
|
320
|
+
completion_tokens_details?: Usage.CompletionTokensDetails;
|
|
451
321
|
/**
|
|
452
|
-
*
|
|
322
|
+
* Number of tokens in the prompt.
|
|
453
323
|
*/
|
|
454
|
-
|
|
324
|
+
prompt_tokens?: number;
|
|
455
325
|
/**
|
|
456
|
-
*
|
|
326
|
+
* Detailed breakdown of input token usage.
|
|
457
327
|
*/
|
|
458
|
-
|
|
328
|
+
prompt_tokens_details?: Usage.PromptTokensDetails;
|
|
459
329
|
/**
|
|
460
|
-
*
|
|
330
|
+
* Total tokens used (prompt + completion).
|
|
461
331
|
*/
|
|
462
|
-
|
|
332
|
+
total_tokens?: number;
|
|
463
333
|
}
|
|
464
334
|
namespace Usage {
|
|
465
335
|
/**
|
|
466
|
-
*
|
|
336
|
+
* Detailed breakdown of output token usage.
|
|
467
337
|
*/
|
|
468
338
|
interface CompletionTokensDetails {
|
|
469
339
|
/**
|
|
470
340
|
* Number of tokens used for reasoning (o1/o3 models).
|
|
471
341
|
*/
|
|
472
|
-
reasoning_tokens?: number
|
|
342
|
+
reasoning_tokens?: number;
|
|
473
343
|
}
|
|
474
344
|
/**
|
|
475
|
-
*
|
|
345
|
+
* Detailed breakdown of input token usage.
|
|
476
346
|
*/
|
|
477
347
|
interface PromptTokensDetails {
|
|
478
348
|
/**
|
|
479
349
|
* Number of tokens retrieved from cache.
|
|
480
350
|
*/
|
|
481
|
-
cached_tokens?: number
|
|
351
|
+
cached_tokens?: number;
|
|
482
352
|
}
|
|
483
353
|
}
|
|
484
354
|
}
|
|
355
|
+
/**
|
|
356
|
+
* Chat completion response extended with the original input messages.
|
|
357
|
+
*/
|
|
485
358
|
export interface CompletionRetrieveResponse {
|
|
486
359
|
/**
|
|
487
360
|
* The ID of the chat completion.
|
|
@@ -508,9 +381,17 @@ export interface CompletionRetrieveResponse {
|
|
|
508
381
|
*/
|
|
509
382
|
object?: 'chat.completion';
|
|
510
383
|
/**
|
|
511
|
-
*
|
|
384
|
+
* The service tier that was used for this response.
|
|
385
|
+
*/
|
|
386
|
+
service_tier?: string | null;
|
|
387
|
+
/**
|
|
388
|
+
* System fingerprint for this completion.
|
|
389
|
+
*/
|
|
390
|
+
system_fingerprint?: string;
|
|
391
|
+
/**
|
|
392
|
+
* Token usage information for the completion.
|
|
512
393
|
*/
|
|
513
|
-
usage?: CompletionRetrieveResponse.Usage
|
|
394
|
+
usage?: CompletionRetrieveResponse.Usage;
|
|
514
395
|
}
|
|
515
396
|
export declare namespace CompletionRetrieveResponse {
|
|
516
397
|
/**
|
|
@@ -518,287 +399,141 @@ export declare namespace CompletionRetrieveResponse {
|
|
|
518
399
|
*/
|
|
519
400
|
interface Choice {
|
|
520
401
|
/**
|
|
521
|
-
* The reason the model stopped generating.
|
|
522
|
-
*/
|
|
523
|
-
finish_reason: 'stop' | 'length' | 'tool_calls' | 'content_filter' | 'function_call';
|
|
524
|
-
/**
|
|
525
|
-
* The index of the choice.
|
|
526
|
-
*/
|
|
527
|
-
index: number;
|
|
528
|
-
/**
|
|
529
|
-
* The message from the model.
|
|
530
|
-
*/
|
|
531
|
-
message: Choice.OpenAIUserMessageParamOutput | Choice.OpenAISystemMessageParam | Choice.OpenAIAssistantMessageParamOutput | Choice.OpenAIToolMessageParam | Choice.OpenAIDeveloperMessageParam;
|
|
532
|
-
/**
|
|
533
|
-
* The log probabilities for the tokens in the message from an OpenAI-compatible
|
|
534
|
-
* chat completion response.
|
|
535
|
-
*/
|
|
536
|
-
logprobs?: Choice.Logprobs | null;
|
|
537
|
-
}
|
|
538
|
-
namespace Choice {
|
|
539
|
-
/**
|
|
540
|
-
* A message from the user in an OpenAI-compatible chat completion request.
|
|
541
|
-
*/
|
|
542
|
-
interface OpenAIUserMessageParamOutput {
|
|
543
|
-
/**
|
|
544
|
-
* The content of the message, which can include text and other media.
|
|
545
|
-
*/
|
|
546
|
-
content: string | Array<OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartTextParam | OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartImageParam | OpenAIUserMessageParamOutput.OpenAIFile>;
|
|
547
|
-
/**
|
|
548
|
-
* The name of the user message participant.
|
|
549
|
-
*/
|
|
550
|
-
name?: string | null;
|
|
551
|
-
/**
|
|
552
|
-
* Must be 'user' to identify this as a user message.
|
|
553
|
-
*/
|
|
554
|
-
role?: 'user';
|
|
555
|
-
}
|
|
556
|
-
namespace OpenAIUserMessageParamOutput {
|
|
557
|
-
/**
|
|
558
|
-
* Text content part for OpenAI-compatible chat completion messages.
|
|
559
|
-
*/
|
|
560
|
-
interface OpenAIChatCompletionContentPartTextParam {
|
|
561
|
-
/**
|
|
562
|
-
* The text content of the message.
|
|
563
|
-
*/
|
|
564
|
-
text: string;
|
|
565
|
-
/**
|
|
566
|
-
* Must be 'text' to identify this as text content.
|
|
567
|
-
*/
|
|
568
|
-
type?: 'text';
|
|
569
|
-
}
|
|
570
|
-
/**
|
|
571
|
-
* Image content part for OpenAI-compatible chat completion messages.
|
|
572
|
-
*/
|
|
573
|
-
interface OpenAIChatCompletionContentPartImageParam {
|
|
574
|
-
/**
|
|
575
|
-
* Image URL specification and processing details.
|
|
576
|
-
*/
|
|
577
|
-
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
578
|
-
/**
|
|
579
|
-
* Must be 'image_url' to identify this as image content.
|
|
580
|
-
*/
|
|
581
|
-
type?: 'image_url';
|
|
582
|
-
}
|
|
583
|
-
namespace OpenAIChatCompletionContentPartImageParam {
|
|
584
|
-
/**
|
|
585
|
-
* Image URL specification and processing details.
|
|
586
|
-
*/
|
|
587
|
-
interface ImageURL {
|
|
588
|
-
/**
|
|
589
|
-
* URL of the image to include in the message.
|
|
590
|
-
*/
|
|
591
|
-
url: string;
|
|
592
|
-
/**
|
|
593
|
-
* Level of detail for image processing. Can be 'low', 'high', or 'auto'.
|
|
594
|
-
*/
|
|
595
|
-
detail?: 'low' | 'high' | 'auto' | null;
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
interface OpenAIFile {
|
|
599
|
-
/**
|
|
600
|
-
* File specification.
|
|
601
|
-
*/
|
|
602
|
-
file: OpenAIFile.File;
|
|
603
|
-
/**
|
|
604
|
-
* Must be 'file' to identify this as file content.
|
|
605
|
-
*/
|
|
606
|
-
type?: 'file';
|
|
607
|
-
}
|
|
608
|
-
namespace OpenAIFile {
|
|
609
|
-
/**
|
|
610
|
-
* File specification.
|
|
611
|
-
*/
|
|
612
|
-
interface File {
|
|
613
|
-
/**
|
|
614
|
-
* Base64-encoded file data.
|
|
615
|
-
*/
|
|
616
|
-
file_data?: string | null;
|
|
617
|
-
/**
|
|
618
|
-
* ID of an uploaded file.
|
|
619
|
-
*/
|
|
620
|
-
file_id?: string | null;
|
|
621
|
-
/**
|
|
622
|
-
* Name of the file.
|
|
623
|
-
*/
|
|
624
|
-
filename?: string | null;
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
/**
|
|
629
|
-
* A system message providing instructions or context to the model.
|
|
402
|
+
* The reason the model stopped generating.
|
|
630
403
|
*/
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
404
|
+
finish_reason: 'stop' | 'length' | 'tool_calls' | 'content_filter' | 'function_call';
|
|
405
|
+
/**
|
|
406
|
+
* The index of the choice.
|
|
407
|
+
*/
|
|
408
|
+
index: number;
|
|
409
|
+
/**
|
|
410
|
+
* The message from the model.
|
|
411
|
+
*/
|
|
412
|
+
message: Choice.Message;
|
|
413
|
+
/**
|
|
414
|
+
* The log probabilities for the tokens in the message.
|
|
415
|
+
*/
|
|
416
|
+
logprobs?: Choice.Logprobs | null;
|
|
417
|
+
}
|
|
418
|
+
namespace Choice {
|
|
419
|
+
/**
|
|
420
|
+
* The message from the model.
|
|
421
|
+
*/
|
|
422
|
+
interface Message {
|
|
637
423
|
/**
|
|
638
|
-
*
|
|
424
|
+
* Annotations for the message, when applicable.
|
|
639
425
|
*/
|
|
640
|
-
|
|
426
|
+
annotations?: Array<{
|
|
427
|
+
[key: string]: unknown;
|
|
428
|
+
}>;
|
|
641
429
|
/**
|
|
642
|
-
*
|
|
430
|
+
* Audio response data when using audio output modality.
|
|
643
431
|
*/
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
432
|
+
audio?: {
|
|
433
|
+
[key: string]: unknown;
|
|
434
|
+
} | null;
|
|
647
435
|
/**
|
|
648
|
-
*
|
|
436
|
+
* The content of the message.
|
|
649
437
|
*/
|
|
650
|
-
|
|
651
|
-
/**
|
|
652
|
-
* The text content of the message.
|
|
653
|
-
*/
|
|
654
|
-
text: string;
|
|
655
|
-
/**
|
|
656
|
-
* Must be 'text' to identify this as text content.
|
|
657
|
-
*/
|
|
658
|
-
type?: 'text';
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
/**
|
|
662
|
-
* A message containing the model's (assistant) response in an OpenAI-compatible
|
|
663
|
-
* chat completion request.
|
|
664
|
-
*/
|
|
665
|
-
interface OpenAIAssistantMessageParamOutput {
|
|
438
|
+
content?: string | null;
|
|
666
439
|
/**
|
|
667
|
-
*
|
|
440
|
+
* Deprecated: the name and arguments of a function that should be called.
|
|
668
441
|
*/
|
|
669
|
-
|
|
442
|
+
function_call?: Message.FunctionCall;
|
|
670
443
|
/**
|
|
671
|
-
* The
|
|
444
|
+
* The refusal message generated by the model.
|
|
672
445
|
*/
|
|
673
|
-
|
|
446
|
+
refusal?: string | null;
|
|
674
447
|
/**
|
|
675
|
-
*
|
|
448
|
+
* The role of the message author, always 'assistant' in responses.
|
|
676
449
|
*/
|
|
677
450
|
role?: 'assistant';
|
|
678
451
|
/**
|
|
679
|
-
*
|
|
452
|
+
* The tool calls generated by the model.
|
|
680
453
|
*/
|
|
681
|
-
tool_calls?: Array<
|
|
454
|
+
tool_calls?: Array<Message.Function | Message.Custom>;
|
|
682
455
|
}
|
|
683
|
-
namespace
|
|
456
|
+
namespace Message {
|
|
684
457
|
/**
|
|
685
|
-
*
|
|
458
|
+
* Deprecated: the name and arguments of a function that should be called.
|
|
686
459
|
*/
|
|
687
|
-
interface
|
|
460
|
+
interface FunctionCall {
|
|
688
461
|
/**
|
|
689
|
-
*
|
|
462
|
+
* Arguments to pass to the function as a JSON string.
|
|
690
463
|
*/
|
|
691
|
-
|
|
464
|
+
arguments: string;
|
|
692
465
|
/**
|
|
693
|
-
*
|
|
466
|
+
* Name of the function to call.
|
|
694
467
|
*/
|
|
695
|
-
|
|
468
|
+
name: string;
|
|
696
469
|
}
|
|
697
470
|
/**
|
|
698
471
|
* Tool call specification for OpenAI-compatible chat completion responses.
|
|
699
472
|
*/
|
|
700
|
-
interface
|
|
473
|
+
interface Function {
|
|
701
474
|
/**
|
|
702
475
|
* Unique identifier for the tool call.
|
|
703
476
|
*/
|
|
704
|
-
id
|
|
477
|
+
id: string;
|
|
705
478
|
/**
|
|
706
|
-
* Function call details
|
|
479
|
+
* Function call details.
|
|
707
480
|
*/
|
|
708
|
-
function
|
|
709
|
-
/**
|
|
710
|
-
* Index of the tool call in the list.
|
|
711
|
-
*/
|
|
712
|
-
index?: number | null;
|
|
481
|
+
function: Function.Function;
|
|
713
482
|
/**
|
|
714
483
|
* Must be 'function' to identify this as a function call.
|
|
715
484
|
*/
|
|
716
|
-
type
|
|
485
|
+
type: 'function';
|
|
717
486
|
}
|
|
718
|
-
namespace
|
|
487
|
+
namespace Function {
|
|
719
488
|
/**
|
|
720
|
-
* Function call details
|
|
489
|
+
* Function call details.
|
|
721
490
|
*/
|
|
722
491
|
interface Function {
|
|
723
492
|
/**
|
|
724
493
|
* Arguments to pass to the function as a JSON string.
|
|
725
494
|
*/
|
|
726
|
-
arguments
|
|
495
|
+
arguments: string;
|
|
727
496
|
/**
|
|
728
497
|
* Name of the function to call.
|
|
729
498
|
*/
|
|
730
|
-
name
|
|
499
|
+
name: string;
|
|
731
500
|
}
|
|
732
501
|
}
|
|
733
|
-
}
|
|
734
|
-
/**
|
|
735
|
-
* A message representing the result of a tool invocation in an OpenAI-compatible
|
|
736
|
-
* chat completion request.
|
|
737
|
-
*/
|
|
738
|
-
interface OpenAIToolMessageParam {
|
|
739
|
-
/**
|
|
740
|
-
* The response content from the tool.
|
|
741
|
-
*/
|
|
742
|
-
content: string | Array<OpenAIToolMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
743
|
-
/**
|
|
744
|
-
* Unique identifier for the tool call this response is for.
|
|
745
|
-
*/
|
|
746
|
-
tool_call_id: string;
|
|
747
|
-
/**
|
|
748
|
-
* Must be 'tool' to identify this as a tool response.
|
|
749
|
-
*/
|
|
750
|
-
role?: 'tool';
|
|
751
|
-
}
|
|
752
|
-
namespace OpenAIToolMessageParam {
|
|
753
502
|
/**
|
|
754
|
-
*
|
|
503
|
+
* A call to a custom tool created by the model.
|
|
755
504
|
*/
|
|
756
|
-
interface
|
|
505
|
+
interface Custom {
|
|
757
506
|
/**
|
|
758
|
-
* The
|
|
507
|
+
* The ID of the tool call.
|
|
759
508
|
*/
|
|
760
|
-
|
|
509
|
+
id: string;
|
|
761
510
|
/**
|
|
762
|
-
*
|
|
511
|
+
* The custom tool that the model called.
|
|
763
512
|
*/
|
|
764
|
-
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
/**
|
|
768
|
-
* A message from the developer in an OpenAI-compatible chat completion request.
|
|
769
|
-
*/
|
|
770
|
-
interface OpenAIDeveloperMessageParam {
|
|
771
|
-
/**
|
|
772
|
-
* The content of the developer message.
|
|
773
|
-
*/
|
|
774
|
-
content: string | Array<OpenAIDeveloperMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
775
|
-
/**
|
|
776
|
-
* The name of the developer message participant.
|
|
777
|
-
*/
|
|
778
|
-
name?: string | null;
|
|
779
|
-
/**
|
|
780
|
-
* Must be 'developer' to identify this as a developer message.
|
|
781
|
-
*/
|
|
782
|
-
role?: 'developer';
|
|
783
|
-
}
|
|
784
|
-
namespace OpenAIDeveloperMessageParam {
|
|
785
|
-
/**
|
|
786
|
-
* Text content part for OpenAI-compatible chat completion messages.
|
|
787
|
-
*/
|
|
788
|
-
interface ListOpenAIChatCompletionContentPartTextParam {
|
|
513
|
+
custom: Custom.Custom;
|
|
789
514
|
/**
|
|
790
|
-
* The
|
|
515
|
+
* The type of the tool. Always 'custom'.
|
|
791
516
|
*/
|
|
792
|
-
|
|
517
|
+
type: 'custom';
|
|
518
|
+
}
|
|
519
|
+
namespace Custom {
|
|
793
520
|
/**
|
|
794
|
-
*
|
|
521
|
+
* The custom tool that the model called.
|
|
795
522
|
*/
|
|
796
|
-
|
|
523
|
+
interface Custom {
|
|
524
|
+
/**
|
|
525
|
+
* The input for the custom tool call generated by the model.
|
|
526
|
+
*/
|
|
527
|
+
input: string;
|
|
528
|
+
/**
|
|
529
|
+
* The name of the custom tool to call.
|
|
530
|
+
*/
|
|
531
|
+
name: string;
|
|
532
|
+
}
|
|
797
533
|
}
|
|
798
534
|
}
|
|
799
535
|
/**
|
|
800
|
-
* The log probabilities for the tokens in the message
|
|
801
|
-
* chat completion response.
|
|
536
|
+
* The log probabilities for the tokens in the message.
|
|
802
537
|
*/
|
|
803
538
|
interface Logprobs {
|
|
804
539
|
/**
|
|
@@ -956,6 +691,9 @@ export declare namespace CompletionRetrieveResponse {
|
|
|
956
691
|
detail?: 'low' | 'high' | 'auto' | null;
|
|
957
692
|
}
|
|
958
693
|
}
|
|
694
|
+
/**
|
|
695
|
+
* File content part for OpenAI-compatible chat completion messages.
|
|
696
|
+
*/
|
|
959
697
|
interface OpenAIFile {
|
|
960
698
|
/**
|
|
961
699
|
* File specification.
|
|
@@ -1040,6 +778,7 @@ export declare namespace CompletionRetrieveResponse {
|
|
|
1040
778
|
* List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
|
|
1041
779
|
*/
|
|
1042
780
|
tool_calls?: Array<OpenAIAssistantMessageParamOutput.ToolCall> | null;
|
|
781
|
+
[k: string]: unknown;
|
|
1043
782
|
}
|
|
1044
783
|
namespace OpenAIAssistantMessageParamOutput {
|
|
1045
784
|
/**
|
|
@@ -1062,33 +801,29 @@ export declare namespace CompletionRetrieveResponse {
|
|
|
1062
801
|
/**
|
|
1063
802
|
* Unique identifier for the tool call.
|
|
1064
803
|
*/
|
|
1065
|
-
id
|
|
1066
|
-
/**
|
|
1067
|
-
* Function call details for OpenAI-compatible tool calls.
|
|
1068
|
-
*/
|
|
1069
|
-
function?: ToolCall.Function | null;
|
|
804
|
+
id: string;
|
|
1070
805
|
/**
|
|
1071
|
-
*
|
|
806
|
+
* Function call details.
|
|
1072
807
|
*/
|
|
1073
|
-
|
|
808
|
+
function: ToolCall.Function;
|
|
1074
809
|
/**
|
|
1075
810
|
* Must be 'function' to identify this as a function call.
|
|
1076
811
|
*/
|
|
1077
|
-
type
|
|
812
|
+
type: 'function';
|
|
1078
813
|
}
|
|
1079
814
|
namespace ToolCall {
|
|
1080
815
|
/**
|
|
1081
|
-
* Function call details
|
|
816
|
+
* Function call details.
|
|
1082
817
|
*/
|
|
1083
818
|
interface Function {
|
|
1084
819
|
/**
|
|
1085
820
|
* Arguments to pass to the function as a JSON string.
|
|
1086
821
|
*/
|
|
1087
|
-
arguments
|
|
822
|
+
arguments: string;
|
|
1088
823
|
/**
|
|
1089
824
|
* Name of the function to call.
|
|
1090
825
|
*/
|
|
1091
|
-
name
|
|
826
|
+
name: string;
|
|
1092
827
|
}
|
|
1093
828
|
}
|
|
1094
829
|
}
|
|
@@ -1158,48 +893,48 @@ export declare namespace CompletionRetrieveResponse {
|
|
|
1158
893
|
}
|
|
1159
894
|
}
|
|
1160
895
|
/**
|
|
1161
|
-
*
|
|
896
|
+
* Token usage information for the completion.
|
|
1162
897
|
*/
|
|
1163
898
|
interface Usage {
|
|
1164
899
|
/**
|
|
1165
900
|
* Number of tokens in the completion.
|
|
1166
901
|
*/
|
|
1167
|
-
completion_tokens
|
|
902
|
+
completion_tokens?: number;
|
|
1168
903
|
/**
|
|
1169
|
-
*
|
|
904
|
+
* Detailed breakdown of output token usage.
|
|
1170
905
|
*/
|
|
1171
|
-
|
|
906
|
+
completion_tokens_details?: Usage.CompletionTokensDetails;
|
|
1172
907
|
/**
|
|
1173
|
-
*
|
|
908
|
+
* Number of tokens in the prompt.
|
|
1174
909
|
*/
|
|
1175
|
-
|
|
910
|
+
prompt_tokens?: number;
|
|
1176
911
|
/**
|
|
1177
|
-
*
|
|
912
|
+
* Detailed breakdown of input token usage.
|
|
1178
913
|
*/
|
|
1179
|
-
|
|
914
|
+
prompt_tokens_details?: Usage.PromptTokensDetails;
|
|
1180
915
|
/**
|
|
1181
|
-
*
|
|
916
|
+
* Total tokens used (prompt + completion).
|
|
1182
917
|
*/
|
|
1183
|
-
|
|
918
|
+
total_tokens?: number;
|
|
1184
919
|
}
|
|
1185
920
|
namespace Usage {
|
|
1186
921
|
/**
|
|
1187
|
-
*
|
|
922
|
+
* Detailed breakdown of output token usage.
|
|
1188
923
|
*/
|
|
1189
924
|
interface CompletionTokensDetails {
|
|
1190
925
|
/**
|
|
1191
926
|
* Number of tokens used for reasoning (o1/o3 models).
|
|
1192
927
|
*/
|
|
1193
|
-
reasoning_tokens?: number
|
|
928
|
+
reasoning_tokens?: number;
|
|
1194
929
|
}
|
|
1195
930
|
/**
|
|
1196
|
-
*
|
|
931
|
+
* Detailed breakdown of input token usage.
|
|
1197
932
|
*/
|
|
1198
933
|
interface PromptTokensDetails {
|
|
1199
934
|
/**
|
|
1200
935
|
* Number of tokens retrieved from cache.
|
|
1201
936
|
*/
|
|
1202
|
-
cached_tokens?: number
|
|
937
|
+
cached_tokens?: number;
|
|
1203
938
|
}
|
|
1204
939
|
}
|
|
1205
940
|
}
|
|
@@ -1229,6 +964,9 @@ export interface CompletionListResponse {
|
|
|
1229
964
|
object?: 'list';
|
|
1230
965
|
}
|
|
1231
966
|
export declare namespace CompletionListResponse {
|
|
967
|
+
/**
|
|
968
|
+
* Chat completion response extended with the original input messages.
|
|
969
|
+
*/
|
|
1232
970
|
interface Data {
|
|
1233
971
|
/**
|
|
1234
972
|
* The ID of the chat completion.
|
|
@@ -1255,9 +993,17 @@ export declare namespace CompletionListResponse {
|
|
|
1255
993
|
*/
|
|
1256
994
|
object?: 'chat.completion';
|
|
1257
995
|
/**
|
|
1258
|
-
*
|
|
996
|
+
* The service tier that was used for this response.
|
|
997
|
+
*/
|
|
998
|
+
service_tier?: string | null;
|
|
999
|
+
/**
|
|
1000
|
+
* System fingerprint for this completion.
|
|
1001
|
+
*/
|
|
1002
|
+
system_fingerprint?: string;
|
|
1003
|
+
/**
|
|
1004
|
+
* Token usage information for the completion.
|
|
1259
1005
|
*/
|
|
1260
|
-
usage?: Data.Usage
|
|
1006
|
+
usage?: Data.Usage;
|
|
1261
1007
|
}
|
|
1262
1008
|
namespace Data {
|
|
1263
1009
|
/**
|
|
@@ -1275,277 +1021,131 @@ export declare namespace CompletionListResponse {
|
|
|
1275
1021
|
/**
|
|
1276
1022
|
* The message from the model.
|
|
1277
1023
|
*/
|
|
1278
|
-
message: Choice.
|
|
1024
|
+
message: Choice.Message;
|
|
1279
1025
|
/**
|
|
1280
|
-
* The log probabilities for the tokens in the message
|
|
1281
|
-
* chat completion response.
|
|
1026
|
+
* The log probabilities for the tokens in the message.
|
|
1282
1027
|
*/
|
|
1283
1028
|
logprobs?: Choice.Logprobs | null;
|
|
1284
1029
|
}
|
|
1285
1030
|
namespace Choice {
|
|
1286
1031
|
/**
|
|
1287
|
-
*
|
|
1288
|
-
*/
|
|
1289
|
-
interface OpenAIUserMessageParamOutput {
|
|
1290
|
-
/**
|
|
1291
|
-
* The content of the message, which can include text and other media.
|
|
1292
|
-
*/
|
|
1293
|
-
content: string | Array<OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartTextParam | OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartImageParam | OpenAIUserMessageParamOutput.OpenAIFile>;
|
|
1294
|
-
/**
|
|
1295
|
-
* The name of the user message participant.
|
|
1296
|
-
*/
|
|
1297
|
-
name?: string | null;
|
|
1298
|
-
/**
|
|
1299
|
-
* Must be 'user' to identify this as a user message.
|
|
1300
|
-
*/
|
|
1301
|
-
role?: 'user';
|
|
1302
|
-
}
|
|
1303
|
-
namespace OpenAIUserMessageParamOutput {
|
|
1304
|
-
/**
|
|
1305
|
-
* Text content part for OpenAI-compatible chat completion messages.
|
|
1306
|
-
*/
|
|
1307
|
-
interface OpenAIChatCompletionContentPartTextParam {
|
|
1308
|
-
/**
|
|
1309
|
-
* The text content of the message.
|
|
1310
|
-
*/
|
|
1311
|
-
text: string;
|
|
1312
|
-
/**
|
|
1313
|
-
* Must be 'text' to identify this as text content.
|
|
1314
|
-
*/
|
|
1315
|
-
type?: 'text';
|
|
1316
|
-
}
|
|
1317
|
-
/**
|
|
1318
|
-
* Image content part for OpenAI-compatible chat completion messages.
|
|
1319
|
-
*/
|
|
1320
|
-
interface OpenAIChatCompletionContentPartImageParam {
|
|
1321
|
-
/**
|
|
1322
|
-
* Image URL specification and processing details.
|
|
1323
|
-
*/
|
|
1324
|
-
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
1325
|
-
/**
|
|
1326
|
-
* Must be 'image_url' to identify this as image content.
|
|
1327
|
-
*/
|
|
1328
|
-
type?: 'image_url';
|
|
1329
|
-
}
|
|
1330
|
-
namespace OpenAIChatCompletionContentPartImageParam {
|
|
1331
|
-
/**
|
|
1332
|
-
* Image URL specification and processing details.
|
|
1333
|
-
*/
|
|
1334
|
-
interface ImageURL {
|
|
1335
|
-
/**
|
|
1336
|
-
* URL of the image to include in the message.
|
|
1337
|
-
*/
|
|
1338
|
-
url: string;
|
|
1339
|
-
/**
|
|
1340
|
-
* Level of detail for image processing. Can be 'low', 'high', or 'auto'.
|
|
1341
|
-
*/
|
|
1342
|
-
detail?: 'low' | 'high' | 'auto' | null;
|
|
1343
|
-
}
|
|
1344
|
-
}
|
|
1345
|
-
interface OpenAIFile {
|
|
1346
|
-
/**
|
|
1347
|
-
* File specification.
|
|
1348
|
-
*/
|
|
1349
|
-
file: OpenAIFile.File;
|
|
1350
|
-
/**
|
|
1351
|
-
* Must be 'file' to identify this as file content.
|
|
1352
|
-
*/
|
|
1353
|
-
type?: 'file';
|
|
1354
|
-
}
|
|
1355
|
-
namespace OpenAIFile {
|
|
1356
|
-
/**
|
|
1357
|
-
* File specification.
|
|
1358
|
-
*/
|
|
1359
|
-
interface File {
|
|
1360
|
-
/**
|
|
1361
|
-
* Base64-encoded file data.
|
|
1362
|
-
*/
|
|
1363
|
-
file_data?: string | null;
|
|
1364
|
-
/**
|
|
1365
|
-
* ID of an uploaded file.
|
|
1366
|
-
*/
|
|
1367
|
-
file_id?: string | null;
|
|
1368
|
-
/**
|
|
1369
|
-
* Name of the file.
|
|
1370
|
-
*/
|
|
1371
|
-
filename?: string | null;
|
|
1372
|
-
}
|
|
1373
|
-
}
|
|
1374
|
-
}
|
|
1375
|
-
/**
|
|
1376
|
-
* A system message providing instructions or context to the model.
|
|
1032
|
+
* The message from the model.
|
|
1377
1033
|
*/
|
|
1378
|
-
interface
|
|
1379
|
-
/**
|
|
1380
|
-
* The content of the 'system prompt'. If multiple system messages are provided,
|
|
1381
|
-
* they are concatenated.
|
|
1382
|
-
*/
|
|
1383
|
-
content: string | Array<OpenAISystemMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
1034
|
+
interface Message {
|
|
1384
1035
|
/**
|
|
1385
|
-
*
|
|
1036
|
+
* Annotations for the message, when applicable.
|
|
1386
1037
|
*/
|
|
1387
|
-
|
|
1038
|
+
annotations?: Array<{
|
|
1039
|
+
[key: string]: unknown;
|
|
1040
|
+
}>;
|
|
1388
1041
|
/**
|
|
1389
|
-
*
|
|
1042
|
+
* Audio response data when using audio output modality.
|
|
1390
1043
|
*/
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1044
|
+
audio?: {
|
|
1045
|
+
[key: string]: unknown;
|
|
1046
|
+
} | null;
|
|
1394
1047
|
/**
|
|
1395
|
-
*
|
|
1048
|
+
* The content of the message.
|
|
1396
1049
|
*/
|
|
1397
|
-
|
|
1398
|
-
/**
|
|
1399
|
-
* The text content of the message.
|
|
1400
|
-
*/
|
|
1401
|
-
text: string;
|
|
1402
|
-
/**
|
|
1403
|
-
* Must be 'text' to identify this as text content.
|
|
1404
|
-
*/
|
|
1405
|
-
type?: 'text';
|
|
1406
|
-
}
|
|
1407
|
-
}
|
|
1408
|
-
/**
|
|
1409
|
-
* A message containing the model's (assistant) response in an OpenAI-compatible
|
|
1410
|
-
* chat completion request.
|
|
1411
|
-
*/
|
|
1412
|
-
interface OpenAIAssistantMessageParamOutput {
|
|
1050
|
+
content?: string | null;
|
|
1413
1051
|
/**
|
|
1414
|
-
*
|
|
1052
|
+
* Deprecated: the name and arguments of a function that should be called.
|
|
1415
1053
|
*/
|
|
1416
|
-
|
|
1054
|
+
function_call?: Message.FunctionCall;
|
|
1417
1055
|
/**
|
|
1418
|
-
* The
|
|
1056
|
+
* The refusal message generated by the model.
|
|
1419
1057
|
*/
|
|
1420
|
-
|
|
1058
|
+
refusal?: string | null;
|
|
1421
1059
|
/**
|
|
1422
|
-
*
|
|
1060
|
+
* The role of the message author, always 'assistant' in responses.
|
|
1423
1061
|
*/
|
|
1424
1062
|
role?: 'assistant';
|
|
1425
1063
|
/**
|
|
1426
|
-
*
|
|
1064
|
+
* The tool calls generated by the model.
|
|
1427
1065
|
*/
|
|
1428
|
-
tool_calls?: Array<
|
|
1066
|
+
tool_calls?: Array<Message.Function | Message.Custom>;
|
|
1429
1067
|
}
|
|
1430
|
-
namespace
|
|
1068
|
+
namespace Message {
|
|
1431
1069
|
/**
|
|
1432
|
-
*
|
|
1070
|
+
* Deprecated: the name and arguments of a function that should be called.
|
|
1433
1071
|
*/
|
|
1434
|
-
interface
|
|
1072
|
+
interface FunctionCall {
|
|
1435
1073
|
/**
|
|
1436
|
-
*
|
|
1074
|
+
* Arguments to pass to the function as a JSON string.
|
|
1437
1075
|
*/
|
|
1438
|
-
|
|
1076
|
+
arguments: string;
|
|
1439
1077
|
/**
|
|
1440
|
-
*
|
|
1078
|
+
* Name of the function to call.
|
|
1441
1079
|
*/
|
|
1442
|
-
|
|
1080
|
+
name: string;
|
|
1443
1081
|
}
|
|
1444
1082
|
/**
|
|
1445
1083
|
* Tool call specification for OpenAI-compatible chat completion responses.
|
|
1446
1084
|
*/
|
|
1447
|
-
interface
|
|
1085
|
+
interface Function {
|
|
1448
1086
|
/**
|
|
1449
1087
|
* Unique identifier for the tool call.
|
|
1450
1088
|
*/
|
|
1451
|
-
id
|
|
1089
|
+
id: string;
|
|
1452
1090
|
/**
|
|
1453
|
-
* Function call details
|
|
1091
|
+
* Function call details.
|
|
1454
1092
|
*/
|
|
1455
|
-
function
|
|
1456
|
-
/**
|
|
1457
|
-
* Index of the tool call in the list.
|
|
1458
|
-
*/
|
|
1459
|
-
index?: number | null;
|
|
1093
|
+
function: Function.Function;
|
|
1460
1094
|
/**
|
|
1461
1095
|
* Must be 'function' to identify this as a function call.
|
|
1462
1096
|
*/
|
|
1463
|
-
type
|
|
1097
|
+
type: 'function';
|
|
1464
1098
|
}
|
|
1465
|
-
namespace
|
|
1099
|
+
namespace Function {
|
|
1466
1100
|
/**
|
|
1467
|
-
* Function call details
|
|
1101
|
+
* Function call details.
|
|
1468
1102
|
*/
|
|
1469
1103
|
interface Function {
|
|
1470
1104
|
/**
|
|
1471
1105
|
* Arguments to pass to the function as a JSON string.
|
|
1472
1106
|
*/
|
|
1473
|
-
arguments
|
|
1107
|
+
arguments: string;
|
|
1474
1108
|
/**
|
|
1475
1109
|
* Name of the function to call.
|
|
1476
1110
|
*/
|
|
1477
|
-
name
|
|
1111
|
+
name: string;
|
|
1478
1112
|
}
|
|
1479
1113
|
}
|
|
1480
|
-
}
|
|
1481
|
-
/**
|
|
1482
|
-
* A message representing the result of a tool invocation in an OpenAI-compatible
|
|
1483
|
-
* chat completion request.
|
|
1484
|
-
*/
|
|
1485
|
-
interface OpenAIToolMessageParam {
|
|
1486
|
-
/**
|
|
1487
|
-
* The response content from the tool.
|
|
1488
|
-
*/
|
|
1489
|
-
content: string | Array<OpenAIToolMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
1490
|
-
/**
|
|
1491
|
-
* Unique identifier for the tool call this response is for.
|
|
1492
|
-
*/
|
|
1493
|
-
tool_call_id: string;
|
|
1494
|
-
/**
|
|
1495
|
-
* Must be 'tool' to identify this as a tool response.
|
|
1496
|
-
*/
|
|
1497
|
-
role?: 'tool';
|
|
1498
|
-
}
|
|
1499
|
-
namespace OpenAIToolMessageParam {
|
|
1500
1114
|
/**
|
|
1501
|
-
*
|
|
1115
|
+
* A call to a custom tool created by the model.
|
|
1502
1116
|
*/
|
|
1503
|
-
interface
|
|
1117
|
+
interface Custom {
|
|
1504
1118
|
/**
|
|
1505
|
-
* The
|
|
1119
|
+
* The ID of the tool call.
|
|
1506
1120
|
*/
|
|
1507
|
-
|
|
1121
|
+
id: string;
|
|
1508
1122
|
/**
|
|
1509
|
-
*
|
|
1123
|
+
* The custom tool that the model called.
|
|
1510
1124
|
*/
|
|
1511
|
-
|
|
1512
|
-
}
|
|
1513
|
-
}
|
|
1514
|
-
/**
|
|
1515
|
-
* A message from the developer in an OpenAI-compatible chat completion request.
|
|
1516
|
-
*/
|
|
1517
|
-
interface OpenAIDeveloperMessageParam {
|
|
1518
|
-
/**
|
|
1519
|
-
* The content of the developer message.
|
|
1520
|
-
*/
|
|
1521
|
-
content: string | Array<OpenAIDeveloperMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
|
|
1522
|
-
/**
|
|
1523
|
-
* The name of the developer message participant.
|
|
1524
|
-
*/
|
|
1525
|
-
name?: string | null;
|
|
1526
|
-
/**
|
|
1527
|
-
* Must be 'developer' to identify this as a developer message.
|
|
1528
|
-
*/
|
|
1529
|
-
role?: 'developer';
|
|
1530
|
-
}
|
|
1531
|
-
namespace OpenAIDeveloperMessageParam {
|
|
1532
|
-
/**
|
|
1533
|
-
* Text content part for OpenAI-compatible chat completion messages.
|
|
1534
|
-
*/
|
|
1535
|
-
interface ListOpenAIChatCompletionContentPartTextParam {
|
|
1125
|
+
custom: Custom.Custom;
|
|
1536
1126
|
/**
|
|
1537
|
-
* The
|
|
1127
|
+
* The type of the tool. Always 'custom'.
|
|
1538
1128
|
*/
|
|
1539
|
-
|
|
1129
|
+
type: 'custom';
|
|
1130
|
+
}
|
|
1131
|
+
namespace Custom {
|
|
1540
1132
|
/**
|
|
1541
|
-
*
|
|
1133
|
+
* The custom tool that the model called.
|
|
1542
1134
|
*/
|
|
1543
|
-
|
|
1135
|
+
interface Custom {
|
|
1136
|
+
/**
|
|
1137
|
+
* The input for the custom tool call generated by the model.
|
|
1138
|
+
*/
|
|
1139
|
+
input: string;
|
|
1140
|
+
/**
|
|
1141
|
+
* The name of the custom tool to call.
|
|
1142
|
+
*/
|
|
1143
|
+
name: string;
|
|
1144
|
+
}
|
|
1544
1145
|
}
|
|
1545
1146
|
}
|
|
1546
1147
|
/**
|
|
1547
|
-
* The log probabilities for the tokens in the message
|
|
1548
|
-
* chat completion response.
|
|
1148
|
+
* The log probabilities for the tokens in the message.
|
|
1549
1149
|
*/
|
|
1550
1150
|
interface Logprobs {
|
|
1551
1151
|
/**
|
|
@@ -1703,6 +1303,9 @@ export declare namespace CompletionListResponse {
|
|
|
1703
1303
|
detail?: 'low' | 'high' | 'auto' | null;
|
|
1704
1304
|
}
|
|
1705
1305
|
}
|
|
1306
|
+
/**
|
|
1307
|
+
* File content part for OpenAI-compatible chat completion messages.
|
|
1308
|
+
*/
|
|
1706
1309
|
interface OpenAIFile {
|
|
1707
1310
|
/**
|
|
1708
1311
|
* File specification.
|
|
@@ -1787,6 +1390,7 @@ export declare namespace CompletionListResponse {
|
|
|
1787
1390
|
* List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
|
|
1788
1391
|
*/
|
|
1789
1392
|
tool_calls?: Array<OpenAIAssistantMessageParamOutput.ToolCall> | null;
|
|
1393
|
+
[k: string]: unknown;
|
|
1790
1394
|
}
|
|
1791
1395
|
namespace OpenAIAssistantMessageParamOutput {
|
|
1792
1396
|
/**
|
|
@@ -1809,33 +1413,29 @@ export declare namespace CompletionListResponse {
|
|
|
1809
1413
|
/**
|
|
1810
1414
|
* Unique identifier for the tool call.
|
|
1811
1415
|
*/
|
|
1812
|
-
id
|
|
1813
|
-
/**
|
|
1814
|
-
* Function call details for OpenAI-compatible tool calls.
|
|
1815
|
-
*/
|
|
1816
|
-
function?: ToolCall.Function | null;
|
|
1416
|
+
id: string;
|
|
1817
1417
|
/**
|
|
1818
|
-
*
|
|
1418
|
+
* Function call details.
|
|
1819
1419
|
*/
|
|
1820
|
-
|
|
1420
|
+
function: ToolCall.Function;
|
|
1821
1421
|
/**
|
|
1822
1422
|
* Must be 'function' to identify this as a function call.
|
|
1823
1423
|
*/
|
|
1824
|
-
type
|
|
1424
|
+
type: 'function';
|
|
1825
1425
|
}
|
|
1826
1426
|
namespace ToolCall {
|
|
1827
1427
|
/**
|
|
1828
|
-
* Function call details
|
|
1428
|
+
* Function call details.
|
|
1829
1429
|
*/
|
|
1830
1430
|
interface Function {
|
|
1831
1431
|
/**
|
|
1832
1432
|
* Arguments to pass to the function as a JSON string.
|
|
1833
1433
|
*/
|
|
1834
|
-
arguments
|
|
1434
|
+
arguments: string;
|
|
1835
1435
|
/**
|
|
1836
1436
|
* Name of the function to call.
|
|
1837
1437
|
*/
|
|
1838
|
-
name
|
|
1438
|
+
name: string;
|
|
1839
1439
|
}
|
|
1840
1440
|
}
|
|
1841
1441
|
}
|
|
@@ -1905,48 +1505,48 @@ export declare namespace CompletionListResponse {
|
|
|
1905
1505
|
}
|
|
1906
1506
|
}
|
|
1907
1507
|
/**
|
|
1908
|
-
*
|
|
1508
|
+
* Token usage information for the completion.
|
|
1909
1509
|
*/
|
|
1910
1510
|
interface Usage {
|
|
1911
1511
|
/**
|
|
1912
1512
|
* Number of tokens in the completion.
|
|
1913
1513
|
*/
|
|
1914
|
-
completion_tokens
|
|
1514
|
+
completion_tokens?: number;
|
|
1915
1515
|
/**
|
|
1916
|
-
*
|
|
1516
|
+
* Detailed breakdown of output token usage.
|
|
1917
1517
|
*/
|
|
1918
|
-
|
|
1518
|
+
completion_tokens_details?: Usage.CompletionTokensDetails;
|
|
1919
1519
|
/**
|
|
1920
|
-
*
|
|
1520
|
+
* Number of tokens in the prompt.
|
|
1921
1521
|
*/
|
|
1922
|
-
|
|
1522
|
+
prompt_tokens?: number;
|
|
1923
1523
|
/**
|
|
1924
|
-
*
|
|
1524
|
+
* Detailed breakdown of input token usage.
|
|
1925
1525
|
*/
|
|
1926
|
-
|
|
1526
|
+
prompt_tokens_details?: Usage.PromptTokensDetails;
|
|
1927
1527
|
/**
|
|
1928
|
-
*
|
|
1528
|
+
* Total tokens used (prompt + completion).
|
|
1929
1529
|
*/
|
|
1930
|
-
|
|
1530
|
+
total_tokens?: number;
|
|
1931
1531
|
}
|
|
1932
1532
|
namespace Usage {
|
|
1933
1533
|
/**
|
|
1934
|
-
*
|
|
1534
|
+
* Detailed breakdown of output token usage.
|
|
1935
1535
|
*/
|
|
1936
1536
|
interface CompletionTokensDetails {
|
|
1937
1537
|
/**
|
|
1938
1538
|
* Number of tokens used for reasoning (o1/o3 models).
|
|
1939
1539
|
*/
|
|
1940
|
-
reasoning_tokens?: number
|
|
1540
|
+
reasoning_tokens?: number;
|
|
1941
1541
|
}
|
|
1942
1542
|
/**
|
|
1943
|
-
*
|
|
1543
|
+
* Detailed breakdown of input token usage.
|
|
1944
1544
|
*/
|
|
1945
1545
|
interface PromptTokensDetails {
|
|
1946
1546
|
/**
|
|
1947
1547
|
* Number of tokens retrieved from cache.
|
|
1948
1548
|
*/
|
|
1949
|
-
cached_tokens?: number
|
|
1549
|
+
cached_tokens?: number;
|
|
1950
1550
|
}
|
|
1951
1551
|
}
|
|
1952
1552
|
}
|
|
@@ -2007,6 +1607,10 @@ export interface CompletionCreateParamsBase {
|
|
|
2007
1607
|
* The penalty for repeated tokens.
|
|
2008
1608
|
*/
|
|
2009
1609
|
presence_penalty?: number | null;
|
|
1610
|
+
/**
|
|
1611
|
+
* A key to use when reading from or writing to the prompt cache.
|
|
1612
|
+
*/
|
|
1613
|
+
prompt_cache_key?: string | null;
|
|
2010
1614
|
/**
|
|
2011
1615
|
* The effort level for reasoning models.
|
|
2012
1616
|
*/
|
|
@@ -2023,6 +1627,10 @@ export interface CompletionCreateParamsBase {
|
|
|
2023
1627
|
* The seed to use.
|
|
2024
1628
|
*/
|
|
2025
1629
|
seed?: number | null;
|
|
1630
|
+
/**
|
|
1631
|
+
* The service tier for the request.
|
|
1632
|
+
*/
|
|
1633
|
+
service_tier?: 'auto' | 'default' | 'flex' | 'priority' | null;
|
|
2026
1634
|
/**
|
|
2027
1635
|
* The stop tokens to use.
|
|
2028
1636
|
*/
|
|
@@ -2054,7 +1662,7 @@ export interface CompletionCreateParamsBase {
|
|
|
2054
1662
|
[key: string]: unknown;
|
|
2055
1663
|
}> | null;
|
|
2056
1664
|
/**
|
|
2057
|
-
* The
|
|
1665
|
+
* The number of most likely tokens to return at each position.
|
|
2058
1666
|
*/
|
|
2059
1667
|
top_logprobs?: number | null;
|
|
2060
1668
|
/**
|
|
@@ -2127,6 +1735,9 @@ export declare namespace CompletionCreateParams {
|
|
|
2127
1735
|
detail?: 'low' | 'high' | 'auto' | null;
|
|
2128
1736
|
}
|
|
2129
1737
|
}
|
|
1738
|
+
/**
|
|
1739
|
+
* File content part for OpenAI-compatible chat completion messages.
|
|
1740
|
+
*/
|
|
2130
1741
|
interface OpenAIFile {
|
|
2131
1742
|
/**
|
|
2132
1743
|
* File specification.
|
|
@@ -2211,6 +1822,7 @@ export declare namespace CompletionCreateParams {
|
|
|
2211
1822
|
* List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
|
|
2212
1823
|
*/
|
|
2213
1824
|
tool_calls?: Array<OpenAIAssistantMessageParamInput.ToolCall> | null;
|
|
1825
|
+
[k: string]: unknown;
|
|
2214
1826
|
}
|
|
2215
1827
|
namespace OpenAIAssistantMessageParamInput {
|
|
2216
1828
|
/**
|
|
@@ -2233,33 +1845,29 @@ export declare namespace CompletionCreateParams {
|
|
|
2233
1845
|
/**
|
|
2234
1846
|
* Unique identifier for the tool call.
|
|
2235
1847
|
*/
|
|
2236
|
-
id
|
|
2237
|
-
/**
|
|
2238
|
-
* Function call details for OpenAI-compatible tool calls.
|
|
2239
|
-
*/
|
|
2240
|
-
function?: ToolCall.Function | null;
|
|
1848
|
+
id: string;
|
|
2241
1849
|
/**
|
|
2242
|
-
*
|
|
1850
|
+
* Function call details.
|
|
2243
1851
|
*/
|
|
2244
|
-
|
|
1852
|
+
function: ToolCall.Function;
|
|
2245
1853
|
/**
|
|
2246
1854
|
* Must be 'function' to identify this as a function call.
|
|
2247
1855
|
*/
|
|
2248
|
-
type
|
|
1856
|
+
type: 'function';
|
|
2249
1857
|
}
|
|
2250
1858
|
namespace ToolCall {
|
|
2251
1859
|
/**
|
|
2252
|
-
* Function call details
|
|
1860
|
+
* Function call details.
|
|
2253
1861
|
*/
|
|
2254
1862
|
interface Function {
|
|
2255
1863
|
/**
|
|
2256
1864
|
* Arguments to pass to the function as a JSON string.
|
|
2257
1865
|
*/
|
|
2258
|
-
arguments
|
|
1866
|
+
arguments: string;
|
|
2259
1867
|
/**
|
|
2260
1868
|
* Name of the function to call.
|
|
2261
1869
|
*/
|
|
2262
|
-
name
|
|
1870
|
+
name: string;
|
|
2263
1871
|
}
|
|
2264
1872
|
}
|
|
2265
1873
|
}
|
|
@@ -2403,7 +2011,7 @@ export interface CompletionListParams {
|
|
|
2403
2011
|
*/
|
|
2404
2012
|
model?: string | null;
|
|
2405
2013
|
/**
|
|
2406
|
-
*
|
|
2014
|
+
* The order to sort the chat completions by: "asc" or "desc". Defaults to "desc".
|
|
2407
2015
|
*/
|
|
2408
2016
|
order?: 'asc' | 'desc' | null;
|
|
2409
2017
|
}
|