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.4.tbz
sha256=4f3f22ae61d360b994cd75323bcb6b6bf915f6755fd1e7bab6844ca8a240c1e7
sha512=3c52b17096da818f5d3bcf9fe16826c3bec4533d6a1681e8ba0f957f37ee4f425696017cb78f1a24732f8851010d436cf446f873b72b6a4f5004d6b492072abf

doc/ocaml-ai-sdk.ai_provider_anthropic/Ai_provider_anthropic/index.html

Module Ai_provider_anthropicSource

Anthropic provider for the OCaml AI SDK.

Implements the Anthropic Messages API for Claude models.

Sourceval create : ?api_key:string -> ?base_url:string -> ?headers:(string * string) list -> unit -> Ai_provider.Provider.t

Create an Anthropic provider factory. api_key defaults to ANTHROPIC_API_KEY env var.

Sourceval language_model : ?api_key:string -> ?base_url:string -> ?headers:(string * string) list -> model:string -> unit -> Ai_provider.Language_model.t

Create a language model with explicit configuration.

Convenience: create a model using ANTHROPIC_API_KEY env var and default base URL.

Re-exported modules

Sourcemodule Config : sig ... end

Anthropic provider configuration.

Sourcemodule Model_catalog : sig ... end

Known Anthropic models with capabilities metadata.

Sourcemodule Thinking : sig ... end

Extended thinking configuration for Claude models.

Sourcemodule Cache_control : sig ... end

Prompt caching control for Anthropic models.

Sourcemodule Anthropic_options : sig ... end

Anthropic-specific provider options.

Sourcemodule Cache_control_options : sig ... end

Per-content-part cache control via Provider_options.

Sourcemodule Convert_prompt : sig ... end

Convert SDK prompts to Anthropic Messages API format.

Sourcemodule Convert_tools : sig ... end

Convert SDK tools and tool choice to Anthropic format.

Sourcemodule Convert_response : sig ... end

Convert Anthropic API responses to SDK format.

Sourcemodule Convert_usage : sig ... end

Convert Anthropic usage to SDK format.

Sourcemodule Anthropic_error : sig ... end

Anthropic API error types and parsing.

Sourcemodule Sse : sig ... end
Sourcemodule Convert_stream : sig ... end

Transform Anthropic SSE events into SDK stream parts.

Sourcemodule Beta_headers : sig ... end

Manage Anthropic beta feature headers.

Sourcemodule Anthropic_api : sig ... end

HTTP client for the Anthropic Messages API.

Sourcemodule Anthropic_model : sig ... end

Anthropic model implementing Ai_provider.Language_model.S.