Spaces:
Sleeping
Sleeping
Update app.py
Browse files13 unmodified lines1415161718192021222313 unmodified linesif history:messages.extend(history)messages.append({"role": "user", "content": message})response = client.chat_completion(messages,temperature = 0.1)return response['choices'][0]['message']['content'].strip()chatbot = gr.ChatInterface(respond, type = "messages")13 unmodified lines1415161718192021222324252627282913 unmodified linesif history:messages.extend(history)messages.append({"role": "user", "content": message})response = ""client.chat_completion(messages,temperature = 0.1stream = True)for message in client.chat_completion:token = messages.choices[0].delta.contentresponse += tokenyield responsereturn response['choices'][0]['message']['content'].strip()chatbot = gr.ChatInterface(respond, type = "messages")
app.py+7-1