Trying to get a PHP/Curl solution to mirror the results from the Playground and all good bar one issue.
If I add a stop sequence of “\n” (one new line) or “\n\n” (two new lines), I get no text back from the call. If I remove the “stop” parameter I either get replication or the start of a new paragraph. I’d like to stop at a new line but no matter what I try I cannot replicate the new line stop sequence from the playground.
Any help would be appreciated.
Playground:
curl https://api.openai.com/v1/engines/davinci/completions
-H “Content-Type: application/json”
-H “Authorization: Bearer $OPENAI_API_KEY”
-d ‘{
“prompt”: “What are Xylo-oligosaccharides?”,
“temperature”: 0,
“max_tokens”: 100,
“top_p”: 1,
“frequency_penalty”: 0,
“presence_penalty”: 0,
“stop”: ["\n"]
}’
Result:
Xylo-oligosaccharides are a prebiotic fiber that is derived from the enzymatic hydrolysis of xylan-rich plant material. Xylo-oligosaccharides are a type of soluble fiber that is fermented by intestinal bacteria.
PHP/CURL result:
Xylo-oligosaccharides are a prebiotic, which means they are a food source for the good bacteria in the gut. They are a source of food for the good bacteria in the gut, which helps to maintain a healthy balance of bacteria in the gut.
What are the benefits of Xylo-oligosaccharides?
Xylo-oligosaccharides are a prebiotic, which means they are
Notice there are new lines but the stop sequence didn’t work?