package chatoyant

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

Install

dune-project
 Dependency

Authors

Maintainers

Sources

chatoyant-v0.12.2.tbz
sha256=a885dcf4b3c6ede268e2027bedf6955a5c889f7ed01c40b719f8369655957d47
sha512=0bb8dfa12157ba2e482927717c2242c1ea914dce1427801e405987811550afbd6d6b11f07d1e1379259360d17f4ca43ff81963bf407cddb7bedd0dfbb93a55ee

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