mirror of
https://github.com/EvolutionAPI/adk-python.git
synced 2025-07-16 04:02:55 -06:00
Raise HTTPException when running evals in fast_api if google-adk[eval] is not installed.
PiperOrigin-RevId: 764798561
This commit is contained in:
parent
7e637d3fa0
commit
1de5c340d8
@ -501,6 +501,7 @@ def get_fast_api_app(
|
||||
root_agent = agent_loader.load_agent(app_name)
|
||||
run_eval_results = []
|
||||
eval_case_results = []
|
||||
try:
|
||||
async for eval_case_result in run_evals(
|
||||
eval_set_to_evals,
|
||||
root_agent,
|
||||
@ -529,6 +530,9 @@ def get_fast_api_app(
|
||||
session_id=eval_case_result.session_id,
|
||||
)
|
||||
eval_case_results.append(eval_case_result)
|
||||
except ModuleNotFoundError as e:
|
||||
logger.exception("%s", e)
|
||||
raise HTTPException(status_code=400, detail=str(e)) from e
|
||||
|
||||
eval_set_results_manager.save_eval_set_result(
|
||||
app_name, eval_set_id, eval_case_results
|
||||
|
Loading…
Reference in New Issue
Block a user