mirror of
https://github.com/jina-ai/node-DeepResearch.git
synced 2025-12-26 06:28:56 +08:00
fix: handle optional references in annotations
This commit is contained in:
parent
1a7267124e
commit
161bb2f964
@ -592,7 +592,7 @@ app.post('/v1/chat/completions', (async (req: Request, res: Response) => {
|
||||
)
|
||||
let finalAnswer = (finalStep as AnswerAction).mdAnswer;
|
||||
|
||||
const annotations = (finalStep as AnswerAction).references.filter(ref => ref?.url && ref?.title && ref?.exactQuote && ref?.dateTime).map(ref => ({
|
||||
const annotations = (finalStep as AnswerAction).references?.filter(ref => ref?.url && ref?.title && ref?.exactQuote && ref?.dateTime).map(ref => ({
|
||||
type: 'url_citation' as const,
|
||||
url_citation: {
|
||||
title: ref.title,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user