Find answers from the community

Updated 3 months ago

i try to use Azure Openai API to run the

i try to use Azure Openai API to run the query engine and got following error:
---------------------------------------------------------------------------
InvalidRequestError Traceback (most recent call last)
<ipython-input-41-f3d4578d9508> in <cell line: 1>()
6 break
7
----> 8 response = query_engine.query(query_text)
9 response_ext = Markdown(f"{response.response}").data
10

33 frames
/usr/local/lib/python3.10/dist-packages/openai/api_requestor.py in _interpret_response_line(self, rbody, rcode, rheaders, stream)
761 stream_error = stream and "error" in resp.data
762 if stream_error or not 200 <= rcode < 300:
--> 763 raise self.handle_error_response(
764 rbody, rcode, resp.data, rheaders, stream_error=stream_error
765 )

InvalidRequestError: Resource not found

but LLM itself is running fine. any idea how to resolve it ?
L
a
4 comments
I know you need to define things in a pretty specific order. The langchain azure openai class is very annoying to work with
Hopefully this works? Just make sure you use the AzureChatOpenAI class if you are using gpt-3.5 or gpt-4

https://gpt-index.readthedocs.io/en/latest/examples/customization/llms/AzureOpenAI.html#azure-openai
Ok. Let me have a try again today and follow exactly the sample code.
tried again and follow the code and it is working now. thx.
Add a reply
Sign up and join the conversation on Discord