Dodanie historii wiadomości
This commit is contained in:
parent
38c7ab8956
commit
52f4e8579e
|
|
@ -319,9 +319,18 @@ async def chat_endpoint(request: ChatRequest):
|
|||
weaviate_results = hybrid_search(keywords)
|
||||
prompt_data += "\n".join([f"Źródło: {doc['file_name']}\n{doc['relevant_fragment']}\n\n" for doc in weaviate_results])
|
||||
|
||||
#messages_with_context =[
|
||||
# {"role": "system", "content": prompt_system},
|
||||
# {"role": "system", "content": prompt_data},
|
||||
# {"role": "user", "content": prompt_answer.format(query=query)}
|
||||
# ]
|
||||
|
||||
# Zmieniamy, aby przekazać pełną historię wiadomości
|
||||
messages_with_context =[
|
||||
{"role": "system", "content": prompt_system},
|
||||
{"role": "system", "content": prompt_data},
|
||||
# Dodajemy wszystkie wiadomości z historii
|
||||
*[{"role": message.role, "content": message.content} for message in request.messages],
|
||||
{"role": "user", "content": prompt_answer.format(query=query)}
|
||||
]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue