mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-15 01:21:48 +03:00
fix(metadata): Removed citation from metadata (#2507)
This pull request removes the citation metadata from the generate_answer and generate_stream functions. The citation metadata was previously being added to the streamed_chat_history and metadata dictionaries, but it is no longer necessary. This change improves the efficiency and clarity of the code.
This commit is contained in:
parent
2be6aac02a
commit
785066f9cb
@ -272,7 +272,6 @@ class KnowledgeBrainQA(BaseModel, QAInterface):
|
||||
if citations:
|
||||
citations = citations
|
||||
answer = model_response["answer"].tool_calls[-1]["args"]["answer"]
|
||||
metadata["citations"] = citations
|
||||
else:
|
||||
answer = model_response["answer"].content
|
||||
sources = model_response["docs"] or []
|
||||
@ -343,8 +342,6 @@ class KnowledgeBrainQA(BaseModel, QAInterface):
|
||||
|
||||
sources_list = generate_source(sources, self.brain_id, citations)
|
||||
|
||||
streamed_chat_history.metadata["citations"] = citations
|
||||
|
||||
# Serialize the sources list
|
||||
serialized_sources_list = [source.dict() for source in sources_list]
|
||||
streamed_chat_history.metadata["sources"] = serialized_sources_list
|
||||
|
Loading…
Reference in New Issue
Block a user