Posoco chat-completions kit — shared OpenAI chat-completions dialect parsing (SSE streaming) with a uniform real-world tolerance policy
Dependencies
fn classify_chat_completions_http_error(status : Int, body_text : String, default_tz_offset_minutes? : Int, retry_after_header? : String?, now_ms~ : Int64) -> ModelError?fn derive_prompt_cache_key(session_id : String) -> Stringfn encode_chat_message_content(blocks : Array[Content], supports_images? : Bool) -> EncodedChatContentfn image_placeholder(media_type : String, data : String) -> Stringfn is_prompt_cache_key_rejection(body_text : String) -> Boolfn parse_reset_timestamp(text : String, default_tz_offset_minutes? : Int, now_ms~ : Int64) -> Int64?fn process_chat_completions_sse(provider~ : String, usage_fields_required? : Bool, data : String, acc : StreamAccumulator, on_chunk : (StreamChunk) -> Unit) -> Bool raise ModelErrorInstall
Download zipPosoco chat-completions kit — shared OpenAI chat-completions dialect parsing (SSE streaming) with a uniform real-world tolerance policy
Dependencies