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 aieng-eval-agents/aieng/agent_evals/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


if TYPE_CHECKING:
from .knowledge_agent.grounding_tool import GroundedResponse
from .tools import GroundedResponse


# Custom theme for consistent styling
Expand Down
12 changes: 6 additions & 6 deletions aieng-eval-agents/aieng/agent_evals/knowledge_agent/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
"""

from aieng.agent_evals.configs import Configs
from aieng.agent_evals.tools import (
GroundedResponse,
GroundingChunk,
create_google_search_tool,
format_response_with_citations,
)

from .agent import KnowledgeAgentManager, KnowledgeGroundedAgent
from .evaluation import (
Expand All @@ -24,12 +30,6 @@
DSQAExample,
EvaluationResult,
)
from .grounding_tool import (
GroundedResponse,
GroundingChunk,
create_google_search_tool,
format_response_with_citations,
)
from .tracing import flush_traces, init_tracing, is_tracing_enabled


Expand Down
11 changes: 5 additions & 6 deletions aieng-eval-agents/aieng/agent_evals/knowledge_agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@
from typing import Any

from aieng.agent_evals.configs import Configs
from google.adk.agents import Agent
from google.adk.runners import Runner
from google.adk.sessions import InMemorySessionService
from google.genai import types

from .grounding_tool import (
from aieng.agent_evals.tools import (
GroundedResponse,
GroundingChunk,
create_google_search_tool,
)
from google.adk.agents import Agent
from google.adk.runners import Runner
from google.adk.sessions import InMemorySessionService
from google.genai import types


logger = logging.getLogger(__name__)
Expand Down
21 changes: 21 additions & 0 deletions aieng-eval-agents/aieng/agent_evals/tools/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"""Reusable tools for ADK agents.

This package provides modular tools for:
- Google Search (search.py)
"""

from .search import (
GroundedResponse,
GroundingChunk,
create_google_search_tool,
format_response_with_citations,
)


__all__ = [
# Search tools
"create_google_search_tool",
"format_response_with_citations",
"GroundedResponse",
"GroundingChunk",
]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Google Search grounding tool for knowledge-grounded QA using ADK.
"""Google Search tool for knowledge-grounded QA using ADK.

This module provides the GoogleSearchTool configuration for use with
Google ADK agents, enabling explicit and traceable web search capabilities.
Expand Down Expand Up @@ -70,9 +70,7 @@ def create_google_search_tool() -> GoogleSearchTool:

Examples
--------
>>> from aieng.agent_evals.knowledge_agent.grounding_tool import (
... create_google_search_tool,
... )
>>> from aieng.agent_evals.tools import create_google_search_tool
>>> search_tool = create_google_search_tool()
>>> # Use with an ADK agent
>>> agent = Agent(tools=[search_tool])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
KnowledgeAgentManager,
KnowledgeGroundedAgent,
)
from aieng.agent_evals.knowledge_agent.grounding_tool import GroundedResponse
from aieng.agent_evals.tools import GroundedResponse


class TestKnowledgeGroundedAgent:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Tests for tools package."""
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Tests for Google Search grounding tool."""
"""Tests for Google Search tool."""

from unittest.mock import MagicMock, patch

import pytest
from aieng.agent_evals.knowledge_agent.grounding_tool import (
from aieng.agent_evals.tools import (
GroundedResponse,
GroundingChunk,
create_google_search_tool,
Expand Down Expand Up @@ -81,7 +81,7 @@ def test_format_with_citations_no_sources(self):
class TestCreateGoogleSearchTool:
"""Tests for the create_google_search_tool function."""

@patch("aieng.agent_evals.knowledge_agent.grounding_tool.GoogleSearchTool")
@patch("aieng.agent_evals.tools.search.GoogleSearchTool")
def test_creates_tool_with_bypass_flag(self, mock_tool_class):
"""Test that the tool is created with bypass_multi_tools_limit=True."""
mock_tool = MagicMock()
Expand Down