Skip to content

Commit f6327c4

Browse files
committed
refactor: remove unused function and associated logic to streamline code
1 parent b87d5b1 commit f6327c4

2 files changed

Lines changed: 0 additions & 27 deletions

File tree

agents/matmaster_agent/base_agents/job_agent.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
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-
755734
class BaseAsyncJobAgent(LlmAgent):
756735
submit_agent: SequentialAgent
757736
result_agent: SequentialAgent

agents/matmaster_agent/utils/event_utils.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff 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-
5145
def is_function_call(event: Event) -> bool:
5246
"""检查事件是否包含函数调用"""
5347
return has_part(event) and any(part.function_call for part in event.content.parts)

0 commit comments

Comments
 (0)