Skip to content

Commit

Permalink
fix: out of index when from openai messages to record models
Browse files Browse the repository at this point in the history
  • Loading branch information
JingYiJun committed Apr 1, 2024
1 parent 0178552 commit 1f07734
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apis/record/schemas.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func (messages OpenAIMessages) BuildRecordModels() (models RecordModels, request
return nil, "", err
}
models = make(RecordModels, len(messages)/2)
for i := 0; i < len(messages); i += 2 {
for i := 0; i < len(messages)-1; i += 2 {
models[i/2] = RecordModel{
Request: messages[i].Content,
Response: messages[i+1].Content,
Expand Down

0 comments on commit 1f07734

Please sign in to comment.