Skip to main content

Module messages

Module messages 

Source
Expand description

Session message roles beyond the provider’s four, and their conversion.

Constants§

BRANCH_SUMMARY_PREFIX
Wraps a branch summary when it is sent to the model.
BRANCH_SUMMARY_SUFFIX
Closes BRANCH_SUMMARY_PREFIX.
COMPACTION_SUMMARY_PREFIX
Wraps a compaction summary when it is sent to the model.
COMPACTION_SUMMARY_SUFFIX
Closes COMPACTION_SUMMARY_PREFIX.

Functions§

bash_execution_text
How a user !command reads to the model.
block_images
pi’s blockImages filter: images in user and tool result messages become a notice, once for each run of images.
convert_to_llm
Converts session messages to provider roles: bash executions, custom messages and summaries become user messages. !! executions are dropped.