llmgleam/claude
Types
pub type ClaudeClientInternal {
ClaudeClientInternal(api_key: String)
}
Constructors
-
ClaudeClientInternal(api_key: String)
pub type ContentBlock {
TextBlock(text: String)
ToolUseBlock(call: types.ToolCall)
IgnoredBlock
}
Constructors
-
TextBlock(text: String) -
ToolUseBlock(call: types.ToolCall) -
IgnoredBlock
pub type MessagesRequest {
MessagesRequest(
model: String,
messages: List(types.ChatMessage),
system: option.Option(String),
max_tokens: Int,
tools: List(types.Tool),
tool_exchanges: List(
#(types.Completion, List(types.ToolOutput)),
),
pending_completion: option.Option(types.Completion),
tool_outputs: List(types.ToolOutput),
)
}
Constructors
-
MessagesRequest( model: String, messages: List(types.ChatMessage), system: option.Option(String), max_tokens: Int, tools: List(types.Tool), tool_exchanges: List( #(types.Completion, List(types.ToolOutput)), ), pending_completion: option.Option(types.Completion), tool_outputs: List(types.ToolOutput), )
pub type MessagesResponse {
MessagesResponse(
id: String,
content: List(ContentBlock),
role: String,
usage: option.Option(Usage),
)
}
Constructors
-
MessagesResponse( id: String, content: List(ContentBlock), role: String, usage: option.Option(Usage), )
Values
pub fn generate_content(
client: ClaudeClientInternal,
model: String,
messages: List(types.ChatMessage),
system_instruction: option.Option(String),
tools: List(types.Tool),
tool_exchanges: List(
#(types.Completion, List(types.ToolOutput)),
),
pending_completion: option.Option(types.Completion),
tool_outputs: List(types.ToolOutput),
) -> Result(types.Completion, types.CompletionError)
pub fn role_to_str(role: types.Role) -> String