Skip to content

Conversation

@vgnshiyer
Copy link
Contributor

Fixes #173

@hangfei hangfei self-requested a review April 22, 2025 04:22
Copy link
Collaborator

@hangfei hangfei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fix!

Please provide a before vs after fix log or screenshot.

@vgnshiyer
Copy link
Contributor Author

Code used for testing.

from google.adk.tools.agent_tool import AgentTool
from google.adk.agents import Agent

test_agent = Agent(
    name="test_agent",
    description="test_agent",
    model="gemini-2.0-flash"
)
agent_tool = AgentTool(agent=test_agent, skip_summarization=True)

print(agent_tool.__dict__)

Before

Screenshot 2025-04-21 at 9 37 03 PM

After

Screenshot 2025-04-21 at 9 38 41 PM

@vgnshiyer vgnshiyer requested a review from hangfei April 22, 2025 04:39
@hangfei
Copy link
Collaborator

hangfei commented Apr 22, 2025

@vgnshiyer Could you share the response you are getting?

@vgnshiyer
Copy link
Contributor Author

test_agent = Agent(
    name="test_agent",
    description="test_agent",
    model="gemini-2.0-flash"
)

root_agent = Agent(
    name="RootAgent",
    model="gemini-2.0-flash",
    description="Root Agent",
    tools=[AgentTool(agent=test_agent, skip_summarization=True)],
)

session_service = InMemorySessionService()
session_service.create_session(app_name="test_app", user_id="test_user", session_id="test_session")

runner = Runner(
    agent=root_agent,
    session_service=session_service,
    app_name="test_app",
)

def get_agent_response(query: str):
    content = Content(role="user", parts=[Part(text=query)])
    events = runner.run(user_id="test_user", session_id="test_session", new_message=content)
    for event in events:
        if event.is_final_response():
            return event.content.parts[0].text


print(get_agent_response("Hello"))

Screenshot 2025-04-21 at 10 10 47 PM

@hangfei hangfei added the ready to pull [Status] This PR is ready to be importing back to Google label Apr 22, 2025
@hangfei hangfei changed the title chore: add support for overriding skip_summarization in AgentTool fix: add support for overriding skip_summarization in AgentTool Apr 22, 2025
@hangfei hangfei changed the title fix: add support for overriding skip_summarization in AgentTool fix: fix support for overriding skip_summarization in AgentTool Apr 22, 2025
copybara-service bot pushed a commit that referenced this pull request Apr 22, 2025
--
94c7f95 by Vignesh Iyer <vgnshiyer@gmail.com>:

chore: add support for overriding `skip_summarization` in AgentTool
COPYBARA_INTEGRATE_REVIEW=#324 from vgnshiyer:main 94c7f95
PiperOrigin-RevId: 750060638
@hangfei hangfei merged commit 0e9096d into google:main Apr 22, 2025
8 checks passed
coder-aditi pushed a commit to coder-aditi/adk-python that referenced this pull request Jul 2, 2025
--
94c7f95 by Vignesh Iyer <vgnshiyer@gmail.com>:

chore: add support for overriding `skip_summarization` in AgentTool
COPYBARA_INTEGRATE_REVIEW=google#324 from vgnshiyer:main 94c7f95
PiperOrigin-RevId: 750060638
coder-aditi pushed a commit to coder-aditi/adk-python that referenced this pull request Jul 2, 2025
coder-aditi pushed a commit to coder-aditi/adk-python that referenced this pull request Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready to pull [Status] This PR is ready to be importing back to Google

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Constructor to have param to skip_summarization

2 participants