AIToolsProvider
Provides an AI chat client and prompt processing for the spreadsheet AI tools.
Definition
Namespace:Telerik.Windows.Controls.Spreadsheet.AI
Assembly:Telerik.Windows.Controls.Spreadsheet.dll
Syntax:
[CLSCompliant(false)]
public class AIToolsProvider
Inheritance: objectAIToolsProvider
Constructors
Initializes a new instance of the AIToolsProvider class.
public AIToolsProvider(IChatClient client, RadSpreadsheet spreadsheet)
The chat client used to create and run the AI agent.
spreadsheetRadSpreadsheetThe spreadsheet control that provides the workbook context.
Properties
Agent
ChatClientAgent
Gets or sets the AI agent used to process chat messages and tool calls.
public ChatClientAgent Agent { get; set; }
Gets or sets the maximum number of tokens that can be processed. Default is 128000.
public int MaxTokenCount { get; set; }
Gets the RadSpreadsheet instance associated with this provider.
public RadSpreadsheet Spreadsheet { get; }
ToolsRegistry
List<AITool>
Gets the registry of AI tools available to the agent.
public List<AITool> ToolsRegistry { get; }
Methods
Sends a user prompt with spreadsheet context to the AI chat client and returns the response.
public virtual Task<string> GetResponseAsync(string userPrompt, CancellationToken cancellationToken = default)
The user's prompt text.
cancellationTokenCancellationTokenA cancellation token to cancel the request.
Returns:The AI-generated response text.
Initializes the spreadsheet context, AI tools registry, and agent instance.
protected virtual void InitializeAgentAndTools(IChatClient client, RadSpreadsheet spreadsheet)
The chat client used to create and run the AI agent.
spreadsheetRadSpreadsheetThe spreadsheet control that provides the workbook context.