mirror of
https://github.com/jina-ai/node-DeepResearch.git
synced 2025-12-26 06:28:56 +08:00
fix: expect rough context data
This commit is contained in:
parent
9c386f5a82
commit
f23be85ac2
@ -171,8 +171,20 @@ export const jinaAiMiddleware = (req: Request, res: Response, next: NextFunction
|
||||
patchedCtx.context = patchedCtx.context.map((x: object) => ({ ...x, result: undefined }))
|
||||
}
|
||||
|
||||
let data;
|
||||
try {
|
||||
data = JSON.stringify(patchedCtx);
|
||||
} catch (err: any) {
|
||||
const obj = marshalErrorLike(err);
|
||||
if (err.stack) {
|
||||
obj.stack = err.stack;
|
||||
}
|
||||
data = JSON.stringify(obj);
|
||||
logger.warn(`Failed to stringify promptContext`, { err: obj });
|
||||
}
|
||||
|
||||
firebaseDefaultBucket.file(`promptContext/${ctx.traceId}.json`).save(
|
||||
JSON.stringify(patchedCtx),
|
||||
data,
|
||||
{
|
||||
metadata: {
|
||||
contentType: 'application/json',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user