10000 [pull] main from google:main by pull[bot] · Pull Request #100 · Stars1233/adk-python · GitHub
[go: up one dir, main page]

Skip to content

[pull] main from google:main #100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 136 commits into
base: main
Choose a base branch
from
Open

[pull] main from google:main #100

wants to merge 136 commits into from

Conversation

pull[bot]
Copy link
@pull pull bot commented Jun 4, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

Summary by Sourcery

Prepare v1.2.0 release with new features, bug fixes, and core service enhancements.

New Features:

  • Add support for engine-based agent deployments and optional GCS artifact storage in ADK CLI and web UI
  • Extend tool integrations with LangChain structured tools, anthropic model updates, and configurable Vertex AI search
  • Enhance UI with agent visualization, resizable image dialog, HTML artifact rendering, and session export capabilities
  • Implement local evaluation sets manager with CRUD operations for eval cases

Bug Fixes:

  • Resolve numerous issues including Windows compatibility, caching warnings, session deletion errors, artifact handling, function schema generation, parallel agent behavior, and telemetry parsing

Enhancements:

  • Refactor session services to enforce timeouts, log deletion errors, augment in-memory session warnings, and centralize artifact forwarding via a new ForwardingArtifactService

CI:

  • Enable release-please workflow for automated releases

Documentation:

  • Add sample agent illustrating state via callbacks, fix typos and broken links, and refine CONTRIBUTING and README documentation

Tests:

  • Add unit tests for agent tool artifact workflows and local evaluation results manager

Chores:

  • Update version to 1.2.0, refresh CHANGELOG, and extract common options for adk web and adk api_server

hangfei and others added 7 commits June 4, 2025 09:29
- Add missing override.
- Add warning to failed actions.
- Remove unused import.
- Remove unused fields.
- Add type checking.

PiperOrigin-RevId: 767209697
PiperOrigin-RevId: 767218068
@pull pull bot added the ⤵️ pull label Jun 4, 2025
Copy link
gitstream-cm bot commented Jun 4, 2025

🚨 gitStream Monthly Automation Limit Reached 🚨

Your organization has exceeded the number of pull requests allowed for automation with gitStream.
Monthly PRs automated: 250/250

To continue automating your PR workflows and unlock additional features, please contact LinearB.

Copy link
coderabbitai bot commented Jun 4, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Join our Discord community for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
sourcery-ai bot commented Jun 4, 2025

Reviewer's Guide

This PR prepares the 1.2.0 release by updating the changelog and version, refactors artifact forwarding in the agent tool, strengthens session services with improved error handling and logging, extends testing coverage, and introduces new LocalEvalSetResultsManager tests.

Sequence Diagram: ForwardingArtifactService - Save Artifact

sequenceDiagram
    participant Client as "Client (e.g. Runner)"
    participant fas as ForwardingArtifactService
    participant tc as ToolContext

    Client->>fas: save_artifact(filename, artifact)
    note right of fas: app_name, user_id, session_id from call are used
    fas->>tc: save_artifact(filename, artifact)
    tc-->>fas: artifact_id
    fas-->>Client: artifact_id
Loading

Sequence Diagram: ForwardingArtifactService - Delete Artifact

sequenceDiagram
    participant Client as "Client (e.g. Runner)"
    participant fas as ForwardingArtifactService
    participant ic as "_InvocationContext (via ToolContext)"
    participant parentAS as "Parent's BaseArtifactService (via _InvocationContext)"

    Client->>fas: delete_artifact(app, user, session, filename)
    note right of fas: Parameters app, user, session from call are ignored.
    fas->>ic: Access parent context (app_name, user_id, session_id, artifact_service)
    ic-->>fas: Returns parent context details & parentAS
    fas->>parentAS: delete_artifact(parent_app_name, parent_user_id, parent_session_id, filename)
    parentAS-->>fas: 
    fas-->>Client:
Loading

Class Diagram: AgentTool Artifact Handling Refactor

classDiagram
    class BaseArtifactService {
        <<Interface>>
        +save_artifact()
        +load_artifact()
        +list_artifact_keys()
        +delete_artifact()
        +list_versions()
    }
    class ForwardingArtifactService {
        -tool_context: ToolContext
        -_invocation_context: _InvocationContext
        +__init__(tool_context: ToolContext)
        +save_artifact(filename, artifact)
        +load_artifact(filename, version)
        +list_artifact_keys()
        +delete_artifact(filename)
        +list_versions(filename)
    }
    class ToolContext {
        #_invocation_context: _InvocationContext
        +save_artifact(filename, artifact)
        +load_artifact(filename, version)
        +list_artifacts()
    }
    class AgentTool {
        +run_async(tool_input, tool_context)
    }
    class _InvocationContext {
        +artifact_service: BaseArtifactService
        +app_name: str
        +user_id: str
        +session: Session
    }

    ForwardingArtifactService --|> BaseArtifactService : implements
    ForwardingArtifactService o-- ToolContext : uses
    AgentTool ..> ForwardingArtifactService : instantiates in run_async
    ToolContext o-- _InvocationContext : contains
    ForwardingArtifactService ..> _InvocationContext : accesses for delete/list_versions
Loading

Class Diagram: Session Service Updates

classDiagram
    class VertexAiSessionService {
        +__init__(project, location) // API client management refactored (obtained per-method)
        +create_session() // Added LRO polling, retry & timeout logic
        +delete_session() // Added error logging (try-except)
        #_convert_event_to_json(event: Event) : Dict~str, Any~ // Return type hint updated
        #_from_api_event(api_event: Dict~str, Any~) : Event // Return type hint updated
    }
    class InMemorySessionService {
        +delete_session() // Added @override, return behavior clarified
        +append_event() // Added warning logs for missing session/app/user
    }
Loading

File-Level Changes

Change Details Files
Bump version and update changelog for 1.2.0
  • Added detailed 1.2.0 release notes to CHANGELOG.md
  • Updated version in version.py to "1.2.0"
CHANGELOG.md
src/google/adk/version.py
Enhance agent tool tests with artifact support
  • Imported SequentialAgent into test_agent_tool
  • Removed skip marker and added test for artifact save/load across tools
tests/unittests/tools/test_agent_tool.py
Improve Vertex AI session service robustness
  • Removed direct client initialization in constructor
  • Added polling response tracking and timeout check in create_session
  • Wrapped delete_session call with try/except and logging
  • Added type annotations to helper functions
src/google/adk/sessions/vertex_ai_session_service.py
Refactor artifact forwarding in AgentTool
  • Replaced manual artifact forwarding loop with ForwardingArtifactService
  • Instantiated Runner with ForwardingArtifactService
src/google/adk/tools/agent_tool.py
src/google/adk/tools/_forwarding_artifact_service.py
Strengthen in-memory session service error handling
  • Marked delete_session with override and standardized return
  • Added warning logs when append_event fails due to missing session entries
src/google/adk/sessions/in_memory_session_service.py
Extend function parameter parser to handle null
  • Mapped Python None to JSON null type
src/google/adk/tools/_function_parameter_parse_util.py
Rename sample agent for clarity
  • Changed root agent name in hello_world_anthropic sample to match example
contributing/samples/hello_world_anthropic/agent.py
Add tests for LocalEvalSetResultsManager
  • Created comprehensive unittest for saving, retrieving, listing, and error cases
  • Mocked time and file operations to validate JSON output
tests/unittests/evaluation/test_local_eval_set_results_manager.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

google-genai-bot and others added 19 commits June 4, 2025 15:51
Fixes #1125

and add it to pyproject.toml. This was added to typing_extensions in 4.5.0. I followed versioning guidance from https://typing-extensions.readthedocs.io/en/latest/index.html#versioning-and-backwards-compatibility.

PiperOrigin-RevId: 767317467
PiperOrigin-RevId: 767338013
add a ADK triaging agent to help triaging issues.


This is an MVP. We can iterate further.
…ute in agent loader

PiperOrigin-RevId: 767447874
Partial fix for #1170

TODOs:
- UI rendering still has issue to match the event with the correct agent.
- graph building needs further fix when there is a workflow agent in the tree.
PiperOrigin-RevId: 767711701
PiperOrigin-RevId: 767732597
PiperOrigin-RevId: 767747328
Fixes #973, #1170

PiperOrigin-RevId: 767921051
hangfei and others added 30 commits June 18, 2025 16:35
the original code passed in wrong args. now fixed.
tested locally.

PiperOrigin-RevId: 773108589
given it was not correctly supported.

PiperOrigin-RevId: 773137317
PiperOrigin-RevId: 773140021
This change accepts the `google.auth.credentials.Credentials` type for `BigQueryCredentialsConfig`, so any subclass of that, including `google.oauth2.credentials.Credentials` would work to integrate with BigQuery service. This opens up a whole range of possibilities, such as using service account credentials to deploy an agent using these tools.

PiperOrigin-RevId: 773190440
PiperOrigin-RevId: 773867075
Also reorganize the fast_api_common_options. This resolves #1444.

PiperOrigin-RevId: 773890111
…unction call if user m
B41A
essage is a function response

PiperOrigin-RevId: 773895971
Merges #1471

Fixes #1436

COPYBARA_INTEGRATE_REVIEW=#1471 from bck-ob-gh:main 4c4f2b6
PiperOrigin-RevId: 774809270
Merge #1079

Fixes part of #356

Add usage attributes to span.
Note: Since the handling of GenAI event bodies in OpenTelemetry has not yet been determined, I have temporarily added only attributes related to usage.
COPYBARA_INTEGRATE_REVIEW=#1079 from soundTricker:feature/356-support-more-opentelemetry-semantics 99a9d03
PiperOrigin-RevId: 774834279
Merge #1451

## Description
Fixes #1306 by using `async for` with `await self.llm_client.acompletion()` instead of synchronous `for` loop.

## Changes
- Updated test mocks to properly handle async streaming by creating an async generator
- Ensured proper parameter handling to avoid duplicate stream parameter

## Testing Plan
- All unit tests now pass with the async streaming implementation
- Verified with `pytest tests/unittests/models/test_litellm.py` that all streaming tests pass
- Manually tested with a sample agent using LiteLLM to confirm streaming works properly

# Test Evidence:
https://youtu.be/hSp3otI79DM

Let me know if you need anything else from me for this PR

COPYBARA_INTEGRATE_REVIEW=#1451 from avidelatm:fix/litellm-async-streaming d35b9dc
PiperOrigin-RevId: 774835130
…ecify GCS bucket to store eval data

PiperOrigin-RevId: 774947795
… RougeEvaluator that is computes ROUGE-1 for "response_match_score" metric

PiperOrigin-RevId: 774949712
…FastAPI endpoint

PiperOrigin-RevId: 775327151
Add examples for for #1273

PiperOrigin-RevId: 775352677
Merge #1528

COPYBARA_INTEGRATE_REVIEW=#1528 from google:doc ec8325e
PiperOrigin-RevId: 775383121
…given their default value is None

PiperOrigin-RevId: 775397286
The intended behavior for include_contents='none' is to:
- Exclude conversation history from previous turns
- Still include current turn context (user input, tool calls/responses within current turn)

https://google.github.io/adk-docs/agents/llm-agents/#managing-context-include_contents

This resolves #1124

PiperOrigin-RevId: 775400036
Merge #1547

This PR replaces the `curl`-based installation of `uv` to instead use the [official GitHub Action from Astral](https://github.com/astral-sh/setup-uv).

Closes #1545

COPYBARA_INTEGRATE_REVIEW=#1547 from d33bs:use-uv-action 05ab7a1
PiperOrigin-RevId: 775402484
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0