Skip to content

ItemType

type ItemType<TData> = {
agent?: {
render?: (data) => string | undefined;
};
data: TData;
description?: string;
id: string;
name: string;
};

Defined in: shared/src/item/item.types.ts:8

A registered kind of conversation item (see promptOutputItemSchema): the schema its data must satisfy, plus how it is presented. Follows the same registry pattern as EntityType and ProviderType.

Type Parameter Default type
TData extends z.ZodType z.ZodType
optional agent?: {
render?: (data) => string | undefined;
};

Defined in: shared/src/item/item.types.ts:18

How items of this type are exposed to the agent. Omit it for presentation-only artifacts (e.g. UI widgets): those stay in the transcript for hosts and UIs to consume, but never enter the model’s context.

optional render?: (data) => string | undefined;

Render an item of this type into the model’s context. Return undefined to keep a specific item out even though the type is exposed. Omit to use the default rendering (a name-labelled JSON dump).

Parameter Type
data z.infer<TData>

string | undefined


data: TData;

Defined in: shared/src/item/item.types.ts:12


optional description?: string;

Defined in: shared/src/item/item.types.ts:11


id: string;

Defined in: shared/src/item/item.types.ts:9


name: string;

Defined in: shared/src/item/item.types.ts:10