@ai-sdk/anthropic 4.0.32 → 4.0.34
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 +14 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +759 -192
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +804 -121
- package/dist/internal/index.js.map +1 -1
- package/docs/05-anthropic.mdx +51 -0
- package/package.json +3 -3
- package/src/anthropic-language-model.ts +4 -4
- package/src/anthropic-messages-batch.ts +756 -0
- package/src/anthropic-provider.ts +7 -7
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
InvalidArgumentError,
|
|
3
3
|
NoSuchModelError,
|
|
4
|
+
type Experimental_BatchLanguageModelV4 as BatchLanguageModelV4,
|
|
4
5
|
type FilesV4,
|
|
5
|
-
type LanguageModelV4,
|
|
6
6
|
type ProviderV4,
|
|
7
7
|
type SkillsV4,
|
|
8
8
|
} from '@ai-sdk/provider';
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
type FetchFunction,
|
|
17
17
|
} from '@ai-sdk/provider-utils';
|
|
18
18
|
import { AnthropicFiles } from './anthropic-files';
|
|
19
|
-
import {
|
|
19
|
+
import { AnthropicMessagesBatchLanguageModel } from './anthropic-messages-batch';
|
|
20
20
|
import type { AnthropicModelId } from './anthropic-language-model-options';
|
|
21
21
|
import { anthropicTools } from './anthropic-tools';
|
|
22
22
|
import { AnthropicSkills } from './skills/anthropic-skills';
|
|
@@ -39,16 +39,16 @@ export interface AnthropicProvider extends ProviderV4 {
|
|
|
39
39
|
/**
|
|
40
40
|
* Creates a model for text generation.
|
|
41
41
|
*/
|
|
42
|
-
(modelId: AnthropicModelId):
|
|
42
|
+
(modelId: AnthropicModelId): BatchLanguageModelV4;
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* Creates a model for text generation.
|
|
46
46
|
*/
|
|
47
|
-
languageModel(modelId: AnthropicModelId):
|
|
47
|
+
languageModel(modelId: AnthropicModelId): BatchLanguageModelV4;
|
|
48
48
|
|
|
49
|
-
chat(modelId: AnthropicModelId):
|
|
49
|
+
chat(modelId: AnthropicModelId): BatchLanguageModelV4;
|
|
50
50
|
|
|
51
|
-
messages(modelId: AnthropicModelId):
|
|
51
|
+
messages(modelId: AnthropicModelId): BatchLanguageModelV4;
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
54
|
* @deprecated Use `embeddingModel` instead.
|
|
@@ -156,7 +156,7 @@ export function createAnthropic(
|
|
|
156
156
|
};
|
|
157
157
|
|
|
158
158
|
const createChatModel = (modelId: AnthropicModelId) =>
|
|
159
|
-
new
|
|
159
|
+
new AnthropicMessagesBatchLanguageModel(modelId, {
|
|
160
160
|
provider: providerName,
|
|
161
161
|
baseURL,
|
|
162
162
|
headers: getHeaders,
|