Skip to content

Commit

Permalink
fix: get real history
Browse files Browse the repository at this point in the history
Signed-off-by: zwwhdls <zww@hdls.me>
  • Loading branch information
zwwhdls committed Apr 22, 2024
1 parent 9359a34 commit 35f4d97
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 35f4d97

Please sign in to comment.