|
51 | 51 | Results saved to: output/capability_{id}_{timestamp}/<domain>.json |
52 | 52 | e.g. output/capability_2_feb_18_11_21am/hockey.json |
53 | 53 | """ |
| 54 | +import os |
54 | 55 | import asyncio |
55 | 56 | from contextlib import AsyncExitStack |
56 | 57 | import json |
@@ -145,7 +146,7 @@ def _setup_phoenix(endpoint: str, project_name: str = "enterprise-benchmark") -> |
145 | 146 | Path(__file__).parent / "benchmark" / "mcp_connection_config.yaml" |
146 | 147 | ) |
147 | 148 | # Timeout for agent execution (seconds) |
148 | | -AGENT_TIMEOUT_SECONDS = 300 |
| 149 | +AGENT_TIMEOUT_SECONDS = float(os.environ.get("AGENT_TIMEOUT_SECONDS", "300")) |
149 | 150 |
|
150 | 151 |
|
151 | 152 | async def run_benchmark_for_domain( |
@@ -316,7 +317,7 @@ async def run_benchmark_for_domain( |
316 | 317 | except Exception as e: |
317 | 318 | import traceback |
318 | 319 | result.status = "error" |
319 | | - result.error = str(e) |
| 320 | + result.error = f"{type(e).__name__} "+str(e) |
320 | 321 | tlog(f" Status: error | {type(e).__name__}: {str(e)[:200]}") |
321 | 322 | tlog(f" Traceback: {traceback.format_exc()}") |
322 | 323 |
|
@@ -357,6 +358,7 @@ async def run_capability( |
357 | 358 | top_k_tools: int = 0, |
358 | 359 | max_iterations: Optional[int] = None, |
359 | 360 | restart: bool = False, |
| 361 | + temperature: float = 0.0, |
360 | 362 | ) -> List[BenchmarkResult]: |
361 | 363 | """Run benchmark for a given capability_id, iterating over all domain files.""" |
362 | 364 |
|
@@ -397,7 +399,7 @@ async def run_capability( |
397 | 399 | tlog(f"Restart mode: skipping {len(completed)} already-completed domain(s): {sorted(completed)}") |
398 | 400 | domain_list = [d for d in domain_list if d not in completed] |
399 | 401 |
|
400 | | - llm = create_llm(provider=provider, model=model) |
| 402 | + llm = create_llm(provider=provider, model=model, temperature=temperature) |
401 | 403 |
|
402 | 404 | # Process each domain, writing output incrementally |
403 | 405 | all_results: List[BenchmarkResult] = [] |
@@ -553,6 +555,12 @@ def main(): |
553 | 555 | default="enterprise-benchmark", |
554 | 556 | help="Phoenix project name for grouping traces (default: enterprise-benchmark)", |
555 | 557 | ) |
| 558 | + parser.add_argument( |
| 559 | + "--temperature", |
| 560 | + type=float, |
| 561 | + default=0.0, |
| 562 | + help="LLM temperature (default: 0.0)" |
| 563 | + ) |
556 | 564 |
|
557 | 565 | args = parser.parse_args() |
558 | 566 | capability_ids = args.capability_id # list of ints now |
@@ -588,6 +596,7 @@ def _make_run_task_coro(tid: int): |
588 | 596 | top_k_tools=args.top_k_tools, |
589 | 597 | max_iterations=args.max_iterations, |
590 | 598 | restart=args.restart, |
| 599 | + temperature=args.temperature |
591 | 600 | ) |
592 | 601 |
|
593 | 602 | def _make_list_tools_coro(tid: int): |
|
0 commit comments