Skip to main content

Module convert

Module convert 

Source
Expand description

Shared conversion helpers between the infinity protocol Message types and the OpenAI / Anthropic wire formats.

Functions§

arguments_to_string
classify_http_status
Classify an HTTP failure into the protocol’s retry classes.
error_message_from_body
Extract a human-readable message from a JSON error body.
push_bytes
Buffer raw response bytes into out, holding back split UTF-8.
take_frames
Split complete SSE frames off the front of buf, leaving any partial tail in place for the next read.
to_openai_messages
Render user/assistant history as OpenAI messages, returning (messages, system_prompt).
to_openai_tools