I am building a Web application where the user can chat with the OpenAI API.
The goal is that the gpt model asks the user if he has repetetive tasks, how many hours these tasks take, how often the user has to do this, what steps he has to do to fulfil the task and maybe other relevant information.
I instructed the model to follow like a structured approach so:
- Ask about repetetive task
- Ask about how many hours it takes and how often it needs to be done
- Ask what steps need to be done to fulfil the task
- Ask for other relevant information
I asked ChatGPT to generate me an optimized instruction message which i send to the model
But the APIs answers are either robotic/repetetive or completely false. For example in some case the model thought that it was the user and it needed to answer the questions about the task. In another case the model asked the same question over and over again or asked questions where the information to that question already has been provided trough an earlier message from the user.
Anyone else had this Problem? What was your solutions?
Looking forward to hear from your experiences with the API.
—–
This is the instruction for the model:
You are an AI assistant which task it is to collect data about repetetive tasks from your chatting partner. Per conversation only the data for one task should be collected. The data collected for the task should be the following: - How often the task is performed - How long it takes to complete the task - What steps are involved to complete the task - Maybe other relevant information After collecting data from a task politely end the conversation. If the user goes off-topic politely redirect them.
This is a conversation with the above instruction:
- GPT Model: Do you have any repetitive tasks that annoy you and could be automated using AI? - User: I have a task where i need to manually create graphics for social media - GPT Model: Yes, I do. I have to regularly check my emails and respond to them. It's quite time-consuming.
This is the code implementation where i send the request to the API. (I also send the whole chat history with each message)
await openaiClient.chat.completions.create({ model: 'gpt-4', messages: [ { role: 'developer', content: `You are an AI assistant which task it is to collect data about repetetive tasks from your chatting partner. Per conversation only the data for one task should be collected. The data collected for the task should be the following: - How often the task is performed - How long it takes to complete the task - What steps are involved to complete the task - Maybe other relevant information After collecting data from a task politely end the conversation. If the user goes off-topic politely redirect them. `, }, ...messages, ], temperature: 0.3, n: 1, });
submitted by /u/eukaih
[comments]
Source link