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
|
@@ -8,10 +8,25 @@ export declare class Chat extends APIResource {
|
|
|
8
8
|
* Chunk from a streaming response to an OpenAI-compatible chat completion request.
|
|
9
9
|
*/
|
|
10
10
|
export interface ChatCompletionChunk {
|
|
11
|
+
/**
|
|
12
|
+
* The ID of the chat completion.
|
|
13
|
+
*/
|
|
11
14
|
id: string;
|
|
15
|
+
/**
|
|
16
|
+
* List of choices.
|
|
17
|
+
*/
|
|
12
18
|
choices: Array<ChatCompletionChunk.Choice>;
|
|
19
|
+
/**
|
|
20
|
+
* The Unix timestamp in seconds when the chat completion was created.
|
|
21
|
+
*/
|
|
13
22
|
created: number;
|
|
23
|
+
/**
|
|
24
|
+
* The model that was used to generate the chat completion.
|
|
25
|
+
*/
|
|
14
26
|
model: string;
|
|
27
|
+
/**
|
|
28
|
+
* The object type.
|
|
29
|
+
*/
|
|
15
30
|
object?: 'chat.completion.chunk';
|
|
16
31
|
/**
|
|
17
32
|
* Usage information for OpenAI chat completion.
|
|
@@ -24,11 +39,17 @@ export declare namespace ChatCompletionChunk {
|
|
|
24
39
|
*/
|
|
25
40
|
interface Choice {
|
|
26
41
|
/**
|
|
27
|
-
*
|
|
42
|
+
* The delta from the chunk.
|
|
28
43
|
*/
|
|
29
44
|
delta: Choice.Delta;
|
|
30
|
-
|
|
45
|
+
/**
|
|
46
|
+
* The index of the choice.
|
|
47
|
+
*/
|
|
31
48
|
index: number;
|
|
49
|
+
/**
|
|
50
|
+
* The reason the model stopped generating.
|
|
51
|
+
*/
|
|
52
|
+
finish_reason?: 'stop' | 'length' | 'tool_calls' | 'content_filter' | 'function_call' | null;
|
|
32
53
|
/**
|
|
33
54
|
* The log probabilities for the tokens in the message from an OpenAI-compatible
|
|
34
55
|
* chat completion response.
|
|
@@ -37,13 +58,28 @@ export declare namespace ChatCompletionChunk {
|
|
|
37
58
|
}
|
|
38
59
|
namespace Choice {
|
|
39
60
|
/**
|
|
40
|
-
*
|
|
61
|
+
* The delta from the chunk.
|
|
41
62
|
*/
|
|
42
63
|
interface Delta {
|
|
64
|
+
/**
|
|
65
|
+
* The content of the delta.
|
|
66
|
+
*/
|
|
43
67
|
content?: string | null;
|
|
68
|
+
/**
|
|
69
|
+
* The reasoning content from the model (for o1/o3 models).
|
|
70
|
+
*/
|
|
44
71
|
reasoning_content?: string | null;
|
|
72
|
+
/**
|
|
73
|
+
* The refusal of the delta.
|
|
74
|
+
*/
|
|
45
75
|
refusal?: string | null;
|
|
76
|
+
/**
|
|
77
|
+
* The role of the delta.
|
|
78
|
+
*/
|
|
46
79
|
role?: string | null;
|
|
80
|
+
/**
|
|
81
|
+
* The tool calls of the delta.
|
|
82
|
+
*/
|
|
47
83
|
tool_calls?: Array<Delta.ToolCall> | null;
|
|
48
84
|
}
|
|
49
85
|
namespace Delta {
|
|
@@ -51,12 +87,21 @@ export declare namespace ChatCompletionChunk {
|
|
|
51
87
|
* Tool call specification for OpenAI-compatible chat completion responses.
|
|
52
88
|
*/
|
|
53
89
|
interface ToolCall {
|
|
90
|
+
/**
|
|
91
|
+
* Unique identifier for the tool call.
|
|
92
|
+
*/
|
|
54
93
|
id?: string | null;
|
|
55
94
|
/**
|
|
56
95
|
* Function call details for OpenAI-compatible tool calls.
|
|
57
96
|
*/
|
|
58
97
|
function?: ToolCall.Function | null;
|
|
98
|
+
/**
|
|
99
|
+
* Index of the tool call in the list.
|
|
100
|
+
*/
|
|
59
101
|
index?: number | null;
|
|
102
|
+
/**
|
|
103
|
+
* Must be 'function' to identify this as a function call.
|
|
104
|
+
*/
|
|
60
105
|
type?: 'function';
|
|
61
106
|
}
|
|
62
107
|
namespace ToolCall {
|
|
@@ -64,7 +109,13 @@ export declare namespace ChatCompletionChunk {
|
|
|
64
109
|
* Function call details for OpenAI-compatible tool calls.
|
|
65
110
|
*/
|
|
66
111
|
interface Function {
|
|
112
|
+
/**
|
|
113
|
+
* Arguments to pass to the function as a JSON string.
|
|
114
|
+
*/
|
|
67
115
|
arguments?: string | null;
|
|
116
|
+
/**
|
|
117
|
+
* Name of the function to call.
|
|
118
|
+
*/
|
|
68
119
|
name?: string | null;
|
|
69
120
|
}
|
|
70
121
|
}
|
|
@@ -74,61 +125,97 @@ export declare namespace ChatCompletionChunk {
|
|
|
74
125
|
* chat completion response.
|
|
75
126
|
*/
|
|
76
127
|
interface Logprobs {
|
|
128
|
+
/**
|
|
129
|
+
* The log probabilities for the tokens in the message.
|
|
130
|
+
*/
|
|
77
131
|
content?: Array<Logprobs.Content> | null;
|
|
132
|
+
/**
|
|
133
|
+
* The log probabilities for the refusal tokens.
|
|
134
|
+
*/
|
|
78
135
|
refusal?: Array<Logprobs.Refusal> | null;
|
|
79
136
|
}
|
|
80
137
|
namespace Logprobs {
|
|
81
138
|
/**
|
|
82
139
|
* The log probability for a token from an OpenAI-compatible chat completion
|
|
83
140
|
* response.
|
|
84
|
-
*
|
|
85
|
-
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
86
|
-
* probability of the token :top_logprobs: The top log probabilities for the token
|
|
87
141
|
*/
|
|
88
142
|
interface Content {
|
|
143
|
+
/**
|
|
144
|
+
* The token.
|
|
145
|
+
*/
|
|
89
146
|
token: string;
|
|
147
|
+
/**
|
|
148
|
+
* The log probability of the token.
|
|
149
|
+
*/
|
|
90
150
|
logprob: number;
|
|
91
|
-
|
|
151
|
+
/**
|
|
152
|
+
* The bytes for the token.
|
|
153
|
+
*/
|
|
92
154
|
bytes?: Array<number> | null;
|
|
155
|
+
/**
|
|
156
|
+
* The top log probabilities for the token.
|
|
157
|
+
*/
|
|
158
|
+
top_logprobs?: Array<Content.TopLogprob> | null;
|
|
93
159
|
}
|
|
94
160
|
namespace Content {
|
|
95
161
|
/**
|
|
96
162
|
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
97
163
|
* response.
|
|
98
|
-
*
|
|
99
|
-
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
100
|
-
* probability of the token
|
|
101
164
|
*/
|
|
102
165
|
interface TopLogprob {
|
|
166
|
+
/**
|
|
167
|
+
* The token.
|
|
168
|
+
*/
|
|
103
169
|
token: string;
|
|
170
|
+
/**
|
|
171
|
+
* The log probability of the token.
|
|
172
|
+
*/
|
|
104
173
|
logprob: number;
|
|
174
|
+
/**
|
|
175
|
+
* The bytes for the token.
|
|
176
|
+
*/
|
|
105
177
|
bytes?: Array<number> | null;
|
|
106
178
|
}
|
|
107
179
|
}
|
|
108
180
|
/**
|
|
109
181
|
* The log probability for a token from an OpenAI-compatible chat completion
|
|
110
182
|
* response.
|
|
111
|
-
*
|
|
112
|
-
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
113
|
-
* probability of the token :top_logprobs: The top log probabilities for the token
|
|
114
183
|
*/
|
|
115
184
|
interface Refusal {
|
|
185
|
+
/**
|
|
186
|
+
* The token.
|
|
187
|
+
*/
|
|
116
188
|
token: string;
|
|
189
|
+
/**
|
|
190
|
+
* The log probability of the token.
|
|
191
|
+
*/
|
|
117
192
|
logprob: number;
|
|
118
|
-
|
|
193
|
+
/**
|
|
194
|
+
* The bytes for the token.
|
|
195
|
+
*/
|
|
119
196
|
bytes?: Array<number> | null;
|
|
197
|
+
/**
|
|
198
|
+
* The top log probabilities for the token.
|
|
199
|
+
*/
|
|
200
|
+
top_logprobs?: Array<Refusal.TopLogprob> | null;
|
|
120
201
|
}
|
|
121
202
|
namespace Refusal {
|
|
122
203
|
/**
|
|
123
204
|
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
124
205
|
* response.
|
|
125
|
-
*
|
|
126
|
-
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
127
|
-
* probability of the token
|
|
128
206
|
*/
|
|
129
207
|
interface TopLogprob {
|
|
208
|
+
/**
|
|
209
|
+
* The token.
|
|
210
|
+
*/
|
|
130
211
|
token: string;
|
|
212
|
+
/**
|
|
213
|
+
* The log probability of the token.
|
|
214
|
+
*/
|
|
131
215
|
logprob: number;
|
|
216
|
+
/**
|
|
217
|
+
* The bytes for the token.
|
|
218
|
+
*/
|
|
132
219
|
bytes?: Array<number> | null;
|
|
133
220
|
}
|
|
134
221
|
}
|
|
@@ -138,8 +225,17 @@ export declare namespace ChatCompletionChunk {
|
|
|
138
225
|
* Usage information for OpenAI chat completion.
|
|
139
226
|
*/
|
|
140
227
|
interface Usage {
|
|
228
|
+
/**
|
|
229
|
+
* Number of tokens in the completion.
|
|
230
|
+
*/
|
|
141
231
|
completion_tokens: number;
|
|
232
|
+
/**
|
|
233
|
+
* Number of tokens in the prompt.
|
|
234
|
+
*/
|
|
142
235
|
prompt_tokens: number;
|
|
236
|
+
/**
|
|
237
|
+
* Total tokens used (prompt + completion).
|
|
238
|
+
*/
|
|
143
239
|
total_tokens: number;
|
|
144
240
|
/**
|
|
145
241
|
* Token details for output tokens in OpenAI chat completion usage.
|
|
@@ -155,12 +251,18 @@ export declare namespace ChatCompletionChunk {
|
|
|
155
251
|
* Token details for output tokens in OpenAI chat completion usage.
|
|
156
252
|
*/
|
|
157
253
|
interface CompletionTokensDetails {
|
|
254
|
+
/**
|
|
255
|
+
* Number of tokens used for reasoning (o1/o3 models).
|
|
256
|
+
*/
|
|
158
257
|
reasoning_tokens?: number | null;
|
|
159
258
|
}
|
|
160
259
|
/**
|
|
161
260
|
* Token details for prompt tokens in OpenAI chat completion usage.
|
|
162
261
|
*/
|
|
163
262
|
interface PromptTokensDetails {
|
|
263
|
+
/**
|
|
264
|
+
* Number of tokens retrieved from cache.
|
|
265
|
+
*/
|
|
164
266
|
cached_tokens?: number | null;
|
|
165
267
|
}
|
|
166
268
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/resources/chat/chat.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,cAAc,MAAM,eAAe,CAAC;AAChD,OAAO,EACL,sBAAsB,EACtB,kCAAkC,EAClC,+BAA+B,EAC/B,wBAAwB,EACxB,oBAAoB,EACpB,sBAAsB,EACtB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,IAAI,oBAAoB,GAClD,CAAC;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.js","sourceRoot":"","sources":["../../src/resources/chat/chat.ts"],"names":[],"mappings":";AAAA,qDAAqD;AACrD,uBAAuB;AACvB,EAAE;AACF,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtF,gDAA6C;AAC7C,iEAAgD;AAChD,kDASuB;AAEvB,MAAa,IAAK,SAAQ,sBAAW;IAArC;;QACE,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzF,CAAC;CAAA;AAFD,oBAEC;
|
|
1
|
+
{"version":3,"file":"chat.js","sourceRoot":"","sources":["../../src/resources/chat/chat.ts"],"names":[],"mappings":";AAAA,qDAAqD;AACrD,uBAAuB;AACvB,EAAE;AACF,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtF,gDAA6C;AAC7C,iEAAgD;AAChD,kDASuB;AAEvB,MAAa,IAAK,SAAQ,sBAAW;IAArC;;QACE,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzF,CAAC;CAAA;AAFD,oBAEC;AAqTD,IAAI,CAAC,WAAW,GAAG,yBAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.mjs","sourceRoot":"","sources":["../../src/resources/chat/chat.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,uBAAuB;AACvB,EAAE;AACF,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,cAAc;OACnB,EAQL,WAAW,GACZ;AAED,MAAM,OAAO,IAAK,SAAQ,WAAW;IAArC;;QACE,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzF,CAAC;CAAA;
|
|
1
|
+
{"version":3,"file":"chat.mjs","sourceRoot":"","sources":["../../src/resources/chat/chat.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,uBAAuB;AACvB,EAAE;AACF,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,cAAc;OACnB,EAQL,WAAW,GACZ;AAED,MAAM,OAAO,IAAK,SAAQ,WAAW;IAArC;;QACE,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzF,CAAC;CAAA;AAqTD,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC"}
|