-
Notifications
You must be signed in to change notification settings - Fork 159
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
vertexai: Add context caching to VertexAI class #645
base: main
Are you sure you want to change the base?
Conversation
@@ -215,6 +215,11 @@ class _VertexAICommon(_VertexAIBase): | |||
model_name will be used to determine the model family | |||
""" | |||
|
|||
cached_content: Optional[str] = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry, but how would it be different from
cached_content: Optional[str] = None |
The issue today is that you cannot use So, the former PR that you linked it adds the parameter to the ChatVertexAI class, whereas this PR is adding it to VertexAI and therefore had to add it to the base model. Does that help? |
I'm wondering whether we should keep VertexAI at all. It's pretty outdated already and the gap will be increasing. Why do you need this class instead of ChatVertexAI? |
That's valid! My customer had attempted to use VertexAI at first since there was no multi-turn for the use case. After realizing context caching wasn't being properly used (there was no error message, we just knew the cache wasn't being invoked since the LLM response clearly was not using the cached instructions), I realized the issue was that they used VertexAI and not ChatVertexAI. I got them to switch over easily to ChatVertexAI after finding the issue. That being said, I didn't know if anyone else was trying to use VertexAI without knowing it wasn't working properly due to a lack of error message, so I implemented it. We don't need this merge request, but I was just trying to help out others. We also mainly use ChatVertexAI for everything else. So in sum, I don't really think VertexAI is needed as well, so you're welcome to just ignore this PR if you think you'll be deprecating the class entirely. |
PR Description
is_gemini_advanced
into utils (to be used by both VertexAI and ChatVertexAI)Type
🆕 New Feature
🧹 Refactoring
✅ Test