Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def execute_code(
{
'name': f.name,
'content': f.content,
'mimeType': f.mime_type,
'mime_type': f.mime_type,
}
for f in code_execution_input.input_files
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@ def test_execute_code_success(
)

@patch("vertexai.Client")
def test_execute_code_sends_input_files_with_content_key(
def test_execute_code_sends_input_files_with_sandbox_api_fields(
self,
mock_vertexai_client,
mock_invocation_context,
):
"""Input files must be sent under the 'content' key the SDK expects."""
"""Input files must use the field names the sandbox API expects."""
mock_api_client = MagicMock()
mock_vertexai_client.return_value = mock_api_client
mock_response = MagicMock()
Expand All @@ -157,7 +157,7 @@ def test_execute_code_sends_input_files_with_content_key(
)
sent_files = call_kwargs["input_data"]["files"]
assert sent_files == [
{"name": "data.csv", "content": "a,b,c", "mimeType": "text/csv"}
{"name": "data.csv", "content": "a,b,c", "mime_type": "text/csv"}
]

@patch("vertexai.Client")
Expand Down