Bläddra i källkod

fix: follow-up (suggested questions) does not refer to the most recen… (#9122)

tags/0.9.2
Hash Brown 1 år sedan
förälder
incheckning
511ffa4698
Inget konto är kopplat till bidragsgivarens mejladress
1 ändrade filer med 5 tillägg och 1 borttagningar
  1. 5
    1
      api/core/memory/token_buffer_memory.py

+ 5
- 1
api/core/memory/token_buffer_memory.py Visa fil

# instead of all messages from the conversation, we only need to extract messages # instead of all messages from the conversation, we only need to extract messages
# that belong to the thread of last message # that belong to the thread of last message
thread_messages = extract_thread_messages(messages) thread_messages = extract_thread_messages(messages)
thread_messages.pop(0)

# for newly created message, its answer is temporarily empty, we don't need to add it to memory
if thread_messages and not thread_messages[-1].answer:
thread_messages.pop()

messages = list(reversed(thread_messages)) messages = list(reversed(thread_messages))


message_file_parser = MessageFileParser(tenant_id=app_record.tenant_id, app_id=app_record.id) message_file_parser = MessageFileParser(tenant_id=app_record.tenant_id, app_id=app_record.id)

Laddar…
Avbryt
Spara