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
|
@@ -14,8 +14,6 @@ import { Stream } from '../streaming';
|
|
|
14
14
|
|
|
15
15
|
export class Completions extends APIResource {
|
|
16
16
|
/**
|
|
17
|
-
* Create completion.
|
|
18
|
-
*
|
|
19
17
|
* Generate an OpenAI-compatible completion for the given prompt using the
|
|
20
18
|
* specified model.
|
|
21
19
|
*/
|
|
@@ -43,37 +41,52 @@ export class Completions extends APIResource {
|
|
|
43
41
|
|
|
44
42
|
/**
|
|
45
43
|
* Response from an OpenAI-compatible completion request.
|
|
46
|
-
*
|
|
47
|
-
* :id: The ID of the completion :choices: List of choices :created: The Unix
|
|
48
|
-
* timestamp in seconds when the completion was created :model: The model that was
|
|
49
|
-
* used to generate the completion :object: The object type, which will be
|
|
50
|
-
* "text_completion"
|
|
51
44
|
*/
|
|
52
45
|
export interface CompletionCreateResponse {
|
|
46
|
+
/**
|
|
47
|
+
* The ID of the completion.
|
|
48
|
+
*/
|
|
53
49
|
id: string;
|
|
54
50
|
|
|
51
|
+
/**
|
|
52
|
+
* List of choices.
|
|
53
|
+
*/
|
|
55
54
|
choices: Array<CompletionCreateResponse.Choice>;
|
|
56
55
|
|
|
56
|
+
/**
|
|
57
|
+
* The Unix timestamp in seconds when the completion was created.
|
|
58
|
+
*/
|
|
57
59
|
created: number;
|
|
58
60
|
|
|
61
|
+
/**
|
|
62
|
+
* The model that was used to generate the completion.
|
|
63
|
+
*/
|
|
59
64
|
model: string;
|
|
60
65
|
|
|
66
|
+
/**
|
|
67
|
+
* The object type.
|
|
68
|
+
*/
|
|
61
69
|
object?: 'text_completion';
|
|
62
70
|
}
|
|
63
71
|
|
|
64
72
|
export namespace CompletionCreateResponse {
|
|
65
73
|
/**
|
|
66
74
|
* A choice from an OpenAI-compatible completion response.
|
|
67
|
-
*
|
|
68
|
-
* :finish_reason: The reason the model stopped generating :text: The text of the
|
|
69
|
-
* choice :index: The index of the choice :logprobs: (Optional) The log
|
|
70
|
-
* probabilities for the tokens in the choice
|
|
71
75
|
*/
|
|
72
76
|
export interface Choice {
|
|
73
|
-
|
|
77
|
+
/**
|
|
78
|
+
* The reason the model stopped generating.
|
|
79
|
+
*/
|
|
80
|
+
finish_reason: 'stop' | 'length' | 'tool_calls' | 'content_filter' | 'function_call';
|
|
74
81
|
|
|
82
|
+
/**
|
|
83
|
+
* The index of the choice.
|
|
84
|
+
*/
|
|
75
85
|
index: number;
|
|
76
86
|
|
|
87
|
+
/**
|
|
88
|
+
* The text of the choice.
|
|
89
|
+
*/
|
|
77
90
|
text: string;
|
|
78
91
|
|
|
79
92
|
/**
|
|
@@ -89,8 +102,14 @@ export namespace CompletionCreateResponse {
|
|
|
89
102
|
* chat completion response.
|
|
90
103
|
*/
|
|
91
104
|
export interface Logprobs {
|
|
105
|
+
/**
|
|
106
|
+
* The log probabilities for the tokens in the message.
|
|
107
|
+
*/
|
|
92
108
|
content?: Array<Logprobs.Content> | null;
|
|
93
109
|
|
|
110
|
+
/**
|
|
111
|
+
* The log probabilities for the refusal tokens.
|
|
112
|
+
*/
|
|
94
113
|
refusal?: Array<Logprobs.Refusal> | null;
|
|
95
114
|
}
|
|
96
115
|
|
|
@@ -98,33 +117,48 @@ export namespace CompletionCreateResponse {
|
|
|
98
117
|
/**
|
|
99
118
|
* The log probability for a token from an OpenAI-compatible chat completion
|
|
100
119
|
* response.
|
|
101
|
-
*
|
|
102
|
-
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
103
|
-
* probability of the token :top_logprobs: The top log probabilities for the token
|
|
104
120
|
*/
|
|
105
121
|
export interface Content {
|
|
122
|
+
/**
|
|
123
|
+
* The token.
|
|
124
|
+
*/
|
|
106
125
|
token: string;
|
|
107
126
|
|
|
127
|
+
/**
|
|
128
|
+
* The log probability of the token.
|
|
129
|
+
*/
|
|
108
130
|
logprob: number;
|
|
109
131
|
|
|
110
|
-
|
|
111
|
-
|
|
132
|
+
/**
|
|
133
|
+
* The bytes for the token.
|
|
134
|
+
*/
|
|
112
135
|
bytes?: Array<number> | null;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* The top log probabilities for the token.
|
|
139
|
+
*/
|
|
140
|
+
top_logprobs?: Array<Content.TopLogprob> | null;
|
|
113
141
|
}
|
|
114
142
|
|
|
115
143
|
export namespace Content {
|
|
116
144
|
/**
|
|
117
145
|
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
118
146
|
* response.
|
|
119
|
-
*
|
|
120
|
-
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
121
|
-
* probability of the token
|
|
122
147
|
*/
|
|
123
148
|
export interface TopLogprob {
|
|
149
|
+
/**
|
|
150
|
+
* The token.
|
|
151
|
+
*/
|
|
124
152
|
token: string;
|
|
125
153
|
|
|
154
|
+
/**
|
|
155
|
+
* The log probability of the token.
|
|
156
|
+
*/
|
|
126
157
|
logprob: number;
|
|
127
158
|
|
|
159
|
+
/**
|
|
160
|
+
* The bytes for the token.
|
|
161
|
+
*/
|
|
128
162
|
bytes?: Array<number> | null;
|
|
129
163
|
}
|
|
130
164
|
}
|
|
@@ -132,33 +166,48 @@ export namespace CompletionCreateResponse {
|
|
|
132
166
|
/**
|
|
133
167
|
* The log probability for a token from an OpenAI-compatible chat completion
|
|
134
168
|
* response.
|
|
135
|
-
*
|
|
136
|
-
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
137
|
-
* probability of the token :top_logprobs: The top log probabilities for the token
|
|
138
169
|
*/
|
|
139
170
|
export interface Refusal {
|
|
171
|
+
/**
|
|
172
|
+
* The token.
|
|
173
|
+
*/
|
|
140
174
|
token: string;
|
|
141
175
|
|
|
176
|
+
/**
|
|
177
|
+
* The log probability of the token.
|
|
178
|
+
*/
|
|
142
179
|
logprob: number;
|
|
143
180
|
|
|
144
|
-
|
|
145
|
-
|
|
181
|
+
/**
|
|
182
|
+
* The bytes for the token.
|
|
183
|
+
*/
|
|
146
184
|
bytes?: Array<number> | null;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* The top log probabilities for the token.
|
|
188
|
+
*/
|
|
189
|
+
top_logprobs?: Array<Refusal.TopLogprob> | null;
|
|
147
190
|
}
|
|
148
191
|
|
|
149
192
|
export namespace Refusal {
|
|
150
193
|
/**
|
|
151
194
|
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
152
195
|
* response.
|
|
153
|
-
*
|
|
154
|
-
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
155
|
-
* probability of the token
|
|
156
196
|
*/
|
|
157
197
|
export interface TopLogprob {
|
|
198
|
+
/**
|
|
199
|
+
* The token.
|
|
200
|
+
*/
|
|
158
201
|
token: string;
|
|
159
202
|
|
|
203
|
+
/**
|
|
204
|
+
* The log probability of the token.
|
|
205
|
+
*/
|
|
160
206
|
logprob: number;
|
|
161
207
|
|
|
208
|
+
/**
|
|
209
|
+
* The bytes for the token.
|
|
210
|
+
*/
|
|
162
211
|
bytes?: Array<number> | null;
|
|
163
212
|
}
|
|
164
213
|
}
|
|
@@ -169,40 +218,94 @@ export namespace CompletionCreateResponse {
|
|
|
169
218
|
export type CompletionCreateParams = CompletionCreateParamsNonStreaming | CompletionCreateParamsStreaming;
|
|
170
219
|
|
|
171
220
|
export interface CompletionCreateParamsBase {
|
|
221
|
+
/**
|
|
222
|
+
* The identifier of the model to use.
|
|
223
|
+
*/
|
|
172
224
|
model: string;
|
|
173
225
|
|
|
226
|
+
/**
|
|
227
|
+
* The prompt to generate a completion for.
|
|
228
|
+
*/
|
|
174
229
|
prompt: string | Array<string> | Array<number> | Array<Array<number>>;
|
|
175
230
|
|
|
231
|
+
/**
|
|
232
|
+
* The number of completions to generate.
|
|
233
|
+
*/
|
|
176
234
|
best_of?: number | null;
|
|
177
235
|
|
|
236
|
+
/**
|
|
237
|
+
* Whether to echo the prompt.
|
|
238
|
+
*/
|
|
178
239
|
echo?: boolean | null;
|
|
179
240
|
|
|
241
|
+
/**
|
|
242
|
+
* The penalty for repeated tokens.
|
|
243
|
+
*/
|
|
180
244
|
frequency_penalty?: number | null;
|
|
181
245
|
|
|
246
|
+
/**
|
|
247
|
+
* The logit bias to use.
|
|
248
|
+
*/
|
|
182
249
|
logit_bias?: { [key: string]: number } | null;
|
|
183
250
|
|
|
251
|
+
/**
|
|
252
|
+
* The log probabilities to use.
|
|
253
|
+
*/
|
|
184
254
|
logprobs?: boolean | null;
|
|
185
255
|
|
|
256
|
+
/**
|
|
257
|
+
* The maximum number of tokens to generate.
|
|
258
|
+
*/
|
|
186
259
|
max_tokens?: number | null;
|
|
187
260
|
|
|
261
|
+
/**
|
|
262
|
+
* The number of completions to generate.
|
|
263
|
+
*/
|
|
188
264
|
n?: number | null;
|
|
189
265
|
|
|
266
|
+
/**
|
|
267
|
+
* The penalty for repeated tokens.
|
|
268
|
+
*/
|
|
190
269
|
presence_penalty?: number | null;
|
|
191
270
|
|
|
271
|
+
/**
|
|
272
|
+
* The seed to use.
|
|
273
|
+
*/
|
|
192
274
|
seed?: number | null;
|
|
193
275
|
|
|
276
|
+
/**
|
|
277
|
+
* The stop tokens to use.
|
|
278
|
+
*/
|
|
194
279
|
stop?: string | Array<string> | null;
|
|
195
280
|
|
|
281
|
+
/**
|
|
282
|
+
* Whether to stream the response.
|
|
283
|
+
*/
|
|
196
284
|
stream?: boolean | null;
|
|
197
285
|
|
|
286
|
+
/**
|
|
287
|
+
* The stream options to use.
|
|
288
|
+
*/
|
|
198
289
|
stream_options?: { [key: string]: unknown } | null;
|
|
199
290
|
|
|
291
|
+
/**
|
|
292
|
+
* The suffix that should be appended to the completion.
|
|
293
|
+
*/
|
|
200
294
|
suffix?: string | null;
|
|
201
295
|
|
|
296
|
+
/**
|
|
297
|
+
* The temperature to use.
|
|
298
|
+
*/
|
|
202
299
|
temperature?: number | null;
|
|
203
300
|
|
|
301
|
+
/**
|
|
302
|
+
* The top p to use.
|
|
303
|
+
*/
|
|
204
304
|
top_p?: number | null;
|
|
205
305
|
|
|
306
|
+
/**
|
|
307
|
+
* The user to use.
|
|
308
|
+
*/
|
|
206
309
|
user?: string | null;
|
|
207
310
|
|
|
208
311
|
[k: string]: unknown;
|
|
@@ -214,12 +317,18 @@ export namespace CompletionCreateParams {
|
|
|
214
317
|
}
|
|
215
318
|
|
|
216
319
|
export interface CompletionCreateParamsNonStreaming extends CompletionCreateParamsBase {
|
|
320
|
+
/**
|
|
321
|
+
* Whether to stream the response.
|
|
322
|
+
*/
|
|
217
323
|
stream?: false | null;
|
|
218
324
|
|
|
219
325
|
[k: string]: unknown;
|
|
220
326
|
}
|
|
221
327
|
|
|
222
328
|
export interface CompletionCreateParamsStreaming extends CompletionCreateParamsBase {
|
|
329
|
+
/**
|
|
330
|
+
* Whether to stream the response.
|
|
331
|
+
*/
|
|
223
332
|
stream: true;
|
|
224
333
|
|
|
225
334
|
[k: string]: unknown;
|
|
@@ -24,8 +24,6 @@ export class Conversations extends APIResource {
|
|
|
24
24
|
items: ItemsAPI.Items = new ItemsAPI.Items(this._client);
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
* Create a conversation.
|
|
28
|
-
*
|
|
29
27
|
* Create a conversation.
|
|
30
28
|
*/
|
|
31
29
|
create(body: ConversationCreateParams, options?: Core.RequestOptions): Core.APIPromise<ConversationObject> {
|
|
@@ -33,8 +31,6 @@ export class Conversations extends APIResource {
|
|
|
33
31
|
}
|
|
34
32
|
|
|
35
33
|
/**
|
|
36
|
-
* Retrieve a conversation.
|
|
37
|
-
*
|
|
38
34
|
* Get a conversation with the given ID.
|
|
39
35
|
*/
|
|
40
36
|
retrieve(conversationId: string, options?: Core.RequestOptions): Core.APIPromise<ConversationObject> {
|
|
@@ -42,8 +38,6 @@ export class Conversations extends APIResource {
|
|
|
42
38
|
}
|
|
43
39
|
|
|
44
40
|
/**
|
|
45
|
-
* Update a conversation.
|
|
46
|
-
*
|
|
47
41
|
* Update a conversation's metadata with the given ID.
|
|
48
42
|
*/
|
|
49
43
|
update(
|
|
@@ -55,8 +49,6 @@ export class Conversations extends APIResource {
|
|
|
55
49
|
}
|
|
56
50
|
|
|
57
51
|
/**
|
|
58
|
-
* Delete a conversation.
|
|
59
|
-
*
|
|
60
52
|
* Delete a conversation with the given ID.
|
|
61
53
|
*/
|
|
62
54
|
delete(conversationId: string, options?: Core.RequestOptions): Core.APIPromise<ConversationDeleteResponse> {
|
|
@@ -119,6 +111,9 @@ export interface ConversationDeleteResponse {
|
|
|
119
111
|
}
|
|
120
112
|
|
|
121
113
|
export interface ConversationCreateParams {
|
|
114
|
+
/**
|
|
115
|
+
* Initial items to include in the conversation context.
|
|
116
|
+
*/
|
|
122
117
|
items?: Array<
|
|
123
118
|
| ConversationCreateParams.OpenAIResponseMessageInput
|
|
124
119
|
| ConversationCreateParams.OpenAIResponseOutputMessageWebSearchToolCall
|
|
@@ -131,6 +126,9 @@ export interface ConversationCreateParams {
|
|
|
131
126
|
| ConversationCreateParams.OpenAIResponseOutputMessageMcpListTools
|
|
132
127
|
> | null;
|
|
133
128
|
|
|
129
|
+
/**
|
|
130
|
+
* Set of key-value pairs that can be attached to an object.
|
|
131
|
+
*/
|
|
134
132
|
metadata?: { [key: string]: string } | null;
|
|
135
133
|
}
|
|
136
134
|
|
|
@@ -149,7 +147,7 @@ export namespace ConversationCreateParams {
|
|
|
149
147
|
| OpenAIResponseMessageInput.OpenAIResponseInputMessageContentFile
|
|
150
148
|
>
|
|
151
149
|
| Array<
|
|
152
|
-
| OpenAIResponseMessageInput.
|
|
150
|
+
| OpenAIResponseMessageInput.OpenAIResponseOutputMessageContentOutputTextInput
|
|
153
151
|
| OpenAIResponseMessageInput.OpenAIResponseContentPartRefusal
|
|
154
152
|
>;
|
|
155
153
|
|
|
@@ -200,20 +198,22 @@ export namespace ConversationCreateParams {
|
|
|
200
198
|
type?: 'input_file';
|
|
201
199
|
}
|
|
202
200
|
|
|
203
|
-
export interface
|
|
201
|
+
export interface OpenAIResponseOutputMessageContentOutputTextInput {
|
|
204
202
|
text: string;
|
|
205
203
|
|
|
206
204
|
annotations?: Array<
|
|
207
|
-
|
|
|
208
|
-
|
|
|
209
|
-
|
|
|
210
|
-
|
|
|
205
|
+
| OpenAIResponseOutputMessageContentOutputTextInput.OpenAIResponseAnnotationFileCitation
|
|
206
|
+
| OpenAIResponseOutputMessageContentOutputTextInput.OpenAIResponseAnnotationCitation
|
|
207
|
+
| OpenAIResponseOutputMessageContentOutputTextInput.OpenAIResponseAnnotationContainerFileCitation
|
|
208
|
+
| OpenAIResponseOutputMessageContentOutputTextInput.OpenAIResponseAnnotationFilePath
|
|
211
209
|
>;
|
|
212
210
|
|
|
211
|
+
logprobs?: Array<OpenAIResponseOutputMessageContentOutputTextInput.Logprob> | null;
|
|
212
|
+
|
|
213
213
|
type?: 'output_text';
|
|
214
214
|
}
|
|
215
215
|
|
|
216
|
-
export namespace
|
|
216
|
+
export namespace OpenAIResponseOutputMessageContentOutputTextInput {
|
|
217
217
|
/**
|
|
218
218
|
* File citation annotation for referencing specific files in response content.
|
|
219
219
|
*/
|
|
@@ -263,6 +263,55 @@ export namespace ConversationCreateParams {
|
|
|
263
263
|
|
|
264
264
|
type?: 'file_path';
|
|
265
265
|
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* The log probability for a token from an OpenAI-compatible chat completion
|
|
269
|
+
* response.
|
|
270
|
+
*/
|
|
271
|
+
export interface Logprob {
|
|
272
|
+
/**
|
|
273
|
+
* The token.
|
|
274
|
+
*/
|
|
275
|
+
token: string;
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* The log probability of the token.
|
|
279
|
+
*/
|
|
280
|
+
logprob: number;
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* The bytes for the token.
|
|
284
|
+
*/
|
|
285
|
+
bytes?: Array<number> | null;
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* The top log probabilities for the token.
|
|
289
|
+
*/
|
|
290
|
+
top_logprobs?: Array<Logprob.TopLogprob> | null;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
export namespace Logprob {
|
|
294
|
+
/**
|
|
295
|
+
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
296
|
+
* response.
|
|
297
|
+
*/
|
|
298
|
+
export interface TopLogprob {
|
|
299
|
+
/**
|
|
300
|
+
* The token.
|
|
301
|
+
*/
|
|
302
|
+
token: string;
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* The log probability of the token.
|
|
306
|
+
*/
|
|
307
|
+
logprob: number;
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* The bytes for the token.
|
|
311
|
+
*/
|
|
312
|
+
bytes?: Array<number> | null;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
266
315
|
}
|
|
267
316
|
|
|
268
317
|
/**
|
|
@@ -428,6 +477,9 @@ export namespace ConversationCreateParams {
|
|
|
428
477
|
}
|
|
429
478
|
|
|
430
479
|
export interface ConversationUpdateParams {
|
|
480
|
+
/**
|
|
481
|
+
* Set of key-value pairs that can be attached to an object.
|
|
482
|
+
*/
|
|
431
483
|
metadata: { [key: string]: string };
|
|
432
484
|
}
|
|
433
485
|
|