AnthropicMessageRequest

data class AnthropicMessageRequest(val model: String, val messages: List<AnthropicMessage>, val maxTokens: Int = MAX_TOKENS_DEFAULT, val container: String? = null, val mcpServers: List<AnthropicMCPServerURLDefinition>? = null, val serviceTier: AnthropicServiceTier? = null, val stopSequence: List<String>? = null, val stream: Boolean = false, val system: List<SystemAnthropicMessage>? = null, val temperature: Double? = null, val thinking: AnthropicThinking? = null, val toolChoice: AnthropicToolChoice? = null, val tools: List<AnthropicTool>? = null, val topK: Int? = null, val topP: Double? = 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, container: String? = null, mcpServers: List<AnthropicMCPServerURLDefinition>? = null, serviceTier: AnthropicServiceTier? = null, stopSequence: List<String>? = null, stream: Boolean = false, system: List<SystemAnthropicMessage>? = null, temperature: Double? = null, thinking: AnthropicThinking? = null, toolChoice: AnthropicToolChoice? = null, tools: List<AnthropicTool>? = null, topK: Int? = null, topP: Double? = 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

Container identifier for reuse across requests.

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

MCP servers to be used in this request

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
@SerialName(value = "service_tier")
val serviceTier: AnthropicServiceTier?

Determines whether to use priority capacity (if available) or standard capacity for this request.

Link copied to clipboard
@SerialName(value = "stop_sequence")
val stopSequence: List<String>?

Custom text sequences that will cause the model to stop generating.

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

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

Link copied to clipboard

Configuration for enabling Claude's extended thinking.

Link copied to clipboard
@SerialName(value = "tool_choice")
val toolChoice: AnthropicToolChoice?

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

Link copied to clipboard

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

Link copied to clipboard
val topK: Int?

Only sample from the top K options for each subsequent token.

Link copied to clipboard
val topP: Double?

Use nucleus sampling.