Skip to content

Commit

Permalink
fix: always read the first respond choice
Browse files Browse the repository at this point in the history
  • Loading branch information
namwoam committed Jul 11, 2024
1 parent 911d052 commit a56d392
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ai/mistralai/v0/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (e *execution) taskTextGeneration(in *structpb.Struct) (*structpb.Struct, e

outputStruct := textGenerationOutput{}

outputStruct.Text = resp.Choices[len(resp.Choices)-1].Message.Content
outputStruct.Text = resp.Choices[0].Message.Content
outputStruct.Usage = chatUsage{
InputTokens: resp.Usage.PromptTokens,
OutputTokens: resp.Usage.CompletionTokens,
Expand Down

0 comments on commit a56d392

Please sign in to comment.