langchain-ai / langchainjs

🦜🔗 Build context-aware reasoning applications 🦜🔗
https://js.langchain.com/docs/
MIT License
11.72k stars 1.96k forks source link

google-common google-genai [feature]: Context Caching #5841

Open afirstenberg opened 1 week ago

afirstenberg commented 1 week ago

Privileged issue

Issue Content

Gemini now allows a developer to create a context cache with the system instructions, contents, tools, and model information already set, and then reference this context as part of a standard query. It must be explicitly cached (ie - it is not automatic as part of a request or reply) and a cache expiration can be set (and later changed).

It does not appear to be supported in Vertex AI at this time.

Open issues:

References:

jacoblee93 commented 1 week ago

Will bring this up again with team Python - it seems like an amazing feature