Skip to content

Commit

Permalink
jina-ai: omit results in context
Browse files Browse the repository at this point in the history
  • Loading branch information
nomagick committed Feb 19, 2025
1 parent bc2f187 commit 13cfd57
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion jina-ai/src/patch-express.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,13 @@ export const jinaAiMiddleware = (req: Request, res: Response, next: NextFunction
});
}
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(
JSON.stringify(ctx.promptContext),
JSON.stringify(patchedCtx),
{
metadata: {
contentType: 'application/json',
Expand Down

0 comments on commit 13cfd57

Please sign in to comment.