@anthropic-ai/sdk 0.5.9 → 0.6.0
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/CHANGELOG.md +46 -0
- package/README.md +56 -22
- package/_shims/ReadableStream.d.ts +38 -0
- package/_shims/ReadableStream.js +5 -0
- package/_shims/ReadableStream.mjs +7 -0
- package/_shims/ReadableStream.node.d.ts +6 -0
- package/_shims/ReadableStream.node.d.ts.map +1 -0
- package/_shims/ReadableStream.node.js +14 -0
- package/_shims/ReadableStream.node.js.map +1 -0
- package/_shims/ReadableStream.node.mjs +3 -0
- package/_shims/ReadableStream.node.mjs.map +1 -0
- package/_shims/fetch.d.ts +8 -1
- package/_shims/fetch.node.d.ts +11 -1
- package/core.d.ts +77 -28
- package/core.d.ts.map +1 -1
- package/core.js +181 -62
- package/core.js.map +1 -1
- package/core.mjs +175 -62
- package/core.mjs.map +1 -1
- package/index.d.mts +2 -0
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -1
- package/index.js.map +1 -1
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/completions.d.ts +115 -191
- package/resources/completions.d.ts.map +1 -1
- package/resources/completions.js.map +1 -1
- package/resources/completions.mjs.map +1 -1
- package/resources/index.d.ts +8 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/src/_shims/ReadableStream.d.ts +38 -0
- package/src/_shims/ReadableStream.js +5 -0
- package/src/_shims/ReadableStream.mjs +7 -0
- package/src/_shims/ReadableStream.node.ts +6 -0
- package/src/_shims/fetch.d.ts +8 -1
- package/src/_shims/fetch.deno.ts +23 -0
- package/src/_shims/fetch.node.d.ts +11 -1
- package/src/_shims/formdata.deno.ts +16 -0
- package/src/core.ts +247 -85
- package/src/index.ts +2 -0
- package/src/resources/completions.ts +121 -203
- package/src/resources/index.ts +8 -1
- package/src/streaming.ts +9 -15
- package/src/uploads.ts +7 -6
- package/src/version.ts +1 -1
- package/streaming.d.ts +3 -7
- package/streaming.d.ts.map +1 -1
- package/streaming.js +8 -5
- package/streaming.js.map +1 -1
- package/streaming.mjs +7 -4
- package/streaming.mjs.map +1 -1
- package/uploads.d.ts +5 -4
- package/uploads.d.ts.map +1 -1
- package/uploads.js +2 -2
- package/uploads.js.map +1 -1
- package/uploads.mjs +2 -2
- package/uploads.mjs.map +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as Core from '@anthropic-ai/sdk/core';
|
|
2
|
+
import { APIPromise } from '@anthropic-ai/sdk/core';
|
|
2
3
|
import { APIResource } from '@anthropic-ai/sdk/resource';
|
|
3
4
|
import * as API from './index.js';
|
|
4
5
|
import { Stream } from '@anthropic-ai/sdk/streaming';
|
|
@@ -6,14 +7,11 @@ export declare class Completions extends APIResource {
|
|
|
6
7
|
/**
|
|
7
8
|
* Create a completion
|
|
8
9
|
*/
|
|
10
|
+
create(body: CompletionCreateParamsNonStreaming, options?: Core.RequestOptions): APIPromise<Completion>;
|
|
9
11
|
create(
|
|
10
|
-
body:
|
|
12
|
+
body: CompletionCreateParamsStreaming,
|
|
11
13
|
options?: Core.RequestOptions,
|
|
12
|
-
):
|
|
13
|
-
create(
|
|
14
|
-
body: CompletionCreateParams.CompletionRequestStreaming,
|
|
15
|
-
options?: Core.RequestOptions,
|
|
16
|
-
): Promise<Core.APIResponse<Stream<Completion>>>;
|
|
14
|
+
): APIPromise<Stream<Completion>>;
|
|
17
15
|
}
|
|
18
16
|
export interface Completion {
|
|
19
17
|
/**
|
|
@@ -35,199 +33,125 @@ export interface Completion {
|
|
|
35
33
|
*/
|
|
36
34
|
stop_reason: string;
|
|
37
35
|
}
|
|
38
|
-
export
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
export interface CompletionCreateParams {
|
|
37
|
+
/**
|
|
38
|
+
* The maximum number of tokens to generate before stopping.
|
|
39
|
+
*
|
|
40
|
+
* Note that our models may stop _before_ reaching this maximum. This parameter
|
|
41
|
+
* only specifies the absolute maximum number of tokens to generate.
|
|
42
|
+
*/
|
|
43
|
+
max_tokens_to_sample: number;
|
|
44
|
+
/**
|
|
45
|
+
* The model that will complete your prompt.
|
|
46
|
+
*
|
|
47
|
+
* As we improve Claude, we develop new versions of it that you can query. This
|
|
48
|
+
* parameter controls which version of Claude answers your request. Right now we
|
|
49
|
+
* are offering two model families: Claude, and Claude Instant. You can use them by
|
|
50
|
+
* setting `model` to `"claude-2"` or `"claude-instant-1"`, respectively. See
|
|
51
|
+
* [models](https://docs.anthropic.com/claude/reference/selecting-a-model) for
|
|
52
|
+
* additional details.
|
|
53
|
+
*/
|
|
54
|
+
model: (string & {}) | 'claude-2' | 'claude-instant-1';
|
|
55
|
+
/**
|
|
56
|
+
* The prompt that you want Claude to complete.
|
|
57
|
+
*
|
|
58
|
+
* For proper response generation you will need to format your prompt as follows:
|
|
59
|
+
*
|
|
60
|
+
* ```javascript
|
|
61
|
+
* const userQuestion = r"Why is the sky blue?";
|
|
62
|
+
* const prompt = `\n\nHuman: ${userQuestion}\n\nAssistant:`;
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* See our
|
|
66
|
+
* [comments on prompts](https://docs.anthropic.com/claude/docs/introduction-to-prompt-design)
|
|
67
|
+
* for more context.
|
|
68
|
+
*/
|
|
69
|
+
prompt: string;
|
|
70
|
+
/**
|
|
71
|
+
* An object describing metadata about the request.
|
|
72
|
+
*/
|
|
73
|
+
metadata?: CompletionCreateParams.Metadata;
|
|
74
|
+
/**
|
|
75
|
+
* Sequences that will cause the model to stop generating completion text.
|
|
76
|
+
*
|
|
77
|
+
* Our models stop on `"\n\nHuman:"`, and may include additional built-in stop
|
|
78
|
+
* sequences in the future. By providing the stop_sequences parameter, you may
|
|
79
|
+
* include additional strings that will cause the model to stop generating.
|
|
80
|
+
*/
|
|
81
|
+
stop_sequences?: Array<string>;
|
|
82
|
+
/**
|
|
83
|
+
* Whether to incrementally stream the response using server-sent events.
|
|
84
|
+
*
|
|
85
|
+
* See
|
|
86
|
+
* [this guide to SSE events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events)
|
|
87
|
+
* for details.
|
|
88
|
+
*/
|
|
89
|
+
stream?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Amount of randomness injected into the response.
|
|
92
|
+
*
|
|
93
|
+
* Defaults to 1. Ranges from 0 to 1. Use temp closer to 0 for analytical /
|
|
94
|
+
* multiple choice, and closer to 1 for creative and generative tasks.
|
|
95
|
+
*/
|
|
96
|
+
temperature?: number;
|
|
97
|
+
/**
|
|
98
|
+
* Only sample from the top K options for each subsequent token.
|
|
99
|
+
*
|
|
100
|
+
* Used to remove "long tail" low probability responses.
|
|
101
|
+
* [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
|
|
102
|
+
*/
|
|
103
|
+
top_k?: number;
|
|
104
|
+
/**
|
|
105
|
+
* Use nucleus sampling.
|
|
106
|
+
*
|
|
107
|
+
* In nucleus sampling, we compute the cumulative distribution over all the options
|
|
108
|
+
* for each subsequent token in decreasing probability order and cut it off once it
|
|
109
|
+
* reaches a particular probability specified by `top_p`. You should either alter
|
|
110
|
+
* `temperature` or `top_p`, but not both.
|
|
111
|
+
*/
|
|
112
|
+
top_p?: number;
|
|
113
|
+
}
|
|
41
114
|
export declare namespace CompletionCreateParams {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
* Note that our models may stop _before_ reaching this maximum. This parameter
|
|
47
|
-
* only specifies the absolute maximum number of tokens to generate.
|
|
48
|
-
*/
|
|
49
|
-
max_tokens_to_sample: number;
|
|
50
|
-
/**
|
|
51
|
-
* The model that will complete your prompt.
|
|
52
|
-
*
|
|
53
|
-
* As we improve Claude, we develop new versions of it that you can query. This
|
|
54
|
-
* parameter controls which version of Claude answers your request. Right now we
|
|
55
|
-
* are offering two model families: Claude, and Claude Instant. You can use them by
|
|
56
|
-
* setting `model` to `"claude-2"` or `"claude-instant-1"`, respectively. See
|
|
57
|
-
* [models](https://docs.anthropic.com/claude/reference/selecting-a-model) for
|
|
58
|
-
* additional details.
|
|
59
|
-
*/
|
|
60
|
-
model: (string & {}) | 'claude-2' | 'claude-instant-1';
|
|
61
|
-
/**
|
|
62
|
-
* The prompt that you want Claude to complete.
|
|
63
|
-
*
|
|
64
|
-
* For proper response generation you will need to format your prompt as follows:
|
|
65
|
-
*
|
|
66
|
-
* ```javascript
|
|
67
|
-
* const userQuestion = r"Why is the sky blue?";
|
|
68
|
-
* const prompt = `\n\nHuman: ${userQuestion}\n\nAssistant:`;
|
|
69
|
-
* ```
|
|
70
|
-
*
|
|
71
|
-
* See our
|
|
72
|
-
* [comments on prompts](https://docs.anthropic.com/claude/docs/introduction-to-prompt-design)
|
|
73
|
-
* for more context.
|
|
74
|
-
*/
|
|
75
|
-
prompt: string;
|
|
76
|
-
/**
|
|
77
|
-
* An object describing metadata about the request.
|
|
78
|
-
*/
|
|
79
|
-
metadata?: CompletionCreateParams.CompletionRequestNonStreaming.Metadata;
|
|
80
|
-
/**
|
|
81
|
-
* Sequences that will cause the model to stop generating completion text.
|
|
82
|
-
*
|
|
83
|
-
* Our models stop on `"\n\nHuman:"`, and may include additional built-in stop
|
|
84
|
-
* sequences in the future. By providing the stop_sequences parameter, you may
|
|
85
|
-
* include additional strings that will cause the model to stop generating.
|
|
86
|
-
*/
|
|
87
|
-
stop_sequences?: Array<string>;
|
|
88
|
-
/**
|
|
89
|
-
* Whether to incrementally stream the response using server-sent events.
|
|
90
|
-
*
|
|
91
|
-
* See
|
|
92
|
-
* [this guide to SSE events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events)
|
|
93
|
-
* for details.
|
|
94
|
-
*/
|
|
95
|
-
stream?: false;
|
|
96
|
-
/**
|
|
97
|
-
* Amount of randomness injected into the response.
|
|
98
|
-
*
|
|
99
|
-
* Defaults to 1. Ranges from 0 to 1. Use temp closer to 0 for analytical /
|
|
100
|
-
* multiple choice, and closer to 1 for creative and generative tasks.
|
|
101
|
-
*/
|
|
102
|
-
temperature?: number;
|
|
103
|
-
/**
|
|
104
|
-
* Only sample from the top K options for each subsequent token.
|
|
105
|
-
*
|
|
106
|
-
* Used to remove "long tail" low probability responses.
|
|
107
|
-
* [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
|
|
108
|
-
*/
|
|
109
|
-
top_k?: number;
|
|
110
|
-
/**
|
|
111
|
-
* Use nucleus sampling.
|
|
112
|
-
*
|
|
113
|
-
* In nucleus sampling, we compute the cumulative distribution over all the options
|
|
114
|
-
* for each subsequent token in decreasing probability order and cut it off once it
|
|
115
|
-
* reaches a particular probability specified by `top_p`. You should either alter
|
|
116
|
-
* `temperature` or `top_p`, but not both.
|
|
117
|
-
*/
|
|
118
|
-
top_p?: number;
|
|
119
|
-
}
|
|
120
|
-
namespace CompletionRequestNonStreaming {
|
|
121
|
-
/**
|
|
122
|
-
* An object describing metadata about the request.
|
|
123
|
-
*/
|
|
124
|
-
interface Metadata {
|
|
125
|
-
/**
|
|
126
|
-
* An external identifier for the user who is associated with the request.
|
|
127
|
-
*
|
|
128
|
-
* This should be a uuid, hash value, or other opaque identifier. Anthropic may use
|
|
129
|
-
* this id to help detect abuse. Do not include any identifying information such as
|
|
130
|
-
* name, email address, or phone number.
|
|
131
|
-
*/
|
|
132
|
-
user_id?: string;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
interface CompletionRequestStreaming {
|
|
136
|
-
/**
|
|
137
|
-
* The maximum number of tokens to generate before stopping.
|
|
138
|
-
*
|
|
139
|
-
* Note that our models may stop _before_ reaching this maximum. This parameter
|
|
140
|
-
* only specifies the absolute maximum number of tokens to generate.
|
|
141
|
-
*/
|
|
142
|
-
max_tokens_to_sample: number;
|
|
143
|
-
/**
|
|
144
|
-
* The model that will complete your prompt.
|
|
145
|
-
*
|
|
146
|
-
* As we improve Claude, we develop new versions of it that you can query. This
|
|
147
|
-
* parameter controls which version of Claude answers your request. Right now we
|
|
148
|
-
* are offering two model families: Claude, and Claude Instant. You can use them by
|
|
149
|
-
* setting `model` to `"claude-2"` or `"claude-instant-1"`, respectively. See
|
|
150
|
-
* [models](https://docs.anthropic.com/claude/reference/selecting-a-model) for
|
|
151
|
-
* additional details.
|
|
152
|
-
*/
|
|
153
|
-
model: (string & {}) | 'claude-2' | 'claude-instant-1';
|
|
154
|
-
/**
|
|
155
|
-
* The prompt that you want Claude to complete.
|
|
156
|
-
*
|
|
157
|
-
* For proper response generation you will need to format your prompt as follows:
|
|
158
|
-
*
|
|
159
|
-
* ```javascript
|
|
160
|
-
* const userQuestion = r"Why is the sky blue?";
|
|
161
|
-
* const prompt = `\n\nHuman: ${userQuestion}\n\nAssistant:`;
|
|
162
|
-
* ```
|
|
163
|
-
*
|
|
164
|
-
* See our
|
|
165
|
-
* [comments on prompts](https://docs.anthropic.com/claude/docs/introduction-to-prompt-design)
|
|
166
|
-
* for more context.
|
|
167
|
-
*/
|
|
168
|
-
prompt: string;
|
|
169
|
-
/**
|
|
170
|
-
* Whether to incrementally stream the response using server-sent events.
|
|
171
|
-
*
|
|
172
|
-
* See
|
|
173
|
-
* [this guide to SSE events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events)
|
|
174
|
-
* for details.
|
|
175
|
-
*/
|
|
176
|
-
stream: true;
|
|
177
|
-
/**
|
|
178
|
-
* An object describing metadata about the request.
|
|
179
|
-
*/
|
|
180
|
-
metadata?: CompletionCreateParams.CompletionRequestStreaming.Metadata;
|
|
181
|
-
/**
|
|
182
|
-
* Sequences that will cause the model to stop generating completion text.
|
|
183
|
-
*
|
|
184
|
-
* Our models stop on `"\n\nHuman:"`, and may include additional built-in stop
|
|
185
|
-
* sequences in the future. By providing the stop_sequences parameter, you may
|
|
186
|
-
* include additional strings that will cause the model to stop generating.
|
|
187
|
-
*/
|
|
188
|
-
stop_sequences?: Array<string>;
|
|
189
|
-
/**
|
|
190
|
-
* Amount of randomness injected into the response.
|
|
191
|
-
*
|
|
192
|
-
* Defaults to 1. Ranges from 0 to 1. Use temp closer to 0 for analytical /
|
|
193
|
-
* multiple choice, and closer to 1 for creative and generative tasks.
|
|
194
|
-
*/
|
|
195
|
-
temperature?: number;
|
|
196
|
-
/**
|
|
197
|
-
* Only sample from the top K options for each subsequent token.
|
|
198
|
-
*
|
|
199
|
-
* Used to remove "long tail" low probability responses.
|
|
200
|
-
* [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
|
|
201
|
-
*/
|
|
202
|
-
top_k?: number;
|
|
115
|
+
/**
|
|
116
|
+
* An object describing metadata about the request.
|
|
117
|
+
*/
|
|
118
|
+
interface Metadata {
|
|
203
119
|
/**
|
|
204
|
-
*
|
|
120
|
+
* An external identifier for the user who is associated with the request.
|
|
205
121
|
*
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
* `temperature` or `top_p`, but not both.
|
|
210
|
-
*/
|
|
211
|
-
top_p?: number;
|
|
212
|
-
}
|
|
213
|
-
namespace CompletionRequestStreaming {
|
|
214
|
-
/**
|
|
215
|
-
* An object describing metadata about the request.
|
|
122
|
+
* This should be a uuid, hash value, or other opaque identifier. Anthropic may use
|
|
123
|
+
* this id to help detect abuse. Do not include any identifying information such as
|
|
124
|
+
* name, email address, or phone number.
|
|
216
125
|
*/
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* An external identifier for the user who is associated with the request.
|
|
220
|
-
*
|
|
221
|
-
* This should be a uuid, hash value, or other opaque identifier. Anthropic may use
|
|
222
|
-
* this id to help detect abuse. Do not include any identifying information such as
|
|
223
|
-
* name, email address, or phone number.
|
|
224
|
-
*/
|
|
225
|
-
user_id?: string;
|
|
226
|
-
}
|
|
126
|
+
user_id?: string;
|
|
227
127
|
}
|
|
128
|
+
type CompletionCreateParamsNonStreaming = API.CompletionCreateParamsNonStreaming;
|
|
129
|
+
type CompletionCreateParamsStreaming = API.CompletionCreateParamsStreaming;
|
|
130
|
+
}
|
|
131
|
+
export interface CompletionCreateParamsNonStreaming extends CompletionCreateParams {
|
|
132
|
+
/**
|
|
133
|
+
* Whether to incrementally stream the response using server-sent events.
|
|
134
|
+
*
|
|
135
|
+
* See
|
|
136
|
+
* [this guide to SSE events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events)
|
|
137
|
+
* for details.
|
|
138
|
+
*/
|
|
139
|
+
stream?: false;
|
|
140
|
+
}
|
|
141
|
+
export interface CompletionCreateParamsStreaming extends CompletionCreateParams {
|
|
142
|
+
/**
|
|
143
|
+
* Whether to incrementally stream the response using server-sent events.
|
|
144
|
+
*
|
|
145
|
+
* See
|
|
146
|
+
* [this guide to SSE events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events)
|
|
147
|
+
* for details.
|
|
148
|
+
*/
|
|
149
|
+
stream: true;
|
|
228
150
|
}
|
|
229
151
|
export declare namespace Completions {
|
|
230
152
|
export import Completion = API.Completion;
|
|
231
153
|
export import CompletionCreateParams = API.CompletionCreateParams;
|
|
154
|
+
export import CompletionCreateParamsNonStreaming = API.CompletionCreateParamsNonStreaming;
|
|
155
|
+
export import CompletionCreateParamsStreaming = API.CompletionCreateParamsStreaming;
|
|
232
156
|
}
|
|
233
157
|
//# sourceMappingURL=completions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"completions.d.ts","sourceRoot":"","sources":["../src/resources/completions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"completions.d.ts","sourceRoot":"","sources":["../src/resources/completions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,GAAG,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAErD,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,kCAAkC,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC;IACvG,MAAM,CACJ,IAAI,EAAE,+BAA+B,EACrC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;CASlC;AAED,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;;;;OAQG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,sBAAsB;IACrC;;;;;OAKG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAE7B;;;;;;;;;OASG;IACH,KAAK,EAAE,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,UAAU,GAAG,kBAAkB,CAAC;IAEvD;;;;;;;;;;;;;OAaG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,QAAQ,CAAC,EAAE,sBAAsB,CAAC,QAAQ,CAAC;IAE3C;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAE/B;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,yBAAiB,sBAAsB,CAAC;IACtC;;OAEG;IACH,UAAiB,QAAQ;QACvB;;;;;;WAMG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB;IAED,KAAY,kCAAkC,GAAG,GAAG,CAAC,kCAAkC,CAAC;IACxF,KAAY,+BAA+B,GAAG,GAAG,CAAC,+BAA+B,CAAC;CACnF;AAED,MAAM,WAAW,kCAAmC,SAAQ,sBAAsB;IAChF;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC;CAChB;AAED,MAAM,WAAW,+BAAgC,SAAQ,sBAAsB;IAC7E;;;;;;OAMG;IACH,MAAM,EAAE,IAAI,CAAC;CACd;AAED,yBAAiB,WAAW,CAAC;IAC3B,MAAM,QAAQ,UAAU,GAAG,GAAG,CAAC,UAAU,CAAC;IAC1C,MAAM,QAAQ,sBAAsB,GAAG,GAAG,CAAC,sBAAsB,CAAC;IAClE,MAAM,QAAQ,kCAAkC,GAAG,GAAG,CAAC,kCAAkC,CAAC;IAC1F,MAAM,QAAQ,+BAA+B,GAAG,GAAG,CAAC,+BAA+B,CAAC;CACrF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"completions.js","sourceRoot":"","sources":["../src/resources/completions.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;
|
|
1
|
+
{"version":3,"file":"completions.js","sourceRoot":"","sources":["../src/resources/completions.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;AAIrD,yDAAyD;AAIzD,MAAa,WAAY,SAAQ,sBAAW;IAS1C,MAAM,CACJ,IAA4B,EAC5B,OAA6B;;QAE7B,OAAO,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,MAAA,IAAI,CAAC,MAAM,mCAAI,KAAK,EAAE,CAElE,CAAC;IACrC,CAAC;CACF;AAjBD,kCAiBC;AAyJD,WAAiB,WAAW;AAK5B,CAAC,EALgB,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAK3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"completions.mjs","sourceRoot":"","sources":["../src/resources/completions.ts"],"names":[],"mappings":"AAAA,qDAAqD;
|
|
1
|
+
{"version":3,"file":"completions.mjs","sourceRoot":"","sources":["../src/resources/completions.ts"],"names":[],"mappings":"AAAA,qDAAqD;OAI9C,EAAE,WAAW,EAAE,MAAM,4BAA4B;AAIxD,MAAM,OAAO,WAAY,SAAQ,WAAW;IAS1C,MAAM,CACJ,IAA4B,EAC5B,OAA6B;;QAE7B,OAAO,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,MAAA,IAAI,CAAC,MAAM,mCAAI,KAAK,EAAE,CAElE,CAAC;IACrC,CAAC;CACF;AAyJD,WAAiB,WAAW;AAK5B,CAAC,EALgB,WAAW,KAAX,WAAW,QAK3B"}
|
package/resources/index.d.ts
CHANGED
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {} from './top-level.js';
|
|
2
|
+
export {
|
|
3
|
+
Completion,
|
|
4
|
+
CompletionCreateParams,
|
|
5
|
+
CompletionCreateParamsNonStreaming,
|
|
6
|
+
CompletionCreateParamsStreaming,
|
|
7
|
+
Completions,
|
|
8
|
+
} from './completions.js';
|
|
2
9
|
//# sourceMappingURL=index.d.ts.map
|
package/resources/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,EACL,UAAU,EACV,sBAAsB,EACtB,kCAAkC,EAClC,+BAA+B,EAC/B,WAAW,GACZ,MAAM,eAAe,CAAC"}
|
package/resources/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;AAGrD,gDAMuB;AADrB,0GAAA,WAAW,OAAA"}
|
package/resources/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;OAG9C,EAKL,WAAW,GACZ"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* >>> Confused? <<<
|
|
7
|
+
*
|
|
8
|
+
* If you're getting errors from these types, try adding "lib": ["DOM"]
|
|
9
|
+
* to your tsconfig.json, or otherwise configure the appropriate builtin
|
|
10
|
+
* `ReadableStream` type for your environment.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
type _ReadableStream<R = any> = unknown extends ReadableStream ? never : ReadableStream<R>;
|
|
15
|
+
declare const _ReadableStream: {
|
|
16
|
+
prototype: _ReadableStream;
|
|
17
|
+
new (
|
|
18
|
+
underlyingSource: _UnderlyingByteSource,
|
|
19
|
+
strategy?: { highWaterMark?: number },
|
|
20
|
+
): _ReadableStream<Uint8Array>;
|
|
21
|
+
new <R = any>(
|
|
22
|
+
underlyingSource: _UnderlyingDefaultSource<R>,
|
|
23
|
+
strategy?: _QueuingStrategy<R>,
|
|
24
|
+
): _ReadableStream<R>;
|
|
25
|
+
new <R = any>(underlyingSource?: _UnderlyingSource<R>, strategy?: _QueuingStrategy<R>): _ReadableStream<R>;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// @ts-ignore
|
|
29
|
+
type _UnderlyingSource<R = any> = unknown extends UnderlyingSource ? never : UnderlyingSource<R>;
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
type _UnderlyingByteSource = unknown extends UnderlyingByteSource ? never : UnderlyingByteSource;
|
|
32
|
+
type _UnderlyingDefaultSource<R = any> =
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
unknown extends UnderlyingDefaultSource ? never : UnderlyingDefaultSource<R>;
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
type _QueuingStrategy<R = any> = unknown extends QueuingStrategy ? never : QueuingStrategy<R>;
|
|
37
|
+
|
|
38
|
+
export { _ReadableStream as ReadableStream };
|
package/src/_shims/fetch.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ type _Response = unknown extends Response ? never : Response;
|
|
|
26
26
|
// @ts-ignore
|
|
27
27
|
type _ResponseInit = unknown extends ResponseInit ? never : ResponseInit;
|
|
28
28
|
// @ts-ignore
|
|
29
|
+
type _ResponseType = unknown extends ResponseType ? never : ResponseType;
|
|
30
|
+
// @ts-ignore
|
|
29
31
|
type _BodyInit = unknown extends BodyInit ? never : BodyInit;
|
|
30
32
|
// @ts-ignore
|
|
31
33
|
type _Headers = unknown extends Headers ? never : Headers;
|
|
@@ -49,4 +51,9 @@ declare const _Headers: {
|
|
|
49
51
|
export const isPolyfilled = false;
|
|
50
52
|
|
|
51
53
|
export { _fetch as fetch, _Request as Request, _Response as Response, _Headers as Headers };
|
|
52
|
-
export type {
|
|
54
|
+
export type {
|
|
55
|
+
_RequestInit as RequestInit,
|
|
56
|
+
_RequestInfo as RequestInfo,
|
|
57
|
+
_ResponseType as ResponseType,
|
|
58
|
+
_BodyInit as BodyInit,
|
|
59
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const _fetch = fetch;
|
|
2
|
+
const _Request = Request;
|
|
3
|
+
type _RequestInfo = RequestInfo;
|
|
4
|
+
type _RequestInit = RequestInit;
|
|
5
|
+
const _Response = Response;
|
|
6
|
+
type _ResponseInit = ResponseInit;
|
|
7
|
+
type _BodyInit = BodyInit;
|
|
8
|
+
const _Headers = Headers;
|
|
9
|
+
type _HeadersInit = HeadersInit;
|
|
10
|
+
|
|
11
|
+
export const isPolyfilled = false;
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
_fetch as fetch,
|
|
15
|
+
_Request as Request,
|
|
16
|
+
type _RequestInfo as RequestInfo,
|
|
17
|
+
type _RequestInit as RequestInit,
|
|
18
|
+
_Response as Response,
|
|
19
|
+
type _ResponseInit as ResponseInit,
|
|
20
|
+
type _BodyInit as BodyInit,
|
|
21
|
+
_Headers as Headers,
|
|
22
|
+
type _HeadersInit as HeadersInit,
|
|
23
|
+
};
|
|
@@ -26,6 +26,11 @@ type _RequestInit = unknown extends RequestInit ? nf.RequestInit : RequestInit;
|
|
|
26
26
|
type _Response = unknown extends Response ? nf.Response : Response;
|
|
27
27
|
// @ts-ignore
|
|
28
28
|
type _ResponseInit = unknown extends ResponseInit ? nf.ResponseInit : ResponseInit;
|
|
29
|
+
type _ResponseType =
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
unknown extends ResponseType ? 'basic' | 'cors' | 'default' | 'error' | 'opaque' | 'opaqueredirect'
|
|
32
|
+
: // @ts-ignore
|
|
33
|
+
ResponseType;
|
|
29
34
|
// @ts-ignore
|
|
30
35
|
type _BodyInit = unknown extends BodyInit ? nf.BodyInit : BodyInit;
|
|
31
36
|
// @ts-ignore
|
|
@@ -50,4 +55,9 @@ declare const _Headers: {
|
|
|
50
55
|
export const isPolyfilled = false;
|
|
51
56
|
|
|
52
57
|
export { _fetch as fetch, _Request as Request, _Response as Response, _Headers as Headers };
|
|
53
|
-
export type {
|
|
58
|
+
export type {
|
|
59
|
+
_RequestInit as RequestInit,
|
|
60
|
+
_RequestInfo as RequestInfo,
|
|
61
|
+
_ResponseType as ResponseType,
|
|
62
|
+
_BodyInit as BodyInit,
|
|
63
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type _BlobPropertyBag = BlobPropertyBag;
|
|
2
|
+
type _FilePropertyBag = FilePropertyBag;
|
|
3
|
+
|
|
4
|
+
const _FormData = FormData;
|
|
5
|
+
const _File = File;
|
|
6
|
+
const _Blob = Blob;
|
|
7
|
+
|
|
8
|
+
export const isPolyfilled = false;
|
|
9
|
+
|
|
10
|
+
export {
|
|
11
|
+
_FormData as FormData,
|
|
12
|
+
_File as File,
|
|
13
|
+
_Blob as Blob,
|
|
14
|
+
type _BlobPropertyBag as BlobPropertyBag,
|
|
15
|
+
type _FilePropertyBag as FilePropertyBag,
|
|
16
|
+
};
|