redis-developer / ArXivChatGuru

Use ArXiv ChatGuru to talk to research papers. This app uses LangChain, OpenAI, Streamlit, and Redis as a vector database/semantic cache.
MIT License
521 stars 69 forks source link

Add AzureOpenAI support #4

Closed antonum closed 1 year ago

antonum commented 1 year ago

This pull request adds Azure OpenAI support to the demo.

In addition to all the standard OpenAI parameters it requires:

OPENAI_API_TYPE=azure
OPENAI_API_VERSION=2022-12-01
OPENAI_API_BASE=https://YOUR_ENDPOINT.openai.azure.com/
OPENAI_COMPLETIONS_ENGINE=text-davinci-003

Current service limits for Azure OpenAI S0 make Embedding API unusable for the purposes of this demo. Instead, if OPENAI_API_TYPE=azure is detected - the demo would load and use HugginFace HuggingFace all-MiniLM-L6-v2 embedding, which can be considerably slower then remote OpenAI embeddings.