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
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ REDIS_URL=redis://localhost:6379/0
# LLM Provider Configuration
# Supported providers: "gemini", "openai", "fake"
LLM_PROVIDER=gemini
LLM_MODEL=gemini-2.0-flash
LLM_MODEL=gemini-3.7-flash
GEMINI_API_KEY=your_gemini_api_key_here
OPENAI_API_KEY=your_openai_api_key_here

Expand Down
2 changes: 1 addition & 1 deletion agentkit/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Settings(BaseSettings):
description="LLM provider: gemini, openai, or fake.",
)
LLM_MODEL: str = Field(
default="gemini-2.0-flash",
default="gemini-3.7-flash",
description="LLM model identifier.",
)
GEMINI_API_KEY: str | None = Field(
Expand Down
2 changes: 1 addition & 1 deletion agentkit/llm/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def create_llm_client(
normalized_provider = provider.strip().lower()

if normalized_provider == "gemini":
default_model = model or "gemini-2.0-flash"
default_model = model or "gemini-3.7-flash"
return GeminiClient(api_key=api_key, model=default_model, **kwargs)

if normalized_provider == "openai":
Expand Down
6 changes: 3 additions & 3 deletions agentkit/llm/gemini.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ class GeminiClient(LLMClient):
def __init__(
self,
api_key: str | None = None,
model: str = "gemini-2.0-flash",
model: str = "gemini-3.7-flash",
client: Any | None = None,
) -> None:
"""Initialize the Gemini client adapter.

Args:
api_key: Gemini API key. If omitted, google-genai attempts ADC/env lookup.
model: Gemini model identifier (default: gemini-2.0-flash).
model: Gemini model identifier (default: gemini-3.7-flash).
client: Optional pre-configured genai.Client instance (useful for mocking).
"""
self.model = model
Expand Down Expand Up @@ -107,7 +107,7 @@ async def chat(
)
contents.append(
types.Content(
role="tool",
role="user",
parts=[
types.Part.from_function_response(
name=tool_name,
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ services:
# Compose keeps ${VAR:-} so `down`, `ps` and `logs` still work without it.
- API_KEYS=${API_KEYS:-}
- LLM_PROVIDER=${LLM_PROVIDER:-gemini}
- LLM_MODEL=${LLM_MODEL:-gemini-2.0-flash}
- LLM_MODEL=${LLM_MODEL:-gemini-3.7-flash}
- GEMINI_API_KEY=${GEMINI_API_KEY:-}
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
volumes:
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_default_settings() -> None:
API_KEYS="key1,key2",
)
assert settings.LLM_PROVIDER == "gemini"
assert settings.LLM_MODEL == "gemini-2.0-flash"
assert settings.LLM_MODEL == "gemini-3.7-flash"
assert settings.MAX_STEPS == 10
assert settings.RUN_TIMEOUT_S == 60
assert settings.TOOL_TIMEOUT_S == 15
Expand Down
11 changes: 7 additions & 4 deletions tests/unit/test_gemini_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ async def test_gemini_multi_turn_history_translation(mock_genai_client: MagicMoc
response = await adapter.chat(messages)
assert response.text == "Result is 25."
assert mock_genai_client.aio.models.generate_content.called
_, kwargs = mock_genai_client.aio.models.generate_content.call_args
contents = kwargs["contents"]
assert contents[2].role == "user"


@pytest.mark.asyncio
Expand Down Expand Up @@ -192,15 +195,15 @@ async def test_gemini_thought_signature_capture_and_forward(mock_genai_client: M
assert model_part.function_call.name == "calculator"
assert model_part.thought_signature == b"opaque_thought_sig_xyz"

# Tool message must have role="tool" and function_response name resolved to "calculator"
# Tool message must have role="user" and function_response name resolved to "calculator"
tool_content = contents[2]
assert tool_content.role == "tool"
assert tool_content.role == "user"
tool_part = tool_content.parts[0]
assert tool_part.function_response.name == "calculator"
assert tool_part.function_response.response == {"result": "4"}


def test_gemini_default_model(mock_genai_client: MagicMock) -> None:
"""Verify GeminiClient defaults to gemini-2.0-flash."""
"""Verify GeminiClient defaults to gemini-3.7-flash."""
adapter = GeminiClient(api_key="fake-key", client=mock_genai_client)
assert adapter.model == "gemini-2.0-flash"
assert adapter.model == "gemini-3.7-flash"
4 changes: 4 additions & 0 deletions tests/unit/test_llm_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ def test_create_gemini_client() -> None:
assert client.model == "gemini-2.5-pro"
assert client.api_key == "test-key-gemini"

client_default = create_llm_client(provider="gemini", api_key="test-key-gemini")
assert isinstance(client_default, GeminiClient)
assert client_default.model == "gemini-3.7-flash"


def test_create_openai_client() -> None:
client = create_llm_client(
Expand Down
Loading