I’ve built several api integrations with OpenAI already, and haven’t had any API response issues until attempting to do a chat format call.
Here’s the conversation I had in the playground that I’m using as a reference point for the API Call:
System:
you are an expert marketing professional
User:
write a witty social media post about a popular subcategory of online marketing
Assistant:
“Email marketing is like a box of chocolates, you never know which one will get clicked first. But with the right strategy, you can have your subscribers begging for more! #EmailMarketing #SweetSuccess”
User:
change the subcategory to seo
Assistant:
“SEO is like a treasure hunt, but instead of gold, you’re searching for the top spot on Google. Let’s crack the code and unlock the ultimate prize! #SEOSuccess #SearchForTheWin”
Here’s my json formatted API call trying to replicate this same conversation in order to get a new final response:
{
"model": "gpt-3.5-turbo",
"messages": [
{
"role": "system",
"content": "you are an expert social media marketer.",
"role": "user",
"content": "write a witty social media post about a popular subcategory of online marketing",
"role": "assistant",
"content": "Email marketing is like a box of chocolates, you never know which one will get clicked first. But with the right strategy, you can have your subscribers begging for more!",
"role": "user",
"content": "change the subcategory to seo"
}
]
}
But when I use the above API call, the response I get is:
{
"id": "chatcmpl-6rGxqT9rrFlAjv6pSbHsXYqaH0wOM",
"object": "chat.completion",
"created": 1678154614,
"model": "gpt-3.5-turbo-0301",
"usage": {
"prompt_tokens": 13,
"completion_tokens": 55,
"total_tokens": 68
},
"choices": [
{
"message": {
"role": "assistant",
"content": "\n\nI'm sorry, as an AI language model, I do not have access to the previous conversation or the context of the subcategory you are referring to. Can you please provide more information about the category or topic you want me to change the subcategory to SEO?"
},
"finish_reason": "stop",
"index": 0
}
]
}
So basically, it’s not processing the previous parts of the conversation that I included in the API call.
What am I doing wrong here?