jina-ai: fix promptContext check

This commit is contained in:
Yanlong Wang
2025-02-14 11:10:59 +08:00
parent 3b76e0b4d8
commit 7743accfb3

View File

@@ -128,7 +128,7 @@ export const jinaAiMiddleware = (req: Request, res: Response, next: NextFunction
chargeAmount,
});
if (ctx.promptContext.knowledge?.length) {
if (ctx.promptContext?.knowledge?.length) {
Promise.all(ctx.promptContext.knowledge.map((x: any) => KnowledgeItem.save(
KnowledgeItem.from({
...x,