feat: add is_active flag to model providers and update provider filtering (#8588)
* update model constants * [autofix.ci] apply automated fixes * update model input constants to reuse the filtered data * Update test_agent_component.py * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
aeebbd3bfc
commit
f4bbfd030b
18 changed files with 48 additions and 114 deletions
|
|
@ -4,7 +4,9 @@ from uuid import uuid4
|
|||
|
||||
import pytest
|
||||
from langflow.base.models.anthropic_constants import ANTHROPIC_MODELS
|
||||
from langflow.base.models.model_input_constants import MODEL_PROVIDERS_DICT
|
||||
from langflow.base.models.model_input_constants import (
|
||||
MODEL_PROVIDERS,
|
||||
)
|
||||
from langflow.base.models.openai_constants import (
|
||||
OPENAI_MODEL_NAMES,
|
||||
OPENAI_REASONING_MODEL_NAMES,
|
||||
|
|
@ -64,7 +66,7 @@ class TestAgentComponent(ComponentTestBaseWithoutClient):
|
|||
assert updated_config["agent_llm"]["value"] == "OpenAI"
|
||||
assert isinstance(updated_config["agent_llm"]["options"], list)
|
||||
assert len(updated_config["agent_llm"]["options"]) > 0
|
||||
assert all(provider in updated_config["agent_llm"]["options"] for provider in MODEL_PROVIDERS_DICT)
|
||||
assert all(provider in updated_config["agent_llm"]["options"] for provider in MODEL_PROVIDERS)
|
||||
assert "Custom" in updated_config["agent_llm"]["options"]
|
||||
|
||||
# Verify model_name field is populated for OpenAI
|
||||
|
|
@ -82,7 +84,7 @@ class TestAgentComponent(ComponentTestBaseWithoutClient):
|
|||
assert updated_config["agent_llm"]["value"] == "Anthropic"
|
||||
assert isinstance(updated_config["agent_llm"]["options"], list)
|
||||
assert len(updated_config["agent_llm"]["options"]) > 0
|
||||
assert all(provider in updated_config["agent_llm"]["options"] for provider in MODEL_PROVIDERS_DICT)
|
||||
assert all(provider in updated_config["agent_llm"]["options"] for provider in MODEL_PROVIDERS)
|
||||
assert "Anthropic" in updated_config["agent_llm"]["options"]
|
||||
assert updated_config["agent_llm"]["input_types"] == []
|
||||
options = updated_config["model_name"]["options"]
|
||||
|
|
@ -94,7 +96,7 @@ class TestAgentComponent(ComponentTestBaseWithoutClient):
|
|||
assert updated_config["agent_llm"]["value"] == "Custom"
|
||||
assert isinstance(updated_config["agent_llm"]["options"], list)
|
||||
assert len(updated_config["agent_llm"]["options"]) > 0
|
||||
assert all(provider in updated_config["agent_llm"]["options"] for provider in MODEL_PROVIDERS_DICT)
|
||||
assert all(provider in updated_config["agent_llm"]["options"] for provider in MODEL_PROVIDERS)
|
||||
assert "Custom" in updated_config["agent_llm"]["options"]
|
||||
assert updated_config["agent_llm"]["input_types"] == ["LanguageModel"]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue