Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Savehistory_processors's result for next round model request #2095

Open
Assignees
Kludex
Labels
questionFurther information is requested
@Wh1isper

Description

@Wh1isper

Question

Hi, I was migrating my old composer implementation tohistory_processors based composer and found that I couldn't save the results processed byhistory_processors, which resulted in each tool return triggering the compact.

I'm now implementing this using a rather tricky way: transfer viactx with apatched_messages field

ctx=AgentContext()asyncwithagent.iter(...,deps=ctx)asrun:asyncfornodeinrun:ifAgent.is_user_prompt_node(node)orAgent.is_end_node(node):continueelifAgent.is_model_request_node(node)orAgent.is_call_tools_node(node):asyncwithnode.stream(run.ctx)asrequest_stream:# Right after request, save immediatelyrun.ctx.state.message_history=ctx.patched_messagesifctx.patched_messageselse ...# Then start streamingasyncforeventinrequest_stream:                        ...

Releated

What do you think? I intuit thathistory_processors will change message history.

cc@Kludex

Additional Context

No response

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp