Skip to content
Merged
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 @@ -304,7 +304,7 @@ def check_and_create_cache(

## CHECK IF CACHED ALREADY
generated_cache_key = local_cache_obj.get_cache_key(
messages=cached_messages, tools=tools
messages=cached_messages, tools=tools, model=model
)
google_cache_name = self.check_cache(
cache_key=generated_cache_key,
Expand Down Expand Up @@ -433,7 +433,7 @@ async def async_check_and_create_cache(

## CHECK IF CACHED ALREADY
generated_cache_key = local_cache_obj.get_cache_key(
messages=cached_messages, tools=tools
messages=cached_messages, tools=tools, model=model
)
google_cache_name = await self.async_check_cache(
cache_key=generated_cache_key,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ def test_check_and_create_cache_existing_cache_found(
assert returned_params == optional_params
assert returned_cache == "existing_cache_name"

# Verify cache key was generated with tools
# Verify cache key was generated with tools and model
mock_cache_obj.get_cache_key.assert_called_once_with(
messages=cached_messages, tools=self.sample_tools
messages=cached_messages, tools=self.sample_tools, model="gemini-1.5-pro"
)

@pytest.mark.parametrize(
Expand Down Expand Up @@ -460,9 +460,9 @@ async def test_async_check_and_create_cache_existing_cache_found(
assert returned_params == optional_params
assert returned_cache == "existing_cache_name"

# Verify cache key was generated with tools
# Verify cache key was generated with tools and model
mock_cache_obj.get_cache_key.assert_called_once_with(
messages=cached_messages, tools=self.sample_tools
messages=cached_messages, tools=self.sample_tools, model="gemini-1.5-pro"
)

@pytest.mark.asyncio
Expand Down
Loading