Fix printing of agent output.
This commit is contained in:
parent
f0f7487485
commit
5053b36d8b
|
|
@ -6,6 +6,7 @@ from typing import Optional, Any, List
|
||||||
|
|
||||||
from langgraph.prebuilt import create_react_agent
|
from langgraph.prebuilt import create_react_agent
|
||||||
from ra_aid.console.formatting import print_stage_header
|
from ra_aid.console.formatting import print_stage_header
|
||||||
|
from ra_aid.console.output import print_agent_output
|
||||||
from ra_aid.tool_configs import (
|
from ra_aid.tool_configs import (
|
||||||
get_implementation_tools,
|
get_implementation_tools,
|
||||||
get_research_tools,
|
get_research_tools,
|
||||||
|
|
@ -127,11 +128,6 @@ def run_research_agent(
|
||||||
# Run agent with retry logic
|
# Run agent with retry logic
|
||||||
return run_agent_with_retry(agent, prompt, run_config)
|
return run_agent_with_retry(agent, prompt, run_config)
|
||||||
|
|
||||||
def print_agent_output(chunk: dict[str, BaseMessage]) -> None:
|
|
||||||
"""Print agent output chunks."""
|
|
||||||
if chunk.get("delta") and chunk["delta"].content:
|
|
||||||
console.print(chunk["delta"].content, end="", style="blue")
|
|
||||||
|
|
||||||
def print_error(msg: str) -> None:
|
def print_error(msg: str) -> None:
|
||||||
"""Print error messages."""
|
"""Print error messages."""
|
||||||
console.print(f"\n{msg}", style="red")
|
console.print(f"\n{msg}", style="red")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue