Skip to content

I think the current implementation of preemptive generation is wrong. #3414

Description

@Panmax

The current implementation of preemptive generation relies on the _generate_reply process of AgentActivity. This poses no problem in pure voice conversation agent scenarios, but if business logic is handled in on_user_turn_completed, llm_node, or tts_node (such as modifying elements on the page), issues may arise. Due to the existence of preemptive generation, similar transcription results may trigger on_user_turn_completed and tts_node multiple times, which can have an erroneous impact on the state machine.

I believe a more reasonable way to implement preemptive generation is to simply call the large model in advance, cache the result, and only go through those node processes when it is confirmed that the preemptive generation data will be used.

Metadata

Metadata

Assignees

No one assigned

    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