mirror of
https://github.com/langgenius/dify-plugin-sdks.git
synced 2026-07-22 02:15:22 -04:00
[PR #51] [CLOSED] feat: parameterize the default tokenizer to obtain the number of tokens #107
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?
📋 Pull Request Information
Original PR: https://github.com/langgenius/dify-plugin-sdks/pull/51
Author: @acelyc111
Created: 3/16/2025
Status: ❌ Closed
Base:
main← Head:selectable_tokenizer📝 Commits (2)
d0e37f4feat: parameterize the default tokenizer to obtain the number of tokensec16715cm1📊 Changes
6 files changed (+63 additions, -44 deletions)
View changed files
📝
python/.gitignore(+1 -0)📝
python/dify_plugin/config/config.py(+10 -0)📝
python/dify_plugin/interfaces/agent/__init__.py(+8 -6)📝
python/dify_plugin/interfaces/model/ai_model.py(+15 -9)📝
python/dify_plugin/interfaces/model/openai_compatible/llm.py(+27 -27)📝
python/dify_plugin/interfaces/model/openai_compatible/text_embedding.py(+2 -2)📄 Description
Especially for Chinese, it's recommended to use a more modern model for tokenizer to estimate the number of tokens.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.