AIDK API Reference / aidk-server / buildEngineContext
Function: buildEngineContext() ​
ts
function buildEngineContext(ctx: RequestContext & {
executionId: string;
}): {
metadata: {
executionId: string;
sessionId: string | undefined;
tenantId: string | undefined;
threadId: string;
userId: string;
};
user: {
id: string;
};
};Defined in: packages/server/src/execution-context.ts:209
Build the withContext options for engine execution
Parameters ​
| Parameter | Type |
|---|---|
ctx | RequestContext & { executionId: string; } |
Returns ​
ts
{
metadata: {
executionId: string;
sessionId: string | undefined;
tenantId: string | undefined;
threadId: string;
userId: string;
};
user: {
id: string;
};
}| Name | Type | Default value | Defined in |
|---|---|---|---|
metadata | { executionId: string; sessionId: string | undefined; tenantId: string | undefined; threadId: string; userId: string; } | - | packages/server/src/execution-context.ts:212 |
metadata.executionId | string | ctx.executionId | packages/server/src/execution-context.ts:217 |
metadata.sessionId | string | undefined | ctx.sessionId | packages/server/src/execution-context.ts:216 |
metadata.tenantId | string | undefined | ctx.tenantId | packages/server/src/execution-context.ts:214 |
metadata.threadId | string | ctx.threadId | packages/server/src/execution-context.ts:215 |
metadata.userId | string | ctx.userId | packages/server/src/execution-context.ts:213 |
user | { id: string; } | - | packages/server/src/execution-context.ts:211 |
user.id | string | ctx.userId | packages/server/src/execution-context.ts:211 |