Azure OpenAI in LangChain: Getting Started
HTML-код
- Опубликовано: 2 авг 2024
- Getting started with Azure's OpenAI offering. In this video, we explore Azure OpenAI and how to integrate it with the LangChain library. We'll build a chatbot by first deploying the OpenAI model in Azure OpenAI Studio, and then see how to use it via the AzureChatOpenAI class in LangChain.
📌 Code:
github.com/pinecone-io/exampl...
🌲 Subscribe for Latest Articles and Videos:
www.pinecone.io/newsletter-si...
👋🏼 AI Consulting:
aurelio.ai
👾 Discord:
/ discord
Twitter: / jamescalam
LinkedIn: / jamescalam
00:00 Azure OpenAI in LangChain
00:27 OpenAI in Azure Portal
03:54 Creating Deployments in Azure OpenAI Studio
05:17 Connecting LangChain with AzureChatOpenAI
#langchain #artificialintelligence #nlp #ai #openai Наука
Thank you for your detailed demo and the langchain version! It helps a lot!
You’re just flexing that you have access to GPT-4 in Azure! Been waiting for months
Thanks - Appreciate your tutorials 👍
I'm inpatiently waiting for azure openai in Australia 😢
Thank you for your detailed demo and the langchain version! Do you have a video with a chain implemented with AzureOpenAI?
Thank you, your videos are always very helpful! Do you happen to have any video where you use LangChain and AzureOpenAIEmbeddings to parse PDFs?
how can i use azure's cognitive search rather than langchain to create the chat app for Q&A over local data?
may I know what tricks you did when hovering around the texts and some prompts pop up?
Thanks once more 😊
wondering whether you can also show how to use LLama 2 in Azure
Do you have any resources about how to fine-tune embeddings models like Instructor-XL?
Hey James,
If you use a unique end point for Azure OpenAI, does that mean a 3rd party cannot see your data (such as OpenAI)?
Secondly, are you able to use embeddings from Azure with Langchain?
Im looking to use gpt3.5/4 and embeddings for RAG on private data.
Thanks again for your videos. I've learnt a lot over the last 7 months!
Thanks a lot!, very useful
Hey james,
Can you find fine-tune model at azure openai studio ? I cannot find any more . etc:East US , north central US, West Europe...,thank you
Could you show as how to use Llama 2 in Azure if possible. Thank you.
james, you have some experiment/experience with request fail rate in azure requests compared to directly open ai calls?
i have a application with a lot of requests per hour, my team are looking for Azure to bypass this situation because openai have a lot of fails.
Great question, in actuality the service James is calling is running in Azure in his tenant... it is not hitting OpenAI service endpoints at all. This is why he had to create a deployment. The benefit is that you have much more control over non-functional concerns and can allocate resources as needed to address scale issues etc.
Hey James - is Azure OpenAI faster than the vanilla OpenAI endpoints? Thanks!
Link to the code is broken
How did you get access to Azure OpenAI?
It seems like you need to apply for the access and even then they only approve enterprises and partners currently.
yeah I'm using partner account here, not sure of any other way to get access for now unfortunately
Usually you have to fill out a huge form, it got approved the next day. However, without a partner account as yours, I don't have access to gpt3.5-16k or gpt4, and i cannot choose model version so function calling isn't available. For gpt4 you need to fill another form. And some version models depend on chosen region @@jamesbriggs @genib6174
When I use Azure with openai API, without langchain I need to specify a certificate
http_client = httpx.Client(verify='ca-root.pem')
client = AzureOpenAI(
api_version=api_version,
base_url=azure_url,
http_client=http_client)
But using from langchain_openai import AzureChatOpenAI I do not know how to specify that.
Could you tell?
🎯 Key Takeaways for quick navigation:
00:00 📝 Learn how to use LangChain with OpenAI in Azure.
02:47 🔑 Integrate OpenAI in Azure by creating a new deployment and copying the endpoint and API key from Azure Open AI.
05:21 🤖 Deployments for each model are necessary in Azure Open AI, unlike the default version.
07:13 🔄 Get meaningful answers from the chat model by relating queries to previous messages.
08:45 🧠 Azure's OpenAI offering allows interaction with models through unique endpoints.
Made with HARPA AI
thanks :)
I get this error
ValidationError: 1 validation error for AzureChatOpenAI
__root__
base_url and azure_endpoint are mutually exclusive (type=value_error)
when i run the code
llm = AzureChatOpenAI(
deployment_name="gpt-4-32k",
model_name="gpt-4-32k"
)
Can you kindly help
does anyone have the link to the latest notebook?
just fixed the links, new url is github.com/pinecone-io/examples/blob/master/learn/generation/langchain/00b-azure-openai-simple.ipynb
Looking for more with azure open ai
Which browser do you use?
Opera GX :)
What’s the benefit of going through Azure?
if big enterprise have billing, approvals, etc setup for Azure - this makes it easier for those devs to get access to OpenAI, not aware of any other reasons
It also provides content filtering also Azure provides assurance on data privacy etc.
@@jamesbriggs isn‘t it also for data privacy reasons? My company is located und Germany and I have to take care of the GDPR and I thought I could finally have a GDPR friendly environment when the API is hosted in europe?
Thanks for the tutorial by the way and for your great content in general!!
Have you guys noticed langchain can be super slow? I built a langchain app but its super slow like takes 10seconds to respond. Is that normal?
Langchain is just a framework that connects different services and tools together. It must be either the LLM or some other services(vector database?) that is being slow. Langachain itself is not doing much heavy lifting.
Langchain does have some very inefficient integrations, so it can come from either, depends on the services you’re ussing
Thanks guys, i also suspected chroma db, then changed to pinecone which slightly improved, but still takes more thank double the time of azure search.
You are a great teacher, but i think it is about time you step up the complexity with your tutorials.
I have some cool ones coming v soon