You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Context caching does not seem to be support with Langchain.
With the new library, one can easily add parts to the cache as such
system_instruction="""You are an expert researcher who has years of experience in conducting systematic literature surveys and meta-analyses of different topics.You pride yourself on incredible accuracy and attention to detail. You always stick to the facts in the sources provided, and never make up new facts.Now look at the research paper below, and answer the following questions in 1-2 sentences."""cached_content=client.caches.create(
model=MODEL_ID,
config=CreateCachedContentConfig(
contents=[
Content(
role="user",
parts=[
Part.from_uri(
file_uri="gs://cloud-samples-data/generative-ai/pdf/2312.11805v3.pdf",
mime_type="application/pdf",
),
Part.from_uri(
file_uri="gs://cloud-samples-data/generative-ai/pdf/2403.05530.pdf",
mime_type="application/pdf",
),
],
)
],
system_instruction=system_instruction,
ttl="3600s",
),
)
The text was updated successfully, but these errors were encountered:
Context caching does not seem to be support with Langchain.
With the new library, one can easily add parts to the cache as such
The text was updated successfully, but these errors were encountered: