Changes for go deployment on agent engine.#1681
Changes for go deployment on agent engine.#1681kdroste-google wants to merge 3 commits intogoogle:mainfrom
Conversation
✅ Deploy Preview for adk-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
Stale Python-only tag in The page header still marks this as Python-only: <div class="language-support-tag" title="Agent Runtime currently supports only Python.">
<span class="lst-supported">Supported in ADK</span><span class="lst-python">Python</span>
</div>Both the <div class="language-support-tag" title="Agent Runtime supports Python and Go.">
<span class="lst-supported">Supported in ADK</span><span class="lst-python">Python</span><span class="lst-go">Go</span>
</div>(Exact tag name for Go should match whatever convention the rest of the docs site uses for language tags.) |
koverholt
left a comment
There was a problem hiding this comment.
Thanks for the PR and additions!
- Let us know when this PR is out of draft state and ready for docs review.
- There is a problem with the committers in this PR that is causing the CI check to fail. Since this PR was co-authored by GitHub Copilot, it will not be possible to pass the CLA CI check. You will need to either amend the commit to remove the Copilot coauthor, or open a new PR without that coauthor.
|
|
||
| Creating source archive : Finished successfully | ||
| Deploying to Agent Engine : Starting | ||
| > [Methods: [{"api_mode":"async","description":"Creates a new session.\n\t\t\nArgs:\n user_id (str):\n\t Required. The ID of the user.\n session_id (str):\n Optional. The ID of the session. If not provided, an ID will be generated for the session.\n state (dict[str, Any]):\n Optional. The initial state of the session.\n\nReturns:\n Session: The newly created session instance.\n","name":"async_create_session","parameters":{"properties":{"session_id":{"nullable":true,"type":"string"},"state":{"nullable":true,"type":"object"},"user_id":{"type":"string"}},"required":["user_id"],"type":"object"}},{"api_mode":"async","description":"Get a session for the given user.\n\nArgs:\n user_id (str):\n Required. The ID of the user.\n session_id (str):\n Required. The ID of the session.\n\nReturns:\n Session: The session instance (if any). Returns an error on failure\n\n","name":"async_get_session","parameters":{"properties":{"session_id":{"type":"string"},"user_id":{"type":"string"}},"required":["user_id","session_id"],"type":"object"}},{"api_mode":"async","description":"List sessions for the given user.\n\nArgs:\n user_id (str):\n Required. The ID of the user.\n\nReturns:\n ListSessionsResponse: The list of sessions with data.\n","name":"async_list_sessions","parameters":{"properties":{"user_id":{"type":"string"}},"required":["user_id"],"type":"object"}},{"api_mode":"async","description":"Deletes a session for the given user.\n\nArgs:\n user_id (str):\n Required. The ID of the user.\n session_id (str):\n Required. The ID of the session.\n\nReturns:\n\ton success returns an empty string. On error returns an error message.\n\n","name":"async_delete_session","parameters":{"properties":{"session_id":{"type":"string"},"user_id":{"type":"string"}},"required":["user_id","session_id"],"type":"object"}},{"api_mode":"async_stream","description":"Streams responses asynchronously from the ADK application.\nArgs:\n message (genai.Content):\n Required. The message to stream responses for.\n user_id (str):\n Required. The ID of the user.\n session_id (str):\n Optional. The ID of the session. If not provided, a new session will be created for the user.\n\nYields:\n Single lines with JSON encoded event each. Errors are also emitted as JSON.\n\n","name":"async_stream_query","parameters":{"properties":{"message":{"additionalProperties":true,"type":"object"},"session_id":{"nullable":true,"type":"string"},"user_id":{"type":"string"}},"required":["message","user_id"],"type":"object"}}]] |
There was a problem hiding this comment.
this is screen dump is entirely too much detail and just adds unnecessary noise.
Cut out all of this except for the starting information and the conclusion showing the completion message only.
There was a problem hiding this comment.
True, fixed
|
|
||
| === "Go" | ||
| ```shell | ||
| random_agent/ |
There was a problem hiding this comment.
The structure of this example agent should be as simple as possible and have a common naming scheme to the python files (e.g., main.go should be agent.go)
Are these files actually necessary for deployment or just conveniences?
- go.mod
- go.sum
There was a problem hiding this comment.
We consistently name entry points for all examples main.go and this is pretty common way.
go.mod and go.sum are standard, following https://adk.dev/get-started/go/#define-the-agent-code
you will have those files after you do
go mod init my-agent/main
go mod tidy
Fixed |
fa2dde9 to
b4b52dc
Compare
About the copilot: I have removed it from commits |
|
Two gaps in the Go section worth addressing before merge: The Also |
Added a section explaining the flags. But maybe it makes sense to have separate pages for CLI
|
|
Please look at the new file "methods.md". It's not final, but in my opinion such an approach will allow end users to use ADK deployed on AgentEngine easier. For me, I had a lot of friction due to not specified inputs , outputs, error handling and misleading overrides done by aiplatform. |
karolpiotrowicz
left a comment
There was a problem hiding this comment.
A few issues to fix before merging — mostly in the new methods.md file.
| </tr> | ||
| <tr> | ||
| <td>async_get_session</td> | ||
| <td></td> |
There was a problem hiding this comment.
Looks like async_get_session, async_list_sessions, async_create_session, and async_delete_session are each listed twice in the Session management table — probably a copy-paste thing. Can you clean those up?
| Session data is returned | ||
|
|
||
| #TODO(kdroste): create a schema for that | ||
| ```go |
There was a problem hiding this comment.
There's a #TODO(kdroste) comment still in here — probably don't want that going out in the public docs 😄 Either fill it in or pull it for now.
| "description": "Method-specific input", | ||
| "type": "object" | ||
| }, | ||
| }, |
There was a problem hiding this comment.
Trailing comma after the last property in properties — invalid JSON. Remove the , on this line.
| "description": "Object describing the error", | ||
| "type": "object" | ||
| }, | ||
| }, |
There was a problem hiding this comment.
Same trailing comma issue here — last property in properties shouldn't have a comma.
| "description": "Dictionary mapping string to objects", | ||
| "type": "object" | ||
| }, | ||
| }, |
There was a problem hiding this comment.
Same here — trailing comma after the "state" property.
| "class_method": "async_create_session", | ||
| "input": { | ||
| "user_id": "u_12345", | ||
| } |
There was a problem hiding this comment.
Trailing comma in the curl JSON body too — this one will actually break if someone copy-pastes and runs it. Also, the file is missing a trailing newline (flagged by the diff) — quick fix.
Added information about the deployment of a golang agent to Agent Engine