Skip to content

Commit

Permalink
Fix AttributeError: 'HumanMessage' object has no attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
pamella committed Nov 19, 2024
1 parent 999980c commit 0d1ae05
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion django_ai_assistant/helpers/assistants.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,9 @@ def retriever(state: AgentState):
# This is necessary for compatibility with Anthropic
messages_to_summarize = state["messages"][1:-1]
input_message = state["messages"][-1]
docs = retriever.invoke({"input": input_message, "history": messages_to_summarize})
docs = retriever.invoke(
{"input": input_message.content, "history": messages_to_summarize}
)

document_separator = self.get_document_separator()
document_prompt = self.get_document_prompt()
Expand Down

0 comments on commit 0d1ae05

Please sign in to comment.