Changed example to use the Global Instruction Plugin (#1244) - #2177
Changed example to use the Global Instruction Plugin (#1244)#2177JuanCaCoder wants to merge 1 commit into
Conversation
📝 Executive Summary
🗂️ PR Consolidation & Verification Mapping
🔍 Technical Verification Report
|
📝 Executive Summary
🗂️ PR Consolidation & Verification Mapping
🔍 Technical Verification Report
|
|
|
||
| ```python title="a2a_basic/agent.py" | ||
| from google.adk.agents.llm_agent import Agent | ||
| from google.adk.apps import App |
There was a problem hiding this comment.
don't add either of these new imports here. revert
| ), | ||
| ) | ||
|
|
||
| app = App( |
There was a problem hiding this comment.
don't modify the example code this way. revert
| ) | ||
| ``` | ||
|
|
||
| !!! note "Global instructions via Plugins" |
There was a problem hiding this comment.
don't add here. remove.
| ``` | ||
|
|
||
| !!! note "Global instructions via Plugins" | ||
| The `global_instruction` parameter on `Agent` is deprecated. Use `GlobalInstructionPlugin` registered on your `App` or `Runner` to apply consistent rules or identity across all agents in your workflow. |
There was a problem hiding this comment.
A. Don't add this "note" here, remove it.
B. revise this to be a tip (see revision below)
C. Add this as a tip in the following locations:
- just ahead of the Known Limitations heading in: https://adk.dev/graphs/#known-limitations
- just ahead of Operating Considerations* heading in: https://adk.dev/workflows/collaboration/#operating-considerations
- At the end of the template workflow pages (after code example):
- https://adk.dev/agents/workflow-agents/sequential-agents/
- https://adk.dev/agents/workflow-agents/loop-agents/
- https://adk.dev/agents/workflow-agents/parallel-agents/
!!! tip "Global instructions for all agents"
Apply consistent rules or identity across all agents in your workflow using `GlobalInstructionPlugin` registered on your `App` or `Runner` object. Do not use the `global_instruction` parameter on `Agent` which is deprecated since ADK Python v1.16.0.
| The `use_legacy` parameter defaults to `True`, so the sample above uses the legacy path. Set `use_legacy=False` to use the new ADK-A2A integration, which sends the [A2A extension](a2a-extension.md) to the remote agent. | ||
|
|
||
| Then, you can simply use the `RemoteA2aAgent` in your agent. In this case, `prime_agent` is used as one of the sub-agents in the `root_agent` below: | ||
| Then, you can simply use the `RemoteA2aAgent` in your agent. In this case, `prime_agent` is used as one of the sub-agents in `root_agent`. To apply a shared identity or global rules across the entire agent hierarchy, configure the [`GlobalInstructionPlugin`](/plugins/#prebuilt-plugins) in your `App`: |
There was a problem hiding this comment.
revert this change.
Placing this update here basically hides it. No one is going to look for it here. See the comment below about where to place a "tip"-only version of this information in a few places where it would be helpful.
Changed the code sample to use the GlobalInstructionPlugin.