mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-04-28 11:40:25 +00:00
enhance: add comprehensive unit tests PR223
This commit is contained in:
parent
1917d599e6
commit
7e72e6b115
6 changed files with 80 additions and 44 deletions
|
|
@ -44,8 +44,16 @@ async def validate_model(request: ValidateModelRequest):
|
|||
)
|
||||
except Exception as e:
|
||||
return ValidateModelResponse(is_valid=False, is_tool_calls=False, message=str(e))
|
||||
is_valid = bool(response)
|
||||
is_tool_calls = False
|
||||
|
||||
if response and hasattr(response, 'info') and response.info:
|
||||
tool_calls = response.info.get("tool_calls", [])
|
||||
if tool_calls and len(tool_calls) > 0:
|
||||
is_tool_calls = tool_calls[0].result == "Tool execution completed successfully for https://www.camel-ai.org, Website Content: Welcome to CAMEL AI!"
|
||||
|
||||
return ValidateModelResponse(
|
||||
is_valid=True if response else False,
|
||||
is_tool_calls=response.info["tool_calls"][0].result == "Tool execution completed successfully for https://www.camel-ai.org, Website Content: Welcome to CAMEL AI!",
|
||||
is_valid=is_valid,
|
||||
is_tool_calls=is_tool_calls,
|
||||
message="",
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue