mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
[PR #950] [MERGED] feat(azure_openai): add support for calculating vision costs in streaming mode #1636
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-official-plugins/pull/950
Author: @ymshenyu
Created: 5/21/2025
Status: ✅ Merged
Merged: 6/25/2025
Merged by: @crazywoola
Base:
main← Head:main📝 Commits (10+)
31587c0feat: add support for calculating vision costs99ec28afix: gpt-4.1-mini/nano and o4-mini calculationf3f5e7dfix: prefer ceil over rounda80203fchore: simplify code89258cefix: tokens should multiply by a factor to get final tokensc33abccchore: improve compatibilityd4d6342fix: fix image tiles calculation393873efix: do not execute_num_tokens_from_imagesifimage_detailsis emptyd6a0b2afeat: get streaming tokens count from usageb0ae188chore: update requirements.txt📊 Changes
3 files changed (+117 additions, -11 deletions)
View changed files
📝
models/azure_openai/manifest.yaml(+1 -1)📝
models/azure_openai/models/llm/llm.py(+115 -10)📝
models/azure_openai/requirements.txt(+1 -0)📄 Description
Related Issues or Context
Before:


After:
The solution may not be fully accurate, especially for some edge cases. Please let me know if you have any suggestions
This PR contains Changes to Non-Plugin
This PR contains Changes to Non-LLM Models Plugin
This PR contains Changes to LLM Models Plugin
Version Control (Any Changes to the Plugin Will Require Bumping the Version)
VersionField, Not in Meta Section)Dify Plugin SDK Version
dify_plugin>=0.2.0,<0.3.0in requirements.txt (SDK docs)Environment Verification (If Any Code Changes)
Local Deployment Environment
SaaS Environment
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.