I’m using GPT API to automatically categorize tickets by feeding it the header and body of the email, and then having it classify the email according to specific rules from my company.
I request that GPT return the classification data in JSON format so I can forward it to my ticket system’s API. However, I often encounter issues such as GPT not providing the output in JSON format or significantly altering the text context. Do you have any suggestions on how I can enhance this process? Maybe changing models? I am currently using gpt-4-turbo-preview.
Two pointers:
As for the JSON-related point, you should consider using JSON mode.
Regarding the second point:
I am not sure if I understand it correctly, but if you are trying to get the model return text as is, you should instruct it to return the text verbatim.
I instruct the model to correct only spelling errors and return the sentences unchanged, but it still adds words that aren’t categorized as spelling errors, I believe.
I see what you mean. I don’t think I have a strong recommendation on this point other than perhaps reinforcing your wording that it should strictly only focus on spelling errors. I was dealing with something similar today and just making adjustments to the wording helped (although did not fully eliminate the issue). Including 1-2 examples in your prompt might help as well.
Perhaps others can weigh in here with additional ideas.
1 Like