-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: Context Caching for Gemini Provider #36
Comments
What would the scenario be here? |
I have a document which serve as the main source of information for all of the user prompts. I want all the user prompts to be based on the document. In vertex studio, by instructing the system to only look at the context provided, I was sort of able to achieve this. Rather than feeding this document for each user prompt I was investigating if there's an alternative and more optimised approach since several users will be using the same document (single main source of information) |
Can you share some example code that shows what you have in mind? |
I think this snippet in the Gemini docs should best describe it - https://ai.google.dev/gemini-api/docs/caching?lang=python#generate-content |
That sample seems to show creating a model using the cached content. If that's the case, just pass that model when creating the LlmChatView. |
I'm exploring the flutter/ai package and would like to understand how to implement Context Caching for specific content as described in the Gemini API documentation. I want to optimize token usage by caching repeated context or static content while generating responses dynamically for user-specific inputs. However, the documentation doesn't explicitly describe how this can be integrated with Flutter's AI package.
The text was updated successfully, but these errors were encountered: