AnthropicMessageRequest

data class AnthropicMessageRequest(val model: String, val messages: List<AnthropicMessage>, val maxTokens: Int = 2048, val temperature: Double? = null, val system: List<SystemAnthropicMessage>? = null, val tools: List<AnthropicTool>? = null, val stream: Boolean = false, val toolChoice: AnthropicToolChoice? = null)(source)

Represents a request for an Anthropic message-based interaction.

This data class is used to configure the parameters for an Anthropic message request, including the model, messages, and additional settings for generation behavior.

Constructors

Link copied to clipboard
constructor(model: String, messages: List<AnthropicMessage>, maxTokens: Int = 2048, temperature: Double? = null, system: List<SystemAnthropicMessage>? = null, tools: List<AnthropicTool>? = null, stream: Boolean = false, toolChoice: AnthropicToolChoice? = null)

Properties

Link copied to clipboard
val maxTokens: Int = 2048

The maximum number of tokens to generate in the response. Defaults to 2048.

Link copied to clipboard

A list of messages constituting the dialogue. Each message contains a role and corresponding content.

Link copied to clipboard

The identifier of the Anthropic model to be used for processing the request.

Link copied to clipboard
val stream: Boolean = false

Whether responses should be returned as a stream. Defaults to false.

Link copied to clipboard

An optional list of system-level messages defining additional context or instructions.

Link copied to clipboard
val temperature: Double? = null

The sampling temperature for adjusting randomness in generation. Higher values increase randomness.

Link copied to clipboard

An optional specification for tool selection during processing, which may define automatic, specific, or no tool usage.

Link copied to clipboard
val tools: List<AnthropicTool>? = null

An optional list of tools that the Anthropic model can utilize during processing.