Skip to content

Commit ede0266

Browse files
happy-qiaocopybara-github
authored andcommitted
fix: Caching - Fixed an edge case where the contents arg could be None
PiperOrigin-RevId: 707633468
1 parent 15bfb54 commit ede0266

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

vertexai/caching/_caching.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ def _prepare_create_request(
7171
_generative_models._validate_tool_config_type(tool_config)
7272

7373
# contents can either be a list of Content objects (most generic case)
74-
contents = _generative_models._content_types_to_gapic_contents(contents)
74+
if contents:
75+
contents = _generative_models._content_types_to_gapic_contents(contents)
7576

7677
gapic_system_instruction: Optional[gapic_content_types.Content] = None
7778
if system_instruction:

0 commit comments

Comments
 (0)