Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions agentflow/core/llm/client_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ def detect_provider(model: str, use_vertex_ai: bool = False) -> str:
return "openai"


def resolve_provider_and_model(
model: str, use_vertex_ai: bool = False
) -> tuple[str, str]:
def resolve_provider_and_model(model: str, use_vertex_ai: bool = False) -> tuple[str, str]:
"""Resolve a model string into a concrete ``(provider, model)`` pair.

Unlike :func:`detect_provider`, this also returns the model name that should
Expand Down
7 changes: 7 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ def setup_test_environment():
# Set dummy Google API key for tests
os.environ.setdefault("GEMINI_API_KEY", "dummy-gemini-key-for-testing-only")

# Vertex AI selection must NOT be inherited from a developer's .env / shell.
# Agent() reads GOOGLE_GENAI_USE_VERTEXAI as the default for use_vertex_ai, so
# an ambient "true" would make provider auto-detection resolve to "google" for
# every model and break deterministic unit tests. Force it off for the suite;
# tests that exercise Vertex pass use_vertex_ai=True explicitly.
os.environ.pop("GOOGLE_GENAI_USE_VERTEXAI", None)

# Keep tests compatible while core graph transitions from
# Node(name, func, publisher) to Node(name, func).
Node.__init__ = _compat_node_init
Expand Down
5 changes: 0 additions & 5 deletions tests/normal_tests/test_custom_state_comprehensive.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,13 @@
from dataclasses import dataclass, field
from typing import Any

from dotenv import load_dotenv

from agentflow.storage.checkpointer import InMemoryCheckpointer
from agentflow.core.graph import StateGraph
from agentflow.core.state.agent_state import AgentState
from agentflow.core.state import Message
from agentflow.utils.converter import convert_messages


load_dotenv()


@dataclass
class TestCustomState(AgentState):
"""Test state with various field types."""
Expand Down
Loading