ChatCompletion error when trying to use CALM with Azure OpenAi endpoint - Rasa CALM - Rasa Community Forum
ChatCompletion error when trying to use CALM with Azure OpenAi endpoint
You have selected 0 posts.
215 views 1 link
post by apo on Mar 21, 2024
Hello everyone, i tried initializing my first CALM bot today. I followed the guide. I set the correct environment variables for using the Azure endpoint but when i run rasa shell and try to interact with the bot i get the following error:
[error ] llm_command_generator.llm.error error=InvalidRequestError(message=“Must provide an ‘engine’ or ‘deployment_id’ parameter to create a <class ‘openai.api_resources.chat_completion.ChatCompletion’>”, param=‘engine’, code=None, http_status=None, request_id=None)
and this info right after it:
[info ] llm_command_generator.predict_commands.finished commands=[ErrorCommand(error_type=‘rasa_internal_error_default’, info={})]
thanks in advance
post by Amina-Derouiche on Mar 21, 2024
Hello @apo
Here is how the config should look like for the LLMCommandGenerator part while using an azure OpenAI endpoint.
- name: LLMCommandGenerator
llm:
engine: gpt-4-**
deployment_id: gpt-4-**
request_timeout: 7
max_tokens: 256
embeddings:
type: openai
model: text-embedding-***
If this doesn’t work please share with us your config so we can have a closer look.
post by apo on Mar 22, 2024
Hi @Amina thanks for the fast answer. Using that config changed the error i get. Now i get the error that the deployment doesnt exist
- name: LLMCommandGenerator
llm:
engine: gpt-4-0613
deployment_id: rasa
request_timeout: 7
max_tokens: 256
embeddings:
type: openai
model: text-embedding-ada-002
(this is my current config)
thats my current config, my deployment is called “rasa” for engine i put gpt-4 and the modell i chose in Azure, for the model at embeddings i used one i found in forums, because there wasnt anything hinting to what that could be in my Azure Studio.
This is the error i get now
[error ] llm_command_generator.llm.error error=InvalidRequestError(message=‘The API deployment for this resource does not exist. If you created the deployment within the last 5 minutes, please wait a moment and try again.’, param=None, code=‘DeploymentNotFound’, http_status=404, request_id=None)
post by Amina-Derouiche on Mar 22, 2024
Hey @apo
Seems it is a deployment either the deployment is not correctly configured or not available.
In your .env you need the
- OPENAI_API_KEY
- OPENAI_API_TYPE will be “azure”
- OPENAI_API_BASE
Maybe this thread can help you as well. Let me know how it goes.