[BUG] 调用工具失败了
System details / 系统信息
macOS 26.3.1 DeepChat v1.0.0-beta.4
What's wrong? / 出了什么问题?
配置gemini 的api,调用工具报错: The tool call with ID gemini-tool-1774096844808 and name exec failed because the remaining context window is too small to continue this turn.
单个toolcall返回过大内容后导致剩余上下文不足的问题 可以试着调整下上下文和输出token的数值来降低这类情况,也可以修改一下compact 的阈值来减少上下文 暂时可能不会特地去适配此类情况
我觉得应该是bug,返回的内容不大,而且上下文很小。
我觉得应该是bug,返回的内容不大,而且上下文很小。
请提供调用日志和上下文配置
I’ve encountered this issue as well. When using public APIs like DeepSeek, tools can be called normally, but when using an OpenAI-compatible API set up with Ollama (0.18.x), a context window insufficient error occurs, even when starting a new session and the model has sufficient context (256K).
I’ve encountered this issue as well. When using public APIs like DeepSeek, tools can be called normally, but when using an OpenAI-compatible API set up with Ollama (0.18.x), a context window insufficient error occurs, even when starting a new session and the model has sufficient context (256K).
Since providers like Ollama can run many unexpected models, and some model IDs are not standardized, this may prevent correct configuration matching. In such cases, context management can easily break down.
There could be multiple causes for this issue. To accurately diagnose it, I would greatly need the session context at that time, including temperature settings, model configuration, and invocation logs. Thank you very much.
The maxTokens setting is too large, which effectively allocates almost the entire context window to the output. As a result, even a small input can cause the request to fail. You can refer to how some third-party providers configure this type of model—see the screenshot here for example.
When configuring a custom model, you can search on https://models.anya2a.com/ to obtain recommended settings. Using these configurations will significantly reduce the likelihood of issues.
The
maxTokenssetting is too large, which effectively allocates almost the entire context window to the output. As a result, even a small input can cause the request to fail. You can refer to how some third-party providers configure this type of model—see the screenshot here for example.
My issue is resolved. Thanks for pointing that out.
The
maxTokenssetting is too large, which effectively allocates almost the entire context window to the output. As a result, even a small input can cause the request to fail. You can refer to how some third-party providers configure this type of model—see the screenshot here for example.My issue is resolved. Thanks for pointing that out.
Glad it helped! Enjoy using DeepChat 🚀