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.3.tbz
sha256=636d458cb1564ed88ca8c0250c432e91c2f822fd49ad2b923819e762bda10be6
sha512=361e476423ebc0f9cf561cc28ccd4531cf08e424e95eea43a67d6b8dbb457a49a25b418625ffa99f6327fc5df14e540e502d1aa8ed606111c5c010fe498eec2a

doc/ocaml-ai-sdk.ai_provider/Ai_provider/index.html

Module Ai_providerSource

OCaml AI SDK — Provider abstraction layer.

Type-safe, provider-agnostic types and module signatures for AI model integration. Inspired by Vercel AI SDK's V3 specification.

Sourcemodule Provider_options : sig ... end

Provider-specific options using an extensible GADT. Each provider registers its own typed key without circular dependencies.

Sourcemodule Finish_reason : sig ... end

Reason why model generation finished.

Sourcemodule Usage : sig ... end

Token usage statistics.

Sourcemodule Warning : sig ... end

Warnings emitted by providers for unsupported features.

Sourcemodule Provider_error : sig ... end

Errors from provider API calls.

Sourcemodule Prompt : sig ... end

Prompt messages with role-constrained content parts.

Sourcemodule Tool : sig ... end

Tool definition for function calling.

Sourcemodule Tool_choice : sig ... end

Strategy for tool selection during generation.

Sourcemodule Mode : sig ... end

Generation mode -- controls the shape of model output.

Sourcemodule Content : sig ... end

Response content parts returned by model generation.

Sourcemodule Call_options : sig ... end

Unified input options for both generate and stream calls.

Sourcemodule Generate_result : sig ... end

Result of a non-streaming generation call.

Sourcemodule Stream_part : sig ... end

Individual parts emitted during streaming generation.

Sourcemodule Stream_result : sig ... end

Result of a streaming generation call.

Sourcemodule Language_model : sig ... end

Core abstraction for AI language models.

Sourcemodule Provider : sig ... end

Factory for creating model instances from a provider.

Sourcemodule Middleware : sig ... end

Middleware for cross-cutting concerns (logging, caching, retries).

Sourcemodule Sse : sig ... end

Server-Sent Events parser for streaming API responses.

Sourcemodule Http_timeouts : sig ... end

HTTP timeout configuration.

Sourcemodule Http_client : sig ... end

HTTP client wrappers that apply Http_timeouts to cohttp calls.