feat: add tool mode unsupported list for groq Models (#7497)
* update groq Models Tested curated list of latest models * add tool mode tested models * Update src/backend/base/langflow/base/models/groq_constants.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * [autofix.ci] apply automated fixes --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
ececff8e90
commit
d421de5b8b
2 changed files with 19 additions and 3 deletions
|
|
@ -42,6 +42,16 @@ UNSUPPORTED_GROQ_MODELS = [
|
|||
"whisper-large-v3-turbo", # OpenAI
|
||||
"distil-whisper-large-v3-en", # HuggingFace
|
||||
]
|
||||
|
||||
TOOL_CALLING_UNSUPPORTED_GROQ_MODELS = [
|
||||
"allam-2-7b", # Saudi Data and AI Authority (SDAIA)
|
||||
"llama-3.1-8b-instant", # Meta Slow Response
|
||||
"llama-guard-3-8b", # Meta
|
||||
"llama-3.2-11b-vision-preview", # Meta
|
||||
"llama3-8b-8192", # Meta
|
||||
"llama3-70b-8192", # Meta
|
||||
"deepseek-r1-distill-llama-70b", # DeepSeek
|
||||
]
|
||||
# Combined list of all current models for backward compatibility
|
||||
GROQ_MODELS = GROQ_PRODUCTION_MODELS + GROQ_PREVIEW_MODELS
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,11 @@ import requests
|
|||
from loguru import logger
|
||||
from pydantic.v1 import SecretStr
|
||||
|
||||
from langflow.base.models.groq_constants import GROQ_MODELS
|
||||
from langflow.base.models.groq_constants import (
|
||||
GROQ_MODELS,
|
||||
TOOL_CALLING_UNSUPPORTED_GROQ_MODELS,
|
||||
UNSUPPORTED_GROQ_MODELS,
|
||||
)
|
||||
from langflow.base.models.model import LCModelComponent
|
||||
from langflow.field_typing import LanguageModel
|
||||
from langflow.field_typing.range_spec import RangeSpec
|
||||
|
|
@ -78,7 +82,9 @@ class GroqModel(LCModelComponent):
|
|||
response = requests.get(url, headers=headers, timeout=10)
|
||||
response.raise_for_status()
|
||||
model_list = response.json()
|
||||
model_ids = [model["id"] for model in model_list.get("data", [])]
|
||||
model_ids = [
|
||||
model["id"] for model in model_list.get("data", []) if model["id"] not in UNSUPPORTED_GROQ_MODELS
|
||||
]
|
||||
except (ImportError, ValueError, requests.exceptions.RequestException) as e:
|
||||
logger.exception(f"Error getting model names: {e}")
|
||||
model_ids = GROQ_MODELS
|
||||
|
|
@ -94,7 +100,7 @@ class GroqModel(LCModelComponent):
|
|||
api_key=self.api_key,
|
||||
base_url=self.base_url,
|
||||
)
|
||||
if not self.supports_tool_calling(model_with_tool):
|
||||
if not self.supports_tool_calling(model_with_tool) or model in TOOL_CALLING_UNSUPPORTED_GROQ_MODELS:
|
||||
model_ids.remove(model)
|
||||
return model_ids
|
||||
return model_ids
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue