I'm working on a project that involves gathering open-ended form inputs from a react interface, stores in a mysql database via a node.js/express server, then sends the collection of inputs to text-davinci-003. it saves the result in the database. I'm getting extremely different responses from the playground compared to my application. in my form i create a prompt structure that the form creator can fill in, then it's bundled together with the inputs. I get the functional use of the playground but it doesn't seem to translate very well to the actual api? Are there resources i'm missing?
Here's a snippet of my project, if anyone has insight that would be amazing:
const responses = await knex
.select("*")
.from("responses")
.where({ project_id });
console.log(responses);
const responseType = responses.map((r) => r.response_type);
const responseTexts = responses.map((r) => r.response_input);
const prompt = responseType.concat(responseTexts);
const apiResponse = await openai.createCompletion({
model: "text-davinci-003",
prompt: `${prompt}`,
max_tokens: 2500,
temperature: 0.9,
top_p: 1,
frequency_penalty: 1.0,
presence_penalty: 1.0,
best_of: 3,
n: 1,
stream: false,
logprobs: null,
});```
From the input form, i'm creating a prompt structure that users fill in(obviously not a super effective approach) but like i said, i get acceptable results from the playground. the prompt structure is:
context:
question:
reply length:
tone:
perspective:
outcome:
Would love any thoughts on refining this on the api side to get more relevant responses. For further clarification, I'm also only testing on about 4-5 inputs.