File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -80,12 +80,13 @@ export class MistralHandler implements ApiHandler {
8080
8181 async * createMessage ( systemPrompt : string , messages : Anthropic . Messages . MessageParam [ ] ) : ApiStream {
8282 this . logDebug ( `Creating message with system prompt: ${ systemPrompt } ` )
83+
8384 const response = await this . client . chat . stream ( {
84- model : this . options . apiModelId || mistralDefaultModelId ,
85- maxTokens : this . options . includeMaxTokens ? this . getModel ( ) . info . maxTokens : undefined ,
85+ model : this . options ? .apiModelId || mistralDefaultModelId ,
86+ maxTokens : this . options ? .includeMaxTokens ? this . getModel ( ) . info . maxTokens : undefined ,
8687 messages : [ { role : "system" , content : systemPrompt } , ...convertToMistralMessages ( messages ) ] ,
87- temperature : this . options . modelTemperature ?? MISTRAL_DEFAULT_TEMPERATURE ,
88- stream : this . options . mistralModelStreamingEnabled ?? undefined ,
88+ temperature : this . options ? .modelTemperature ?? MISTRAL_DEFAULT_TEMPERATURE ,
89+ ... ( this . options ? .mistralModelStreamingEnabled === true && { stream : true } ) ,
8990 } )
9091
9192 let completeContent = ""
You can’t perform that action at this time.
0 commit comments