Fix Mistral API parameter naming issue
- Change maxTokens to max_tokens for Mistral API compatibility - Extract maxTokens from options before spreading to avoid parameter conflicts - Tested successfully with live API calls
This commit is contained in:
parent
d2894af925
commit
5b67cca5cb
@ -50,6 +50,8 @@ Output format: JSON with fields {proposal, justification, confidence (0-1), depe
|
||||
* Call Mistral AI API
|
||||
*/
|
||||
async function callMistralAPI(messages, options = {}) {
|
||||
const { maxTokens, ...otherOptions } = options;
|
||||
|
||||
const response = await fetch(MISTRAL_API_URL, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
@ -60,8 +62,8 @@ async function callMistralAPI(messages, options = {}) {
|
||||
model: options.model || 'mistral-small-latest',
|
||||
messages,
|
||||
temperature: options.temperature || 0.7,
|
||||
max_tokens: options.maxTokens || 2048,
|
||||
...options
|
||||
max_tokens: maxTokens || 2048,
|
||||
...otherOptions
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user