File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6969 is_function_call ,
7070 is_function_response ,
7171 is_text ,
72- is_text_and_not_bohrium ,
7372 send_error_event ,
7473 update_state_event ,
7574)
@@ -732,26 +731,6 @@ async def _run_async_impl(
732731 yield error_event
733732
734733
735- class ResultTransferLlmAgent (LlmAgent ):
736- @override
737- async def _run_async_impl (
738- self , ctx : InvocationContext
739- ) -> AsyncGenerator [Event , None ]:
740- async for event in super ()._run_async_impl (ctx ):
741- # Send Normal LlmResponse to Frontend, function_call -> function_response -> Llm_response
742- if is_text_and_not_bohrium (event ):
743- for function_event in context_function_event (
744- ctx ,
745- self .name ,
746- 'system_result_transfer_info' ,
747- {'response' : event .content .parts [0 ].text },
748- ModelRole ,
749- ):
750- yield function_event
751- else :
752- yield event
753-
754-
755734class BaseAsyncJobAgent (LlmAgent ):
756735 submit_agent : SequentialAgent
757736 result_agent : SequentialAgent
Original file line number Diff line number Diff line change @@ -42,12 +42,6 @@ def is_text(event: Event):
4242 return has_part (event ) and event .content .parts [0 ].text
4343
4444
45- def is_text_and_not_bohrium (event : Event ):
46- return is_text (event ) and not event .content .parts [0 ].text .startswith (
47- '<bohrium-chat-msg>'
48- )
49-
50-
5145def is_function_call (event : Event ) -> bool :
5246 """检查事件是否包含函数调用"""
5347 return has_part (event ) and any (part .function_call for part in event .content .parts )
You can’t perform that action at this time.
0 commit comments