mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 04:15:25 +00:00
refac: api usage
This commit is contained in:
parent
56cefde161
commit
512d475ecc
1 changed files with 6 additions and 1 deletions
|
|
@ -938,7 +938,12 @@ async def process_chat_payload(request, form_data, user, metadata, model):
|
|||
)
|
||||
|
||||
# If there are citations, add them to the data_items
|
||||
sources = [source for source in sources if source.get("source", {}).get("name", "")]
|
||||
sources = [
|
||||
source
|
||||
for source in sources
|
||||
if source.get("source", {}).get("name", "")
|
||||
or source.get("source", {}).get("id", "")
|
||||
]
|
||||
|
||||
if len(sources) > 0:
|
||||
events.append({"sources": sources})
|
||||
|
|
|
|||
Loading…
Reference in a new issue