package chatoyant
Build not checked 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.15.0.tbz
sha256=10cf101ecaa2862daaf543a95506825431808c737fabb2fe6a40b8c1aed9f5a8
sha512=ef9a00877ef8090724cbed59cf8335a225e5178ec6a9220740cf79465e5a221b562ff3d593c009e43502474fd1d55ac38f2e4644aa28dca2b199d9a65f1ce69c
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)"
>