Commit 45c4a373 by 陈正乐

修正单词错误

parent b2c6461d
...@@ -81,7 +81,7 @@ class QA: ...@@ -81,7 +81,7 @@ class QA:
def get_history(self): def get_history(self):
return self.history return self.history
def updata_history(self): def update_history(self):
self.history.append((self.cur_question, self.cur_answer)) self.history.append((self.cur_question, self.cur_answer))
self.crud.update_last(chat_id=self.chat_id) self.crud.update_last(chat_id=self.chat_id)
self.crud.insert_turn_qa(chat_id=self.chat_id, question=self.cur_question, answer=self.cur_answer, self.crud.insert_turn_qa(chat_id=self.chat_id, question=self.cur_question, answer=self.cur_answer,
...@@ -96,6 +96,6 @@ if __name__ == "__main__": ...@@ -96,6 +96,6 @@ if __name__ == "__main__":
chat_completion=ChatCompletion(ak="pT7sV1smp4AeDl0LjyZuHBV9", sk="b3N0ibo1IKTLZlSs7weZc8jdR0oHjyMu")) chat_completion=ChatCompletion(ak="pT7sV1smp4AeDl0LjyZuHBV9", sk="b3N0ibo1IKTLZlSs7weZc8jdR0oHjyMu"))
my_chat = QA(PROMPT1, base_llm, {"temperature": 0.9}, ['context', 'question'], _db=c_db, _chat_id='2') my_chat = QA(PROMPT1, base_llm, {"temperature": 0.9}, ['context', 'question'], _db=c_db, _chat_id='2')
print(my_chat.async_chat("当别人想你说你好的时候,你也应该说你好", "你好")) print(my_chat.async_chat("当别人想你说你好的时候,你也应该说你好", "你好"))
my_chat.updata_history() my_chat.update_history()
time.sleep(20) time.sleep(20)
print(my_chat.cur_answer) print(my_chat.cur_answer)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment