-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Move the code samples out of the markdown into snippet files #2196
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -260,14 +260,7 @@ that reads this property without handling `undefined` no longer compiles under | |
| `strict` mode. | ||
|
|
||
| ```typescript | ||
| // Before (ADK TypeScript 1.x) | ||
| const name = ctx.agent.name; | ||
|
|
||
| // After (ADK TypeScript 2.0), inside an agent's own execution | ||
| const name = requireAgent(ctx).name; | ||
|
|
||
| // After (ADK TypeScript 2.0), outside an agent's own execution | ||
| const name = ctx.agent?.name; | ||
| --8<-- "examples/inline/typescript/2.0/index/001-context-invocationcontext-agent-is-optio.ts" | ||
| ``` | ||
|
|
||
| **Migration action:** Inside an agent's own execution, call `requireAgent(ctx)`, | ||
|
|
@@ -347,13 +340,7 @@ logic into the execution lifecycle. | |
| `session.NewEvent` now requires a `context.Context` as its first argument: | ||
|
|
||
| ```go | ||
| // Before (ADK Go 1.x) | ||
| ev := session.NewEvent(ctx.InvocationID()) | ||
| // or | ||
| ev := session.NewEventWithContext(ctx, ctx.InvocationID()) | ||
|
|
||
| // After (ADK Go 2.0) | ||
| ev := session.NewEvent(ctx, ctx.InvocationID()) | ||
| --8<-- "examples/inline/go/2.0/index/002-event-construction-session-newevent-sign.go.txt" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. similar comment here. too much for no appreciable gain, and added maintenance cost. |
||
| ``` | ||
|
|
||
| The event ID and timestamp are now obtained through the `platform` package, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,13 +31,7 @@ To activate the extension, the client can instantiate the `RemoteA2aAgent` with | |
| Activating this extension implies that the server will use the new agent executor implementation. | ||
|
|
||
| ```python | ||
| from google.adk.agents.remote_a2a_agent import RemoteA2aAgent | ||
|
|
||
| remote_agent = RemoteA2aAgent( | ||
| name="remote_agent", | ||
| agent_card="http://localhost:8000/a2a/remote_agent/.well-known/agent-card.json", | ||
| use_legacy=False, | ||
| ) | ||
| --8<-- "examples/inline/python/a2a/a2a-extension/001-client-side-extension-activation.py" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. GLOBAL: Inclusions are not specific (global fix): In order to not bloat pages unnecessarily, the inclusions need to be targeted and not include the entirety of the source code file. You do this by inserting tags in the source code file to mark the beginning and ending of the code you want to include (and skip all the boilerplate stuff). Not doing this will bloat the documentation pages with lines and lines boilerplate code and wind up frustrating users |
||
| ``` | ||
|
|
||
| The `A2aAgentExecutor` uses by default the new implementation, if the a2a extension is detected in the request. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is complete overkill for 6 lines of code. Remove