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>
2023-08-09 10:56:15 -07:00
..
callbacks Extend the StreamlitChatMessageHistory docs with a fuller example and… (#8774) 2023-08-04 14:27:46 -07:00
chat Feature/fix azureopenai model mappings (#8621) 2023-08-09 10:56:15 -07:00
document_loaders Airbyte based loaders (#8586) 2023-08-08 14:49:25 -07:00
document_transformers Bagatur/revert revert nuclia (#8833) 2023-08-06 11:24:36 -07:00
llms Fixes to the Nebula LLM Integration (#8918) 2023-08-08 10:04:43 -07:00
memory Integrate Rockset as a chat history store (#8940) 2023-08-08 18:54:07 -07:00
providers add instructions on integrating Log10 (#8938) 2023-08-08 19:15:31 -07:00
retrievers PubMed document loader (#8893) 2023-08-08 14:26:03 -04:00
text_embedding Add BGE embeddings support (#8848) 2023-08-07 11:15:30 -07:00
toolkits MultiOn client toolkit update 2.0 (#8750) 2023-08-06 22:24:10 -07:00
tools Harrison/image (#845) 2023-08-08 13:58:27 -07:00
vectorstores Weaviate: adding auth example + fixing spelling in ReadME (#8939) 2023-08-08 16:24:17 -07:00