Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 支持修改API地址 #51

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

feat: 支持修改API地址 #51

wants to merge 1 commit into from

Conversation

Dituon
Copy link

@Dituon Dituon commented Dec 20, 2023

背景

issue #36

mirai论坛 2584/7

@PandragonXIII

This comment was marked as duplicate.

@misaka10032w
Copy link

misaka10032w commented Aug 15, 2024

deepseek在响应数组里面的Usage加入了两个新的键

在 API 返回的 usage 中,增加了两个字段,帮助用户实时监测缓存的命中情况:

prompt_cache_hit_tokens:本次请求的输入中,缓存命中的` tokens 数(0.1 元 / 百万 tokens)

prompt_cache_miss_tokens:本次请求的输入中,缓存未命中的` tokens 数(1 元 / 百万 tokens)

因为插件没对这两个键做处理,所以会报
io.ktor.serialization.JsonConvertException: Illegal input: Unexpected JSON token at offset xxxx: Encountered an unknown key 'prompt_cache_hit_tokens' at path: $.usage.total_tokens Use 'ignoreUnknownKeys = true' in 'Json {}' builder to ignore unknown keys.
感觉可以在Usage数据类加上
@SerialName("prompt_cache_hit_tokens")
val promptCacheHitTokens: Int = 0,
@SerialName("prompt_cache_miss_tokens")
val promptCacheMissTokens: Int = 0
来简单处理一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants