Skip to content

Use full url without key param in cache key #5

@decherd

Description

@decherd

Problem

With the change to just use the url.host, calls to different models by the same provider are not separately cached.

Solution

Update the _key method so that it uses the url.copy_remove_param('key') when creating the cache key. This caches the full url with the model name (e.g. https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent) allowing for unique cache by model.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions