Using API to modify query before it is sent
-
AI Engine seems to work perfectly, very easy setup. But the API documentation, especially for the client-side JS part, is fairly limited. I’m trying to use the “system” role in prompt to include guidance for OpenAI API, inserting dynamic content on-the-fly, but no success so far:
1. Seems that only ai.reply is available for client-side JS, not ai.query?
2. I made a workaround to tap to fetch API and modify the body content before the request is sent, but it is not clear how that should be modified. Following instructions that ChatGPT gave me, I added “system”:”My guidance string” to the body object, but that did not seem to work. Is there such a parameter as “system”, or should I modify the “messages” array?
- You must be logged in to reply to this topic.