Skip to content

Commit d61613a

Browse files
committed
fix: Improve prompt accuracy
1 parent df13cfa commit d61613a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/useQuery.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@ export async function queryVariableNames(content: string, signal?: AbortSignal):
2222
Authorization: `Bearer ${apiKey}`,
2323
},
2424
body: JSON.stringify({
25+
// https://platform.openai.com/docs/api-reference/chat/create
2526
model: "gpt-3.5-turbo",
27+
temperature: 0.2,
2628
messages: [
2729
{
2830
role: "user",
2931
content: `Translate variable names into English and apply naming conventions: ${CASES.join(",")}.
30-
Save the result in the format: [{value: 'translation result', type: 'naming convention'}],
31-
serialize the output. I want to translate is: ${content}`,
32+
Save the result in the format: [{value: 'result', type: 'convention'}],
33+
serialize the output. The variable name to be translated is: '${content}'`,
3234
},
3335
],
3436
}),

0 commit comments

Comments
 (0)