@ai-sdk/anthropic 3.0.25 → 3.0.26
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 +6 -0
- package/dist/index.d.mts +20 -20
- package/dist/index.d.ts +20 -20
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/docs/05-anthropic.mdx +37 -9
- package/package.json +1 -1
- package/src/anthropic-provider.ts +20 -20
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -698,12 +698,12 @@ declare const anthropicTools: {
|
|
|
698
698
|
|
|
699
699
|
interface AnthropicProvider extends ProviderV3 {
|
|
700
700
|
/**
|
|
701
|
-
|
|
702
|
-
|
|
701
|
+
* Creates a model for text generation.
|
|
702
|
+
*/
|
|
703
703
|
(modelId: AnthropicMessagesModelId): LanguageModelV3;
|
|
704
704
|
/**
|
|
705
|
-
|
|
706
|
-
|
|
705
|
+
* Creates a model for text generation.
|
|
706
|
+
*/
|
|
707
707
|
languageModel(modelId: AnthropicMessagesModelId): LanguageModelV3;
|
|
708
708
|
chat(modelId: AnthropicMessagesModelId): LanguageModelV3;
|
|
709
709
|
messages(modelId: AnthropicMessagesModelId): LanguageModelV3;
|
|
@@ -712,36 +712,36 @@ interface AnthropicProvider extends ProviderV3 {
|
|
|
712
712
|
*/
|
|
713
713
|
textEmbeddingModel(modelId: string): never;
|
|
714
714
|
/**
|
|
715
|
-
|
|
715
|
+
* Anthropic-specific computer use tool.
|
|
716
716
|
*/
|
|
717
717
|
tools: typeof anthropicTools;
|
|
718
718
|
}
|
|
719
719
|
interface AnthropicProviderSettings {
|
|
720
720
|
/**
|
|
721
|
-
|
|
722
|
-
|
|
721
|
+
* Use a different URL prefix for API calls, e.g. to use proxy servers.
|
|
722
|
+
* The default prefix is `https://api.anthropic.com/v1`.
|
|
723
723
|
*/
|
|
724
724
|
baseURL?: string;
|
|
725
725
|
/**
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
726
|
+
* API key that is being send using the `x-api-key` header.
|
|
727
|
+
* It defaults to the `ANTHROPIC_API_KEY` environment variable.
|
|
728
|
+
* Only one of `apiKey` or `authToken` is required.
|
|
729
729
|
*/
|
|
730
730
|
apiKey?: string;
|
|
731
731
|
/**
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
732
|
+
* Auth token that is being sent using the `Authorization: Bearer` header.
|
|
733
|
+
* It defaults to the `ANTHROPIC_AUTH_TOKEN` environment variable.
|
|
734
|
+
* Only one of `apiKey` or `authToken` is required.
|
|
735
735
|
*/
|
|
736
736
|
authToken?: string;
|
|
737
737
|
/**
|
|
738
|
-
|
|
739
|
-
|
|
738
|
+
* Custom headers to include in the requests.
|
|
739
|
+
*/
|
|
740
740
|
headers?: Record<string, string>;
|
|
741
741
|
/**
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
742
|
+
* Custom fetch implementation. You can use it as a middleware to intercept requests,
|
|
743
|
+
* or to provide a custom fetch implementation for e.g. testing.
|
|
744
|
+
*/
|
|
745
745
|
fetch?: FetchFunction;
|
|
746
746
|
generateId?: () => string;
|
|
747
747
|
/**
|
|
@@ -751,11 +751,11 @@ interface AnthropicProviderSettings {
|
|
|
751
751
|
name?: string;
|
|
752
752
|
}
|
|
753
753
|
/**
|
|
754
|
-
Create an Anthropic provider instance.
|
|
754
|
+
* Create an Anthropic provider instance.
|
|
755
755
|
*/
|
|
756
756
|
declare function createAnthropic(options?: AnthropicProviderSettings): AnthropicProvider;
|
|
757
757
|
/**
|
|
758
|
-
Default Anthropic provider instance.
|
|
758
|
+
* Default Anthropic provider instance.
|
|
759
759
|
*/
|
|
760
760
|
declare const anthropic: AnthropicProvider;
|
|
761
761
|
|
package/dist/index.d.ts
CHANGED
|
@@ -698,12 +698,12 @@ declare const anthropicTools: {
|
|
|
698
698
|
|
|
699
699
|
interface AnthropicProvider extends ProviderV3 {
|
|
700
700
|
/**
|
|
701
|
-
|
|
702
|
-
|
|
701
|
+
* Creates a model for text generation.
|
|
702
|
+
*/
|
|
703
703
|
(modelId: AnthropicMessagesModelId): LanguageModelV3;
|
|
704
704
|
/**
|
|
705
|
-
|
|
706
|
-
|
|
705
|
+
* Creates a model for text generation.
|
|
706
|
+
*/
|
|
707
707
|
languageModel(modelId: AnthropicMessagesModelId): LanguageModelV3;
|
|
708
708
|
chat(modelId: AnthropicMessagesModelId): LanguageModelV3;
|
|
709
709
|
messages(modelId: AnthropicMessagesModelId): LanguageModelV3;
|
|
@@ -712,36 +712,36 @@ interface AnthropicProvider extends ProviderV3 {
|
|
|
712
712
|
*/
|
|
713
713
|
textEmbeddingModel(modelId: string): never;
|
|
714
714
|
/**
|
|
715
|
-
|
|
715
|
+
* Anthropic-specific computer use tool.
|
|
716
716
|
*/
|
|
717
717
|
tools: typeof anthropicTools;
|
|
718
718
|
}
|
|
719
719
|
interface AnthropicProviderSettings {
|
|
720
720
|
/**
|
|
721
|
-
|
|
722
|
-
|
|
721
|
+
* Use a different URL prefix for API calls, e.g. to use proxy servers.
|
|
722
|
+
* The default prefix is `https://api.anthropic.com/v1`.
|
|
723
723
|
*/
|
|
724
724
|
baseURL?: string;
|
|
725
725
|
/**
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
726
|
+
* API key that is being send using the `x-api-key` header.
|
|
727
|
+
* It defaults to the `ANTHROPIC_API_KEY` environment variable.
|
|
728
|
+
* Only one of `apiKey` or `authToken` is required.
|
|
729
729
|
*/
|
|
730
730
|
apiKey?: string;
|
|
731
731
|
/**
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
732
|
+
* Auth token that is being sent using the `Authorization: Bearer` header.
|
|
733
|
+
* It defaults to the `ANTHROPIC_AUTH_TOKEN` environment variable.
|
|
734
|
+
* Only one of `apiKey` or `authToken` is required.
|
|
735
735
|
*/
|
|
736
736
|
authToken?: string;
|
|
737
737
|
/**
|
|
738
|
-
|
|
739
|
-
|
|
738
|
+
* Custom headers to include in the requests.
|
|
739
|
+
*/
|
|
740
740
|
headers?: Record<string, string>;
|
|
741
741
|
/**
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
742
|
+
* Custom fetch implementation. You can use it as a middleware to intercept requests,
|
|
743
|
+
* or to provide a custom fetch implementation for e.g. testing.
|
|
744
|
+
*/
|
|
745
745
|
fetch?: FetchFunction;
|
|
746
746
|
generateId?: () => string;
|
|
747
747
|
/**
|
|
@@ -751,11 +751,11 @@ interface AnthropicProviderSettings {
|
|
|
751
751
|
name?: string;
|
|
752
752
|
}
|
|
753
753
|
/**
|
|
754
|
-
Create an Anthropic provider instance.
|
|
754
|
+
* Create an Anthropic provider instance.
|
|
755
755
|
*/
|
|
756
756
|
declare function createAnthropic(options?: AnthropicProviderSettings): AnthropicProvider;
|
|
757
757
|
/**
|
|
758
|
-
Default Anthropic provider instance.
|
|
758
|
+
* Default Anthropic provider instance.
|
|
759
759
|
*/
|
|
760
760
|
declare const anthropic: AnthropicProvider;
|
|
761
761
|
|
package/dist/index.js
CHANGED
|
@@ -32,7 +32,7 @@ var import_provider4 = require("@ai-sdk/provider");
|
|
|
32
32
|
var import_provider_utils23 = require("@ai-sdk/provider-utils");
|
|
33
33
|
|
|
34
34
|
// src/version.ts
|
|
35
|
-
var VERSION = true ? "3.0.
|
|
35
|
+
var VERSION = true ? "3.0.26" : "0.0.0-test";
|
|
36
36
|
|
|
37
37
|
// src/anthropic-messages-language-model.ts
|
|
38
38
|
var import_provider3 = require("@ai-sdk/provider");
|