-
Notifications
You must be signed in to change notification settings - Fork 409
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
Explicit Caching #355
Explicit Caching #355
Conversation
*Add basic CURD support for caching *Remove INPUT_ONLY marked fields from CachedContent dataclass *Rename files 'cached_content*' -> 'caching*' *Update 'Create' method for explicit instantination of 'CachedContent' *Add a factory method to instatinate model with `CachedContent` as its context *blacken *Add tests Change-Id: I694545243efda467d6fd599beded0dc6679b727d
Change-Id: Ie41602621d99ddff6404c6708c7278e0da790652
If not provided, the name will be randomly generated Change-Id: Ib95fbafd3dfe098b43164d7ee4d6c2a84b0aae2e
Change-Id: I6c69c036e54d56d18ea60368fa0a1dcda2d315fd
Change-Id: I06676fad23895e3e1a6393baa938fc1f2df57d80
Change-Id: I6020df4e862a4f1d58462a4cd70876a8448293cf
…ve-ai-python into caching Change-Id: Id2b259fe4b2c91653bf5e4d5e883f556366d8676
Change-Id: I2f02d2421d7303f0309ec86f05d33c07332c03c1
Change-Id: Ic1cd4fc28f591794dc5fbff0647a00a77ea7f601
Change-Id: I2bade6b0099f12dd37a24fe26cfda1981c58fbc0
Passing with the preview build. |
Cool, Thnx! |
return protos.CreateCachedContentRequest(cached_content=cached_content) | ||
|
||
@classmethod | ||
def create( |
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.
Async?
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.
Didn't implement it, due to the following reason:
- Does it make sense to have async for cacheservice?
- Anyway, I'll submit it in a separate PR, just copy paste and async/await :)
This is passing unittests, and works in my end-to-end testing. Let's merge, and we can fix these comments in follow-on PRs. |
Thanks for the review 🙌🏻 |
Change-Id: I694545243efda467d6fd599beded0dc6679b727d
===DO NOT SUBMIT===
*Inital prototype for explicit caching
*Add basic CURD support for caching
*Remove
INPUT_ONLY
marked fields fromCachedContent
dataclass*Rename files
cached_content*
->caching*
*Update
create
method for explicit instantination of 'CachedContent'*Add a factory method to instatinate model with
CachedContent
as its context*blacken
*Add tests
*Rename
get_cached_content
->get
*Stroke out functional approach for
CachedContent
CURD ops*Validate
name
checks forCachedContent
creation*Update repr for
GenerativeModel
to include information about the model's context*Update docstrings
*Improve tests