Liking cljdoc? Tell your friends :D

fractal-engine.context

Provider-visible transcript accounting and compact-frame rendering.

This namespace is deliberately value-only: it does not mutate sessions, create heads, or restore vars. Session code owns those state transitions.

Provider-visible transcript accounting and compact-frame rendering.

This namespace is deliberately value-only: it does not mutate sessions, create
heads, or restore vars. Session code owns those state transitions.
raw docstring

assess-requestclj

(assess-request cfg role messages)

Return nil when the model's context window is unknown; otherwise return an estimate/budget map for provider input messages.

Return nil when the model's context window is unknown; otherwise return an
estimate/budget map for provider input messages.
sourceraw docstring

compaction-request-messagesclj

(compaction-request-messages cfg
                             {:keys [session-id head-id messages turns evals
                                     calls snapshots latest-snapshot]})

Render the model-mediated compaction request from the current completed head view. The response to this request becomes the compact synthetic user message.

Render the model-mediated compaction request from the current completed head
view. The response to this request becomes the compact synthetic user message.
sourceraw docstring

compaction-system-promptclj

source

default-policyclj

source

estimate-message-tokensclj

(estimate-message-tokens message)
(estimate-message-tokens policy message)
source

estimate-request-tokensclj

(estimate-request-tokens messages)
(estimate-request-tokens policy messages)
source

estimate-text-tokensclj

(estimate-text-tokens text)
(estimate-text-tokens policy text)
source

model-window-tokensclj

(model-window-tokens cfg role)
source

normalize-policyclj

(normalize-policy policy)
source

prospective-turn-messagesclj

(prospective-turn-messages messages user-message)
source

should-compact-before-turn?clj

(should-compact-before-turn? cfg role messages user-message)
source

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