package chatoyant

  1. Overview
  2. Docs
OCaml-first LLM SDK with Melange-generated JavaScript

Install

dune-project
 Dependency

Authors

Maintainers

Sources

chatoyant-v0.12.4.tbz
sha256=fbf19dea0d39482e0263812504d94c682a9f3a6e93f68fe0c57b2d38ed4166b3
sha512=4e01be9c0ec9c16880f98360dec4ef5e0dddd9192e2113991b154e891b3bdaefb614051c2cb63afa0b714efa0e4cc4fd8054528fdc1995f3a4858fe2fcd50256

doc/chatoyant.provider/Chatoyant_provider/Openai_stream/index.html

Module Chatoyant_provider.Openai_streamSource

OpenAI-compatible stream accumulation over decoded JSON chunks.

Sourcetype tool_call_delta = {
  1. tool_index : int;
  2. tool_id : string option;
  3. tool_name : string option;
  4. tool_arguments_delta : string option;
}
Sourcetype delta = {
  1. delta_content : string option;
  2. delta_reasoning_content : string option;
  3. delta_tool_calls : tool_call_delta list;
  4. delta_finish_reason : string option;
  5. delta_usage : Chatoyant_runtime.Json.t option;
}
Sourcetype accumulated = {
  1. accumulated_content : string;
  2. accumulated_reasoning_content : string;
  3. accumulated_finish_reason : string option;
  4. accumulated_usage : Chatoyant_runtime.Json.t option;
}
Sourceval empty : accumulated
Sourceval delta_of_json : Chatoyant_runtime.Json.t -> delta
Sourceval apply_delta : accumulated -> delta -> accumulated