-
|
If I am using |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
|
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: The Hello! That's an excellent question that gets to the heart of how ADK manages resources. The The purpose of the Regarding your concern with It's not that it will always complain, but it will complain if there's a mismatch. When you initialize an The solution is to be explicit. To prevent this issue, you should pass the correct from google.adk.runners import InMemoryRunner
from your_agent_module import my_agent # or your App object
# Explicitly set the app_name to match your application's name
runner = InMemoryRunner(agent=my_agent, app_name="my_agent_app")
# Now run_debug will use the correct app_name
await runner.run_debug("Hello there!")By doing this, you ensure that the runner, the session service, and the artifact service all use the same consistent identifier for your application, and the alignment check will pass as expected. I am closing this discussion, but if you have any follow-up questions, feel free to open a new discussion. [1] https://google.github.io/adk-docs/streaming/custom-streaming-ws/ |
Beta Was this translation helpful? Give feedback.
-
|
The whole point of using
|
Beta Was this translation helpful? Give feedback.
-
|
@GWeale to help answer this. |
Beta Was this translation helpful? Give feedback.
-
|
Hi, @kawolum _enforce_app_name_alignment is just a guardrail. It compares the runners app_name to the agent’s folder name (under agents/) and logs a warning to help you debug “session not found” issues. It does not block run_debug. InMemoryRunner defaults app_name to "InMemoryRunner" just so you can call run_debug without passing anything. The sessions are created and read with that same name. The warning is only about the folder mismatch. To silence the warning, pass app_name (like, InMemoryRunner(agent, app_name="my_agent")) or put the agent in App(name="my_agent", root_agent=agent). You would not need to move the agent into an InMemoryRunner directory. |
Beta Was this translation helpful? Give feedback.
Hi, @kawolum
_enforce_app_name_alignment is just a guardrail. It compares the runners app_name to the agent’s folder name (under agents/) and logs a warning to help you debug “session not found” issues. It does not block run_debug.
InMemoryRunner defaults app_name to "InMemoryRunner" just so you can call run_debug without passing anything. The sessions are created and read with that same name. The warning is only about the folder mismatch.
To silence the warning, pass app_name (like, InMemoryRunner(agent, app_name="my_agent")) or put the agent in App(name="my_agent", root_agent=agent). You would not need to move the agent into an InMemoryRunner directory.