package ocaml-ai-sdk
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
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_provider_openrouter/Ai_provider_openrouter/Openrouter_error/index.html
Module Ai_provider_openrouter.Openrouter_errorSource
OpenRouter API error handling.
Parse an HTTP error response into a provider error. Extracts the most specific readable message from OpenRouter's JSON error envelope (upstream provider name, raw upstream error, and error_type when available). The HTTP status is authoritative for retryability.
Source
val of_response_with_retry_after :
?retry_after_ms:string option ->
status:int ->
body:string ->
retry_after:string option ->
unit ->
Ai_provider.Provider_error.tAs of_response, parsing and preserving raw rate-limit hint headers. retry_after_ms (milliseconds) takes precedence over retry_after (seconds); see Ai_provider.Retry_after.parse.
Source
val of_error_json :
?status:int ->
?retry_after_s:float ->
Yojson.Basic.t ->
Ai_provider.Provider_error.tBuild a Provider_error from an OpenRouter error object. Pass status on the HTTP error path so retryability keys off the real gateway status; omit it for 200-embedded, choice-level, and streaming errors, where the status is derived from error.code (default 200).
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>