fix(code_executors): send correct field names for sandbox input files#5958
Open
jordanchendev wants to merge 1 commit into
Open
fix(code_executors): send correct field names for sandbox input files#5958jordanchendev wants to merge 1 commit into
jordanchendev wants to merge 1 commit into
Conversation
AgentEngineSandboxCodeExecutor was sending 'contents' and 'mimeType' when the Agent Engine Sandbox API expects 'content' and 'mime_type'. This caused input files to be silently unreadable inside the sandbox, producing errors such as pandas.errors.EmptyDataError. Fixes google#3690
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
AgentEngineSandboxCodeExecutorwas building the input-file payload withincorrect JSON field names:
contentscontentmimeTypemime_typeThis caused all input files to be silently unreadable inside the sandbox,
producing errors such as:
Fixes #3690
Changes
src/google/adk/code_executors/agent_engine_sandbox_code_executor.py— rename the two dict keys in theinput_data['files']list comprehension.tests/unittests/code_executors/test_agent_engine_sandbox_code_executor.py— add regression testtest_execute_code_sends_correct_field_names_for_input_filesthat verifies the correct keys are sent to the API.Testing plan
contentandmime_typeare used (was failing before the fix, passes after).pytest output
pre-commit