From 35f4d9784cba5fbcc781664951d02665a1be8f1c Mon Sep 17 00:00:00 2001 From: zwwhdls Date: Mon, 22 Apr 2024 16:34:46 +0800 Subject: [PATCH] fix: get real history Signed-off-by: zwwhdls --- pkg/friday/question.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/friday/question.go b/pkg/friday/question.go index 7f57a29..70b9d12 100644 --- a/pkg/friday/question.go +++ b/pkg/friday/question.go @@ -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") @@ -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