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.17.4.tbz
sha256=27a1ef94087a204e08ff7be20fa6f7b0bef28d8af2af08624c4d967042325d74
sha512=27f82f6cae81febbdd53a9df05955fc429f0e2ed7a2a886d5d55bb27dadfd01914af3b4a638bc347ca9eeef89ab5f395480be7e2b677a332bf841d691a4b584b
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)"
>