Chainlit / chainlit

Build Conversational AI in minutes ⚡️
https://docs.chainlit.io
Apache License 2.0
6.76k stars 878 forks source link

AzureChat Bad Request engine / deployment__id #412

Closed johannes-dornheim closed 11 months ago

johannes-dornheim commented 12 months ago

Hi

when i try to use the pre-defined AzureChatOpenAI provider in the playground i get the following error:

Bad Request: OpenAI API request was invalid: Must provide an engine or deployment_id parameter to create a <class ... ChatCompletion>.

where do i set the deployment_id per model (Ive already set the required environment vars OPENAI_API_BASE, OPENAI_API_KEY, OPENAI_API_TYPE, OPENAI_API_VERSION)?

Best, Johannes

willydouhard commented 12 months ago

You should set OPENAI_API_DEPLOYMENT_ID

johannes-dornheim commented 11 months ago

tyvm for the fast answer, indeed it works when setting it. I have not seen it in documentation nor in the azure_openai_env_vars.

azure_openai_env_vars = { "api_key": "OPENAI_API_KEY", "api_type": "OPENAI_API_TYPE", "api_base": "OPENAI_API_BASE", "api_version": "OPENAI_API_VERSION", }

https://github.com/Chainlit/chainlit/blob/main/backend/chainlit/playground/providers/openai.py

willydouhard commented 11 months ago

Yes more documentation on that would not hurt