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 @@ -827,22 +827,12 @@ def generate_reply(
827
827
)
828
828
829
829
run_state = self ._global_run_state
830
- if self ._activity .scheduling_paused :
831
- if self ._next_activity is None :
832
- raise RuntimeError ("AgentSession is closing, cannot use generate_reply()" )
833
-
834
- handle = self ._next_activity ._generate_reply (
835
- user_message = user_message ,
836
- instructions = instructions ,
837
- tool_choice = tool_choice ,
838
- allow_interruptions = allow_interruptions ,
839
- )
840
- if run_state :
841
- run_state ._watch_handle (handle )
842
830
843
- return handle
831
+ activity = self ._next_activity if self ._activity .scheduling_paused else self ._activity
832
+ if activity is None :
833
+ raise RuntimeError ("AgentSession is closing, cannot use generate_reply()" )
844
834
845
- handle = self . _activity ._generate_reply (
835
+ handle = activity ._generate_reply (
846
836
user_message = user_message ,
847
837
instructions = instructions ,
848
838
tool_choice = tool_choice ,
You can’t perform that action at this time.
0 commit comments