const prompt = [
{
role: "system",
content:
`
Your task: ONLY use the information provided. Never
invent anything!
`
},
{
role: "user",
content: `Here is the information to be used:
${JSON.stringify(data)}
Now please answer this question based on the information above:
"${userMessage}"
`
}
];
try {
const gpt = await axios.post(
"https://api.openai.com/v1/chat/completions",
{
model: "gpt-3.5-turbo",
messages: prompt,
temperature: 0.2,
max_tokens: 700
},
{
headers: {
Authorization: `Bearer ${openaiKey}`,
"Content-Type": "application/json"
}
}
);
< /code>
Мои данные выглядят как: < /p>
{
"events": [
{
"date": "Monday, 07.04.2025",
"title": "Event1",
"body": "xxx2"
},
...
}
< /code>
, если я отправлю это, например, в эту подсказку: < /p>
Which event is on 07.04?
< /code>
или < /p>
Which event is on 7. April?
Часто я получаю совершенно другое событие с совершенно другой датой?>
Я отправляю usermessage в GPT-3.5-Turbo через Axios, такие как: < /p> [code]const prompt = [ { role: "system", content: ` Your task: ONLY use the information provided. Never invent anything! ` }, { role: "user", content: `Here is the information to be used:
${JSON.stringify(data)}
Now please answer this question based on the information above:
"${userMessage}" ` } ];
try { const gpt = await axios.post( "https://api.openai.com/v1/chat/completions", { model: "gpt-3.5-turbo", messages: prompt, temperature: 0.2, max_tokens: 700 }, { headers: { Authorization: `Bearer ${openaiKey}`, "Content-Type": "application/json" } } ); < /code> Мои данные выглядят как: < /p> { "events": [ { "date": "Monday, 07.04.2025", "title": "Event1", "body": "xxx2" }, ... } < /code> , если я отправлю это, например, в эту подсказку: < /p> Which event is on 07.04? < /code> или < /p> Which event is on 7. April? [/code] Часто я получаю совершенно другое событие с совершенно другой датой?>