Search working!!!
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
const OpenAI = require("openai");
|
||||
const { getApiKey } = require("./apiKey");
|
||||
|
||||
async function openAiChatCompletion(query) {
|
||||
async function openAiChatCompletion(query, systemPrompt) {
|
||||
const openai = new OpenAI({ apiKey: await getApiKey("openai_api_key") });
|
||||
const completion = await openai.chat.completions.create({
|
||||
messages: [
|
||||
{ role: "system", content: "You are a helpful assistant." },
|
||||
{ role: "system", content: systemPrompt },
|
||||
{ role: "user", content: query },
|
||||
],
|
||||
model: "gpt-4o-mini",
|
||||
|
||||
Reference in New Issue
Block a user