Liking cljdoc? Tell your friends :D

hyperphor.ellum.chat


add-message!clj

(add-message! chat msg)

Append a message to the conversation history.

Append a message to the conversation history.
sourceraw docstring

assistant-message-from-responseclj

(assistant-message-from-response response)

Build an assistant history message from a normalized response. Preserves tool_calls in the message so the history is valid for re-submission.

Build an assistant history message from a normalized response.
Preserves tool_calls in the message so the history is valid for re-submission.
sourceraw docstring

chat-configclj

(chat-config chat)

Return the non-history config for use in a complete call.

Return the non-history config for use in a complete call.
sourceraw docstring

clear!clj

(clear! chat)

Clear the conversation history, keeping configuration.

Clear the conversation history, keeping configuration.
sourceraw docstring

handle-tool-callsclj

(handle-tool-calls provider tool-defs response)

Given a response with tool calls and a tools collection, execute all tool calls and return the result messages to add to history. For Anthropic, packs results into a single user message.

Given a response with tool calls and a tools collection,
execute all tool calls and return the result messages to add to history.
For Anthropic, packs results into a single user message.
sourceraw docstring

make-chatclj

(make-chat &
           [{:keys [provider model system tools max-tokens]
             :or {provider :openai}}])

Create a new chat conversation context. Options: :provider - :openai or :anthropic (default :openai) :model - model string override :system - system prompt string :tools - vector of tool definitions :max-tokens - max tokens per completion

Create a new chat conversation context.
Options:
  :provider  - :openai or :anthropic (default :openai)
  :model     - model string override
  :system    - system prompt string
  :tools     - vector of tool definitions
  :max-tokens - max tokens per completion
sourceraw docstring

messagesclj

(messages chat)

Return the current message history.

Return the current message history.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close