Skip to content

Commit

Permalink
Merge pull request #43 from basenana/fix/history
Browse files Browse the repository at this point in the history
fix: get real history
  • Loading branch information
zwwhdls authored Apr 22, 2024
2 parents 9359a34 + 35f4d97 commit ff7ccfa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/friday/question.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ func (f *Friday) Question(q string) *Friday {
return f
}

func (f *Friday) GetRealHistory() []map[string]string {
return f.statement.history
}

func (f *Friday) Chat(res *ChatState) *Friday {
if len(f.statement.history) == 0 {
f.Error = errors.New("history can not be nil")
Expand Down Expand Up @@ -156,6 +160,7 @@ func (f *Friday) chat(res *ChatState) *Friday {
}

// go for llm
f.statement.history = dialogues // return realHistory
_, err := f.LLM.Chat(f.statement.context, true, dialogues, res.Response)
if err != nil {
f.Error = err
Expand Down

0 comments on commit ff7ccfa

Please sign in to comment.