Class AdkApp (1.95.1)
AdkApp(
*,
agent: BaseAgent,
enable_tracing: bool = False,
session_service_builder: typing.Optional[
typing.Callable[[...], BaseSessionService]
] = None,
artifact_service_builder: typing.Optional[
typing.Callable[[...], BaseArtifactService]
] = None,
env_vars: typing.Optional[typing.Dict[str, str]] = None
)
Methods
AdkApp
AdkApp(
*,
agent: BaseAgent,
enable_tracing: bool = False,
session_service_builder: typing.Optional[
typing.Callable[[...], BaseSessionService]
] = None,
artifact_service_builder: typing.Optional[
typing.Callable[[...], BaseArtifactService]
] = None,
env_vars: typing.Optional[typing.Dict[str, str]] = None
)
async_create_session
async_create_session(
*,
user_id: str,
session_id: typing.Optional[str] = None,
state: typing.Optional[typing.Dict[str, typing.Any]] = None,
**kwargs
)
Parameters |
Name |
Description |
user_id |
str
Required. The ID of the user.
|
session_id |
str
Optional. The ID of the session. If not provided, an ID will be be generated for the session.
|
state |
dict[str, Any]
Optional. The initial state of the session.
|
\*\*kwargs |
dict[str, Any]
Optional. Additional keyword arguments to pass to the session service.
|
Returns |
Type |
Description |
Session |
The newly created session instance. |
async_delete_session
async_delete_session(*, user_id: str, session_id: str, **kwargs)
Deletes a session for the given user.
Parameters |
Name |
Description |
user_id |
str
Required. The ID of the user.
|
session_id |
str
Required. The ID of the session.
|
\*\*kwargs |
dict[str, Any]
Optional. Additional keyword arguments to pass to the session service.
|
async_get_session
async_get_session(*, user_id: str, session_id: str, **kwargs)
Get a session for the given user.
Parameters |
Name |
Description |
user_id |
str
Required. The ID of the user.
|
session_id |
str
Required. The ID of the session.
|
\*\*kwargs |
dict[str, Any]
Optional. Additional keyword arguments to pass to the session service.
|
Exceptions |
Type |
Description |
RuntimeError |
If the session is not found. |
Returns |
Type |
Description |
Session |
The session instance (if any). It returns None if the session is not found. |
async_list_sessions
async_list_sessions(*, user_id: str, **kwargs)
List sessions for the given user.
Parameters |
Name |
Description |
user_id |
str
Required. The ID of the user.
|
\*\*kwargs |
dict[str, Any]
Optional. Additional keyword arguments to pass to the session service.
|
Returns |
Type |
Description |
ListSessionsResponse |
The list of sessions. |
async_stream_query
async_stream_query(
*,
message: typing.Union[str, typing.Dict[str, typing.Any]],
user_id: str,
session_id: typing.Optional[str] = None,
**kwargs
) -> typing.AsyncIterable[typing.Dict[str, typing.Any]]
Streams responses asynchronously from the ADK application.
Parameters |
Name |
Description |
message |
str
Required. The message to stream responses for.
|
user_id |
str
Required. The ID of the user.
|
session_id |
str
Optional. The ID of the session. If not provided, a new session will be created for the user.
|
\*\*kwargs |
dict[str, Any] :Yields: Event dictionaries asynchronously.
Optional. Additional keyword arguments to pass to the runner.
|
clone
Returns a clone of the ADK application.
create_session
create_session(
*,
user_id: str,
session_id: typing.Optional[str] = None,
state: typing.Optional[typing.Dict[str, typing.Any]] = None,
**kwargs
)
delete_session
delete_session(*, user_id: str, session_id: str, **kwargs)
Deletes a session for the given user.
get_session
get_session(*, user_id: str, session_id: str, **kwargs)
Get a session for the given user.
list_sessions
list_sessions(*, user_id: str, **kwargs)
List sessions for the given user.
register_operations
register_operations() -> typing.Dict[str, typing.List[str]]
Registers the operations of the ADK application.
set_up
Sets up the ADK application.
stream_query
stream_query(
*,
message: typing.Union[str, typing.Dict[str, typing.Any]],
user_id: str,
session_id: typing.Optional[str] = None,
**kwargs
)
Streams responses from the ADK application in response to a message.
Parameters |
Name |
Description |
message |
Union[str, Dict[str, Any]]
Required. The message to stream responses for.
|
user_id |
str
Required. The ID of the user.
|
session_id |
str
Optional. The ID of the session. If not provided, a new session will be created for the user.
|
\*\*kwargs |
dict[str, Any] :Yields: The output of querying the ADK application.
Optional. Additional keyword arguments to pass to the runner.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-28 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Class AdkApp (1.95.1)\n\nVersion latestkeyboard_arrow_down\n\n- [1.95.1 (latest)](/python/docs/reference/vertexai/latest/vertexai.preview.reasoning_engines.AdkApp)\n- [1.94.0](/python/docs/reference/vertexai/1.94.0/vertexai.preview.reasoning_engines.AdkApp)\n- [1.93.1](/python/docs/reference/vertexai/1.93.1/vertexai.preview.reasoning_engines.AdkApp)\n- [1.92.0](/python/docs/reference/vertexai/1.92.0/vertexai.preview.reasoning_engines.AdkApp)\n- [1.91.0](/python/docs/reference/vertexai/1.91.0/vertexai.preview.reasoning_engines.AdkApp)\n- [1.90.0](/python/docs/reference/vertexai/1.90.0/vertexai.preview.reasoning_engines.AdkApp)\n- [1.89.0](/python/docs/reference/vertexai/1.89.0/vertexai.preview.reasoning_engines.AdkApp)\n- [1.88.0](/python/docs/reference/vertexai/1.88.0/vertexai.preview.reasoning_engines.AdkApp)\n- [1.87.0](/python/docs/reference/vertexai/1.87.0/vertexai.preview.reasoning_engines.AdkApp)\n- [1.86.0](/python/docs/reference/vertexai/1.86.0/vertexai.preview.reasoning_engines.AdkApp)\n- [1.85.0](/python/docs/reference/vertexai/1.85.0/vertexai.preview.reasoning_engines.AdkApp)\n- [1.84.0](/python/docs/reference/vertexai/1.84.0/vertexai.preview.reasoning_engines.AdkApp)\n- [1.83.0](/python/docs/reference/vertexai/1.83.0/vertexai.preview.reasoning_engines.AdkApp)\n- [1.82.0](/python/docs/reference/vertexai/1.82.0/vertexai.preview.reasoning_engines.AdkApp)\n- [1.81.0](/python/docs/reference/vertexai/1.81.0/vertexai.preview.reasoning_engines.AdkApp)\n- [1.80.0](/python/docs/reference/vertexai/1.80.0/vertexai.preview.reasoning_engines.AdkApp)\n- [1.79.0](/python/docs/reference/vertexai/1.79.0/vertexai.preview.reasoning_engines.AdkApp)\n- [1.78.0](/python/docs/reference/vertexai/1.78.0/vertexai.preview.reasoning_engines.AdkApp)\n- [1.77.0](/python/docs/reference/vertexai/1.77.0/vertexai.preview.reasoning_engines.AdkApp)\n- [1.76.0](/python/docs/reference/vertexai/1.76.0/vertexai.preview.reasoning_engines.AdkApp)\n- [1.75.0](/python/docs/reference/vertexai/1.75.0/vertexai.preview.reasoning_engines.AdkApp)\n- [1.74.0](/python/docs/reference/vertexai/1.74.0/vertexai.preview.reasoning_engines.AdkApp)\n- [1.73.0](/python/docs/reference/vertexai/1.73.0/vertexai.preview.reasoning_engines.AdkApp)\n- [1.72.0](/python/docs/reference/vertexai/1.72.0/vertexai.preview.reasoning_engines.AdkApp)\n- [1.71.1](/python/docs/reference/vertexai/1.71.1/vertexai.preview.reasoning_engines.AdkApp)\n- [1.70.0](/python/docs/reference/vertexai/1.70.0/vertexai.preview.reasoning_engines.AdkApp)\n- [1.69.0](/python/docs/reference/vertexai/1.69.0/vertexai.preview.reasoning_engines.AdkApp)\n- [1.68.0](/python/docs/reference/vertexai/1.68.0/vertexai.preview.reasoning_engines.AdkApp)\n- [1.67.1](/python/docs/reference/vertexai/1.67.1/vertexai.preview.reasoning_engines.AdkApp)\n- [1.66.0](/python/docs/reference/vertexai/1.66.0/vertexai.preview.reasoning_engines.AdkApp)\n- [1.65.0](/python/docs/reference/vertexai/1.65.0/vertexai.preview.reasoning_engines.AdkApp)\n- [1.63.0](/python/docs/reference/vertexai/1.63.0/vertexai.preview.reasoning_engines.AdkApp)\n- [1.62.0](/python/docs/reference/vertexai/1.62.0/vertexai.preview.reasoning_engines.AdkApp)\n- [1.60.0](/python/docs/reference/vertexai/1.60.0/vertexai.preview.reasoning_engines.AdkApp)\n- [1.59.0](/python/docs/reference/vertexai/1.59.0/vertexai.preview.reasoning_engines.AdkApp) \n\n AdkApp(\n *,\n agent: BaseAgent,\n enable_tracing: bool = False,\n session_service_builder: typing.Optional[\n typing.Callable[[...], BaseSessionService]\n ] = None,\n artifact_service_builder: typing.Optional[\n typing.Callable[[...], BaseArtifactService]\n ] = None,\n env_vars: typing.Optional[typing.Dict[str, str]] = None\n )\n\nAn ADK Application.\n\nMethods\n-------\n\n### AdkApp\n\n AdkApp(\n *,\n agent: BaseAgent,\n enable_tracing: bool = False,\n session_service_builder: typing.Optional[\n typing.Callable[[...], BaseSessionService]\n ] = None,\n artifact_service_builder: typing.Optional[\n typing.Callable[[...], BaseArtifactService]\n ] = None,\n env_vars: typing.Optional[typing.Dict[str, str]] = None\n )\n\nAn ADK Application.\n\n### async_create_session\n\n async_create_session(\n *,\n user_id: str,\n session_id: typing.Optional[str] = None,\n state: typing.Optional[typing.Dict[str, typing.Any]] = None,\n **kwargs\n )\n\nCreates a new session.\n\n### async_delete_session\n\n async_delete_session(*, user_id: str, session_id: str, **kwargs)\n\nDeletes a session for the given user.\n\n### async_get_session\n\n async_get_session(*, user_id: str, session_id: str, **kwargs)\n\nGet a session for the given user.\n\n### async_list_sessions\n\n async_list_sessions(*, user_id: str, **kwargs)\n\nList sessions for the given user.\n\n### async_stream_query\n\n async_stream_query(\n *,\n message: typing.Union[str, typing.Dict[str, typing.Any]],\n user_id: str,\n session_id: typing.Optional[str] = None,\n **kwargs\n ) -\u003e typing.AsyncIterable[typing.Dict[str, typing.Any]]\n\nStreams responses asynchronously from the ADK application.\n\n### clone\n\n clone()\n\nReturns a clone of the ADK application.\n\n### create_session\n\n create_session(\n *,\n user_id: str,\n session_id: typing.Optional[str] = None,\n state: typing.Optional[typing.Dict[str, typing.Any]] = None,\n **kwargs\n )\n\nCreates a new session.\n\n### delete_session\n\n delete_session(*, user_id: str, session_id: str, **kwargs)\n\nDeletes a session for the given user.\n\n### get_session\n\n get_session(*, user_id: str, session_id: str, **kwargs)\n\nGet a session for the given user.\n\n### list_sessions\n\n list_sessions(*, user_id: str, **kwargs)\n\nList sessions for the given user.\n\n### register_operations\n\n register_operations() -\u003e typing.Dict[str, typing.List[str]]\n\nRegisters the operations of the ADK application.\n\n### set_up\n\n set_up()\n\nSets up the ADK application.\n\n### stream_query\n\n stream_query(\n *,\n message: typing.Union[str, typing.Dict[str, typing.Any]],\n user_id: str,\n session_id: typing.Optional[str] = None,\n **kwargs\n )\n\nStreams responses from the ADK application in response to a message."]]