Skip to content

Commit

Permalink
enhance(gpt tag): better accuracy through gpt-4
Browse files Browse the repository at this point in the history
  • Loading branch information
mlbrgl committed Oct 2, 2023
1 parent 53c054b commit 1aca155
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions db/model/Chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ WHERE c.config -> "$.isPublished" = true

const topics: Tag[] = await db.queryMysql(`
SELECT t.id, t.name
FROM tags t
FROM tags t
WHERE t.isTopic IS TRUE
AND t.parentId IN (${PUBLIC_TAG_PARENT_IDS.join(",")})
`)
Expand All @@ -209,9 +209,9 @@ WHERE c.config -> "$.isPublished" = true
(topic) => `<topic id=${topic.id}>${topic.name}</topic>\n`
)}
</topics>
Respond with the two categories you think best describe the chart.
Respond with the two categories you think best describe the chart.
Format your response as follows:
[
{ "id": 1, "name": "Topic 1" },
Expand All @@ -223,7 +223,7 @@ WHERE c.config -> "$.isPublished" = true
})
const completion = await openai.chat.completions.create({
messages: [{ role: "user", content: prompt }],
model: "gpt-3.5-turbo",
model: "gpt-4",
})

const json = completion.choices[0]?.message?.content
Expand Down

0 comments on commit 1aca155

Please sign in to comment.