Commit Graph

447 Commits

Author SHA1 Message Date
Xiang (Sean) Zhou c5b976b306 chore: Create the context cache based on the token count of previous request
before this change, we estimate the token count of the contents to cache and use it to compare with the threshold user set. but that's not precise , so we use the actual prompt token count of previous llm request.

We won't create cache for the very initial request

PiperOrigin-RevId: 814484840
2025-10-02 19:22:00 -07:00
Xuan Yang d3148dacc9 ADK changes
PiperOrigin-RevId: 814319961
2025-10-02 13:44:05 -07:00
Ankur Sharma 65554d6621 chore: Update AgentEvaluator to use EvalConfig
We updated the one of the public methods on AgentEvaluator to take in eval metric configurations using a more formal EvalConfig data model.

We also mark "criteria" field on the method as deprecated.

Updated some integration test cases.

PiperOrigin-RevId: 814314134
2025-10-02 13:43:44 -07:00
George Weale e68006386f fix: Fixes a bug that causes intermittent pydantic validation errors when uploading files
The root cause is an unsafe in-memory mutation. The `SaveFilesAsArtifactsPlugin` was saving a direct reference to the message part and then modifying the message list in-place. This created a race condition where downstream code could alter the original part *after* it had been saved as an artifact, leading to a corrupted state.
This CL saves a `copy.copy()` of the artifact, which create a snapshot of the data.
Also Changes the plugin to return a new `types.Content` object instead of modifying the original message in-place

PiperOrigin-RevId: 814308070
2025-10-02 13:43:34 -07:00
George Weale f667c7445e chore: deprecate global_instructions and make it a plugin instead
PiperOrigin-RevId: 814307563
2025-10-02 13:43:22 -07:00
Xiang (Sean) Zhou 571c802fba fix: Convert argument to pydantic model when tool declare to accept pydantic model as argument
PiperOrigin-RevId: 814273005
2025-10-02 13:43:00 -07:00
Xiang (Sean) Zhou c46308b7cf chore: Add session patch endpoint to api server for state update
This is allow user to update session state without running the agent. e.g. if I want to test some case when session has certain state on adk web.

PiperOrigin-RevId: 814252851
2025-10-02 13:42:49 -07:00
Google Team Member a5cf80b952 fix: Handling of A2ATaskStatusUpdateEvent when streaming in remote_a2a_agent
The proto has the Message object in the TaskStatus.

PiperOrigin-RevId: 813844289
2025-10-01 11:43:03 -07:00
Joseph Pagadora 8c73d29c75 feat: Add HallucinationsV1 evaluation metric
PiperOrigin-RevId: 813456369
2025-09-30 15:39:10 -07:00
Xuan Yang a239716930 ADK changes
PiperOrigin-RevId: 813321782
2025-09-30 10:18:30 -07:00
Shangjie Chen 83fd045718 feat: Migrate VertexAiMemoryBankService to use Agent Engine SDK
PiperOrigin-RevId: 813104746
2025-09-29 23:14:50 -07:00
Shangjie Chen ce9c39f5a8 feat: Implement checkpoint and resume logic for LoopAgent
PiperOrigin-RevId: 813096880
2025-09-29 22:45:57 -07:00
Xinran (Sherry) Tang fbf75761bb feat: Modify runner to support resuming an invocation (optionally with a function response)
PiperOrigin-RevId: 813008406
2025-09-29 17:35:18 -07:00
Xinran (Sherry) Tang f005414895 feat: Make resumable llm agents yield checkpoint events
PiperOrigin-RevId: 813001108
2025-09-29 17:08:58 -07:00
Google Team Member 8e5f361264 fix: Update remote_a2a_agent to better handle streaming events and avoid duplicate responses
Currently, the A2A Task -> ADK event conversion is producing the same events on the last two update events (the last is a status update marking the task complete)

The change here based on A2AClientEvent(task, update):
 - if the update == None: handle the non-streaming task case and also streaming case for the initial task creation event
 - if the update = TaskStatusUpdateEvent AND a message is set: emit an event with that message
 - if a task status update AND no message is set: don't emit event (for example, the final status update)
 - if the update is ArtifactUpdateEvent and it's final artifact: emit the event

PiperOrigin-RevId: 812878869
2025-09-29 11:42:49 -07:00
Shangjie Chen 2f1040f296 feat: Implement checkpoint and resume logic for ParallelAgent
PiperOrigin-RevId: 812658378
2025-09-29 00:26:32 -07:00
Google Team Member 3f28e30c6d feat: add citation_metadata to LlmResponse
PiperOrigin-RevId: 811997009
2025-09-26 16:31:01 -07:00
Ankur Sharma c984b9e552 feat: Add Rubric based tool use metric
The PR does two main things:
1) Introduces a new rubric based tool use metric
2) Given that we now have two rubric based metric, we refactor and create a new RubricBasedEvaluator interface.

PiperOrigin-RevId: 811983514
2025-09-26 15:47:42 -07:00
Shangjie Chen 1ee01cc05a feat: Implement checkpoint and resume logic for SequentialAgent
PiperOrigin-RevId: 811977004
2025-09-26 15:26:42 -07:00
Xinran (Sherry) Tang 28d44a365a test: Make testing_utils.InMemoryRunner support ADK App and add utils for extracting event contents for testing resumability
PiperOrigin-RevId: 811933527
2025-09-26 13:22:11 -07:00
Shangjie Chen 2c752934a8 feat: Skip running a workflow agent if it has no sub-agents
PiperOrigin-RevId: 811528166
2025-09-25 15:39:38 -07:00
Xinran (Sherry) Tang b2b80e7fa0 feat: Pause invocations on long running function calls for resumable apps
PiperOrigin-RevId: 811518771
2025-09-25 15:11:11 -07:00
Shangjie Chen 8b081751ed feat: Add core checkpointing primitive for base agent
PiperOrigin-RevId: 811458903
2025-09-25 12:35:36 -07:00
Max Ind e7528aebd4 feat(otel): adjust telemetry to follow OTLP 1.37 GenAI semconv
Changes include:
- Implementing missing attributes. e.g. 'gen_ai.agent.name'
- Specifying reasons for not filling out some conditionally required attributes. e.g. 'gen_ai.data_source.id'
- Specifying reasons for not including certain attributes which are specified in current semconv. e.g. inference attributes on agent spans

PiperOrigin-RevId: 811379706
2025-09-25 09:25:15 -07:00
Xinran (Sherry) Tang cbb6e4945a feat: Add a app level config for resumable applications
PiperOrigin-RevId: 811272046
2025-09-25 03:14:34 -07:00