autogen icon indicating copy to clipboard operation
autogen copied to clipboard

[Bug]: cost calculation from Azure openai is wrong for new version

Open yiranwu0 opened this issue 2 years ago • 0 comments

Describe the bug

Azure OpenAi completion returns the model without version information. The returned model is either 'gpt-35-turbo' or 'gpt-4'. From there, we are calculating the cost based on gpt-3.5-0613: ((0.0015, 0.002) per 1k prompt and completion tokens) and gpt-4-0613: (0.03,0.06). This means the cost is wrong if the user is using the 1106 version of the models from azure OpenAI.

Potential solution: One way is to pass the model name specified by the user (instead of the model returned from completion) to calculation cost. However, self-created names (for example, gpt4-11) can result in fail at cost calculation.

Steps to reproduce

No response

Expected Behavior

No response

Screenshots and logs

No response

Additional Information

No response

yiranwu0 avatar Jan 15 '24 20:01 yiranwu0