Skip to content

Commit

Permalink
🐛 hotfix thought glitch (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyusap authored Dec 18, 2023
1 parent 19eecaf commit d2a903e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions agent/chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def think(cls, cache: Conversation, input: str):
chain = thought_prompt | cls.llm

def save_new_messages(ai_response):
cache.add_message("response", HumanMessage(content=input))
cache.add_message("response", AIMessage(content=ai_response))
cache.add_message("thought", HumanMessage(content=input))
cache.add_message("thought", AIMessage(content=ai_response))

return Streamable(chain.astream({}, {"tags": ["thought"], "metadata": {"conversation_id": cache.conversation_id, "user_id": cache.user_id}}), save_new_messages)

Expand Down

0 comments on commit d2a903e

Please sign in to comment.