Expand description
Shared utilities across LLM provider crates.
Structs§
- ApiError
- Structured API error returned by LLM providers.
- Chat
Runner - Shared runner for provider adapters that differ only by wire dialect.
- Open
AiDialect - Converts an rskit
CompletionRequestinto theOpenAIwire format and parses the response back into an rskitCompletionResponse. - Stream
Chunk - Normalized content/tool delta extracted from a provider stream event.
- Stream
Tool Call - Incremental tool-call state extracted from a provider stream event.
Functions§
- accumulate_
tool_ uses - Reconstruct tool-use blocks from a sequence of streamed chunks.
- estimate_
tokens - Rough token estimator (~4 chars per token).
- merge_
tool_ delta - Merge a streamed tool-call delta into the accumulated call list.
- parse_
anthropic_ error - Parse an Anthropic-style error response body into an
ApiError. - parse_
gemini_ error - Parse a Google Gemini-style error response body into an
ApiError. - parse_
input_ json - Parse a provider tool-input JSON fragment into a JSON object map.
- parse_
openai_ error - Parse an OpenAI-style error response body into an
ApiError. - send_
text - Send a provider request, map provider errors, and return the response body text.
- value_
to_ input_ map - Convert a JSON value into a tool-input object map.