AIToolsProvider
Provides an AI chat client and prompt processing for the spreadsheet AI tools.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.RadSpreadsheet.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 AI chat client instance.
spreadsheetRadSpreadsheetThe RadSpreadsheet instance associated with this provider.
Properties
Agent
ChatClientAgent
Gets the AI chat client agent configured for this provider.
public ChatClientAgent Agent { get; }
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; }
Tools
List<AITool>
Gets the tools configured for this provider.
public List<AITool> Tools { 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 AI tools collection and chat client agent.
protected virtual void InitializeToolsAndAgent(IChatClient client)
The AI chat client instance.