package chatoyant
All checked builds pass 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.18.0.tbz
sha256=3c003dd1e14cfa4656de04ab97118dac151be5233df885eab5b09744584a745b
sha512=510b59defbbf182697947937b33e3a3546ab5796a0962f1126d5fa8ec813ca891a655376853115676a40c72b1780b381603d7feca0a78f1f638e7535fec51686
doc/src/chatoyant.core/chat.ml.html
Source file chat.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23type t = { model : string; defaults : Options.t; messages : Message.t list; tools : Tool.t list; } let create ?(model = "gpt-4o") ?(defaults = Options.default) () = { model; defaults; messages = []; tools = [] } let model chat = chat.model let messages chat = List.rev chat.messages let tools chat = List.rev chat.tools let add_message message chat = { chat with messages = message :: chat.messages } let add_tool tool chat = { chat with tools = tool :: chat.tools } let system content chat = add_message (Message.system content) chat let user ?attachments content chat = add_message (Message.user ?attachments content) chat let assistant content chat = add_message (Message.assistant content) chat let clear_messages chat = { chat with messages = [] } let clear_tools chat = { chat with tools = [] }
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>