mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-23 14:04:18 +02:00
Fix prompt caching middleware missing wrap/unwrap round-trip (#3666)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
376a4a57e2
commit
2491993327
1 changed files with 3 additions and 2 deletions
|
|
@ -480,14 +480,15 @@ class ResponseCachingMiddleware(Middleware):
|
|||
return cached_value.unwrap()
|
||||
|
||||
value: PromptResult = await call_next(context=context)
|
||||
cached_value = CachablePromptResult.wrap(value)
|
||||
|
||||
await self._get_prompt_cache.put(
|
||||
key=cache_key,
|
||||
value=CachablePromptResult.wrap(value),
|
||||
value=cached_value,
|
||||
ttl=self._get_prompt_settings.get("ttl", ONE_HOUR_IN_SECONDS),
|
||||
)
|
||||
|
||||
return value
|
||||
return cached_value.unwrap()
|
||||
|
||||
def _matches_tool_cache_settings(self, tool_name: str) -> bool:
|
||||
"""Check if the tool matches the cache settings for tool calls."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue