package chatoyant

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

Install

dune-project
 Dependency

Authors

Maintainers

Sources

chatoyant-v0.12.1.tbz
sha256=72752addb69fe17825f43f5a861f8d0a7817f6a5a711916e722023e10679daff
sha512=d1a62989e34f8b9173d4c53f8e17c611900855df8a139888e73ee509b445ef1e65105c17bb399bf25712a893a251827513f18ed36d0e2b3fcc908fb00584c6f3

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