package chatoyant

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

Install

dune-project
 Dependency

Authors

Maintainers

Sources

chatoyant-v0.13.0.tbz
sha256=1f84c5229b2d58ec6264dd651a58f2686130afa6e91989f110aa7aaf10bba0f5
sha512=49142e122dbb44b03f7f27b52839492800332207d0efeacc7451173827c899a9b965b671a3d9028cc05250aaebbc6789d3815a6cf356f4319bc0c1b0454c68dd

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