Sign up (with export icon)

AIContextResource

Api-typedef icon 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...'
}
Copy code

Properties

  • data : string | File | AIContextTextResource | undefined

  • id : string

  • label : string

  • type : AIContextItemType