mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-05-05 15:30:48 +00:00
Update model_controller.py
This commit is contained in:
parent
7d224c2585
commit
9bbc9c9ffe
1 changed files with 9 additions and 1 deletions
|
|
@ -25,12 +25,20 @@ class ValidateModelResponse(BaseModel):
|
|||
async def validate_model(request: ValidateModelRequest):
|
||||
try:
|
||||
extra = request.extra_params or {}
|
||||
|
||||
# Ensure the model config forces tool usage when supported (e.g., OpenAI tool_choice)
|
||||
model_config = (
|
||||
request.model_config_dict.copy() if request.model_config_dict else {}
|
||||
)
|
||||
# Always require tool call for the validation prompt
|
||||
model_config.setdefault("tool_choice", "required")
|
||||
|
||||
agent = create_agent(
|
||||
request.model_platform,
|
||||
request.model_type,
|
||||
api_key=request.api_key,
|
||||
url=request.url,
|
||||
model_config_dict=request.model_config_dict,
|
||||
model_config_dict=model_config,
|
||||
**extra,
|
||||
)
|
||||
response = agent.step(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue