File tree Expand file tree Collapse file tree 1 file changed +4
-14
lines changed
livekit-agents/livekit/agents/voice Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -830,22 +830,12 @@ def generate_reply(
830830 )
831831
832832 run_state = self ._global_run_state
833- if self ._activity .scheduling_paused :
834- if self ._next_activity is None :
835- raise RuntimeError ("AgentSession is closing, cannot use generate_reply()" )
836-
837- handle = self ._next_activity ._generate_reply (
838- user_message = user_message ,
839- instructions = instructions ,
840- tool_choice = tool_choice ,
841- allow_interruptions = allow_interruptions ,
842- )
843- if run_state :
844- run_state ._watch_handle (handle )
833+ activity = self ._next_activity if self ._activity .scheduling_paused else self ._activity
845834
846- return handle
835+ if activity is None :
836+ raise RuntimeError ("AgentSession is closing, cannot use generate_reply()" )
847837
848- handle = self . _activity ._generate_reply (
838+ handle = activity ._generate_reply (
849839 user_message = user_message ,
850840 instructions = instructions ,
851841 tool_choice = tool_choice ,
You can’t perform that action at this time.
0 commit comments