Spaces:
Sleeping
Sleeping
changed personality and added comments
Browse files6 unmodified lines7891011121314151617181920216 unmodified linesdef respond(message, history):messages = [{"role": "system", "content": "You are a friendly chatbot."}]# change the personality of the chatbotif history:messages.extend(history)messages.append({"role" : "user", "content" : message})response = client.chat_completion(messages, max_tokens = 100)# change the length of the responseprint(response["choices"][0]["message"]["content"].strip())6 unmodified lines78910111213141516171819202122236 unmodified linesdef respond(message, history):messages = [{"role": "system", "content": "You are a smart but rude chatbot."}]# change the personality of the chatbotif history:messages.extend(history)messages.append({"role" : "user", "content" : message})response = client.chat_completion(messages, max_tokens = 100, temperature= .9, top_p= 0.7)# max tokens = change the length of the response# temp = between 0-2# top-p = between 0-1print(response["choices"][0]["message"]["content"].strip())
app.py+5-3