mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-02-14 00:35:02 -05:00
fix(builder): normalize query hyphens for LLM model search matching
Apply same hyphen-to-space normalization to the query that's applied to model slugs. This ensures 'gpt-4' matches 'gpt 4o' in search.
This commit is contained in:
@@ -509,8 +509,10 @@ async def _get_static_counts():
|
||||
def _matches_llm_model(schema_cls: type[BlockSchema], query: str) -> bool:
|
||||
for field in schema_cls.model_fields.values():
|
||||
if field.annotation == LlmModel:
|
||||
# Normalize query same as model slugs (hyphens to spaces) for matching
|
||||
normalized_model_query = query.replace("-", " ")
|
||||
# Check if query matches any value in llm_models from registry
|
||||
if any(query in name for name in _get_llm_models()):
|
||||
if any(normalized_model_query in name for name in _get_llm_models()):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user