Find answers from the community

Updated 2 months ago

Azure


I can't seem to get the code below running.
Plain Text
from llama_index.embeddings import AzureOpenAIEmbedding

# You need to deploy your own embedding model as well as your own chat completion model
embed_model = AzureOpenAIEmbedding(
    model="text-embedding-ada-002",
    deployment_name="text-embedding-ada-002-2",
    api_key='...',
    azure_endpoint='...',
    api_version="2",
)
embed_model.get_text_embedding(
    "It is raining cats and dogs here!"
)

When I try to run it, the following error occurs.
NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}}

https://docs.llamaindex.ai/en/stable/examples/customization/llms/AzureOpenAI.html
L
G
d
7 comments
I don't think that's a valid api version?
Plain Text
api_key = "<api-key>"
azure_endpoint = "https://<your-resource-name>.openai.azure.com/"
api_version = "2023-07-01-preview"

embed_model = AzureOpenAIEmbedding(
    model="text-embedding-ada-002",
    deployment_name="my-custom-embedding",
    api_key=api_key,
    azure_endpoint=azure_endpoint,
    api_version=api_version,
)
may i know what should be the api version?
Attachments
image.png
image.png
Usually it's something like above
2023-07-01-preview
ok cool, thanks!
Add a reply
Sign up and join the conversation on Discord