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.tbz
sha256=44e7f6ebef6da2828ec2844dd5b38c8f37284c08e54a29e06f6a8822df6f8e10
sha512=ce31d0868abf28bcaef7b24a0ab09b37dcfc94db3de96b38ff36a03800ae59a19e8009a35314f93191b3c8f178c40f8569630d4389f56ddc2f2cc94fb7bffc3c
doc/ocaml-ai-sdk.ai_provider/Ai_provider/Provider_error/index.html
Module Ai_provider.Provider_errorSource
Errors from provider API calls.
Source
type error_kind = | Api_error of {}| Network_error of {}| Deserialization_error of {}| Timeout of {phase : timeout_phase;elapsed_s : float;limit_s : float;
}
Source
type t = {provider : string;kind : error_kind;is_retryable : bool;retry_after_s : float option;
}Source
val make_api_error :
provider:string ->
status:int ->
body:string ->
?is_retryable:bool ->
?retry_after_s:float ->
unit ->
tConstruct an API error.
When is_retryable is omitted, defaults to the upstream status-code heuristic: 408, 409, 429, or any 5xx are retryable. Providers may override this when they can parse the error type from the response body.
Source
val make_timeout :
provider:string ->
phase:timeout_phase ->
elapsed_s:float ->
limit_s:float ->
tConstruct a timeout error. is_retryable is derived from phase: Request_headers is not retryable (server may already be processing the request; retry risks double-billing); Stream_idle is retryable (stream is dead, safe to start over).
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>