mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
tongyi model get_num_tokens always returns 0 #248
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @zhenliuxc on GitHub (Apr 30, 2025).
Self Checks
Dify version
v1.1.2
Plugin version
tongyi-0.0.16
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
I tried to get the token nums for prompt messages from '/dispatch/llm/num_tokens', but it always returns 0 when using the Tongyi model.
✔️ Error log
if self.get_customizable_model_schema(model, credentials) is not None:
return 0
When debugging the problem, I found that because get_customizable_model_schema always returns a non-None value, the function get_num_tokens always returns 0. Why was get_customizable_model_schema added?
@zhenliuxc commented on GitHub (Apr 30, 2025):
@Yeuoly
@dosubot[bot] commented on GitHub (Aug 17, 2025):
Hi, @zhenliuxc. I'm Dosu (https://dosu.dev), and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.
Issue Summary:
Next Steps:
Thank you for your understanding and contribution!