When exposing a component to the chat, you must provide a schema for the props of that component. The ComponentPropSchema
type defines the schema for those component props.
type ComponentPropSchema<T> = ɵtypes.Prettify<T extends ComponentType<infer P> ? {
[K in keyof P]?: s.Schema<P[K]>;
} : never>;
@type
T
Examples
// Example usage in a tool definition.
exposeComponent(CardComponent, {
// ...
props: { // The ComponentPropSchema
title: s.string('The title of the card'),
description: s.streaming.string('The description of the card'),
},
});