New example: Google ADK#309
Conversation
…d dependencies at pyproject.toml. Created google_adk under examples (adk_agent.py, adk_debug.py, prepare_dataset.py, README.md, train_adk.py)
|
@microsoft-github-policy-service agree [company="KellySit"] |
|
@microsoft-github-policy-service agree |
ultmaster
left a comment
There was a problem hiding this comment.
Thank you for your contribution! Let's work together to polish this work!
| @@ -0,0 +1,395 @@ | |||
| # Train ADK Agent with Agent-lightning and VERL | |||
There was a problem hiding this comment.
Let's refine this example. Users might have already read the how-to with verl + langchain. This how-to should focus on the differences -- how to make ADK agent available for training. Omitting other unnecessary details.
There was a problem hiding this comment.
Thank you so much! I have updated and made a latest commit based on the feedback. Ready for the review.
| ``` | ||
|
|
||
| This allows you to verify that the agent logic and reward computation behave as expected before reinforcement learning is introduced. | ||
|
|
There was a problem hiding this comment.
If that's a how-to, please write the training results here.
| algorithm=algo, | ||
| # Increase the number of runners to run more rollouts in parallel | ||
| n_runners=8, | ||
| strategy={ |
| @@ -0,0 +1,8 @@ | |||
| vendor/ | |||
There was a problem hiding this comment.
I think most of these ignores have been included in global gitignore. Please check,
| logger = logging.getLogger(__name__) | ||
|
|
||
| try: # pragma: no cover - import guarded for optional dependency. | ||
| from google.genai import types as genai_types |
There was a problem hiding this comment.
no need for try except here. This example assumes user have installed google ADK.
| console = Console() | ||
|
|
||
|
|
||
| def parse_args() -> argparse.Namespace: |
There was a problem hiding this comment.
let's work together to add CI for this example.
| print(f"Wrote {len(df)} rows to {out_path}") | ||
|
|
||
|
|
||
| def create_toy_dataset(n_train: int = 8, n_test: int = 2) -> tuple[list[dict[str, Any]], list[dict[str, Any]]]: |
There was a problem hiding this comment.
So you use a toy dataset. Any real dataset we can use?
|
|
||
| This example demonstrates training a Google ADK (Application Development Kit) agent using Agent-Lightning with reinforcement learning. The agent processes user instructions and generates ADK actions for Google applications. It's compatible with Agent-lightning v0.2 or later. | ||
|
|
||
| ## Requirements |
There was a problem hiding this comment.
If you have decided to create a how-to tutorial, this README can be greatly simplified and only keeps necessarily installation and running guidance.
| agentlightning/dashboard/**/*.js | ||
| agentlightning/dashboard/**/*.html | ||
| agentlightning/dashboard/**/*.svg | ||
| .claude/*.local.json |
There was a problem hiding this comment.
no need to change this I think.
6a05b16 to
4ddfe51
Compare
|
@ultmaster Thank you so much for the feedback. I have made some updates based on the feedback:
The changes are now pushed and ready for re-review. The latest commit is the ready one. Thanks. |
|
@KellySit Great work but seems you have to resolve the conflict before the CI can run ! |
|
@ultmaster PTAL, conflicts resolved. Thank you! |
|
Hi. Appreciate the improvements. Given the implementation of current LitAdkAgent, I recommend using the style of @agl.rollout, which would be more concise. You only need to keep the async version. No need for both. Another question is, would you mind changing a dataset? I don't want all the examples focusing on a single spider dataset. If you want to stick to spider, you can augment the existing how to train sql how-to document by adding a section about ADK; and merge the examples into spider directory. There is no need for another example directory --- which could cause confusion on why this is not called spider, do we prefer langchain over ADK, or whatever. Also, would you allow me to edit the PR so that I can make some minor improvements and verify with CI? |
| instruction = self._compose_instruction(task) | ||
| agent_name = task["app_id"] or "adk_agent" | ||
|
|
||
| return LlmAgent( |
There was a problem hiding this comment.
I'm not sure about how ADK works. Is this agent equivalent to a single non-agentic LLM?
There was a problem hiding this comment.
Basically yea, ADK agent example here wraps in its own orchestration/runtime. No use of tools or multi-step planning, so behavior is close to a non-agentic LLM, with a structured system prompt. But ADK supports multi‑step, agentic workflow too. I try to keep things simple for this example, but if necessary, we can extend it too.
There was a problem hiding this comment.
@ultmaster Thanks! I will update this later, adopt the style @agl.rollout and switch to a different dataset. Feel free to edit the PR, improve it, or help with verification, let’s make this project great together!
There was a problem hiding this comment.
@KellySit maybe we can discuss more on what tasks, datasets and the expected outcomes of this example. Are you available on Discord or Wechat or X?
There was a problem hiding this comment.
@ultmaster Sure! I am available on Discord, here is my username: ivylavender.
There was a problem hiding this comment.
@KellySit Sorry I've been laggy on responses.
It seems I can't add you on Discord:
Would you be able to DM me in our discord community: https://discord.gg/RYk7CdvDR7
|
Great example, I love you |
New Example: ADK Agent
Adds a new example demonstrating ADK agent training with Agent-Lightning. ADK is an observability framework for agent traces with span visualization and Cloud Trace integration.
Files Added:
examples/google_adk/adk_agent.py- LitAdkAgent implementationexamples/google_adk/train_adk.py- Training script with CI supportexamples/google_adk/adk_debug.py- Sanity check scriptexamples/google_adk/prepare_dataset.py- Dataset conversion utilitydocs/how-to/train-adk-agent.md- Comprehensive training guidepyproject.tomlwithadkoptional dependency group