milwright commited on
Commit
243e743
·
1 Parent(s): 78a1f73

fix: prevent AI hallucination and remove problematic tool_choice parameter

Browse files
Files changed (1) hide show
  1. src/aiService.js +2 -3
src/aiService.js CHANGED
@@ -118,7 +118,6 @@ Use the ${tool.name} tool to provide an appropriate educational hint.`;
118
  type: 'function',
119
  function: tool
120
  }],
121
- tool_choice: tool.name,
122
  max_tokens: 200,
123
  temperature: 0.3
124
  })
@@ -303,10 +302,10 @@ Passage: "${passage}"`
303
  model: this.model,
304
  messages: [{
305
  role: 'system',
306
- content: 'You are a literary expert. Provide exactly 1 short sentence about this classic work. Be factual and concise. No exaggerative language.'
307
  }, {
308
  role: 'user',
309
- content: `Describe "${title}" by ${author} in one factual sentence.`
310
  }],
311
  max_tokens: 80,
312
  temperature: 0.2
 
118
  type: 'function',
119
  function: tool
120
  }],
 
121
  max_tokens: 200,
122
  temperature: 0.3
123
  })
 
302
  model: this.model,
303
  messages: [{
304
  role: 'system',
305
+ content: 'You are a literary expert. Provide exactly 1 short, factual sentence about this classic work. Be accurate and concise. Do not add fictional details or characters.'
306
  }, {
307
  role: 'user',
308
+ content: `Write one factual sentence about "${title}" by ${author}. Focus on what type of work it is, when it was written, or its historical significance.`
309
  }],
310
  max_tokens: 80,
311
  temperature: 0.2