AnthropicEvaluationModel
Namespace: Vercel.AI.Anthropic
public sealed class AnthropicEvaluationModel : IRubricModelBuilds and scores Anthropic evaluation requests on the Messages API.
Inheritance: object
Implements: IRubricModel
Constructors
Section titled “Constructors”AnthropicEvaluationModel(AnthropicProvider, string)
Section titled “AnthropicEvaluationModel(AnthropicProvider, string)”public AnthropicEvaluationModel(AnthropicProvider provider, string modelId)Creates an evaluation model.
Parameters
| Name | Type | Description |
|---|---|---|
provider |
AnthropicProvider | |
modelId |
string |
Properties
Section titled “Properties”ModelId
Section titled “ModelId”public string ModelId { get; }Model id.
Value: string
Provider
Section titled “Provider”public string Provider { get; }Provider id.
Value: string
SupportedQuestionTypes
Section titled “SupportedQuestionTypes”public IReadOnlyList<string> SupportedQuestionTypes { get; }Question types this model accepts.
Value: IReadOnlyList<string>
Methods
Section titled “Methods”BuildSchema(IReadOnlyList<AnthropicEvaluationQuestion>)
Section titled “BuildSchema(IReadOnlyList<AnthropicEvaluationQuestion>)”public static JsonElement BuildSchema(IReadOnlyList<AnthropicEvaluationQuestion> questions)Builds the json schema. Choice values are c0, c1, …. Number bounds are omitted.
Parameters
| Name | Type | Description |
|---|---|---|
questions |
IReadOnlyList<AnthropicEvaluationQuestion> |
Returns: JsonElement
DoEvaluateAsync(string, string, CancellationToken)
Section titled “DoEvaluateAsync(string, string, CancellationToken)”public Task<RubricResult> DoEvaluateAsync(string rubric, string candidate, CancellationToken cancellationToken)Scores a candidate against a rubric.
Parameters
| Name | Type | Description |
|---|---|---|
rubric |
string | |
candidate |
string | |
cancellationToken |
CancellationToken |
Returns: Task<RubricResult>
EvaluateAsync(IReadOnlyList<AnthropicEvaluationQuestion>, LanguageModelCallOptions?, CancellationToken)
Section titled “EvaluateAsync(IReadOnlyList<AnthropicEvaluationQuestion>, LanguageModelCallOptions?, CancellationToken)”public Task<AnthropicEvaluationResult> EvaluateAsync(IReadOnlyList<AnthropicEvaluationQuestion> questions, LanguageModelCallOptions? options, CancellationToken cancellationToken)Evaluates questions and maps q0, q1, … back onto the question names.
Parameters
| Name | Type | Description |
|---|---|---|
questions |
IReadOnlyList<AnthropicEvaluationQuestion> | |
options |
LanguageModelCallOptions | |
cancellationToken |
CancellationToken |
Returns: Task<AnthropicEvaluationResult>
ParseAnswers(IReadOnlyList<AnthropicEvaluationQuestion>, string)
Section titled “ParseAnswers(IReadOnlyList<AnthropicEvaluationQuestion>, string)”public static IReadOnlyDictionary<string, AnthropicEvaluationAnswer> ParseAnswers(IReadOnlyList<AnthropicEvaluationQuestion> questions, string json)Maps encoded answers back to criteria labels and checks score and probability bounds.
Parameters
| Name | Type | Description |
|---|---|---|
questions |
IReadOnlyList<AnthropicEvaluationQuestion> | |
json |
string |
Returns: IReadOnlyDictionary<string, AnthropicEvaluationAnswer>
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product