ConversationContextRender Module
Render recent conversation transcript for a spawned async agent. An async agent runs in a brand-new sub-session that shares none of the parent conversation's history, so without this a follow-up like "convert it to html" arrives with no idea what "it" is. We surface the recent turns (and any attachment names, which are usually the subject of the follow-up) so the agent can resolve the reference.
Functions and values
| Function or value |
Description
|
Full Usage:
recentTranscript maxMessages messages
Parameters:
int
messages : MessageRecord seq
Returns: string
|
The last `maxMessages` messages rendered as "Role: content [attached: a, b]" lines. Returns "" when there is no prior history.
|
Full Usage:
withHistory maxMessages messages input
Parameters:
int
messages : MessageRecord seq
input : string
Returns: string
|
Prefix `input` with the recent transcript so the agent has conversational context. When there is no prior history the input is returned unchanged.
|
Nao