You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: libraries/radpdfprocessing/features/gen-ai-powered-document-insights/complete-context-question-processor.md
The **CompleteContextQuestionProcessor** class enables you to ask questions about a PDF document and receive answers based on the entire document content. Unlike [PartialContextQuestionProcessor]({%slug radpdfprocessing-features-ai-document-analysis-partial-context-question-processor%}), this processor sends the complete document text to the AI model, which is suitable for smaller documents or when you need to ensure that the AI model has access to all the information in the document. This class inherits from the abstract **AIProcessorBase** class, which provides common functionality for all AI processors.
23
+
The **CompleteContextQuestionProcessor** class enables you to ask questions about a PDF document and receive answers based on the entire document content. This processor sends the complete document text to the AI model, which is suitable for smaller documents or when you need to ensure that the AI model has access to all the information in the document. This class inherits from the abstract **AIProcessorBase** class, which provides common functionality for all AI processors.
24
24
25
25
## When to Use CompleteContextQuestionProcessor
26
26
27
27
The **CompleteContextQuestionProcessor** is ideal for the following scenarios:
28
28
29
29
1.**Small Documents**: When the document is small enough to fit within the token limit of the AI model.
30
30
2.**Holistic Understanding**: When the question requires understanding the entire document context.
31
-
3.**Simplicity**: When you don't need the advanced embedding functionality of **PartialContextQuestionProcessor**.
31
+
3.**Simplicity**: When you don't need the advanced embedding functionality of [PartialContextQuestionProcessor]({%slug radpdfprocessing-features-ai-document-analysis-partial-context-question-processor%}).
32
32
33
33
However, if you're working with larger documents or want to optimize token usage, you should use the [PartialContextQuestionProcessor]({%slug radpdfprocessing-features-ai-document-analysis-partial-context-question-processor%}#when-to-use-partialcontextquestionprocessor) instead.
34
34
35
35
## Public API
36
36
37
37
|Property|Description|
38
38
|---|---|
39
-
|**Settings**|Gets the settings for the AI question-answering process. Returns **CompleteContextProcessorSettings**.|
39
+
|**Settings**|Gets the settings for the AI question-answering process. Returns [CompleteContextProcessorSettings]({%slug radpdfprocessing-features-ai-document-analysis-complete-context-question-processor%}#completectextprocessorsettings).|
40
40
41
41
|Method|Description|
42
42
|---|---|
@@ -169,7 +169,7 @@ private bool IsDocumentSuitableForCompleteContext(RadFixedDocument document, int
The AI Document Analysis feature enables you to easily extract insights from PDF documents using Large Language Models (LLMs). This functionality allows you to summarize document content and ask questions about the document, with the AI providing relevant answers based on the document's content.
12
+
The GenAI-powered Document Insights feature enables you to easily extract insights from PDF documents using Large Language Models (LLMs). This functionality allows you to summarize document content and ask questions about the document, with the AI providing relevant answers based on the document's content.
13
13
14
-
The AI Document Analysis feature includes three main components:
14
+
The GenAI-powered Document Insights feature includes three main components:
15
15
16
16
***[SummarizationProcessor]({%slug radpdfprocessing-features-ai-document-analysis-summarization-processor%})**: Generates concise summaries of PDF documents.
17
17
***[CompleteContextQuestionProcessor]({%slug radpdfprocessing-features-ai-document-analysis-complete-context-question-processor%})**: Answers questions by providing the entire document content to the AI model.
@@ -26,9 +26,9 @@ The AI Document Analysis feature includes three main components:
26
26
27
27
## Complete Example
28
28
29
-
The following example demonstrates how to use the AI Document Analysis functionality to summarize a PDF document and ask questions about it:
29
+
The following example demonstrates how to use the GenAI-powered Document Insights functionality to summarize a PDF document and ask questions about it:
30
30
31
-
#### __[C#] Example 1: Using AI Document Analysis__
31
+
#### __[C#] Example 1: Using GenAI-powered Document Insights__
32
32
33
33
```csharp
34
34
privateasyncvoidProcessPdfWithAI()
@@ -119,7 +119,7 @@ When you run this code, the AI will process your document, generate a summary, a
Copy file name to clipboardExpand all lines: libraries/radpdfprocessing/features/gen-ai-powered-document-insights/partial-context-question-processor.md
The **PartialContextQuestionProcessor** class enables you to ask questions about a PDF document and receive answers based on the most relevant parts of the document content. Unlike [CompleteContextQuestionProcessor]({%slug radpdfprocessing-features-ai-document-analysis-complete-context-question-processor%}), this processor uses embeddings to identify and send only the relevant portions of the document to the AI model, making it more efficient for token usage and more suitable for large documents. This class inherits from the abstract **AIProcessorBase** class, which provides common functionality for all AI processors.
26
+
The **PartialContextQuestionProcessor** class enables you to ask questions about a PDF document and receive answers based on the most relevant parts of the document content. This processor uses embeddings to identify and send only the relevant portions of the document to the AI model, making it more efficient for token usage and more suitable for large documents. This class inherits from the abstract **AIProcessorBase** class, which provides common functionality for all AI processors.
27
27
28
28
## When to Use PartialContextQuestionProcessor
29
29
@@ -38,7 +38,7 @@ The **PartialContextQuestionProcessor** is ideal for the following scenarios:
38
38
|Constructor|Platform|Description|
39
39
|---|---|---|
40
40
|**PartialContextQuestionProcessor(IChatClient chatClient, int modelMaxInputTokenLimit, ISimpleTextDocument document)**|.NET 7+|Creates an instance with built-in embeddings storage|
41
-
|**PartialContextQuestionProcessor(IChatClient chatClient, IEmbeddingsStorage embeddingsStorage, int modelMaxInputTokenLimit, ISimpleTextDocument document)**|All platforms|Creates an instance with custom embeddings storage|
41
+
|**PartialContextQuestionProcessor(IChatClient chatClient, IEmbeddingsStorage embeddingsStorage, int modelMaxInputTokenLimit, ISimpleTextDocument document)**|Any|Creates an instance with custom embeddings storage|
42
42
43
43
> The .NET 7+ constructor uses **DefaultEmbeddingsStorage** internally, while the cross-platform constructor requires a custom implementation of **IEmbeddingsStorage** as shown in the [Prerequisites]({%slug radpdfprocessing-features-ai-document-analysis-prerequisites%}#iembeddingsstorage-setup-for-net-standard-and-net-framework).
44
44
@@ -283,7 +283,7 @@ using (PartialContextQuestionProcessor processor =
This article explains the requirements for using the AI Document Analysis functionality in the [RadPdfProcessing library]({%slug radpdfprocessing-overview%}).
26
+
# GenAI-powered Document Insights Prerequisites
27
+
This article explains the requirements for using the GenAI-powered Document Insights functionality in the [RadPdfProcessing library]({%slug radpdfprocessing-overview%}).
23
28
24
29
## Required Assemblies
25
30
26
-
In addition to the [standard RadPdfProcessing assemblies]({%slug radpdfprocessing-getting-started%}#assembly-references), you will need to reference the following assemblies to use the AI Document Analysis features:
31
+
In addition to the [standard RadPdfProcessing assemblies]({%slug radpdfprocessing-getting-started%}#assembly-references), you will need to reference the following assemblies to use the GenAI-powered Document Insights features:
27
32
28
33
|.NET Framework|.NET Standard-compatible|
29
34
|---|---|
@@ -44,7 +49,11 @@ Additionally, you'll need a package for your specific AI provider:
44
49
45
50
## AI Provider Setup
46
51
47
-
Before using the AI Document Analysis functionality, you need to set up an AI provider.
52
+
Before using the GenAI-powered Document Insights functionality, you need to set up an AI provider.
| Uses the Azure OpenAI service, which provides enterprise-grade security, compliance, and regional availability for OpenAI models. | Uses direct access to OpenAI's models through their API service. Suitable for general development scenarios. | Runs AI models locally on your machine. Useful for development or working with sensitive data where privacy is important. |
48
57
49
58
### Azure OpenAI Setup
50
59
@@ -118,7 +127,7 @@ int maxTokenLimit = 4096; // Adjust based on your model
118
127
119
128
## IEmbeddingsStorage Setup for .NET Standard and .NET Framework
120
129
121
-
When using the **PartialContextQuestionProcessor**in .NET Standard or .NET Framework, you need to provide an implementation of the **IEmbeddingsStorage** interface. This is required for the functionality described in the [PartialContextQuestionProcessor]({%slug radpdfprocessing-features-ai-document-analysis-partial-context-question-processor%}#constructors-and-platform-support) section.
130
+
When using the [PartialContextQuestionProcessor]({%slug radpdfprocessing-features-ai-document-analysis-partial-context-question-processor%}#constructors-and-platform-support) in .NET Standard or .NET Framework, you need to provide an implementation of the **IEmbeddingsStorage** interface.
122
131
123
132
For this sample Ollama implementation, you'll need to add references to the following NuGet packages:
124
133
***LangChain.Ollama**
@@ -184,7 +193,7 @@ internal class OllamaEmbeddingsStorage : IEmbeddingsStorage
0 commit comments