I have put single slash n and double slash (\)n but it has reduced it both to single slash.
I have this issue as well, and it’s not the first time.
I have automation tests with gpt-3.5 requests using a temperature of 0. Those requests started failing today, after several months. When I take the system prompt and user message (which is printed for every request) to the playground, I get the expected result (which I am no longer getting via the API).
Is there any good workaround on that topic? I am running in the same problem here.
I really double and tripple checked that I am using the same model and settings. I copied the prompt directly from my code to the playground, just to be absolutely sure, I am using the same.
I tried the /n to //n fix in my javascript code, but did not have an effect. Also tried to escape anything that is not a letter or number. But did not help either.
I would provide sample code, but prompts are very long, as i am doing retrieval based augmentation with it. Also it has angled brackets in the prompt, which the forum software misinterprets as links.
I’m having the same issue as well. The playground chat outputs in a correct format (CSV) but the API doesn’t. Did you find a solution yet?
Hey everyone!
(IGNORE THIS POST, It was not working as I expected)
I think I found the answer, I been having this problem and it is causing harm to products that outputs we are being anal about. We are using temperature 0 to maintain constant results.
The answer we found is the string encoding from python was different from playground. To fix use this strategy:
prompt = ....
prompt = prompt.encode('utf-8')
I found the answer when playing with a text file →
I noticed when I opened the file this way it would not give same results as playground would give:
with open("debug_txt/test_Special_0.txt", 'r') as f:
prompt = f.read()
But when I opened it this way I got the right output:
with open("debug_txt/test_Special_0.txt", 'rb') as f:
prompt = f.read()
What I came to found is that when I sent utf-8 byte data it would work.
Hope that helps, still exploring… lel
Following up (I noticed another difference that result in a major change in output):
When using the playground you are using stream = True
. When I was using the API I was not setting stream equal to true. After setting it equal to true I started getting the same results as playground. For anyone challenged with the issue this is another component to checkout
Hi everyone. I am encountering this exact same issue: The playground being superior to the API call.
What is the technical reason for this? What is happening?
The only potential difference would be “in the building” communication or at least in the country, it’s likely that the servers servicing the playground are in the same approximate location as the machines making the API calls, everything else will be the same as your setup apart from the code making the calls.