mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-04-28 11:40:25 +00:00
Revert "feat: add model type autocomplete with api based suggestions and plat…" (#1352)
This commit is contained in:
parent
73cea2f0ef
commit
ddada3e642
23 changed files with 28 additions and 1081 deletions
|
|
@ -18,7 +18,6 @@ from fastapi import APIRouter, HTTPException
|
|||
from pydantic import BaseModel, Field
|
||||
|
||||
from app.component.error_format import normalize_error_to_openai_format
|
||||
from app.component.model_suggestions import get_model_type_suggestions
|
||||
from app.component.model_validation import (
|
||||
ValidationErrorType,
|
||||
ValidationStage,
|
||||
|
|
@ -290,28 +289,3 @@ async def validate_model(request: ValidateModelRequest):
|
|||
},
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
class ModelTypeSuggestionRequest(BaseModel):
|
||||
platform: str | None = Field(None, description="Model platform")
|
||||
|
||||
|
||||
class ModelTypeSuggestionResponse(BaseModel):
|
||||
model_types: list[str] = Field(
|
||||
..., description="List of available model types"
|
||||
)
|
||||
|
||||
|
||||
@router.post("/model/types")
|
||||
async def get_model_types(request: ModelTypeSuggestionRequest):
|
||||
"""Return CAMEL model types for the given platform, newest first."""
|
||||
try:
|
||||
return ModelTypeSuggestionResponse(
|
||||
model_types=get_model_type_suggestions(request.platform)
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error("Error getting model types: %s", e, exc_info=True)
|
||||
raise HTTPException(
|
||||
status_code=500,
|
||||
detail={"message": f"Failed to get model types: {e}"},
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue