Skip to content

Commit b71b797

Browse files
committed
Add propagate as true
1 parent 1dff8b5 commit b71b797

File tree

1 file changed

+38
-40
lines changed

1 file changed

+38
-40
lines changed

lisa/ai/default_flow.py

Lines changed: 38 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -605,67 +605,65 @@ async def async_analyze_default(
605605
# Create specialized agents using the custom base class
606606
logger.info("Initializing agents")
607607

608-
# Set global logger for callbacks
609-
log_search_agent = LogSearchAgent(
610-
log_paths=log_folder_path,
611-
deployment_name=software_deployment_name,
612-
api_key=azure_openai_api_key,
613-
base_url=azure_openai_endpoint,
614-
)
615-
code_search_agent = CodeSearchAgent(
616-
code_paths=[code_path],
617-
deployment_name=software_deployment_name,
618-
api_key=azure_openai_api_key,
619-
base_url=azure_openai_endpoint,
620-
)
608+
def make_participants():
609+
final_answer_prompt = _load_prompt("final_answer.txt", flow="default")
610+
chat_options = create_agent_chat_options()
611+
summary_chat_client = AzureOpenAIChatClient(
612+
api_key=azure_openai_api_key,
613+
endpoint=azure_openai_endpoint,
614+
deployment_name=general_deployment_name,
615+
)
616+
return [
617+
LogSearchAgent(
618+
log_paths=log_folder_path,
619+
deployment_name=software_deployment_name,
620+
api_key=azure_openai_api_key,
621+
base_url=azure_openai_endpoint,
622+
),
623+
CodeSearchAgent(
624+
code_paths=[code_path],
625+
deployment_name=software_deployment_name,
626+
api_key=azure_openai_api_key,
627+
base_url=azure_openai_endpoint,
628+
),
629+
ChatAgent(
630+
chat_client=summary_chat_client,
631+
name=SUMMARY_AGENT_NAME,
632+
description="Summarizes and formats final answer.",
633+
instructions=final_answer_prompt,
634+
tools=[],
635+
temperature=chat_options.temperature,
636+
top_p=chat_options.top_p,
637+
max_tokens=chat_options.max_tokens,
638+
),
639+
]
621640

622641
# Create summary agent for final answer synthesis
623-
final_answer_prompt = _load_prompt("final_answer.txt", flow="default")
624-
chat_options = create_agent_chat_options()
625-
summary_chat_client = AzureOpenAIChatClient(
626-
api_key=azure_openai_api_key,
627-
endpoint=azure_openai_endpoint,
628-
deployment_name=general_deployment_name,
629-
)
630-
summary_agent = ChatAgent(
631-
chat_client=summary_chat_client,
632-
name=SUMMARY_AGENT_NAME,
633-
description="Summarizes and formats final answer.",
634-
instructions=final_answer_prompt,
635-
tools=[],
636-
temperature=chat_options.temperature,
637-
top_p=chat_options.top_p,
638-
max_tokens=chat_options.max_tokens,
639-
)
640-
641642
logger.info("Building Sequential workflow...")
643+
print("Building Sequential workflow...")
642644
workflow = (
643-
SequentialBuilder()
644-
.participants(
645-
[
646-
log_search_agent,
647-
code_search_agent,
648-
summary_agent,
649-
]
650-
)
651-
.build()
645+
SequentialBuilder().participants(participants=make_participants()).build()
652646
)
653647

654648
logger.info("executing run...")
649+
print("Executing run...")
655650

656651
async def _run() -> str:
657652
final_text: str = ""
653+
print("running workflow run stream...")
658654
async for event in workflow.run_stream(analysis_prompt):
659655
# Lifecycle: executor invoked
660656
if isinstance(event, ExecutorInvokedEvent):
661657
exec_id = getattr(event, "executor_id", None)
662658
logger.info(f"[ExecutorInvoked] executor={exec_id}")
659+
print(f"[ExecutorInvoked] executor={exec_id}")
663660
continue
664661

665662
# Lifecycle: executor completed
666663
if isinstance(event, ExecutorCompletedEvent):
667664
exec_id = getattr(event, "executor_id", None)
668665
logger.info(f"[ExecutorCompleted] executor={exec_id}")
666+
print(f"[ExecutorCompleted] executor={exec_id}")
669667
continue
670668

671669
# Final aggregated output from SequentialBuilder: list[ChatMessage]

0 commit comments

Comments
 (0)