mirror of
https://github.com/jina-ai/node-DeepResearch.git
synced 2026-03-22 07:29:35 +08:00
jina-ai: omit results in context
This commit is contained in:
@@ -166,8 +166,13 @@ export const jinaAiMiddleware = (req: Request, res: Response, next: NextFunction
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (ctx.promptContext) {
|
if (ctx.promptContext) {
|
||||||
|
const patchedCtx = { ...ctx.promptContext };
|
||||||
|
if (Array.isArray(patchedCtx.context)) {
|
||||||
|
patchedCtx.context = patchedCtx.context.map((x: object) => ({ ...x, result: undefined }))
|
||||||
|
}
|
||||||
|
|
||||||
firebaseDefaultBucket.file(`promptContext/${ctx.traceId}.json`).save(
|
firebaseDefaultBucket.file(`promptContext/${ctx.traceId}.json`).save(
|
||||||
JSON.stringify(ctx.promptContext),
|
JSON.stringify(patchedCtx),
|
||||||
{
|
{
|
||||||
metadata: {
|
metadata: {
|
||||||
contentType: 'application/json',
|
contentType: 'application/json',
|
||||||
|
|||||||
Reference in New Issue
Block a user