@ai-sdk/anthropic 4.0.55 → 4.0.56

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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # @ai-sdk/anthropic
2
2
 
3
+ ## 4.0.56
4
+
5
+ ### Patch Changes
6
+
7
+ - d4d96bf: Add `anthropic.evaluationModel()` for experimental Choice, Score, and Boolean evaluations through Messages structured output, with exact labels, validated score bounds, and prompted Boolean P(true) estimates validated to be in [0, 1]. Boolean estimates are not guaranteed to be calibrated; application code chooses thresholds.
8
+ - Updated dependencies [215b25e]
9
+ - Updated dependencies [d4d96bf]
10
+ - Updated dependencies [a7dd893]
11
+ - Updated dependencies [3456e2c]
12
+ - Updated dependencies [c4e76de]
13
+ - @ai-sdk/provider-utils@5.0.43
14
+ - @ai-sdk/provider@4.0.17
15
+
3
16
  ## 4.0.55
4
17
 
5
18
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { JSONObject, ProviderV4, LanguageModelV4, Experimental_BatchV4, FilesV4, SkillsV4 } from '@ai-sdk/provider';
1
+ import { JSONObject, ProviderV4, LanguageModelV4, Experimental_EvaluationModelV4, Experimental_BatchV4, FilesV4, SkillsV4 } from '@ai-sdk/provider';
2
2
  import { z } from 'zod/v4';
3
3
  import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
4
4
  import { ToolExecuteFunction, Tool, Experimental_SandboxSession, ProviderDefinedTool, FetchFunction } from '@ai-sdk/provider-utils';
@@ -1372,6 +1372,8 @@ interface AnthropicProvider extends ProviderV4 {
1372
1372
  languageModel(modelId: AnthropicModelId): LanguageModelV4;
1373
1373
  chat(modelId: AnthropicModelId): LanguageModelV4;
1374
1374
  messages(modelId: AnthropicModelId): LanguageModelV4;
1375
+ /** Creates an experimental Choice/Score/Boolean evaluation model using Messages. */
1376
+ evaluationModel(modelId: AnthropicModelId): Experimental_EvaluationModelV4;
1375
1377
  experimental_batch(): Experimental_BatchV4<{
1376
1378
  text: AnthropicModelId;
1377
1379
  }>;
package/dist/index.js CHANGED
@@ -11,6 +11,7 @@ import {
11
11
  withoutTrailingSlash,
12
12
  withUserAgentSuffix
13
13
  } from "@ai-sdk/provider-utils";
14
+ import { Experimental_EvaluationLanguageModel as EvaluationLanguageModel } from "@ai-sdk/provider-utils/experimental-evaluation";
14
15
 
15
16
  // src/anthropic-files.ts
16
17
  import {
@@ -7825,7 +7826,7 @@ var AnthropicSkills = class {
7825
7826
  };
7826
7827
 
7827
7828
  // src/version.ts
7828
- var VERSION = true ? "4.0.55" : "0.0.0-test";
7829
+ var VERSION = true ? "4.0.56" : "0.0.0-test";
7829
7830
 
7830
7831
  // src/anthropic-provider.ts
7831
7832
  var ANTHROPIC_API_URL = "https://api.anthropic.com";
@@ -7904,6 +7905,10 @@ function createAnthropic(options = {}) {
7904
7905
  provider.languageModel = createChatModel;
7905
7906
  provider.chat = createChatModel;
7906
7907
  provider.messages = createChatModel;
7908
+ provider.evaluationModel = (modelId) => new EvaluationLanguageModel({
7909
+ model: createChatModel(modelId),
7910
+ provider: `${providerName.replace(/\.messages$/, "")}.evaluation`
7911
+ });
7907
7912
  provider.experimental_batch = createBatch;
7908
7913
  provider.embeddingModel = (modelId) => {
7909
7914
  throw new NoSuchModelError({ modelId, modelType: "embeddingModel" });