[]
        
(Showing Draft Content)

GrapeCity.Documents.Pdf.AI.OpenAIDocumentAssistantBase

OpenAIDocumentAssistantBase Class

The base abstract class for AzureOpenAIDocumentAssistant and OpenAIDocumentAssistant classes.

Inheritance
OpenAIDocumentAssistantBase
Namespace: GrapeCity.Documents.Pdf.AI
Assembly: DS.Documents.Pdf.AI.dll
Syntax
public abstract class OpenAIDocumentAssistantBase
Public MustInherit Class OpenAIDocumentAssistantBase

Constructors

Name Description
OpenAIDocumentAssistantBase()

Properties

Name Description
BuildOutlinesMessage

Gets or sets the message used by the BuildOutlines(GcPdfDocument, RecognitionAlgorithm, OutlineNodeCollection, OutputRange, CancellationToken) method when requesting the outlines.

ChatCompletionOptions

Gets or sets the OpenAI.Chat.ChatCompletionOptions used to configure chat completion requests.

GetAbstractMessage

Gets or sets the message used by the GetAbstract(GcPdfDocument, RecognitionAlgorithm, OutputRange, CancellationToken) method when requesting the abstract.

GetSummaryMessage

Gets or sets the message used by the GetSummary(GcPdfDocument, RecognitionAlgorithm, OutputRange, CancellationToken) method when requesting the summary.

GetTableMessageFmt

Gets or sets the format string used to construct the message for the GetTable(GcPdfDocument, string, RecognitionAlgorithm, OutputRange, CancellationToken) method. The format item in the string is replaced with the specific table request passed to the method.

Model

Gets or sets the OpenAI model to use for document analysis. Defaults to gpt4o-mini.

Methods

Name Description
BuildOutlines(GcPdfDocument, RecognitionAlgorithm, OutlineNodeCollection, OutputRange, CancellationToken)

Analyzes the specified GcPdfDocument and generates outlines for it.

GetAbstract(GcPdfDocument, RecognitionAlgorithm, OutputRange, CancellationToken)

Creates an abstract for the specified GcPdfDocument.

GetChatClient()

Returns the OpenAI.Chat.ChatClient used to execute Open AI requests.

GetOpenAIModelClient()

Returns the OpenAI.Models.OpenAIModelClient used to execute Open AI requests.

GetSummary(GcPdfDocument, RecognitionAlgorithm, OutputRange, CancellationToken)

Creates a summary of the specified GcPdfDocument.

GetTable(GcPdfDocument, string, RecognitionAlgorithm, OutputRange, CancellationToken)

Extracts tabular data from a specified table in a PDF document.

TryParseTextTableResponse(string)

Tries to parse an OpenAI response that represents a table. Expects the response to use dashes ('-') and pipes ('|') to represent the table grid lines, for example:

| Item | Description | Unit | Quantity |
|-------------|-------------------------|------|----------|
| S-502-2414 | Firewall(101-150 users) | Ea | 1 |
| S-502-2417 | IPS(101-150 users) | Ea | 1 |