Skip to content

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 ​

ParameterType
ctxRequestContext & { executionId: string; }

Returns ​

ts
{
  metadata: {
     executionId: string;
     sessionId: string | undefined;
     tenantId: string | undefined;
     threadId: string;
     userId: string;
  };
  user: {
     id: string;
  };
}
NameTypeDefault valueDefined in
metadata{ executionId: string; sessionId: string | undefined; tenantId: string | undefined; threadId: string; userId: string; }-packages/server/src/execution-context.ts:212
metadata.executionIdstringctx.executionIdpackages/server/src/execution-context.ts:217
metadata.sessionIdstring | undefinedctx.sessionIdpackages/server/src/execution-context.ts:216
metadata.tenantIdstring | undefinedctx.tenantIdpackages/server/src/execution-context.ts:214
metadata.threadIdstringctx.threadIdpackages/server/src/execution-context.ts:215
metadata.userIdstringctx.userIdpackages/server/src/execution-context.ts:213
user{ id: string; }-packages/server/src/execution-context.ts:211
user.idstringctx.userIdpackages/server/src/execution-context.ts:211

Released under the MIT License.