Commit Graph

16 Commits

Author SHA1 Message Date
Xiang (Sean) Zhou
98c8a71d67 refactor: rename parameter name and add type annotation of _get_agent_to_run method
PiperOrigin-RevId: 763234780
2025-05-25 18:56:16 -07:00
Wei Sun (Jack)
e0851a1e57 chore: batch organize imports.
PiperOrigin-RevId: 761824628
2025-05-21 23:40:47 -07:00
Wei Sun (Jack)
0d7d7918b6 chore: logger = logging.getLogger(__name__) --> logger = logging.getLogger('google_adk.' + __name__)
PiperOrigin-RevId: 759894901
2025-05-16 23:04:02 -07:00
Selcuk Gun
509db3f9fb Add token usage to gemini (streaming), litellm and anthropic
Also included a token_usage sample that showcases the token usage of subagents with different models under a parent agent.

PiperOrigin-RevId: 759347015
2025-05-15 16:22:36 -07:00
Hangfei Lin
4188673b0f feat(live): Support live mode of sequential agent
Add a `task_completed` function to the agent so when a model finished the task, it can send a signal and the program knows it can go to next agent.

This cl include:
* Implements the `_run_live_impl` in `sequential_agent` so it can handle live case.
* Add an example for sequential agent.
* Improve error message for unimplemented _run_live_impl in other agents.

Note:
1. Compared to non-live case, live agents process a continuous streams of audio
or video, so it doesn't have a native way to tell if it's finished and should pass
to next agent or not. So we introduce a task_compelted() function so the
model can call this function to signal that it's finished the task and we
can move on to next agent.

2. live agents doesn't seems to be very useful or natural in parallel or loop agents so we don't implement it for now. If there is user demand, we can implement it easily using similar approach.

PiperOrigin-RevId: 758315430
2025-05-13 11:56:16 -07:00
Hangfei Lin
39f78dc28f feat(live): Support native(model-side) audio transcription for agent transferring in live mode.
The old implementation:
1. We only started transcription at the beginning of agent transferring.
2. The transcription service we used is not as good / fast as the model/native transcription.

In the current implementation, the live agent will rely on the llm's transcription, instead of our transcription when llm support audio transcription in the input. And in that case, the live agent won't use our own audio transcriber. This reduces the latency from 5secs to 2 secs during agent transferring. It also improves the transcription quality.

When the llm doesn't support audio transcription, we still use our audio transcriber to transcribe audio input.

PiperOrigin-RevId: 758296647
2025-05-13 11:13:08 -07:00
Shangjie Chen
c4ecef54bc fix: Generate event id at beginning, and regen for every new yield event. This is because trace module requires an event id.
PiperOrigin-RevId: 756905471
2025-05-09 14:22:42 -07:00
Xiang (Sean) Zhou
4d7298e4f2 add toolset base class and allow llm agent to accept toolset as tools
PiperOrigin-RevId: 756605470
2025-05-08 22:27:52 -07:00
Selcuk Gun
d45084f311 Support chaining for agent callbacks
(before/after) agent callbacks are invoked throughout the provided chain until one callback does not return None. Callbacks can be async and sync.

PiperOrigin-RevId: 756359693
2025-05-08 10:09:33 -07:00
Shangjie Chen
26f55fb5ab fix: Use new id for every event.
Fixes #297

PiperOrigin-RevId: 755901205
2025-05-07 10:07:38 -07:00
Selcuk Gun
e4317c9eb7 Support chaining for model callbacks
(before/after) model callbacks are invoked throughout the provided chain until one callback does not return None. Callbacks can be async and sync.

PiperOrigin-RevId: 755565583
2025-05-06 16:16:02 -07:00
Selcuk Gun
794a70edcd Support async agent and model callbacks
PiperOrigin-RevId: 755542756
2025-05-06 15:14:10 -07:00
Alan
fcca0afdac add input transcription support for live/streaming.
Copybara import of the project:

--
d481e0604a79470e2c1308827b3ecb78bfb5327e by Alan B <alan@nerds.ai>:

feat: 🚧 catch user transcription

--
bba436bb76d1d2f9d5ba969fce38ff8b8a443254 by Alan B <alan@nerds.ai>:

feat:  send user transcription event as llm_response

--
ad2abf540c60895b79c50f9051a6289ce394b98d by Alan B <death1027@outlook.com>:

style: 💄 update lint problems

--
744703c06716300c0f9f41633d3bafdf4cb180a1 by Hangfei Lin <hangfeilin@gmail.com>:

fix: set right order for input transcription

--
31a5d42d6155b0e5caad0c73c8df43255322016f by Hangfei Lin <hangfeilin@gmail.com>:

remove print

--
59e5d9c72060f97d124883150989315401a4c1b5 by Hangfei Lin <hangfeilin@gmail.com>:

remove api version

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/495 from BloodBoy21:main ea29015af041f9785abaa8583e2c767f9d8c8bc8
PiperOrigin-RevId: 755401615
2025-05-06 09:26:33 -07:00
Nilanjan De
1664b45562 Copybara import of the project:
--
16994cb2d5d646341f5285ca71d72697d81d18fe by Nilanjan De <nilanjan.de@gmail.com>:

chore: fix typos
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/272 from n1lanjan:fix-typos a1ab655b08ec08c5dd2da71aab9a2386e3610e84
PiperOrigin-RevId: 749690489
2025-04-20 22:53:15 -07:00
hangfei
363e10619a Changes for 0.1.0 release 2025-04-09 04:24:34 +00:00
hangfei
9827820143 Agent Development Kit(ADK)
An easy-to-use and powerful framework to build AI agents.
2025-04-08 17:25:47 +00:00