create_session is async; calling it without await at module scope
produces an un-awaited coroutine. Wrap with asyncio.run, matching the
pattern used in other built-in tool examples.
* fix: remove broken relative import in rag_engine example
The snippet imported from a non-existent .prompts module and used an
undefined return_instructions_root(). Replaced with a self-contained
instruction string so the knowledge-engine example runs standalone.
* Apply suggestion from @joefernandez
---------
Co-authored-by: Joe Fernandez <931947+joefernandez@users.noreply.github.com>
* fix: await create_session and add license header in agent_cli example
create_session is async; the un-awaited coroutine caused a RuntimeError
when session.id was accessed. Also added the missing Apache 2.0 header.
* Apply suggestion from @joefernandez
---------
Co-authored-by: Joe Fernandez <931947+joefernandez@users.noreply.github.com>
The BigQuery integration page still imports from google.adk.tools.bigquery,
which now raises a DeprecationWarning pointing at
google.adk.integrations.bigquery. Update all five auth snippets and the
included sample to the new path.
The sample also wrapped session_service.create_session() in asyncio.run(),
which blows up in Colab and other notebooks where a loop is already running.
Restructure it around an async main() that awaits create_session() and
iterates runner.run_async(), matching the pattern the other built-in tool
snippets already use.
Bug: b/559149787
Co-authored-by: Joe Fernandez <931947+joefernandez@users.noreply.github.com>
- Add pip install "google-adk[gcp]" step to Eventarc Prerequisites.
- Clarify datacontenttype inference defaults and specify application/json in snippet prompt.
- Update Runtime Lambda table entry to use ctx.session_id and note support for payload and Context.
- Update OMIT table entry to list all mandatory attributes (type, source, bus, id, specversion).
Addresses feedback in https://github.com/google/adk-docs/pull/2045#issuecomment-5184438669
Co-authored-by: Joe Fernandez <931947+joefernandez@users.noreply.github.com>
* #1029 - 8 vector_store_similarity_search and SpannerVectorStoreSettings
Added vector_store_similarity_search to SpannerToolset. SpannerVectorStoreSettings is introduced to support this feature.
* Update spanner.md
* Update spanner.md
Applied feedback. Additionally, reviewed the phrasing in the intro for clarity and concision and did some minor formatting edits.
* Fix wrapping, missing import, trailing whitespace, formatting fixes
* Restructure Spanner page: add intro, section headings, reorder vector search
* Add experimental tags/notes to corresponding integration pages
---------
Co-authored-by: Kristopher Overholt <koverholt@google.com>
* fix: working code for the new version
* fix: typos
* fix: lint
* Fix import paths, remove trailing underscore from prefix, and replace Runner with InMemoryRunner/run_debug for a self-contained runnable example.
---------
Co-authored-by: Kristopher Overholt <koverholt@google.com>
While the check_and_transfer function is wrapped as a FunctionTool named as escalation_tool , this name is later on remains unused. This fix should clarify the example using the right name.
Co-authored-by: Joe Fernandez <joefernandez@users.noreply.github.com>
* fix(docs): Update bigquery.py creds
I required this to make it work
application_default_credentials, _ = google.auth.default()
* Update examples/python/snippets/tools/built-in-tools/bigquery.py
---------
Co-authored-by: Kristopher Overholt <koverholt@google.com>
* Fix the code sample of using BigQuery with the application default credentails
* Update bigquery.py
---------
Co-authored-by: Kristopher Overholt <koverholt@google.com>
Co-authored-by: Joe Fernandez <joefernandez@users.noreply.github.com>
the removed line is not needed -events is never used and the 2 lines below is creating events_async
Co-authored-by: Joe Fernandez <joefernandez@users.noreply.github.com>
In the human-in-the-loop example, the long_running_function_response
variable could be overwritten with `None` by a subsequent event that
did not contain a function response. This would cause the logic that
depends on the response to fail.
Fixes#375
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Joe Fernandez <joefernandez@users.noreply.github.com>
* fix: applied `await` on the `session_service.create_session()` call
* added license to the code
---------
Co-authored-by: Sita Lakshmi Sangameswaran <sitalakshmi@google.com>
* fix: change call_agent to call_agent_async
* added await in storyflow where missing
* updated callbacks and storyflow with await and user comment
* fixed more
* added licencse header
---------
Co-authored-by: Lavi Nigam <98014943+lavinigam-gcp@users.noreply.github.com>
Co-authored-by: Lavi Nigam <lavinigam@google.com>
The LRO (Long-Running Operation) and HTIL (Human-in-the-Loop) tools were failing to execute properly due to an unhandled promise.
The `session_service.create_session` method is asynchronous but was not being awaited, causing race conditions. This change adds the required `await` to ensure proper execution flow.
Additionally, the related documentation has been updated to reflect the corrected code.
Changed the agent's description from second-person (you) to third-person (this agent).
I also fixed a couple of grammatical errors in the agent's instructions.
* fix: update gemini 2.0 flash to latest model id for Live API
* fix: use -flash for most pages instead of the live api model
* fix: wording andformatting
* fix: resolve merge conflict