cloudwego / cloudwego/eino-ext
[Feat]是否可以支持千问的上下文缓存功能
- Dominant language
- Go
- Stars
- 811
- Forks
- 368
- Avg merge
- 16h 22m
- Merged PRs (30d)
- 13
Description
## Is your feature request related to a problem? Please describe.
千问部分模型可以使用**上下文缓存**功能,但当前项目尚未支持该功能。
## Describe the solution you'd like
我希望能够支持千问的**上下文缓存**功能。具体需求如下:
1. **支持显式缓存**:允许用户在调用千问模型时启用显式缓存。
2. **对外暴露cache_creation_input_tokens**:在使用显式缓存功能时,千问的 API 会返回一个名为 `cache_creation_input_tokens` 的特定字段。我希望系统能够解析这个数值,并在Message.ResponseMeta.Usage中对外暴露。
## Describe alternatives you've considered
暂无
## Additional context
- **千问上下文缓存官方说明文档**: [阿里云百炼 - 上下文缓存 (Context Cache)](https://help.aliyun.com/zh/model-studio/context-cache?spm=a2c4g.11186623.help-menu-2400256.d_0_3_0_8.2fef220fdGKln0&scm=20140722.H_2862577._.OR_help-T_cn~zh-V_1#1ba8a19b9dmui)
Contributor guide
Research direction
The issue names no files or tests, so first locate the existing Qwen integration and its handling of request options and Message.ResponseMeta.Usage. Read the linked Qwen context-cache documentation, then verify that explicit caching and cache_creation_input_tokens are both represented; done means the requested option and usage value are supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- ai
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100