@wabot-dev/framework 0.1.0-beta.13 → 0.1.0-beta.14
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/dist/src/ai/claude/ClaudeChatBotAdapter.js +1 -3
- package/package.json +1 -1
- package/dist/src/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.js +0 -221
- package/dist/src/node_modules/@anthropic-ai/sdk/client.js +0 -540
- package/dist/src/node_modules/@anthropic-ai/sdk/core/api-promise.js +0 -74
- package/dist/src/node_modules/@anthropic-ai/sdk/core/error.js +0 -100
- package/dist/src/node_modules/@anthropic-ai/sdk/core/pagination.js +0 -119
- package/dist/src/node_modules/@anthropic-ai/sdk/core/resource.js +0 -8
- package/dist/src/node_modules/@anthropic-ai/sdk/core/streaming.js +0 -283
- package/dist/src/node_modules/@anthropic-ai/sdk/internal/constants.js +0 -16
- package/dist/src/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.js +0 -37
- package/dist/src/node_modules/@anthropic-ai/sdk/internal/decoders/line.js +0 -110
- package/dist/src/node_modules/@anthropic-ai/sdk/internal/detect-platform.js +0 -159
- package/dist/src/node_modules/@anthropic-ai/sdk/internal/errors.js +0 -37
- package/dist/src/node_modules/@anthropic-ai/sdk/internal/headers.js +0 -71
- package/dist/src/node_modules/@anthropic-ai/sdk/internal/parse.js +0 -53
- package/dist/src/node_modules/@anthropic-ai/sdk/internal/request-options.js +0 -11
- package/dist/src/node_modules/@anthropic-ai/sdk/internal/shims.js +0 -86
- package/dist/src/node_modules/@anthropic-ai/sdk/internal/to-file.js +0 -94
- package/dist/src/node_modules/@anthropic-ai/sdk/internal/tslib.js +0 -14
- package/dist/src/node_modules/@anthropic-ai/sdk/internal/uploads.js +0 -113
- package/dist/src/node_modules/@anthropic-ai/sdk/internal/utils/bytes.js +0 -27
- package/dist/src/node_modules/@anthropic-ai/sdk/internal/utils/env.js +0 -19
- package/dist/src/node_modules/@anthropic-ai/sdk/internal/utils/log.js +0 -82
- package/dist/src/node_modules/@anthropic-ai/sdk/internal/utils/path.js +0 -76
- package/dist/src/node_modules/@anthropic-ai/sdk/internal/utils/sleep.js +0 -4
- package/dist/src/node_modules/@anthropic-ai/sdk/internal/utils/uuid.js +0 -16
- package/dist/src/node_modules/@anthropic-ai/sdk/internal/utils/values.js +0 -48
- package/dist/src/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.js +0 -588
- package/dist/src/node_modules/@anthropic-ai/sdk/lib/MessageStream.js +0 -582
- package/dist/src/node_modules/@anthropic-ai/sdk/resources/beta/beta.js +0 -19
- package/dist/src/node_modules/@anthropic-ai/sdk/resources/beta/files.js +0 -120
- package/dist/src/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.js +0 -202
- package/dist/src/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.js +0 -85
- package/dist/src/node_modules/@anthropic-ai/sdk/resources/beta/models.js +0 -58
- package/dist/src/node_modules/@anthropic-ai/sdk/resources/completions.js +0 -21
- package/dist/src/node_modules/@anthropic-ai/sdk/resources/messages/batches.js +0 -151
- package/dist/src/node_modules/@anthropic-ai/sdk/resources/messages/messages.js +0 -71
- package/dist/src/node_modules/@anthropic-ai/sdk/resources/models.js +0 -43
- package/dist/src/node_modules/@anthropic-ai/sdk/version.js +0 -3
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { APIResource } from '../../core/resource.js';
|
|
2
|
-
import { MessageStream } from '../../lib/MessageStream.js';
|
|
3
|
-
import { Batches } from './batches.js';
|
|
4
|
-
import { MODEL_NONSTREAMING_TOKENS } from '../../internal/constants.js';
|
|
5
|
-
|
|
6
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
7
|
-
class Messages extends APIResource {
|
|
8
|
-
constructor() {
|
|
9
|
-
super(...arguments);
|
|
10
|
-
this.batches = new Batches(this._client);
|
|
11
|
-
}
|
|
12
|
-
create(body, options) {
|
|
13
|
-
if (body.model in DEPRECATED_MODELS) {
|
|
14
|
-
console.warn(`The model '${body.model}' is deprecated and will reach end-of-life on ${DEPRECATED_MODELS[body.model]}\nPlease migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);
|
|
15
|
-
}
|
|
16
|
-
let timeout = this._client._options.timeout;
|
|
17
|
-
if (!body.stream && timeout == null) {
|
|
18
|
-
const maxNonstreamingTokens = MODEL_NONSTREAMING_TOKENS[body.model] ?? undefined;
|
|
19
|
-
timeout = this._client.calculateNonstreamingTimeout(body.max_tokens, maxNonstreamingTokens);
|
|
20
|
-
}
|
|
21
|
-
return this._client.post('/v1/messages', {
|
|
22
|
-
body,
|
|
23
|
-
timeout: timeout ?? 600000,
|
|
24
|
-
...options,
|
|
25
|
-
stream: body.stream ?? false,
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Create a Message stream
|
|
30
|
-
*/
|
|
31
|
-
stream(body, options) {
|
|
32
|
-
return MessageStream.createMessage(this, body, options);
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Count the number of tokens in a Message.
|
|
36
|
-
*
|
|
37
|
-
* The Token Count API can be used to count the number of tokens in a Message,
|
|
38
|
-
* including tools, images, and documents, without creating it.
|
|
39
|
-
*
|
|
40
|
-
* Learn more about token counting in our
|
|
41
|
-
* [user guide](/en/docs/build-with-claude/token-counting)
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* ```ts
|
|
45
|
-
* const messageTokensCount =
|
|
46
|
-
* await client.messages.countTokens({
|
|
47
|
-
* messages: [{ content: 'string', role: 'user' }],
|
|
48
|
-
* model: 'claude-3-7-sonnet-latest',
|
|
49
|
-
* });
|
|
50
|
-
* ```
|
|
51
|
-
*/
|
|
52
|
-
countTokens(body, options) {
|
|
53
|
-
return this._client.post('/v1/messages/count_tokens', { body, ...options });
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
const DEPRECATED_MODELS = {
|
|
57
|
-
'claude-1.3': 'November 6th, 2024',
|
|
58
|
-
'claude-1.3-100k': 'November 6th, 2024',
|
|
59
|
-
'claude-instant-1.1': 'November 6th, 2024',
|
|
60
|
-
'claude-instant-1.1-100k': 'November 6th, 2024',
|
|
61
|
-
'claude-instant-1.2': 'November 6th, 2024',
|
|
62
|
-
'claude-3-sonnet-20240229': 'July 21st, 2025',
|
|
63
|
-
'claude-3-opus-20240229': 'January 5th, 2026',
|
|
64
|
-
'claude-2.1': 'July 21st, 2025',
|
|
65
|
-
'claude-2.0': 'July 21st, 2025',
|
|
66
|
-
'claude-3-5-sonnet-20241022': 'October 22, 2025',
|
|
67
|
-
'claude-3-5-sonnet-20240620': 'October 22, 2025',
|
|
68
|
-
};
|
|
69
|
-
Messages.Batches = Batches;
|
|
70
|
-
|
|
71
|
-
export { Messages };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { APIResource } from '../core/resource.js';
|
|
2
|
-
import { Page } from '../core/pagination.js';
|
|
3
|
-
import { buildHeaders } from '../internal/headers.js';
|
|
4
|
-
import { path } from '../internal/utils/path.js';
|
|
5
|
-
|
|
6
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
7
|
-
class Models extends APIResource {
|
|
8
|
-
/**
|
|
9
|
-
* Get a specific model.
|
|
10
|
-
*
|
|
11
|
-
* The Models API response can be used to determine information about a specific
|
|
12
|
-
* model or resolve a model alias to a model ID.
|
|
13
|
-
*/
|
|
14
|
-
retrieve(modelID, params = {}, options) {
|
|
15
|
-
const { betas } = params ?? {};
|
|
16
|
-
return this._client.get(path `/v1/models/${modelID}`, {
|
|
17
|
-
...options,
|
|
18
|
-
headers: buildHeaders([
|
|
19
|
-
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
20
|
-
options?.headers,
|
|
21
|
-
]),
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* List available models.
|
|
26
|
-
*
|
|
27
|
-
* The Models API response can be used to determine which models are available for
|
|
28
|
-
* use in the API. More recently released models are listed first.
|
|
29
|
-
*/
|
|
30
|
-
list(params = {}, options) {
|
|
31
|
-
const { betas, ...query } = params ?? {};
|
|
32
|
-
return this._client.getAPIList('/v1/models', (Page), {
|
|
33
|
-
query,
|
|
34
|
-
...options,
|
|
35
|
-
headers: buildHeaders([
|
|
36
|
-
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
37
|
-
options?.headers,
|
|
38
|
-
]),
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export { Models };
|