-
Notifications
You must be signed in to change notification settings - Fork 1k
fix: when converting the llm_request to JSON, skip non-serializable data #879
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?
Conversation
tests/unittests/test_telemetry.py
Outdated
|
||
async def _create_invocation_context( | ||
agent: LlmAgent, state: Optional[dict[str, Any]] = None | ||
) -> ReadonlyContext: |
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.
please replace the return type:
ReadonlyContext -> InvocationContext
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.
Sounds good, will do!
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.
Done
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.
Thank you for the PR!
LGTM (after changing the return type in test)
tests/unittests/test_telemetry.py
Outdated
|
||
from google.adk.sessions import InMemorySessionService | ||
from google.adk.agents.invocation_context import InvocationContext | ||
from google.adk.agents.readonly_context import ReadonlyContext |
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.
nit: import not needed anymore.
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.
Whoops, good catch; fixed
Fixes: #878
When converting the
llm_request
to JSON, the code in this PR adds skipping of non-serializable data.testing plan
unit test
Added unit test.
manual e2e test
Followed To reproduce steps from #878 -- agent responds without crashing.
