Skip to content

Commit d9be320

Browse files
committed
enable ephemeral prompt caching by default
1 parent 2959001 commit d9be320

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

jupyter_ai_jupyternaut/jupyternaut/chat_models.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,17 @@ async def acompletion_with_retry(
343343

344344
@retry_decorator
345345
async def _completion_with_retry(**kwargs: Any) -> Any:
346-
return await self.client.acompletion(**kwargs)
346+
return await self.client.acompletion(
347+
**kwargs,
348+
# Enables ephemeral prompt caching of the last system message by
349+
# default.
350+
cache_control_injection_points=[
351+
{
352+
"location": "message",
353+
"role": "system",
354+
}
355+
],
356+
)
347357

348358
return await _completion_with_retry(**kwargs)
349359

0 commit comments

Comments
 (0)