AnthropicMessageRequest

data class AnthropicMessageRequest(val model: String, val messages: List<AnthropicMessage>, val maxTokens: Int = MAX_TOKENS_DEFAULT, val temperature: Double? = null, val system: List<SystemAnthropicMessage>? = null, val tools: List<AnthropicTool>? = null, val stream: Boolean = false, val toolChoice: AnthropicToolChoice? = null, val additionalProperties: Map<String, JsonElement>? = 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 = MAX_TOKENS_DEFAULT, temperature: Double? = null, system: List<SystemAnthropicMessage>? = null, tools: List<AnthropicTool>? = null, stream: Boolean = false, toolChoice: AnthropicToolChoice? = null, additionalProperties: Map<String, JsonElement>? = null)

Types

Link copied to clipboard
object Companion

Companion object with default values for request

Properties

Link copied to clipboard
Link copied to clipboard
@SerialName(value = "max_tokens")
val maxTokens: Int

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

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
@SerialName(value = "tool_choice")
val toolChoice: AnthropicToolChoice? = null

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.