SkillKit.LLM.Anthropic.Encoder (SkillKit v0.1.0)

Copy Markdown View Source

Translates SkillKit.Types message structs to Anthropic Messages API format.

Summary

Functions

Encodes a list of native message structs into Anthropic API message format.

Encodes Tool structs into Anthropic tool format.

Functions

encode_messages(messages)

@spec encode_messages([SkillKit.LLM.message()]) :: [map()]

Encodes a list of native message structs into Anthropic API message format.

Consecutive ToolResult messages are grouped into a single user message with tool_result content blocks, as required by the Anthropic API.

encode_tools(tools)

Encodes Tool structs into Anthropic tool format.