Skip to main content

Interface: IAIGatewayVercelUiConfig

Defined in: entries/vercel-ui/types.ts:108

Configuration of one AIGatewayVercelUi instance: one chat use case of the application. A second use case is a second instance with another config.

Taken by the AIGatewayVercelUi constructor.

Properties​

call​

call: TUiCallConfig

Defined in: entries/vercel-ui/types.ts:124

The gateway input every call of this use case shares: profileId, kbFilters, the tools, instructions, context, limits.


files?​

optional files?: object

Defined in: entries/vercel-ui/types.ts:143

File parts: how a part the client sends names a stored file, and how a stored file is loaded by the client.

The upload itself is the application's route (AIGateway.uploadFile); the client only names what it uploaded.

Without it a file part in a chat request is a 400, and the file parts of a stored thread are left out of history.

fromUi​

fromUi: (args) => Promise<IFileRef>

The IFileRef of a file part the client sent (the upload route gave the client the id, e.g. in url). A file of another user is the gateway's 400.

Parameters​
args​
part​

FileUIPart

userContext​

IUserContext

Returns​

Promise<IFileRef>

toUrl​

toUrl: (args) => Promise<string>

The url the client loads a stored file from: AIGateway.getFileUrl (a signed url), or the application's download route.

Parameters​
args​
file​

IFileRef

userContext​

IUserContext

Returns​

Promise<string>


mode​

mode: "ask" | "run"

Defined in: entries/vercel-ui/types.ts:114

ask (one grounded answer, no tools) or run (an agent run with the profile's tools, pauses included).

Example​

"run" - a support chat whose model may look up orders and ask for approval before a refund

outputSchema?​

optional outputSchema?: ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>

Defined in: entries/vercel-ui/types.ts:129

The schema of a structured use case: the answer's parsed value lands in the metadata as structured. Handed to the gateway's resume again (D36).


prepareCall?​

optional prepareCall?: (args) => Promise<Partial<TUiCallConfig>>

Defined in: entries/vercel-ui/types.ts:135

Per-request overrides of call.

The context of what the client is looking at, carried in the request's body, or a profile picked per request.

Parameters​

args​
body​

IUiChatRequestBody

request​

Request

userContext​

IUserContext

Returns​

Promise<Partial<TUiCallConfig>>


userContext​

userContext: (args) => Promise<IUserContext>

Defined in: entries/vercel-ui/types.ts:122

The trust boundary of the endpoint: the application's authentication turns the request into the calling user.

The gateway trusts its caller (D118); nothing of the request body names the tenant or the user.

Throws a dynaError with status: 401 for a request it cannot authenticate: chat and resume answer with that status.

Parameters​

args​
request​

Request

Returns​

Promise<IUserContext>