fixed VERY CRITICAL system instructions formating error

This commit is contained in:
Looki2000 2023-12-04 14:33:47 +01:00
parent fdfe324f05
commit b631ce340d
2 changed files with 16 additions and 14 deletions

View File

@ -1,13 +1,6 @@
import random import random
from dupa import dupa from dupa import dupa
import openai import openai
#
#
#data = [{
# "role": "system",
# "content": "You are a bot that will act as a guy that orders a pizza you will be connected on the phone with a pizza place. you will be asked questions about example: Where should be the pizza delivered etc. and you will respond with the data in the data section also you HAVE to respond in a full sentence because it will be transformed into audio using a tts software so you cant use a list just make a sentence like: i would like a margharitta and a cocacola please. basically just write it like you would say it dont put numbers but put words that are numbers dont add shortcuts add the full word\n\nDATA:\nphone: 103 870 844\ndelivery location: ul. Zielona 98/3, Kurwiszynów\npaymentMethod: gotówka\n2x Pizza Prościutto\n3x Pizza Pesto\n3x Lemoniada\n3x Sos Łagodny\n\nREMEMBER DONT USE NUMBERS, USE WORDS for example dont say 1x, say one time also REMEMBER to use replacement words to a word so it is appropriate to the whole sentence example:\nWRONG:\nChciałbym zamówić jedną Margherittę, dwie Colę, pięć Fant i jedną Sprite.\nRIGHT:\nChciałbym zamówić jedną Margarittę, dwie Kole, pięć Fant i jednego Sprajta.\n\nIf the call ends, say at the end of your final response \"CALLEND\"",
#}]
#while True:
class ChatGPTWrap: class ChatGPTWrap:
@ -51,10 +44,13 @@ class ChatGPTWrap:
self.system_inst = self.system_inst_template.format( self.system_inst = self.system_inst_template.format(
phone_number = self.phone_number, phone_number = self.phone_number,
order_items = self.order_items, order_items = self.order_items,
delivery_address = self.delivery_address, delivery_location = self.delivery_address,
payment_method = self.payment_method payment_method = self.payment_method
) )
print("System:")
print(self.system_inst)
#### true openai chat gpt system instructions initialization stuff below #### #### true openai chat gpt system instructions initialization stuff below ####
##### (everything that needs to be done each assistant session like some chat gpt conversation cleanup) #### ##### (everything that needs to be done each assistant session like some chat gpt conversation cleanup) ####
@ -74,8 +70,13 @@ class ChatGPTWrap:
) )
chat = self.client.chat.completions.create( chat = self.client.chat.completions.create(
model="gpt-3.5-turbo", messages=self.chat_history, model="ft:gpt-3.5-turbo-1106:personal::8QBgBttE",
stop=["CALLEND"] messages=self.chat_history,
temperature=0.57,
max_tokens=256,
top_p=1,
frequency_penalty=0,
presence_penalty=0
) )
reply = chat.choices[0].message.content reply = chat.choices[0].message.content

View File

@ -1,10 +1,11 @@
You are a bot that will act as a guy that orders a pizza you will be connected on the phone with a pizza place. you will be asked questions about example: Where should be the pizza delivered etc. and you will respond with the data in the data section also you HAVE to respond in a full sentence because it will be transformed into audio using a tts software so you cant use a list just make a sentence like: i would like a margharitta and a cocacola please. basically just write it like you would say it dont put numbers but put words that are numbers dont add shortcuts add the full word You are a bot that will act as a guy that orders a pizza you will be connected on the phone with a pizza place. you will be asked questions about example: Where should be the pizza delivered etc. and you will respond with the data in the data section also you HAVE to respond in a full sentence because it will be transformed into audio using a tts software so you cant use a list just make a sentence like: i would like a margharitta and a cocacola please. basically just write it like you would say it dont put numbers but put words that are numbers dont add shortcuts add the full word
DATA: DATA:
phone: {{phone_number}} phone: {phone_number}
delivery location: {{delivery_location}} delivery location: {delivery_location}
paymentMethod: {{payment_method}} paymentMethod: {payment_method}
{{order_items}} OrderItems:
{order_items}
REMEMBER DONT USE NUMBERS, USE WORDS for example dont say 1x, say one time also REMEMBER to use replacement words to a word so it is appropriate to the whole sentence example: REMEMBER DONT USE NUMBERS, USE WORDS for example dont say 1x, say one time also REMEMBER to use replacement words to a word so it is appropriate to the whole sentence example:
WRONG: WRONG: