Query
Allows you to send an HTML document and a custom prompt to OpenAI for processing.
NodeJS
const html = await getHTML("https://www.amazon.com/dp/B01LR5S6HK");
if (!html) return;
const ai = new AIService(cloudBrowserToken, {
openAIConfiguration: { apiKey: openAiToken },
});
// Response format can be created manually but it is easier to use a type
// await ai.query({
// html: html,
// prompt: "Give me the lowest price",
// responseFormat: JSON.stringify({ response: "number", required: ["response"] })
// });
const rpai = await ai.query({
html: html,
prompt: "Give me the lowest price",
});
console.log("The lowest price is:", rpai);.NET
/api/v1/ai/Query – Process an HTML Document and Prompt
Last updated