Class CountMessageTokensRequest
- Namespace
- AnthropicClient.Models
- Assembly
- AnthropicClient.dll
Represents a request to count the number of tokens in a message.
public class CountMessageTokensRequest
- Inheritance
-
CountMessageTokensRequest
- Inherited Members
Constructors
CountMessageTokensRequest(string, List<Message>, ToolChoice?, List<Tool>?, List<TextContent>?)
Initializes a new instance of the CountMessageTokensRequest class.
public CountMessageTokensRequest(string model, List<Message> messages, ToolChoice? toolChoice = null, List<Tool>? tools = null, List<TextContent>? systemPrompt = null)
Parameters
model
stringThe model ID to use for the request.
messages
List<Message>The messages to count the number of tokens in.
toolChoice
ToolChoiceThe tool choice mode to use for the request.
tools
List<Tool>The tools to use for the request.
systemPrompt
List<TextContent>The system prompt to use for the request.
Exceptions
- ArgumentNullException
Thrown when
model
ormessages
is null.- ArgumentException
Thrown when
messages
is empty.
Properties
Messages
Gets the messages to count the number of tokens in.
public List<Message> Messages { get; init; }
Property Value
Model
Gets the model ID to be used for the request.
public string Model { get; init; }
Property Value
SystemPrompt
Gets the system prompt to use for the request.
[JsonPropertyName("system")]
public List<TextContent>? SystemPrompt { get; init; }
Property Value
ToolChoice
Gets the tool choice mode to use for the request.
[JsonPropertyName("tool_choice")]
public ToolChoice? ToolChoice { get; init; }
Property Value
Tools
Gets the tools to use for the request.
public List<Tool>? Tools { get; init; }