package chatoyant
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
OCaml-first LLM SDK with Melange-generated JavaScript
Install
dune-project
Dependency
Authors
Maintainers
Sources
chatoyant-v0.12.4.tbz
sha256=fbf19dea0d39482e0263812504d94c682a9f3a6e93f68fe0c57b2d38ed4166b3
sha512=4e01be9c0ec9c16880f98360dec4ef5e0dddd9192e2113991b154e891b3bdaefb614051c2cb63afa0b714efa0e4cc4fd8054528fdc1995f3a4858fe2fcd50256
doc/src/chatoyant.core/shortcuts.ml.html
Source file shortcuts.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33module Make (Provider : Chatoyant_provider.Provider.CHAT) (Clock : Chatoyant_runtime.Effect.CLOCK) = struct module Chat = Session.Make (Provider) (Clock) let build_chat ?system ?model prompt = let chat = match model with | None -> Chat.create () | Some model -> Chat.create ~model () in let chat = match system with | None -> chat | Some content -> Chat.system content chat in Chat.user prompt chat let gen_result ?system ?model ?options prompt = let chat = build_chat ?system ?model prompt in Chat.generate_with_result ?options chat let gen_text ?system ?model ?options prompt = match gen_result ?system ?model ?options prompt with | Error _ as err -> err | Ok result -> Ok result.Result.content let gen_stream_accumulate ?system ?model ?(options = Options.default) frames prompt = let chat = build_chat ?system ?model prompt in Chat.stream_accumulate ~options frames chat end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>