AnthropicResponse
data class AnthropicResponse(val id: String, val type: String, val role: String, val content: List<AnthropicResponseContent>, val model: String, val stopReason: String? = null, val usage: AnthropicUsage? = null)(source)
Represents the response structure from an Anthropic API call.
This class encapsulates essential data returned from the API, including information about the response's unique identifier, type, role, content, the model used, and additional metadata such as stop reason and usage statistics.
Constructors
Link copied to clipboard
constructor(id: String, type: String, role: String, content: List<AnthropicResponseContent>, model: String, stopReason: String? = null, usage: AnthropicUsage? = null)
Properties
Link copied to clipboard
A list of content units within the response, which can represent text or tool usage instructions.
Link copied to clipboard
Optional. The reason why the generation process was stopped, if applicable.
Link copied to clipboard
Optional. Usage statistics for the response, including details such as token counts.