[Feature] 增加provider开关,用于禁用Anthropic提示词缓存功能

Open
#11,246 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
58/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
ai, backend

Research direction

Start by locating where the Anthropic provider injects cache_control: ephemeral and how provider settings are exposed in the WebUI and configuration. Trace the existing provider options and their tests to identify the relevant entry points. Done means users can disable prompt caching through a configurable setting and the provider omits cache creation when it is disabled.

Written by the indexing model from the issue text.

Description

enhancement open-for-contribution
功能描述

AstrBot 目前对 Anthropic Provider 默认启用 Prompt Caching(通过注入 cache_control: ephemeral),但部分用户(如使用第三方计费渠道或特定代理网关时)需要关闭缓存创建以避免额外费用或兼容性问题。目前 WebUI 和配置文件中均无相关开关,希望增加一个可配置项。

使用场景

· 某些第三方 Anthropic 兼容网关对 cache_control 字段支持不完整,出现无法进行缓存,请求异常的情况。
· 需要在调试或对比测试中,验证关闭缓存对响应质量和延迟的影响。

检查清单
  • 我已在 Issue 列表中搜索过相关功能,确认该功能想法从未被提出过。
  • 我建议的功能与 AstrBot 本体相关,而非在建议某一插件的功能。
  • 我已阅读并同意本项目的贡献者行为准则。
  • (可选)我愿意提交 PR 以帮助实现该功能。
Dominant language
Python
Stars
46.9k
Forks
3.6k
Avg merge
1d 6h
Merged PRs (30d)
136

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from AstrBotDevs/AstrBot

All issues in AstrBotDevs/AstrBot

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.