Package-level declarations

Types

Link copied to clipboard
class AnthropicClientSettings(val modelVersionsMap: Map<LLModel, String> = DEFAULT_ANTHROPIC_MODEL_VERSIONS_MAP, val baseUrl: String = "https://api.anthropic.com", val apiVersion: String = "2023-06-01", val timeoutConfig: ConnectionTimeoutConfig = ConnectionTimeoutConfig())

Represents the settings for configuring an Anthropic client, including model mapping, base URL, and API version.

Link copied to clipboard

Represents content that can be processed or generated by Anthropic systems.

Link copied to clipboard
open class AnthropicLLMClient(apiKey: String, settings: AnthropicClientSettings = AnthropicClientSettings(), baseClient: HttpClient = HttpClient(), clock: Clock = Clock.System) : LLMClient

A client implementation for interacting with Anthropic's API in a suspendable and direct manner.

Link copied to clipboard
data class AnthropicMessage(val role: String, val content: List<AnthropicContent>)

Represents a message within the Anthropic LLM system. This data class encapsulates the role of the message and its associated content.

Link copied to clipboard
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)

Represents a request for an Anthropic message-based interaction.

Link copied to clipboard

Anthropic models for text generation and embeddings.

Link copied to clipboard
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)

Represents the response structure from an Anthropic API call.

Link copied to clipboard

Represents the content of a response from Anthropic's API. This is a sealed class that encapsulates different possible response types.

Link copied to clipboard
data class AnthropicStreamDelta(val type: String, val text: String? = null, val toolUse: AnthropicResponseContent.ToolUse? = null)

Represents a delta update from the Anthropic stream response.

Link copied to clipboard
data class AnthropicStreamResponse(val type: String, val delta: AnthropicStreamDelta? = null, val message: AnthropicResponse? = null)

Represents a response from the Anthropic stream API.

Link copied to clipboard
data class AnthropicTool(val name: String, val description: String, val inputSchema: AnthropicToolSchema)

Represents a tool definition for Anthropic integration.

Link copied to clipboard

Represents a sealed interface for different tool choices in the Anthropic client API. This API is marked as internal and may change or be removed without notice.

Link copied to clipboard
data class AnthropicToolSchema(val type: String = "object", val properties: JsonObject, val required: List<String>)

Represents a schema definition for an Anthropic tool utilized in LLM clients. This data class defines the structure expected for tools, including the type of schema, properties, and required fields.

Link copied to clipboard
data class AnthropicUsage(val inputTokens: Int, val outputTokens: Int)

Represents the usage statistics of the Anthropic LLM API.

Link copied to clipboard
sealed interface DocumentSource

Represents a sealed interface for different types of document sources. It defines a contract for how documents can be represented or accessed.

Link copied to clipboard
sealed interface ImageSource

Represents a source of an image. This sealed interface has two implementations: one wrapping a URL and another wrapping raw base64-encoded image data.

Link copied to clipboard
data class SystemAnthropicMessage(val text: String, val type: String = "text")

Represents a system message with designated text and type properties that can be utilized in anthropic system communication.