I need to modify the prompt sent to the OpenAI API for optimized responses while ensuring that the user sees their original input exactly as typed, without any modifications. But still showing the user the prompt which they gave and not the modified one
Code:
const question= //User question in the prompt;
const databaseDetails= //Details fetched from DB;
return openai.beta.threads.messages.create(threadId, {
role: “user”,
content: Based on the following database details, answer the question: ${question}\n\database details:\n${databaseDetails}
,
});
Why do you need to do this? What is your transformation?
If you want more control I would use Chat Completions. Then you can fully manage the list of prompts memorised and sent.