From 4c9432e3df75fcb78745c8d301b46616a6131ea3 Mon Sep 17 00:00:00 2001 From: Viswajith-SF4658 Date: Tue, 31 Mar 2026 16:12:07 +0530 Subject: [PATCH 1/5] 1015822- Added Ug documentation for AI Agent tools --- Document-Processing-toc.html | 16 + .../AIAgentTool/customization.md | 232 ++++++++++ .../AIAgentTool/getting-started.md | 287 ++++++++++++ Document-Processing/AIAgentTool/overview.md | 89 ++++ Document-Processing/AIAgentTool/tools.md | 415 ++++++++++++++++++ 5 files changed, 1039 insertions(+) create mode 100644 Document-Processing/AIAgentTool/customization.md create mode 100644 Document-Processing/AIAgentTool/getting-started.md create mode 100644 Document-Processing/AIAgentTool/overview.md create mode 100644 Document-Processing/AIAgentTool/tools.md diff --git a/Document-Processing-toc.html b/Document-Processing-toc.html index eeb1d387d3..6e306f2415 100644 --- a/Document-Processing-toc.html +++ b/Document-Processing-toc.html @@ -24,6 +24,22 @@ Spreadsheet Editor SDK + +
  • AI Agent Tools +
  • AI Coding Assistant
  • -
  • AI Agent Tools +
  • AI Agent Tools
  • diff --git a/Document-Processing/AIAgentTool/customization.md b/Document-Processing/ai-agent-tools/customization.md similarity index 94% rename from Document-Processing/AIAgentTool/customization.md rename to Document-Processing/ai-agent-tools/customization.md index 4282bdc466..e2dd9a6405 100644 --- a/Document-Processing/AIAgentTool/customization.md +++ b/Document-Processing/ai-agent-tools/customization.md @@ -17,7 +17,7 @@ The Syncfusion Document SDK Agent Tool library is designed to be extensible. Thi Follow these steps to expose new document operations to the AI agent. -### Step 1: Subclass AgentToolBase +**Step 1: Create a Custom Agent Tool by Inheriting AgentToolBase** Create a new class that inherits from `AgentToolBase` (in the `Syncfusion.AI.AgentTools.Core` namespace) and accepts a document repository through its constructor: @@ -37,7 +37,7 @@ public class WordWatermarkAgentTools : AgentToolBase } ``` -### Step 2: Add Tool Methods with [Tool] +**Step 2: Add Tool Methods with [Tool]** Add `public` instance methods and decorate each one with `[Tool]`, providing a name and a description that the AI agent will use to understand when to call it: @@ -51,7 +51,7 @@ public CallToolResult AddTextWatermark(...) } ``` -### Step 3: Annotate Parameters with [ToolParameter] +**Step 3: Annotate Parameters with [ToolParameter]** Decorate each method parameter with `[ToolParameter]` to give the AI a natural-language description of what value to pass: @@ -65,7 +65,7 @@ public CallToolResult AddTextWatermark( float fontSize = 72f) ``` -### Step 4: Return CallToolResult +**Step 4: Return CallToolResult** All tool methods must return `CallToolResult`. Use the static factory methods to signal success or failure: @@ -77,7 +77,7 @@ return CallToolResult.Ok("Operation completed successfully."); return CallToolResult.Fail("Reason the operation failed."); ``` -### Complete Example +### Example ```csharp using Syncfusion.AI.AgentTools.Core; @@ -155,7 +155,7 @@ public class WordWatermarkAgentTools : AgentToolBase Once your custom tool class is created, register it alongside the built-in tools in your host application. -### Step 1: Instantiate the Custom Tool Class +**Step 1: Instantiate the Custom Tool Class** ```csharp var wordRepo = new WordDocumentRepository(TimeSpan.FromMinutes(5)); @@ -167,7 +167,7 @@ var wordDocTools = new WordDocumentAgentTools(wordRepo, outputDirectory); var wordWatermarkTools = new WordWatermarkAgentTools(wordRepo); ``` -### Step 2: Collect All Tools +**Step 2: Collect All Tools** ```csharp var allSyncfusionTools = new List(); @@ -175,7 +175,7 @@ allSyncfusionTools.AddRange(wordDocTools.GetTools()); allSyncfusionTools.AddRange(wordWatermarkTools.GetTools()); // <-- custom tools ``` -### Step 3: Convert to Microsoft.Extensions.AI Tools +**Step 3: Convert to Microsoft.Extensions.AI Tools** ```csharp using Microsoft.Extensions.AI; @@ -190,7 +190,7 @@ var msAiTools = allSyncfusionTools .ToList(); ``` -### Step 4: Build the Agent +**Step 4: Build the Agent** ```csharp var agent = openAIClient.AsAIAgent( diff --git a/Document-Processing/AIAgentTool/getting-started.md b/Document-Processing/ai-agent-tools/getting-started.md similarity index 95% rename from Document-Processing/AIAgentTool/getting-started.md rename to Document-Processing/ai-agent-tools/getting-started.md index 7958c079ef..6b4e2eb747 100644 --- a/Document-Processing/AIAgentTool/getting-started.md +++ b/Document-Processing/ai-agent-tools/getting-started.md @@ -19,18 +19,18 @@ The Syncfusion Document SDK Agent Tool library exposes Word, Excel, PDF, and Pow |---|---| | **.NET SDK** | .NET 8.0 or .NET 10.0 | | **OpenAI API Key** | Obtain one from [platform.openai.com](https://platform.openai.com). | -| **Syncfusion License** | Community or commercial license. See [syncfusion.com/products/communitylicense](https://www.syncfusion.com/products/communitylicense). | +| **Syncfusion License** | Community or commercial license. See [syncfusion.com/products/community-license](https://www.syncfusion.com/products/communitylicense). | | **NuGet Packages** | `Microsoft.Agents.AI.OpenAI` (v1.0.0-rc4) and Syncfusion AgentLibrary packages. | --- -## Integration Overview +## Integration Integrating the Agent Tool library into an agent framework involves following steps: --- -## Step 1 — Register the Syncfusion License +**Step 1 — Register the Syncfusion License** Register your Syncfusion license key at application startup before any document operations are performed: @@ -46,7 +46,7 @@ if (!string.IsNullOrEmpty(licenseKey)) --- -## Step 2 — Create Document Repositories +**Step 2 — Create Document Repositories** Repositories are in-memory containers that hold document instances across tool calls. Create one repository per document type: @@ -83,7 +83,7 @@ repoCollection.AddRepository(DocumentType.PowerPoint, presentationRepository); --- -## Step 3 — Instantiate Agent Tool Classes and Collect Tools +**Step 3 — Instantiate Agent Tool Classes and Collect Tools** Each tool class is initialized with the relevant repository (and an optional output directory). Call `GetTools()` on each to get a list of `AITool` objects: @@ -126,7 +126,7 @@ allTools.AddRange(new DataExtractionAgentTools(outputDir).GetTools()); --- -## Step 4 — Convert Syncfusion AITools to Microsoft.Extensions.AI Functions +**Step 4 — Convert Syncfusion AITools to Microsoft.Extensions.AI Functions** The Syncfusion `AITool` objects expose a `MethodInfo` and a target instance. Use `AIFunctionFactory.Create` from `Microsoft.Extensions.AI` to wrap them into framework-compatible function objects: @@ -150,7 +150,7 @@ Each converted function carries the tool name, description, and parameter metada --- -## Step 5 — Build the AIAgent and Run the Chat Loop +**Step 5 — Build the AIAgent and Run the Chat Loop** ### Create the Agent @@ -262,7 +262,7 @@ Any other provider that exposes an `IChatClient` (Ollama, Anthropic via adapters --- -## Example Prompts to Try +## Example Prompts | Category | Example Prompt | |---|---| @@ -270,7 +270,6 @@ Any other provider that exposes an `IChatClient` (Ollama, Anthropic via adapters | **Word** | *"Merge three Word documents and apply password protection"* | | **Word** | *"Perform a mail merge using customer data and save individual documents"* | | **Excel** | *"Create a spreadsheet with sales data and SUM formulas, then export to CSV"* | -| **PDF** | *"Merge multiple PDFs and add a diagonal watermark to each page"* | | **PDF** | *"Compress report.pdf and encrypt it with a password"* | | **PowerPoint** | *"Open Sample.pptx and replace all occurrences of `{product}` with `Cycle`"* | | **Conversion** | *"Convert Simple.docx to PDF"* | diff --git a/Document-Processing/AIAgentTool/overview.md b/Document-Processing/ai-agent-tools/overview.md similarity index 100% rename from Document-Processing/AIAgentTool/overview.md rename to Document-Processing/ai-agent-tools/overview.md diff --git a/Document-Processing/AIAgentTool/tools.md b/Document-Processing/ai-agent-tools/tools.md similarity index 63% rename from Document-Processing/AIAgentTool/tools.md rename to Document-Processing/ai-agent-tools/tools.md index 6b78cfa61c..4c74818636 100644 --- a/Document-Processing/AIAgentTool/tools.md +++ b/Document-Processing/ai-agent-tools/tools.md @@ -17,7 +17,7 @@ Tools are organized into the following categories: |---|---|---| | **PDF** | `PdfDocumentAgentTools`, `PdfOperationsAgentTools`, `PdfSecurityAgentTools`, `PdfContentExtractionAgentTools`, `PdfAnnotationAgentTools` | Create, manipulate, secure, extract content from, and annotate PDF documents. | | **Word** | `WordDocumentAgentTools`, `WordOperationsAgentTools`, `WordSecurityAgentTools`, `WordMailMergeAgentTools`, `WordFindAndReplaceAgentTools`, `WordRevisionAgentTools`, `WordImportExportAgentTools`, `WordFormFieldAgentTools`, `WordBookmarkAgentTools` | Create, edit, protect, mail-merge, find/replace, track changes, import/export, and manage form fields and bookmarks in Word documents. | -| **Excel** | `ExcelWorkbookAgentTools`, `ExcelWorksheetAgentTools`, `ExcelSecurityAgentTools`, `ExcelFormulaAgentTools` | Create and manage workbooks and worksheets, set cell values and formulas, and apply security settings. | +| **Excel** | `ExcelWorkbookAgentTools`, `ExcelWorksheetAgentTools`, `ExcelSecurityAgentTools`, `ExcelFormulaAgentTools`, `ExcelChartAgentTools`, `ExcelConditionalFormattingAgentTools`, `ExcelConversionAgentTools`, `ExcelDataValidationAgentTools`, `ExcelPivotTableAgentTools` | Create and manage workbooks and worksheets, set cell values, formulas, and number formats, apply security, create and configure charts and sparklines, add conditional formatting, convert to image/HTML/ODS/JSON, manage data validation, and create and manipulate pivot tables. | | **PowerPoint** | `PresentationDocumentAgentTools`, `PresentationOperationsAgentTools`, `PresentationSecurityAgentTools`, `PresentationContentAgentTools`, `PresentationFindAndReplaceAgentTools` | Load, merge, split, secure, and extract content from PowerPoint presentations. | | **Conversion** | `OfficeToPdfAgentTools` | Convert Word, Excel, and PowerPoint documents to PDF. | | **Data Extraction** | `DataExtractionAgentTools` | Extract structured data (text, tables, forms) from PDF and image files as JSON. | @@ -26,7 +26,7 @@ Tools are organized into the following categories: ## Repositories -Repositories are in-memory containers that manage document lifecycles during AI agent operations. Each repository extends `DocumentRepositoryBase`, which provides common functionality including document creation, import/export, active document tracking, and automatic expiration-based cleanup. +Repositories are in-memory containers that manage document life cycles during AI agent operations. Each repository extends `DocumentRepositoryBase`, which provides common functionality including document creation, import/export, active document tracking, and automatic expiration-based cleanup. ### Available Repositories @@ -279,7 +279,7 @@ Provides encryption, decryption, and protection management for Excel workbooks a ### ExcelFormulaAgentTools -Provides tools to set, retrieve, calculate, and validate cell formulas in Excel workbooks. +Provides tools to set, retrieve, calculate and validate cell formulas in Excel workbooks. | Tool | Syntax | Description | |---|---|---| @@ -290,6 +290,101 @@ Provides tools to set, retrieve, calculate, and validate cell formulas in Excel --- +### ExcelChartAgentTools + +Provides tools to create modify and remove charts in excel workbooks + +| Tool | Syntax | Description | +|---|---|---| +| CreateChart | `CreateChart(string workbookId, string worksheetName, string chartType, string dataRange, bool isSeriesInRows = false, int topRow = 8, int leftColumn = 1, int bottomRow = 23, int rightColumn = 8)` | Creates a chart from a data range in the worksheet. Supports many chart types (e.g., `Column_Clustered`, `Line`, `Pie`, `Bar_Clustered`). Returns the chart index. | +| CreateChartWithSeries | `CreateChartWithSeries(string workbookId, string worksheetName, string chartType, string seriesName, string valuesRange, string categoryLabelsRange, int topRow = 8, int leftColumn = 1, int bottomRow = 23, int rightColumn = 8)` | Creates a chart and adds a named series with values and category labels. Returns the chart index. | +| AddSeriesToChart | `AddSeriesToChart(string workbookId, string worksheetName, int chartIndex, string seriesName, string valuesRange, string categoryLabelsRange)` | Adds a new series to an existing chart. | +| SetChartTitle | `SetChartTitle(string workbookId, string worksheetName, int chartIndex, string title)` | Sets the title text of a chart. | +| SetChartLegend | `SetChartLegend(string workbookId, string worksheetName, int chartIndex, bool hasLegend, string position = "Bottom")` | Configures the chart legend visibility and position (`Bottom`, `Top`, `Left`, `Right`, `Corner`). | +| SetDataLabels | `SetDataLabels(string workbookId, string worksheetName, int chartIndex, int seriesIndex, bool showValue = true, bool showCategoryName = false, bool showSeriesName = false, string position = "Outside")` | Configures data labels for a chart series. | +| SetChartPosition | `SetChartPosition(string workbookId, string worksheetName, int chartIndex, int topRow, int leftColumn, int bottomRow, int rightColumn)` | Sets the position and size of a chart in the worksheet. | +| SetAxisTitles | `SetAxisTitles(string workbookId, string worksheetName, int chartIndex, string? categoryAxisTitle = null, string? valueAxisTitle = null)` | Sets titles for the category (horizontal) and value (vertical) axes. | +| RemoveChart | `RemoveChart(string workbookId, string worksheetName, int chartIndex)` | Removes a chart from the worksheet by its 0-based index. | +| GetChartCount | `GetChartCount(string workbookId, string worksheetName)` | Returns the number of charts in a worksheet. | +| CreateSparkline | `CreateSparkline(string workbookId, string worksheetName, string sparklineType, string dataRange, string referenceRange)` | Creates sparkline charts in worksheet cells. Types: `Line`, `Column`, `WinLoss`. | +--- + +### ExcelConditionalFormattingAgentTools + +Provides toolsto add or remove conditional formatting in workbook + +| Tool | Syntax | Description | +|---|---|---| +| AddConditionalFormat | `AddConditionalFormat(string workbookId, string worksheetName, string rangeAddress, string formatType, string? operatorType = null, string? firstFormula = null, string? secondFormula = null, string? backColor = null, bool? isBold = null, bool? isItalic = null)` | Adds conditional formatting to a cell or range. `formatType` values: `CellValue`, `Formula`, `DataBar`, `ColorScale`, `IconSet`. | +| RemoveConditionalFormat | `RemoveConditionalFormat(string workbookId, string worksheetName, string rangeAddress)` | Removes all conditional formatting from a specified cell or range. | +| RemoveConditionalFormatAtIndex | `RemoveConditionalFormatAtIndex(string workbookId, string worksheetName, string rangeAddress, int index)` | Removes the conditional format at a specific 0-based index from a range. | +--- + +### ExcelConversionAgentTools + +Provides tools to convert worksheet to image, HTML, ODS, JSON file formats + +| Tool | Syntax | Description | +|---|---|---| +| ConvertWorksheetToImage | `ConvertWorksheetToImage(string workbookId, string worksheetName, string outputPath, string imageFormat = "PNG", string scalingMode = "Best")` | Converts an entire worksheet to an image file (PNG, JPEG, BMP, GIF, TIFF). | +| ConvertRangeToImage | `ConvertRangeToImage(string workbookId, string worksheetName, string rangeAddress, string outputPath, string imageFormat = "PNG", string scalingMode = "Best")` | Converts a specific cell range to an image file. | +| ConvertRowColumnRangeToImage | `ConvertRowColumnRangeToImage(string workbookId, string worksheetName, int startRow, int startColumn, int endRow, int endColumn, string outputPath, string imageFormat = "PNG", string scalingMode = "Best")` | Converts a row/column range to an image using 1-based row and column numbers. | +| ConvertChartToImage | `ConvertChartToImage(string workbookId, string worksheetName, int chartIndex, string outputPath, string imageFormat = "PNG", string scalingMode = "Best")` | Converts a chart to an image file (PNG or JPEG). | +| ConvertAllChartsToImages | `ConvertAllChartsToImages(string workbookId, string worksheetName, string outputDirectory, string imageFormat = "PNG", string scalingMode = "Best", string fileNamePrefix = "Chart")` | Converts all charts in a worksheet to separate image files. | +| ConvertWorkbookToHtml | `ConvertWorkbookToHtml(string workbookId, string outputPath, string textMode = "DisplayText")` | Converts an entire workbook to an HTML file preserving styles, hyperlinks, images, and charts. | +| ConvertWorksheetToHtml | `ConvertWorksheetToHtml(string workbookId, string worksheetName, string outputPath, string textMode = "DisplayText")` | Converts a specific worksheet to an HTML file. | +| ConvertUsedRangeToHtml | `ConvertUsedRangeToHtml(string workbookId, string worksheetName, string outputPath, string textMode = "DisplayText", bool autofitColumns = true)` | Converts the used range of a worksheet to an HTML file with optional column auto-fitting. | +| ConvertAllWorksheetsToHtml | `ConvertAllWorksheetsToHtml(string workbookId, string outputDirectory, string textMode = "DisplayText", string fileNamePrefix = "Sheet")` | Converts all worksheets in a workbook to separate HTML files. | +| ConvertWorkbookToOds | `ConvertWorkbookToOds(string workbookId, string outputPath)` | Converts an entire workbook to OpenDocument Spreadsheet (ODS) format. | +| ConvertWorkbookToOdsStream | `ConvertWorkbookToOdsStream(string workbookId, string outputPath)` | Converts an entire workbook to ODS format using stream-based output. | +| ConvertWorkbookToJson | `ConvertWorkbookToJson(string workbookId, string outputPath, bool includeSchema = true)` | Converts an entire workbook to JSON format with optional schema. | +| ConvertWorkbookToJsonStream | `ConvertWorkbookToJsonStream(string workbookId, string outputPath, bool includeSchema = true)` | Converts an entire workbook to JSON format using stream-based output. | +| ConvertWorksheetToJson | `ConvertWorksheetToJson(string workbookId, string worksheetName, string outputPath, bool includeSchema = true)` | Converts a specific worksheet to JSON format. | +| ConvertWorksheetToJsonStream | `ConvertWorksheetToJsonStream(string workbookId, string worksheetName, string outputPath, bool includeSchema = true)` | Converts a specific worksheet to JSON format using stream-based output. | +| ConvertRangeToJson | `ConvertRangeToJson(string workbookId, string worksheetName, string rangeAddress, string outputPath, bool includeSchema = true)` | Converts a specific cell range to JSON format. | +| ConvertRangeToJsonStream | `ConvertRangeToJsonStream(string workbookId, string worksheetName, string rangeAddress, string outputPath, bool includeSchema = true)` | Converts a specific cell range to JSON format using stream-based output. | +--- + +### ExcelDataValidationAgentTools + +Provides tools to add data validation to workbook + +| Tool | Syntax | Description | +|---|---|---| +| AddDropdownListValidation | `AddDropdownListValidation(string workbookId, string worksheetName, string rangeAddress, string listValues, bool showErrorBox = true, string? errorTitle = null, string? errorMessage = null, bool showPromptBox = false, string? promptMessage = null)` | Adds a dropdown list data validation to a cell or range. `listValues` is comma-separated (max 255 chars). | +| AddDropdownFromRange | `AddDropdownFromRange(string workbookId, string worksheetName, string rangeAddress, string sourceRange, bool showErrorBox = true, string? errorTitle = null, string? errorMessage = null, bool showPromptBox = false, string? promptMessage = null)` | Adds a dropdown list validation using a reference range as the data source (e.g., `=Sheet1!$A$1:$A$10`). | +| AddNumberValidation | `AddNumberValidation(string workbookId, string worksheetName, string rangeAddress, string numberType, string comparisonOperator, string firstValue, string? secondValue = null, ...)` | Adds number validation (`Integer` or `Decimal`) with a comparison operator and value(s). | +| AddDateValidation | `AddDateValidation(string workbookId, string worksheetName, string rangeAddress, string comparisonOperator, string firstDate, string? secondDate = null, ...)` | Adds date validation using dates in `yyyy-MM-dd` format. | +| AddTimeValidation | `AddTimeValidation(string workbookId, string worksheetName, string rangeAddress, string comparisonOperator, string firstTime, string? secondTime = null, ...)` | Adds time validation using 24-hour `HH:mm` format. | +| AddTextLengthValidation | `AddTextLengthValidation(string workbookId, string worksheetName, string rangeAddress, string comparisonOperator, string firstLength, string? secondLength = null, ...)` | Adds text length validation with a comparison operator and length value(s). | +| AddCustomValidation | `AddCustomValidation(string workbookId, string worksheetName, string rangeAddress, string formula, ...)` | Adds custom formula-based validation (e.g., `=A1>10`). | +| RemoveValidation | `RemoveValidation(string workbookId, string worksheetName, string rangeAddress)` | Removes data validation from a cell or range. | +| RemoveAllValidations | `RemoveAllValidations(string workbookId, string worksheetName)` | Removes all data validations from a worksheet. | +--- + +### ExcelPivotTableAgentTools + +Provides tools to create, edit pivot table in workbook + +| Tool | Syntax | Description | +|---|---|---| +| CreatePivotTable | `CreatePivotTable(string workbookId, string dataWorksheetName, string dataRange, string pivotWorksheetName, string pivotTableName, string pivotLocation, string rowFieldIndices, string columnFieldIndices, int dataFieldIndex, string dataFieldCaption, string subtotalType = "Sum")` | Creates a pivot table from a data range. Row/column field indices are comma-separated 0-based values. `subtotalType`: `Sum`, `Count`, `Average`, `Max`, `Min`, etc. XLSX only. | +| EditPivotTableCell | `EditPivotTableCell(string workbookId, string worksheetName, int pivotTableIndex, string cellAddress, string newValue)` | Lays out a pivot table and edits a specific cell value within the pivot area. | +| RemovePivotTable | `RemovePivotTable(string workbookId, string worksheetName, string pivotTableName)` | Removes a pivot table from a worksheet by name. | +| RemovePivotTableByIndex | `RemovePivotTableByIndex(string workbookId, string worksheetName, int pivotTableIndex)` | Removes a pivot table from a worksheet by its 0-based index. | +| GetPivotTables | `GetPivotTables(string workbookId, string worksheetName)` | Returns all pivot table names and their indices in the specified worksheet. | +| LayoutPivotTable | `LayoutPivotTable(string workbookId, string worksheetName, int pivotTableIndex, bool setRefreshOnLoad = true)` | Materializes pivot table values into worksheet cells, enabling reading and editing of pivot data. | +| RefreshPivotTable | `RefreshPivotTable(string workbookId, string worksheetName, int pivotTableIndex)` | Marks the pivot table cache to refresh when the file is opened in Excel. | +| ApplyPivotTableStyle | `ApplyPivotTableStyle(string workbookId, string worksheetName, int pivotTableIndex, string builtInStyle)` | Applies a built-in Excel style to a pivot table (e.g., `PivotStyleLight1`, `PivotStyleMedium2`, `PivotStyleDark12`, `None`). | +| FormatPivotTableCells | `FormatPivotTableCells(string workbookId, string worksheetName, int pivotTableIndex, string rangeAddress, string backColor)` | Applies a background color to a cell range within a pivot table area. | +| SortPivotTableTopToBottom | `SortPivotTableTopToBottom(string workbookId, string worksheetName, int pivotTableIndex, int rowFieldIndex, string sortType, int dataFieldIndex = 1)` | Sorts a pivot table row field top-to-bottom (`Ascending` or `Descending`) by data field values. | +| SortPivotTableLeftToRight | `SortPivotTableLeftToRight(string workbookId, string worksheetName, int pivotTableIndex, int columnFieldIndex, string sortType, int dataFieldIndex = 1)` | Sorts a pivot table column field left-to-right (`Ascending` or `Descending`) by data field values. | +| ApplyPivotPageFilter | `ApplyPivotPageFilter(string workbookId, string worksheetName, int pivotTableIndex, int pageFieldIndex, string hiddenItemIndices)` | Sets a pivot field as a page/report filter and hides specified items (comma-separated 0-based indices). | +| ApplyPivotLabelFilter | `ApplyPivotLabelFilter(string workbookId, string worksheetName, int pivotTableIndex, int fieldIndex, string filterType, string filterValue)` | Applies a caption/label filter to a pivot field (e.g., `CaptionEqual`, `CaptionBeginsWith`, `CaptionContains`). | +| ApplyPivotValueFilter | `ApplyPivotValueFilter(string workbookId, string worksheetName, int pivotTableIndex, int fieldIndex, string filterType, string filterValue)` | Applies a value-based filter to a pivot field (e.g., `ValueGreaterThan`, `ValueLessThan`, `ValueBetween`). | +| HidePivotFieldItems | `HidePivotFieldItems(string workbookId, string worksheetName, int pivotTableIndex, int fieldIndex, string hiddenItemIndices)` | Hides specified items within a pivot table row or column field by comma-separated 0-based indices. | +--- + ## PowerPoint Tools ### PresentationDocumentAgentTools From 39eaadffc4b5e396275234ffe4339b939b38fba8 Mon Sep 17 00:00:00 2001 From: Viswajith-SF4658 Date: Tue, 31 Mar 2026 19:14:31 +0530 Subject: [PATCH 3/5] Modified the content to resolve CI failures --- Document-Processing/ai-agent-tools/getting-started.md | 4 ++-- Document-Processing/ai-agent-tools/overview.md | 2 +- Document-Processing/ai-agent-tools/tools.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Document-Processing/ai-agent-tools/getting-started.md b/Document-Processing/ai-agent-tools/getting-started.md index 6b4e2eb747..dcf78c89bc 100644 --- a/Document-Processing/ai-agent-tools/getting-started.md +++ b/Document-Processing/ai-agent-tools/getting-started.md @@ -18,7 +18,7 @@ The Syncfusion Document SDK Agent Tool library exposes Word, Excel, PDF, and Pow | Requirement | Details | |---|---| | **.NET SDK** | .NET 8.0 or .NET 10.0 | -| **OpenAI API Key** | Obtain one from [platform.openai.com](https://platform.openai.com). | +| **OpenAI API Key** | Obtain one from [platform.openai.com](https://platform.openai.com/login). | | **Syncfusion License** | Community or commercial license. See [syncfusion.com/products/community-license](https://www.syncfusion.com/products/communitylicense). | | **NuGet Packages** | `Microsoft.Agents.AI.OpenAI` (v1.0.0-rc4) and Syncfusion AgentLibrary packages. | @@ -232,7 +232,7 @@ The agent automatically: For a complete, runnable example that combines all five steps, refer to the example application in the GitHub repository: -**[Examples/SyncfusionAgentTools/Program.cs](https://github.com/syncfusion/Document-SDK-Agent-Tool/blob/main/Examples/SyncfusionAgentTools/Program.cs)** +**Examples/SyncfusionAgentTools/Program.cs** You can clone and run it directly: diff --git a/Document-Processing/ai-agent-tools/overview.md b/Document-Processing/ai-agent-tools/overview.md index fb48b96685..0b07b2ff8f 100644 --- a/Document-Processing/ai-agent-tools/overview.md +++ b/Document-Processing/ai-agent-tools/overview.md @@ -7,7 +7,7 @@ control: AI Agent Tools documentation: ug --- -# Overview +# Syncfusion® Document SDK Agent tool Overview ## What is Syncfusion Document SDK Agent Tool? diff --git a/Document-Processing/ai-agent-tools/tools.md b/Document-Processing/ai-agent-tools/tools.md index 4c74818636..3b106894f3 100644 --- a/Document-Processing/ai-agent-tools/tools.md +++ b/Document-Processing/ai-agent-tools/tools.md @@ -7,7 +7,7 @@ control: AI Agent Tools documentation: ug --- -## Agent Tools +# Agent Tools Agent Tools are the callable functions exposed to the AI agent. Each tool class is initialized with the appropriate repository. From 8f4aa01763749def21ada615960a8330c78e724e Mon Sep 17 00:00:00 2001 From: Viswajith-SF4658 Date: Tue, 31 Mar 2026 20:47:27 +0530 Subject: [PATCH 4/5] Modified the content for feedback addressed and to resolve CI fails --- .../ai-agent-tools/customization.md | 5 +- .../ai-agent-tools/getting-started.md | 14 +- .../ai-agent-tools/overview.md | 4 +- Document-Processing/ai-agent-tools/tools.md | 127 +++++++++--------- 4 files changed, 73 insertions(+), 77 deletions(-) diff --git a/Document-Processing/ai-agent-tools/customization.md b/Document-Processing/ai-agent-tools/customization.md index e2dd9a6405..db485cf018 100644 --- a/Document-Processing/ai-agent-tools/customization.md +++ b/Document-Processing/ai-agent-tools/customization.md @@ -100,9 +100,7 @@ public class WordWatermarkAgentTools : AgentToolBase [ToolParameter(Description = "The document ID of the Word document.")] string documentId, [ToolParameter(Description = "The watermark text to display (e.g., 'DRAFT', 'CONFIDENTIAL').")] - string watermarkText, - [ToolParameter(Description = "Optional: the font size of the watermark. Defaults to 72.")] - float fontSize = 72f) + string watermarkText) { try { @@ -111,7 +109,6 @@ public class WordWatermarkAgentTools : AgentToolBase return CallToolResult.Fail($"Document not found: {documentId}"); TextWatermark watermark = new TextWatermark(watermarkText, "", 250, 100); - watermark.FontSize = fontSize; watermark.Color = Syncfusion.Drawing.Color.LightGray; watermark.Layout = WatermarkLayout.Diagonal; doc.Watermark = watermark; diff --git a/Document-Processing/ai-agent-tools/getting-started.md b/Document-Processing/ai-agent-tools/getting-started.md index dcf78c89bc..e897e27104 100644 --- a/Document-Processing/ai-agent-tools/getting-started.md +++ b/Document-Processing/ai-agent-tools/getting-started.md @@ -18,7 +18,7 @@ The Syncfusion Document SDK Agent Tool library exposes Word, Excel, PDF, and Pow | Requirement | Details | |---|---| | **.NET SDK** | .NET 8.0 or .NET 10.0 | -| **OpenAI API Key** | Obtain one from [platform.openai.com](https://platform.openai.com/login). | +| **OpenAI API Key** | Obtain one from [platform.openai.com](https://platform.openai.com/api-keys). | | **Syncfusion License** | Community or commercial license. See [syncfusion.com/products/community-license](https://www.syncfusion.com/products/communitylicense). | | **NuGet Packages** | `Microsoft.Agents.AI.OpenAI` (v1.0.0-rc4) and Syncfusion AgentLibrary packages. | @@ -67,7 +67,7 @@ var presentationRepository = new PresentationRepository(timeout); The `timeout` parameter controls how long an unused document is kept in memory before it is automatically cleaned up. -### DocumentRepositoryCollection +**Step-3 - Add repositories to DocumentRepositoryCollection** Some tool classes need to read from one repository and write results into another. For example, `OfficeToPdfAgentTools` reads a source document from the Word, Excel, or PowerPoint repository and saves the converted output into the PDF repository. A `DocumentRepositoryCollection` is passed to such tools so they can resolve the correct repository at runtime: @@ -83,7 +83,7 @@ repoCollection.AddRepository(DocumentType.PowerPoint, presentationRepository); --- -**Step 3 — Instantiate Agent Tool Classes and Collect Tools** +**Step 4 — Instantiate Agent Tool Classes and Collect Tools** Each tool class is initialized with the relevant repository (and an optional output directory). Call `GetTools()` on each to get a list of `AITool` objects: @@ -126,7 +126,7 @@ allTools.AddRange(new DataExtractionAgentTools(outputDir).GetTools()); --- -**Step 4 — Convert Syncfusion AITools to Microsoft.Extensions.AI Functions** +**Step 5 — Convert Syncfusion AITools to Microsoft.Extensions.AI Functions** The Syncfusion `AITool` objects expose a `MethodInfo` and a target instance. Use `AIFunctionFactory.Create` from `Microsoft.Extensions.AI` to wrap them into framework-compatible function objects: @@ -150,9 +150,7 @@ Each converted function carries the tool name, description, and parameter metada --- -**Step 5 — Build the AIAgent and Run the Chat Loop** - -### Create the Agent +**Step 6 — Build the AIAgent and Run the Chat Loop** Use `AsAIAgent()` from `Microsoft.Agents.AI` to build an agent from an OpenAI chat client, passing the converted tools and a system prompt: @@ -178,8 +176,6 @@ AIAgent agent = new OpenAIClient(apiKey) tools: aiTools); ``` -### Run the Interactive Chat Loop - The agent handles multi-turn tool calling automatically. Pass the growing conversation history to `RunAsync()` on each turn: ```csharp diff --git a/Document-Processing/ai-agent-tools/overview.md b/Document-Processing/ai-agent-tools/overview.md index 0b07b2ff8f..3b31c3b65e 100644 --- a/Document-Processing/ai-agent-tools/overview.md +++ b/Document-Processing/ai-agent-tools/overview.md @@ -7,11 +7,11 @@ control: AI Agent Tools documentation: ug --- -# Syncfusion® Document SDK Agent tool Overview +# Overview ## What is Syncfusion Document SDK Agent Tool? -**Syncfusion Document SDK Agent Tool** is a comprehensive AI toolkit that enables AI models and assistants to autonomously create, manipulate, convert, and extract data from documents using [Syncfusion Document SDK](https://www.syncfusion.com/document-sdk) libraries. +**Syncfusion Document SDK Agent Tool** is a comprehensive AI toolkit that enables AI models and assistants to autonomously create, manipulate, convert, and extract data from documents using Syncfusion Document SDK libraries. It exposes a rich set of well-defined tools and functions that an AI agent can invoke to perform document operations across Word, Excel, PDF, and PowerPoint formats — without requiring the host application to implement document-processing logic directly. diff --git a/Document-Processing/ai-agent-tools/tools.md b/Document-Processing/ai-agent-tools/tools.md index 3b106894f3..96109cd74e 100644 --- a/Document-Processing/ai-agent-tools/tools.md +++ b/Document-Processing/ai-agent-tools/tools.md @@ -7,7 +7,7 @@ control: AI Agent Tools documentation: ug --- -# Agent Tools +# Syncfusion Document SDK Agent Tools Agent Tools are the callable functions exposed to the AI agent. Each tool class is initialized with the appropriate repository. @@ -15,7 +15,7 @@ Tools are organized into the following categories: | Category | Tool Classes | Description | |---|---|---| -| **PDF** | `PdfDocumentAgentTools`, `PdfOperationsAgentTools`, `PdfSecurityAgentTools`, `PdfContentExtractionAgentTools`, `PdfAnnotationAgentTools` | Create, manipulate, secure, extract content from, and annotate PDF documents. | +| **PDF** | `PdfDocumentAgentTools`, `PdfOperationsAgentTools`, `PdfSecurityAgentTools`, `PdfContentExtractionAgentTools`, `PdfAnnotationAgentTools`,`PdfConverterAgentTools`,`PdfOcrAgentTools` | Create, manipulate, secure, extract content from, annotate, convert, and perform OCR on PDF documents. | | **Word** | `WordDocumentAgentTools`, `WordOperationsAgentTools`, `WordSecurityAgentTools`, `WordMailMergeAgentTools`, `WordFindAndReplaceAgentTools`, `WordRevisionAgentTools`, `WordImportExportAgentTools`, `WordFormFieldAgentTools`, `WordBookmarkAgentTools` | Create, edit, protect, mail-merge, find/replace, track changes, import/export, and manage form fields and bookmarks in Word documents. | | **Excel** | `ExcelWorkbookAgentTools`, `ExcelWorksheetAgentTools`, `ExcelSecurityAgentTools`, `ExcelFormulaAgentTools`, `ExcelChartAgentTools`, `ExcelConditionalFormattingAgentTools`, `ExcelConversionAgentTools`, `ExcelDataValidationAgentTools`, `ExcelPivotTableAgentTools` | Create and manage workbooks and worksheets, set cell values, formulas, and number formats, apply security, create and configure charts and sparklines, add conditional formatting, convert to image/HTML/ODS/JSON, manage data validation, and create and manipulate pivot tables. | | **PowerPoint** | `PresentationDocumentAgentTools`, `PresentationOperationsAgentTools`, `PresentationSecurityAgentTools`, `PresentationContentAgentTools`, `PresentationFindAndReplaceAgentTools` | Load, merge, split, secure, and extract content from PowerPoint presentations. | @@ -28,7 +28,7 @@ Tools are organized into the following categories: Repositories are in-memory containers that manage document life cycles during AI agent operations. Each repository extends `DocumentRepositoryBase`, which provides common functionality including document creation, import/export, active document tracking, and automatic expiration-based cleanup. -### Available Repositories +**Available Repositories** | Repository | Description | |---|---| @@ -37,7 +37,7 @@ Repositories are in-memory containers that manage document life cycles during AI | `PdfDocumentRepository` | Manages PDF documents in memory. Supports both new `PdfDocument` instances and loaded `PdfLoadedDocument` instances, including password-protected files. | | `PresentationRepository` | Manages PowerPoint presentations in memory. Supports creating new empty presentations and loading existing `.pptx` files, including password-protected ones. | -### DocumentRepositoryCollection +**DocumentRepositoryCollection** `DocumentRepositoryCollection` is a centralized registry that holds one repository for each `DocumentType`. It is designed for tool classes that need to work across multiple document types within a single operation — specifically when the source and output documents belong to different repositories. @@ -47,7 +47,7 @@ Repositories are in-memory containers that manage document life cycles during AI ## PDF Tools -### PdfDocumentAgentTools +**PdfDocumentAgentTools** Provides core lifecycle operations for PDF documents — creating, loading, exporting, and managing PDF documents in memory. @@ -59,9 +59,7 @@ Provides core lifecycle operations for PDF documents — creating, loading, expo | `RemovePdfDocument` | `RemovePdfDocument(string documentId)` | Removes a specific PDF document from memory by its ID. | | `SetActivePdfDocument` | `SetActivePdfDocument(string documentId)` | Changes the active PDF document context to the specified document ID. | ---- - -### PdfOperationsAgentTools +**PdfOperationsAgentTools** Provides merge, split, and compression operations for PDF documents. @@ -71,9 +69,8 @@ Provides merge, split, and compression operations for PDF documents. | `SplitPdfs` | `SplitPdfs(string filePath, int[,]? pageRanges = null, bool splitTags = false)` | Splits a single PDF into multiple PDFs by page ranges. Returns the output folder path. | | `CompressPdf` | `CompressPdf(string documentId, bool compressImage = true, bool optimizePageContent = true, bool optimizeFont = true, bool removeMetadata = true, int imageQuality = 50)` | Optimizes a PDF by compressing images, reducing content stream size, and optionally removing metadata. | ---- -### PdfSecurityAgentTools +**PdfSecurityAgentTools** Provides encryption, decryption, and permissions management for PDF documents. @@ -84,9 +81,8 @@ Provides encryption, decryption, and permissions management for PDF documents. | `SetPermissions` | `SetPermissions(string documentId, string permissions)` | Sets document permissions (e.g., `Print`, `CopyContent`, `EditContent`). | | `RemovePermissions` | `RemovePermissions(string documentId)` | Removes all document-level permissions from a PDF. | ---- -### PdfContentExtractionAgentTools +**PdfContentExtractionAgentTools** Provides tools for extracting text, images, and tables from PDF documents. @@ -96,9 +92,8 @@ Provides tools for extracting text, images, and tables from PDF documents. | `ExtractImages` | `ExtractImages(string documentId, int startPageIndex = -1, int endPageIndex = -1)` | Extracts embedded images from a PDF document across a specified page range. | | `ExtractTables` | `ExtractTables(string documentId, int startPageIndex = -1, int endPageIndex = -1)` | Extracts tables from a PDF document across a specified page range and returns the result as JSON. | ---- -### PdfAnnotationAgentTools +**PdfAnnotationAgentTools** Provides tools for watermarking, digitally signing, and adding or removing annotations in PDF documents. @@ -109,11 +104,25 @@ Provides tools for watermarking, digitally signing, and adding or removing annot | `AddAnnotation` | `AddAnnotation(string documentId, int pageIndex, string annotationType, float boundsX, float boundsY, float boundsWidth, float boundsHeight, string text)` | Adds a `Text`, `Rectangle`, or `Circle` annotation to a PDF page at the specified position. | | `RemoveAnnotation` | `RemoveAnnotation(string documentId, int pageIndex, int annotationIndex)` | Removes an annotation from a PDF page by its 0-based index. | +**PdfConverterAgentTools** + +| Tool | Syntax | Description | +|---|---|---| +| ConvertPdfToPdfA | `ConvertPdfToPdfA(string documentId, PdfConformanceLevel conformanceLevel)` | Converts a loaded PDF document to a PDF/A-compliant format. Supported conformance levels: `PdfA1B`, `PdfA2B`, `PdfA3B`, `Pdf_A4`, `Pdf_A4F`, `Pdf_A4E`. | +| ConvertHtmlToPdf | `ConvertHtmlToPdf(string urlOrFilePath, int pageWidth = 825, int pageHeight = 1100)` | Converts a webpage URL or a local HTML file to a PDF document with the specified page dimensions. Returns the new document ID. | +| ImageToPdf | `ImageToPdf(string[] imageFiles, string imagePosition = "FitToPage", int pageWidth = 612, int pageHeight = 792)` | Creates a PDF document from one or more image files. `imagePosition` values: `Stretch`, `Center`, `FitToPage`. Returns the new document ID. | + +**PdfOcrAgentTools** + +| Tool | Syntax | Description | +|---|---|---| +| OcrPdf | `OcrPdf(string documentId, string language = "eng")` | Performs Optical Character Recognition (OCR) on a scanned or image-based PDF document to make its content text-searchable. Supported language codes: `eng` (English), `fra` (French). | + --- ## Word Tools -### WordDocumentAgentTools +**WordDocumentAgentTools** Provides core lifecycle operations for Word documents — creating, loading, exporting, and managing Word documents in memory. @@ -126,9 +135,9 @@ Provides core lifecycle operations for Word documents — creating, loading, exp | `SetActiveDocument` | `SetActiveDocument(string documentId)` | Changes the active Word document context to the specified document ID. | | `ExportAsImage` | `ExportAsImage(string documentId, string? imageFormat = "Png", int? startPageIndex = null, int? endPageIndex = null)` | Exports Word document pages as PNG or JPEG images to the output directory. | ---- -### WordOperationsAgentTools + +**WordOperationsAgentTools** Provides merge, split, and compare operations for Word documents. @@ -138,9 +147,9 @@ Provides merge, split, and compare operations for Word documents. | `SplitDocument` | `SplitDocument(string documentId, string splitRules)` | Splits a Word document into multiple documents based on split rules (e.g., sections, headings, bookmarks). | | `CompareDocuments` | `CompareDocuments(string originalDocumentId, string revisedDocumentId, string author, DateTime dateTime)` | Compares two Word documents and marks differences as tracked changes in the original document. | ---- -### WordSecurityAgentTools + +**WordSecurityAgentTools** Provides password protection, encryption, and decryption for Word documents. @@ -151,9 +160,9 @@ Provides password protection, encryption, and decryption for Word documents. | `UnprotectDocument` | `UnprotectDocument(string documentId, string password)` | Removes protection from a Word document using the provided password. | | `DecryptDocument` | `DecryptDocument(string documentId)` | Removes encryption from a Word document. | ---- -### WordMailMergeAgentTools + +**WordMailMergeAgentTools** Provides mail merge operations for populating Word document templates with structured data. @@ -162,9 +171,9 @@ Provides mail merge operations for populating Word document templates with struc | `MailMerge` | `MailMerge(string documentId, string dataTableJson, bool removeEmptyFields = true, bool removeEmptyGroup = true)` | Executes a mail merge on a Word document using a JSON-represented DataTable. | | `ExecuteMailMerge` | `ExecuteMailMerge(string documentId, string dataSourceJson, bool generateSeparateDocuments = false, bool removeEmptyFields = true)` | Extended mail merge with an option to generate one output document per data record. Returns document IDs. | ---- -### WordFindAndReplaceAgentTools + +**WordFindAndReplaceAgentTools** Provides text search and replacement operations within Word documents. @@ -175,9 +184,8 @@ Provides text search and replacement operations within Word documents. | `Replace` | `Replace(string documentId, string findWhat, string replaceText, bool matchCase = false, bool wholeWord = false)` | Replaces the first occurrence of the specified text in a Word document. | | `ReplaceAll` | `ReplaceAll(string documentId, string findWhat, string replaceText, bool matchCase = false, bool wholeWord = false)` | Replaces all occurrences of the specified text in a Word document. Returns the count of replacements made. | ---- -### WordRevisionAgentTools +**WordRevisionAgentTools** Provides tools to inspect and manage tracked changes (revisions) in Word documents. @@ -189,9 +197,9 @@ Provides tools to inspect and manage tracked changes (revisions) in Word documen | `AcceptAllRevisions` | `AcceptAllRevisions(string documentId)` | Accepts all tracked changes in the document and returns the count accepted. | | `RejectAllRevisions` | `RejectAllRevisions(string documentId)` | Rejects all tracked changes in the document and returns the count rejected. | ---- -### WordImportExportAgentTools + +**WordImportExportAgentTools** Provides tools to import from and export Word documents to HTML and Markdown formats. @@ -203,9 +211,9 @@ Provides tools to import from and export Word documents to HTML and Markdown for | `GetMarkdown` | `GetMarkdown(string documentIdOrFilePath)` | Returns the Word document content as a Markdown string. | | `GetText` | `GetText(string documentIdOrFilePath)` | Returns the Word document content as plain text. | ---- -### WordFormFieldAgentTools + +**WordFormFieldAgentTools** Provides tools to read and write form field values in Word documents. @@ -216,9 +224,9 @@ Provides tools to read and write form field values in Word documents. | `GetFormField` | `GetFormField(string documentId, string fieldName)` | Gets the value of a specific form field by name. | | `SetFormField` | `SetFormField(string documentId, string fieldName, object fieldValue)` | Sets the value of a specific form field by name. | ---- -### WordBookmarkAgentTools + +**WordBookmarkAgentTools** Provides tools to manage bookmarks and bookmark content within Word documents. @@ -234,7 +242,7 @@ Provides tools to manage bookmarks and bookmark content within Word documents. ## Excel Tools -### ExcelWorkbookAgentTools +**ExcelWorkbookAgentTools** Provides core lifecycle operations for Excel workbooks — creating, loading, exporting, and managing workbooks in memory. @@ -246,9 +254,8 @@ Provides core lifecycle operations for Excel workbooks — creating, loading, ex | `RemoveWorkbook` | `RemoveWorkbook(string workbookId)` | Removes a specific workbook from memory by its ID. | | `SetActiveWorkbook` | `SetActiveWorkbook(string workbookId)` | Changes the active workbook context to the specified workbook ID. | ---- -### ExcelWorksheetAgentTools +**ExcelWorksheetAgentTools** Provides tools to create, manage, and populate worksheets within Excel workbooks. @@ -260,9 +267,9 @@ Provides tools to create, manage, and populate worksheets within Excel workbooks | `DeleteWorksheet` | `DeleteWorksheet(string workbookId, string worksheetName)` | Deletes a worksheet from the workbook. | | `SetValue` | `SetValue(string workbookId, string worksheetName, string cellAddress, string data)` | Assigns a data value to a cell (supports text, numbers, dates, and booleans). | ---- -### ExcelSecurityAgentTools + +**ExcelSecurityAgentTools** Provides encryption, decryption, and protection management for Excel workbooks and worksheets. @@ -275,9 +282,9 @@ Provides encryption, decryption, and protection management for Excel workbooks a | `ProtectWorksheet` | `ProtectWorksheet(string workbookId, string worksheetName, string password)` | Protects a specific worksheet from editing using a password. | | `UnprotectWorksheet` | `UnprotectWorksheet(string workbookId, string worksheetName, string password)` | Removes protection from a specific worksheet. | ---- -### ExcelFormulaAgentTools + +**ExcelFormulaAgentTools** Provides tools to set, retrieve, calculate and validate cell formulas in Excel workbooks. @@ -288,9 +295,9 @@ Provides tools to set, retrieve, calculate and validate cell formulas in Excel w | `CalculateFormulas` | `CalculateFormulas(string workbookId)` | Forces recalculation of all formulas in the workbook. | | `ValidateFormulas` | `ValidateFormulas(string workbookId)` | Validates all formulas in the workbook and returns any errors as JSON. | ---- -### ExcelChartAgentTools + +**ExcelChartAgentTools** Provides tools to create modify and remove charts in excel workbooks @@ -307,9 +314,9 @@ Provides tools to create modify and remove charts in excel workbooks | RemoveChart | `RemoveChart(string workbookId, string worksheetName, int chartIndex)` | Removes a chart from the worksheet by its 0-based index. | | GetChartCount | `GetChartCount(string workbookId, string worksheetName)` | Returns the number of charts in a worksheet. | | CreateSparkline | `CreateSparkline(string workbookId, string worksheetName, string sparklineType, string dataRange, string referenceRange)` | Creates sparkline charts in worksheet cells. Types: `Line`, `Column`, `WinLoss`. | ---- -### ExcelConditionalFormattingAgentTools + +**ExcelConditionalFormattingAgentTools** Provides toolsto add or remove conditional formatting in workbook @@ -318,9 +325,9 @@ Provides toolsto add or remove conditional formatting in workbook | AddConditionalFormat | `AddConditionalFormat(string workbookId, string worksheetName, string rangeAddress, string formatType, string? operatorType = null, string? firstFormula = null, string? secondFormula = null, string? backColor = null, bool? isBold = null, bool? isItalic = null)` | Adds conditional formatting to a cell or range. `formatType` values: `CellValue`, `Formula`, `DataBar`, `ColorScale`, `IconSet`. | | RemoveConditionalFormat | `RemoveConditionalFormat(string workbookId, string worksheetName, string rangeAddress)` | Removes all conditional formatting from a specified cell or range. | | RemoveConditionalFormatAtIndex | `RemoveConditionalFormatAtIndex(string workbookId, string worksheetName, string rangeAddress, int index)` | Removes the conditional format at a specific 0-based index from a range. | ---- -### ExcelConversionAgentTools + +**ExcelConversionAgentTools** Provides tools to convert worksheet to image, HTML, ODS, JSON file formats @@ -343,9 +350,9 @@ Provides tools to convert worksheet to image, HTML, ODS, JSON file formats | ConvertWorksheetToJsonStream | `ConvertWorksheetToJsonStream(string workbookId, string worksheetName, string outputPath, bool includeSchema = true)` | Converts a specific worksheet to JSON format using stream-based output. | | ConvertRangeToJson | `ConvertRangeToJson(string workbookId, string worksheetName, string rangeAddress, string outputPath, bool includeSchema = true)` | Converts a specific cell range to JSON format. | | ConvertRangeToJsonStream | `ConvertRangeToJsonStream(string workbookId, string worksheetName, string rangeAddress, string outputPath, bool includeSchema = true)` | Converts a specific cell range to JSON format using stream-based output. | ---- -### ExcelDataValidationAgentTools + +**ExcelDataValidationAgentTools** Provides tools to add data validation to workbook @@ -360,9 +367,9 @@ Provides tools to add data validation to workbook | AddCustomValidation | `AddCustomValidation(string workbookId, string worksheetName, string rangeAddress, string formula, ...)` | Adds custom formula-based validation (e.g., `=A1>10`). | | RemoveValidation | `RemoveValidation(string workbookId, string worksheetName, string rangeAddress)` | Removes data validation from a cell or range. | | RemoveAllValidations | `RemoveAllValidations(string workbookId, string worksheetName)` | Removes all data validations from a worksheet. | ---- -### ExcelPivotTableAgentTools + +**ExcelPivotTableAgentTools** Provides tools to create, edit pivot table in workbook @@ -383,11 +390,11 @@ Provides tools to create, edit pivot table in workbook | ApplyPivotLabelFilter | `ApplyPivotLabelFilter(string workbookId, string worksheetName, int pivotTableIndex, int fieldIndex, string filterType, string filterValue)` | Applies a caption/label filter to a pivot field (e.g., `CaptionEqual`, `CaptionBeginsWith`, `CaptionContains`). | | ApplyPivotValueFilter | `ApplyPivotValueFilter(string workbookId, string worksheetName, int pivotTableIndex, int fieldIndex, string filterType, string filterValue)` | Applies a value-based filter to a pivot field (e.g., `ValueGreaterThan`, `ValueLessThan`, `ValueBetween`). | | HidePivotFieldItems | `HidePivotFieldItems(string workbookId, string worksheetName, int pivotTableIndex, int fieldIndex, string hiddenItemIndices)` | Hides specified items within a pivot table row or column field by comma-separated 0-based indices. | ---- + ## PowerPoint Tools -### PresentationDocumentAgentTools +**PresentationDocumentAgentTools** Provides core lifecycle operations for PowerPoint presentations — creating, loading, exporting, and managing presentations in memory. @@ -400,9 +407,9 @@ Provides core lifecycle operations for PowerPoint presentations — creating, lo | `RemovePresentation` | `RemovePresentation(string documentId)` | Removes a specific presentation from memory by its ID. | | `SetActivePresentation` | `SetActivePresentation(string documentId)` | Changes the active presentation context to the specified document ID. | ---- -### PresentationOperationsAgentTools + +**PresentationOperationsAgentTools** Provides merge and split operations for PowerPoint presentations. @@ -411,9 +418,8 @@ Provides merge and split operations for PowerPoint presentations. | `MergePresentations` | `MergePresentations(string destinationDocumentId, string sourceDocumentIds, string pasteOption = "SourceFormatting")` | Merges multiple presentations into a destination presentation. Accepts comma-separated source document IDs or file paths. | | `SplitPresentation` | `SplitPresentation(string documentId, string splitRules, string pasteOption = "SourceFormatting")` | Splits a presentation by sections, layout type, or slide numbers (e.g., `"1,3,5"`). Returns the resulting document IDs. | ---- -### PresentationSecurityAgentTools +**PresentationSecurityAgentTools** Provides password protection and encryption management for PowerPoint presentations. @@ -424,9 +430,8 @@ Provides password protection and encryption management for PowerPoint presentati | `UnprotectPresentation` | `UnprotectPresentation(string documentId)` | Removes write protection from a presentation. | | `DecryptPresentation` | `DecryptPresentation(string documentId)` | Removes encryption from a presentation. | ---- -### PresentationContentAgentTools +**PresentationContentAgentTools** Provides tools for reading content and metadata from PowerPoint presentations. @@ -435,9 +440,8 @@ Provides tools for reading content and metadata from PowerPoint presentations. | `GetText` | `GetText(string? documentId = null, string? filePath = null)` | Extracts all text content from a presentation by document ID or file path. | | `GetSlideCount` | `GetSlideCount(string documentId)` | Returns the number of slides in the presentation. | ---- -### PresentationFindAndReplaceAgentTools +**PresentationFindAndReplaceAgentTools** Provides text search and replacement across all slides in a PowerPoint presentation. @@ -446,11 +450,10 @@ Provides text search and replacement across all slides in a PowerPoint presentat | `FindAndReplace` | `FindAndReplace(string documentId, string findWhat, string replaceText, bool matchCase = false, bool wholeWord = false)` | Finds and replaces all occurrences of the specified text across all slides in the presentation. | | `FindAndReplaceByPattern` | `FindAndReplaceByPattern(string documentId, string regexPattern, string replaceText)` | Finds and replaces text that matches a regex pattern across all slides (e.g., `{[A-Za-z]+}`). | ---- ## PDF Conversion Tools -### OfficeToPdfAgentTools +**OfficeToPdfAgentTools** Provides conversion of Word, Excel, and PowerPoint documents to PDF format. @@ -468,7 +471,7 @@ Provides conversion of Word, Excel, and PowerPoint documents to PDF format. ## Data Extraction Tools -### DataExtractionAgentTools +**DataExtractionAgentTools** Provides AI-powered structured data extraction from PDF documents and images, returning results as JSON. @@ -477,7 +480,7 @@ Provides AI-powered structured data extraction from PDF documents and images, re | `ExtractDataAsJSON` | `ExtractDataAsJSON(string inputFilePath, bool enableFormDetection = true, bool enableTableDetection = true, double confidenceThreshold = 0.6, int startPage = -1, int endPage = -1, bool detectSignatures = true, bool detectTextboxes = true, bool detectCheckboxes = true, bool detectRadioButtons = true, bool detectBorderlessTables = true, string? outputFilePath = null)` | Extracts structured data (text, forms, tables, checkboxes, signatures) from a PDF or image file and returns the result as JSON. | | `ExtractTableAsJSON` | `ExtractTableAsJSON(string inputFilePath, bool detectBorderlessTables = true, double confidenceThreshold = 0.6, int startPage = -1, int endPage = -1, string? outputFilePath = null)` | Extracts only table data from a PDF document and returns the result as JSON. Optimized for table-focused extraction. | -### ExtractDataAsJSON — Parameter Details +**ExtractDataAsJSON** — Parameter Details | Parameter | Type | Default | Description | |---|---|---|---| From 998f6ef8c267d3c11dc91abcd6bed256ab05602f Mon Sep 17 00:00:00 2001 From: Viswajith-SF4658 Date: Tue, 31 Mar 2026 21:16:33 +0530 Subject: [PATCH 5/5] Feedback addressed --- .../ai-agent-tools/getting-started.md | 2 +- Document-Processing/ai-agent-tools/overview.md | 2 +- Document-Processing/ai-agent-tools/tools.md | 14 ++++++-------- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Document-Processing/ai-agent-tools/getting-started.md b/Document-Processing/ai-agent-tools/getting-started.md index e897e27104..08a01d904b 100644 --- a/Document-Processing/ai-agent-tools/getting-started.md +++ b/Document-Processing/ai-agent-tools/getting-started.md @@ -18,7 +18,7 @@ The Syncfusion Document SDK Agent Tool library exposes Word, Excel, PDF, and Pow | Requirement | Details | |---|---| | **.NET SDK** | .NET 8.0 or .NET 10.0 | -| **OpenAI API Key** | Obtain one from [platform.openai.com](https://platform.openai.com/api-keys). | +| **OpenAI API Key** | Obtain one from platform.openai.com. | | **Syncfusion License** | Community or commercial license. See [syncfusion.com/products/community-license](https://www.syncfusion.com/products/communitylicense). | | **NuGet Packages** | `Microsoft.Agents.AI.OpenAI` (v1.0.0-rc4) and Syncfusion AgentLibrary packages. | diff --git a/Document-Processing/ai-agent-tools/overview.md b/Document-Processing/ai-agent-tools/overview.md index 3b31c3b65e..8f6f84432a 100644 --- a/Document-Processing/ai-agent-tools/overview.md +++ b/Document-Processing/ai-agent-tools/overview.md @@ -7,7 +7,7 @@ control: AI Agent Tools documentation: ug --- -# Overview +# Syncfusion Document SDK Agent Tools Overview ## What is Syncfusion Document SDK Agent Tool? diff --git a/Document-Processing/ai-agent-tools/tools.md b/Document-Processing/ai-agent-tools/tools.md index 96109cd74e..9577a6c669 100644 --- a/Document-Processing/ai-agent-tools/tools.md +++ b/Document-Processing/ai-agent-tools/tools.md @@ -116,7 +116,7 @@ Provides tools for watermarking, digitally signing, and adding or removing annot | Tool | Syntax | Description | |---|---|---| -| OcrPdf | `OcrPdf(string documentId, string language = "eng")` | Performs Optical Character Recognition (OCR) on a scanned or image-based PDF document to make its content text-searchable. Supported language codes: `eng` (English), `fra` (French). | +| OcrPdf | `OcrPdf(string documentId, string language = "eng")` | Performs Optical Character Recognition (OCR) on a scanned or image-based PDF document to make its content text-searchable. Supported language codes: `eng` (English), etc.| --- @@ -318,7 +318,7 @@ Provides tools to create modify and remove charts in excel workbooks **ExcelConditionalFormattingAgentTools** -Provides toolsto add or remove conditional formatting in workbook +Provides tools to add or remove conditional formatting in workbook | Tool | Syntax | Description | |---|---|---| @@ -342,8 +342,6 @@ Provides tools to convert worksheet to image, HTML, ODS, JSON file formats | ConvertWorksheetToHtml | `ConvertWorksheetToHtml(string workbookId, string worksheetName, string outputPath, string textMode = "DisplayText")` | Converts a specific worksheet to an HTML file. | | ConvertUsedRangeToHtml | `ConvertUsedRangeToHtml(string workbookId, string worksheetName, string outputPath, string textMode = "DisplayText", bool autofitColumns = true)` | Converts the used range of a worksheet to an HTML file with optional column auto-fitting. | | ConvertAllWorksheetsToHtml | `ConvertAllWorksheetsToHtml(string workbookId, string outputDirectory, string textMode = "DisplayText", string fileNamePrefix = "Sheet")` | Converts all worksheets in a workbook to separate HTML files. | -| ConvertWorkbookToOds | `ConvertWorkbookToOds(string workbookId, string outputPath)` | Converts an entire workbook to OpenDocument Spreadsheet (ODS) format. | -| ConvertWorkbookToOdsStream | `ConvertWorkbookToOdsStream(string workbookId, string outputPath)` | Converts an entire workbook to ODS format using stream-based output. | | ConvertWorkbookToJson | `ConvertWorkbookToJson(string workbookId, string outputPath, bool includeSchema = true)` | Converts an entire workbook to JSON format with optional schema. | | ConvertWorkbookToJsonStream | `ConvertWorkbookToJsonStream(string workbookId, string outputPath, bool includeSchema = true)` | Converts an entire workbook to JSON format using stream-based output. | | ConvertWorksheetToJson | `ConvertWorksheetToJson(string workbookId, string worksheetName, string outputPath, bool includeSchema = true)` | Converts a specific worksheet to JSON format. | @@ -396,7 +394,7 @@ Provides tools to create, edit pivot table in workbook **PresentationDocumentAgentTools** -Provides core lifecycle operations for PowerPoint presentations — creating, loading, exporting, and managing presentations in memory. +Provides core life cycle operations for PowerPoint presentations — creating, loading, exporting, and managing presentations in memory. | Tool | Syntax | Description | |---|---|---| @@ -477,8 +475,8 @@ Provides AI-powered structured data extraction from PDF documents and images, re | Tool | Syntax | Description | |---|---|---| -| `ExtractDataAsJSON` | `ExtractDataAsJSON(string inputFilePath, bool enableFormDetection = true, bool enableTableDetection = true, double confidenceThreshold = 0.6, int startPage = -1, int endPage = -1, bool detectSignatures = true, bool detectTextboxes = true, bool detectCheckboxes = true, bool detectRadioButtons = true, bool detectBorderlessTables = true, string? outputFilePath = null)` | Extracts structured data (text, forms, tables, checkboxes, signatures) from a PDF or image file and returns the result as JSON. | -| `ExtractTableAsJSON` | `ExtractTableAsJSON(string inputFilePath, bool detectBorderlessTables = true, double confidenceThreshold = 0.6, int startPage = -1, int endPage = -1, string? outputFilePath = null)` | Extracts only table data from a PDF document and returns the result as JSON. Optimized for table-focused extraction. | +| `ExtractDataAsJSON` | `ExtractDataAsJSON(string inputFilePath, bool enableFormDetection = true, bool enableTableDetection = true, double confidenceThreshold = 0.6, int startPage = -1, int endPage = -1, bool detectSignatures = true, bool detectTextboxes = true, bool detectCheckboxes = true, bool detectRadioButtons = true, bool detect_Border_less_Tables = true, string? outputFilePath = null)` | Extracts structured data (text, forms, tables, checkboxes, signatures) from a PDF or image file and returns the result as JSON. | +| `ExtractTableAsJSON` | `ExtractTableAsJSON(string inputFilePath, bool detect_Border_less_Tables = true, double confidenceThreshold = 0.6, int startPage = -1, int endPage = -1, string? outputFilePath = null)` | Extracts only table data from a PDF document and returns the result as JSON. Optimized for table-focused extraction. | **ExtractDataAsJSON** — Parameter Details @@ -494,7 +492,7 @@ Provides AI-powered structured data extraction from PDF documents and images, re | `detectTextboxes` | `bool` | `true` | Enables detection of text box fields. | | `detectCheckboxes` | `bool` | `true` | Enables detection of checkbox fields. | | `detectRadioButtons` | `bool` | `true` | Enables detection of radio button fields. | -| `detectBorderlessTables` | `bool` | `true` | Enables detection of tables without visible borders. | +| `detect_Border_less_Tables` | `bool` | `true` | Enables detection of tables without visible borders. | | `outputFilePath` | `string?` | `null` | Optional file path to save the JSON output. | **Example usage prompts:**