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.1.tbz
sha256=467ed85a42617ce399d0032d81f27f8dd2e8ca9b0753daeb2cbd84bf46761370
sha512=f5e96feea16c6ffdb45f49ee3e84e9cdb5426245c1ac32acc6434c15b949cc576c1007ed463bf1362dce507d10700eb96acf5a42fa7eed4e8e491ae0214a2e4a
doc/ocaml-ai-sdk.ai_core/Ai_core/Prompt_builder/index.html
Module Ai_core.Prompt_builderSource
Build provider-layer prompt messages from user-friendly inputs.
Source
val messages_of_prompt :
?system:string ->
prompt:string ->
unit ->
Ai_provider.Prompt.message listConvert a simple string prompt to provider messages. Prepends a system message if system is provided.
Source
val messages_of_string_messages :
?system:string ->
messages:(string * string) list ->
unit ->
Ai_provider.Prompt.message listConvert (role, content) pairs to provider messages. Roles: "system", "user", "assistant". Prepends a system message if system is provided.
Source
val append_assistant_and_tool_results :
messages:Ai_provider.Prompt.message list ->
assistant_content:Ai_provider.Content.t list ->
tool_results:Generate_text_result.tool_result list ->
Ai_provider.Prompt.message listAppend an assistant response and tool results to the message list for the next iteration of the tool loop.
Source
val resolve_messages :
?system:string ->
?prompt:string ->
?messages:Ai_provider.Prompt.message list ->
unit ->
Ai_provider.Prompt.message listBuild the initial message list from either prompt (string) or messages. Prepends system message if provided. Raises if both or neither are given.
Source
val make_call_options :
messages:Ai_provider.Prompt.message list ->
tools:Ai_provider.Tool.t list ->
?tool_choice:Ai_provider.Tool_choice.t ->
?mode:Ai_provider.Mode.t ->
?max_output_tokens:int ->
?temperature:float ->
?top_p:float ->
?top_k:int ->
?stop_sequences:string list ->
?seed:int ->
?provider_options:Ai_provider.Provider_options.t ->
?headers:(string * string) list ->
unit ->
Ai_provider.Call_options.tBuild a Call_options.t with common defaults.
Convert Core SDK tools to provider-layer tool definitions.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>