feat: enhance agent TUI and CLI with streaming responses and model selection improvements

- Added a `_safe_render` function to escape Rich markup and convert markdown to Rich format.
- Implemented token-by-token streaming for agent responses in the TUI, improving user experience during interactions.
- Updated the CLI to allow selection of LLM providers and models, enhancing flexibility in agent creation.
- Refactored benchmark case paths to use a `tests` directory instead of `benchmarks`.
- Introduced a `last_stream_result` property in the `NewAgent` class to retrieve the latest streaming response.

These changes aim to provide a more interactive and user-friendly experience in managing agents within the CrewAI framework.
This commit is contained in:
Joao Moura
2026-05-12 16:03:50 -04:00
committed by alex-clawd
parent fe7f730546
commit 6cb29dce65
7 changed files with 235 additions and 87 deletions

View File

@@ -192,12 +192,12 @@ def _train_new_agents(agent_files: list, n_iterations: int) -> None:
from crewai_cli.benchmark import load_benchmark_cases
benchmarks_dir = Path("benchmarks")
tests_dir = Path("tests")
agents_trained = 0
for agent_path in agent_files:
agent_name = agent_path.stem
cases_path = benchmarks_dir / f"{agent_name}_cases.json"
cases_path = tests_dir / f"{agent_name}_cases.json"
if not cases_path.exists():
click.secho(f" Skipping {agent_name} — no {cases_path}", fg="yellow")