Everywhere icon indicating copy to clipboard operation
Everywhere copied to clipboard

[Bug] 上下文限制无效

Open WhiteElephant-abc opened this issue 6 months ago • 9 comments

请确认以下事项

  • [x] 我已经查找过相关的 Issue

问题描述

最大上下文长度:默认(64000) 模型:DeepSeek(官方API)

API 密钥缺失或无效。 HTTP 400 (invalid_request_error: invalid_request_error)

This model's maximum context length is 131072 tokens. However, you requested 134034 tokens (134034 in the messages, 0 in the completion). Please reduce the length of the messages or completion.

应用版本

0.3.9.0

使用环境

版本 Windows 11 专业版 版本号 24H2 安装日期 ‎2025/‎9/‎20 操作系统版本 26100.6584 体验 Windows 功能体验包 1000.26100.234.0

预期行为

重现步骤

请求突破API上下文限制

补充信息

No response

WhiteElephant-abc avatar Oct 13 '25 04:10 WhiteElephant-abc

token限制只是估算,因为在请求模型之前不可能获取到真实的token数量,不同的模型嵌入方式大相径庭,一些模型嵌入算法不佳会导致实际token数量大大超出预期。

DearVa avatar Oct 13 '25 04:10 DearVa

好的,那么我尝试缩小限制

WhiteElephant-abc avatar Oct 13 '25 04:10 WhiteElephant-abc

请问更新上下文设置后是否需要重启应用

WhiteElephant-abc avatar Oct 13 '25 04:10 WhiteElephant-abc

不需要,即时应用

DearVa avatar Oct 13 '25 04:10 DearVa

上下文设置:5000 API响应:

HTTP 400 (invalid_request_error: invalid_request_error)

This model's maximum context length is 131072 tokens. However, you requested 134455 tokens (134455 in the messages, 0 in the completion). Please reduce the length of the messages or completion.

WhiteElephant-abc avatar Oct 13 '25 04:10 WhiteElephant-abc

上下文设置:100

API 密钥缺失或无效。 HTTP 400 (invalid_request_error: invalid_request_error)

This model's maximum context length is 131072 tokens. However, you requested 134455 tokens (134455 in the messages, 0 in the completion). Please reduce the length of the messages or completion.

WhiteElephant-abc avatar Oct 13 '25 04:10 WhiteElephant-abc

在聊天窗口的设置按钮里面设置试试

DearVa avatar Oct 13 '25 04:10 DearVa

这个视觉树长度限制滑条怎么拖动都是4096

WhiteElephant-abc avatar Oct 13 '25 04:10 WhiteElephant-abc

我尝试复现一下

DearVa avatar Oct 13 '25 04:10 DearVa