package ocaml-ai-sdk

  1. Overview
  2. Docs
OCaml AI SDK - Provider abstraction for AI models

Install

dune-project
 Dependency

Authors

Maintainers

Sources

ocaml-ai-sdk-0.6.1.tbz
sha256=cb3b82428abcda76c02ec92f8103a4db28edf3f42795794a37135e9a3c40af96
sha512=11be8889ee25bee67b2be00553c42a4692bc73e5ce23985e8bb87f8a07e9d8f556b5a63b219fe5fe30366c8b0d4edae494afa80ccfbfcb112f1fa1e458de55bf

doc/ocaml-ai-sdk.ai_core/Ai_core/index.html

Module Ai_coreSource

OCaml AI SDK — Core SDK layer.

Provides generate_text, stream_text, and UIMessage stream protocol for frontend interoperability with useChat().

Sourcemodule Core_tool : sig ... end

Tool definition for the Core SDK.

Sourcemodule Retry : sig ... end

Retry with exponential backoff for provider calls.

Sourcemodule Stop_condition : sig ... end

Predicates that control when the multi-step tool loop terminates.

Sourcemodule Smooth_stream : sig ... end

Smooth text and reasoning streaming output.

Sourcemodule Generate_text_result : sig ... end

Results from text generation, including multi-step tool loops.

Sourcemodule Text_stream_part : sig ... end

Events emitted by the fullStream during streaming text generation.

Sourcemodule Ui_message_chunk : sig ... end

UIMessage stream protocol chunk types.

Sourcemodule Prompt_builder : sig ... end

Build provider-layer prompt messages from user-friendly inputs.

Sourcemodule Ui_message_stream : sig ... end

SSE encoding for the UIMessage stream protocol.

Sourcemodule Generate_text : sig ... end

Non-streaming text generation with multi-step tool execution.

Sourcemodule Stream_text_result : sig ... end

Result of streaming text generation.

Sourcemodule Stream_text : sig ... end

Streaming text generation with multi-step tool execution.

Sourcemodule Server_handler : sig ... end

Convenience handler for building chat API endpoints with cohttp.

Sourcemodule Partial_json : sig ... end

Partial JSON parser — repairs truncated JSON for streaming.

Sourcemodule Output : sig ... end

Structured output API for generate_text and stream_text.

Sourcemodule Ui_message_stream_writer : sig ... end

Composable UIMessage stream builder.

Sourcemodule Telemetry : sig ... end

Telemetry configuration for AI SDK operations.