Skip to content

Commit 2617cea

Browse files
committed
fix: use sandbox mime_type input field
1 parent 623c9bd commit 2617cea

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/google/adk/code_executors/agent_engine_sandbox_code_executor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def execute_code(
181181
{
182182
'name': f.name,
183183
'content': f.content,
184-
'mimeType': f.mime_type,
184+
'mime_type': f.mime_type,
185185
}
186186
for f in code_execution_input.input_files
187187
]

tests/unittests/code_executors/test_agent_engine_sandbox_code_executor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,12 @@ def test_execute_code_success(
127127
)
128128

129129
@patch("vertexai.Client")
130-
def test_execute_code_sends_input_files_with_content_key(
130+
def test_execute_code_sends_input_files_with_sandbox_api_fields(
131131
self,
132132
mock_vertexai_client,
133133
mock_invocation_context,
134134
):
135-
"""Input files must be sent under the 'content' key the SDK expects."""
135+
"""Input files must use the field names the sandbox API expects."""
136136
mock_api_client = MagicMock()
137137
mock_vertexai_client.return_value = mock_api_client
138138
mock_response = MagicMock()
@@ -157,7 +157,7 @@ def test_execute_code_sends_input_files_with_content_key(
157157
)
158158
sent_files = call_kwargs["input_data"]["files"]
159159
assert sent_files == [
160-
{"name": "data.csv", "content": "a,b,c", "mimeType": "text/csv"}
160+
{"name": "data.csv", "content": "a,b,c", "mime_type": "text/csv"}
161161
]
162162

163163
@patch("vertexai.Client")

0 commit comments

Comments
 (0)