Chat completion incorrect responses

Hello, I’m creating a chatbot that should focus on a specific topic to assist the user. However, it’s necessary to request information from the user such as name, surname, age, and an email address. I’ve created a simple API that generates a completion. But sometimes it takes the system prompt and other times it doesn’t.

It depends on the model which you are using for your completion as well. GPT 3.5 is notorious for not paying attention to the system message a lot of the time and might be the cause of your issue. GPT 4 API does not face a similar issue.