mirror of
https://github.com/jina-ai/node-DeepResearch.git
synced 2026-03-22 07:29:35 +08:00
fix: handle optional references in annotations
This commit is contained in:
@@ -592,7 +592,7 @@ app.post('/v1/chat/completions', (async (req: Request, res: Response) => {
|
|||||||
)
|
)
|
||||||
let finalAnswer = (finalStep as AnswerAction).mdAnswer;
|
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,
|
type: 'url_citation' as const,
|
||||||
url_citation: {
|
url_citation: {
|
||||||
title: ref.title,
|
title: ref.title,
|
||||||
|
|||||||
Reference in New Issue
Block a user