AIContextResource
typedef
An individual resource item within a AIContextProvider
.
Represents a single selectable item in the resources list displayed when a user clicks on a custom
context menu option. The label
is displayed to the user as the resource name, and the type
indicates what kind of context item this represents (file, document, or URL).
When selected, the resource will be attached to the AI prompt to provide additional context for
generating responses. If the data
property is provided, it contains the content of the resource.
If data
is undefined, the content will be retrieved using the getData
callback from the parent
AIContextProvider
when the resource is selected.
{
id: 'user-guide-intro',
type: AIContextItemType.DOCUMENT,
label: 'User Guide - Introduction',
data: 'This is the introduction to our user guide...'
}
Properties
-
data : string | File | AIContextTextResource | undefined
module:ai/aichat/model/aichatcontext~AIContextResource#data
-
id : string
module:ai/aichat/model/aichatcontext~AIContextResource#id
-
label : string
module:ai/aichat/model/aichatcontext~AIContextResource#label
-
type : AIContextItemType
module:ai/aichat/model/aichatcontext~AIContextResource#type