You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain/docs/extras/integrations
Jerzy Czopek 539672a7fd
Feature/fix azureopenai model mappings (#8621)
This pull request aims to ensure that the `OpenAICallbackHandler` can
properly calculate the total cost for Azure OpenAI chat models. The
following changes have resolved this issue:

- The `model_name` has been added to the ChatResult llm_output. Without
this, the default values of `gpt-35-turbo` were applied. This was
causing the total cost for Azure OpenAI's GPT-4 to be significantly
inaccurate.
- A new parameter `model_version` has been added to `AzureChatOpenAI`.
Azure does not include the model version in the response. With the
addition of `model_name`, this is not a significant issue for GPT-4
models, but it's an issue for GPT-3.5-Turbo. Version 0301 (default) of
GPT-3.5-Turbo on Azure has a flat rate of 0.002 per 1k tokens for both
prompt and completion. However, version 0613 introduced a split in
pricing for prompt and completion tokens.
- The `OpenAICallbackHandler` implementation has been updated with the
proper model names, versions, and cost per 1k tokens.

Unit tests have been added to ensure the functionality works as
expected; the Azure ChatOpenAI notebook has been updated with examples.

Maintainers: @hwchase17, @baskaryan

Twitter handle: @jjczopek

---------

Co-authored-by: Jerzy Czopek <jerzy.czopek@avanade.com>
Co-authored-by: Bagatur <baskaryan@gmail.com>
1 year ago
..
callbacks Extend the StreamlitChatMessageHistory docs with a fuller example and… (#8774) 1 year ago
chat Feature/fix azureopenai model mappings (#8621) 1 year ago
document_loaders Airbyte based loaders (#8586) 1 year ago
document_transformers Bagatur/revert revert nuclia (#8833) 1 year ago
llms Fixes to the Nebula LLM Integration (#8918) 1 year ago
memory Integrate Rockset as a chat history store (#8940) 1 year ago
providers add instructions on integrating Log10 (#8938) 1 year ago
retrievers `PubMed` document loader (#8893) 1 year ago
text_embedding Add BGE embeddings support (#8848) 1 year ago
toolkits MultiOn client toolkit update 2.0 (#8750) 1 year ago
tools Harrison/image (#845) 1 year ago
vectorstores Weaviate: adding auth example + fixing spelling in ReadME (#8939) 1 year ago