microsoft / sample-app-aoai-chatGPT

Sample code for a simple web chat experience through Azure OpenAI, including Azure OpenAI On Your Data.
MIT License
1.42k stars 2.13k forks source link

Deployment from Azure Chat Playground does not work #682

Open EricSpeidel opened 3 months ago

EricSpeidel commented 3 months ago

Describe the bug I've chosen the deployment function straight from the Azure Chat Playground interface. The playground works as expected, but after the deployment, the app does not run correctly. It seems to not interact with the CosmosDB correctly. Adding the CosmosDB key to an environment variable did not help.

To Reproduce Steps to reproduce the behavior:

  1. Go to Azure Chat Playground
  2. Click on Deploy...
  3. Enable Chat History
  4. Wait for deployment to finish
  5. See error: There was an error generating a response. Chat history can't be saved at this time. Error code: 400 - {'error': {'message': '1 validation error for Request\nbody -> stop\n none is not an allowed value (type=type_error.none.not_allowed)', 'type': 'invalid_request_error', 'param': None, 'code': None}}

Configuration: Please provide the following

EC-ma-hirochika commented 3 months ago

Hi @EricSpeidel I encountered the exact same issue. I can't guarantee it's the definitive solution, but I managed to resolve a similar issue by entering an appropriate value for the "AZURE_OPENAI_STOP_SEQUENCE" environment variable. In my case, I used ["stop1", "stop2"] as the input value. Give it a try and see if it helps!

JeryLu2020 commented 3 months ago

Facing same issue here, deploy to a new web app from Platground failed. exactly same error: Error There was an error generating a response. Chat history can't be saved at this time. Error code: 400 - {'error': {'message': '1 validation error for Request\nbody -> stop\n none is not an allowed value (type=type_error.none.not_allowed)', 'type': 'invalid_request_error', 'param': None, 'code': None}}

I have added appsetting "AZURE_COSMOSDB_ACCOUNT_KEY" and modified "AZURE_OPENAI_STOP_SEQUENCE" to "stop1|stop2|stop3" based on document, still facing same issue, please help.

Fetheddine-Addad commented 1 month ago

i'm getting the same errors as listed below with chat history enabled:

There was an error generating a response. Chat history can't be saved at this time. Error code: 400 - {'error': {'message': '1 validation error for Request\nbody -> stop\n none is not an allowed value (type=type_error.none.not_allowed)', 'type': 'invalid_request_error', 'param': None, 'code': None}}

after redeploying without chat history : Error code: 400 - {'error': {'message': '1 validation error for Request\nbody -> stop\n none is not an allowed value (type=type_error.none.not_allowed)', 'type': 'invalid_request_error', 'param': None, 'code': None}}