Skip to content

Commit de0a05a

Browse files
committed
Merge branch 'main' into production
2 parents 90cb9bb + 1f5a700 commit de0a05a

File tree

82 files changed

+1743
-1458
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+1743
-1458
lines changed

english/java/com.aspose.words/_index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The **MailMerge** object which provides access to the reporting functionality is
3535
| [Adjustment](../com.aspose.words/adjustment/) | Represents adjustment values that are applied to the specified shape. |
3636
| [AdjustmentCollection](../com.aspose.words/adjustmentcollection/) | Represents a read-only collection of [Adjustment](../com.aspose.words/adjustment/) adjust values that are applied to the specified shape. |
3737
| [AdvancedCompareOptions](../com.aspose.words/advancedcompareoptions/) | Allows to set advanced compare options. |
38-
| [AiModel](../com.aspose.words/aimodel/) | Represents information about a Generative Language Model. |
38+
| [AiModel](../com.aspose.words/aimodel/) | An abstract class representing the integration with various AI models within the Aspose.Words. |
3939
| [AiModelType](../com.aspose.words/aimodeltype/) | Represents the types of [AiModel](../com.aspose.words/aimodel/) that can be integrated into the document processing workflow. |
4040
| [AnthropicAiModel](../com.aspose.words/anthropicaimodel/) | An abstract class representing the integration with Anthropic\\u2019s AI models within the Aspose.Words. |
4141
| [ArrowLength](../com.aspose.words/arrowlength/) | Length of the arrow at the end of a line. |
@@ -714,8 +714,8 @@ The **MailMerge** object which provides access to the reporting functionality is
714714
| [UnsupportedFileFormatException](../com.aspose.words/unsupportedfileformatexception/) | Thrown during document load, when the document format is not recognized or not supported by Aspose.Words. |
715715
| [UserInformation](../com.aspose.words/userinformation/) | Specifies information about the user. |
716716
| [VariableCollection](../com.aspose.words/variablecollection/) | A collection of document variables. |
717-
| [VariationAxis](../com.aspose.words/variationaxis/) | |
718-
| [VariationAxisCoordinate](../com.aspose.words/variationaxiscoordinate/) | |
717+
| [VariationAxis](../com.aspose.words/variationaxis/) | Represents OpenType Design-Variation Axis Tag. |
718+
| [VariationAxisCoordinate](../com.aspose.words/variationaxiscoordinate/) | Represents an axis coordinate. |
719719
| [VbaModule](../com.aspose.words/vbamodule/) | Provides access to VBA project module. |
720720
| [VbaModuleCollection](../com.aspose.words/vbamodulecollection/) | Represents a collection of [VbaModule](../com.aspose.words/vbamodule/) objects. |
721721
| [VbaModuleType](../com.aspose.words/vbamoduletype/) | Specifies the type of a model in a VBA project. |

english/java/com.aspose.words/absolutepositiontab/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,7 @@ public boolean isComposite()
11261126
```
11271127

11281128

1129-
Returns true if this node can contain other nodes. (194435,6)
1129+
Returns true if this node can contain other nodes. (194242,6)
11301130

11311131
**Examples:**
11321132

english/java/com.aspose.words/aimodel/_index.md

Lines changed: 144 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: AiModel
33
linktitle: AiModel
44
second_title: Aspose.Words for Java
5-
description: Represents information about a Generative Language Model in Java.
5+
description: An abstract class representing the integration with various AI models within the Aspose.Words in Java.
66
type: docs
77
weight: 14
88
url: /java/com.aspose.words/aimodel/
@@ -14,7 +14,7 @@ java.lang.Object
1414
public abstract class AiModel
1515
```
1616

17-
Represents information about a Generative Language Model.
17+
An abstract class representing the integration with various AI models within the Aspose.Words.
1818

1919
**Examples:**
2020

@@ -27,14 +27,14 @@ Shows how to summarize text using OpenAI and Google models.
2727
2828
String apiKey = System.getenv("API_KEY");
2929
// Use OpenAI or Google generative language models.
30-
IAiModelText model = ((OpenAiModel)AiModel.create(AiModelType.GPT_4_O_MINI).withApiKey(apiKey)).withOrganization("Organization").withProject("Project");
30+
AiModel model = ((OpenAiModel)AiModel.create(AiModelType.GPT_4_O_MINI).withApiKey(apiKey)).withOrganization("Organization").withProject("Project");
3131
3232
SummarizeOptions options = new SummarizeOptions();
33+
3334
options.setSummaryLength(SummaryLength.SHORT);
3435
Document oneDocumentSummary = model.summarize(firstDoc, options);
3536
oneDocumentSummary.save(getArtifactsDir() + "AI.AiSummarize.One.docx");
3637
37-
options = new SummarizeOptions();
3838
options.setSummaryLength(SummaryLength.LONG);
3939
Document multiDocumentSummary = model.summarize(new Document[] { firstDoc, secondDoc }, options);
4040
multiDocumentSummary.save(getArtifactsDir() + "AI.AiSummarize.Multi.docx");
@@ -49,14 +49,54 @@ Shows how to summarize text using OpenAI and Google models.
4949

5050
| Method | Description |
5151
| --- | --- |
52+
| [checkGrammar(Document sourceDocument, CheckGrammarOptions options)](#checkGrammar-com.aspose.words.Document-com.aspose.words.CheckGrammarOptions) | Checks grammar of the provided document. |
5253
| [create(int modelType)](#create-int) | |
54+
| [summarize(Document sourceDocument, SummarizeOptions options)](#summarize-com.aspose.words.Document-com.aspose.words.SummarizeOptions) | Generates a summary of the specified document, with options to adjust the length of the summary. |
55+
| [summarize(Document[] sourceDocuments, SummarizeOptions options)](#summarize-com.aspose.words.Document---com.aspose.words.SummarizeOptions) | Generates summaries for an array of documents, with options to control the summary length and other settings. |
56+
| [translate(Document sourceDocument, int targetLanguage)](#translate-com.aspose.words.Document-int) | |
5357
| [withApiKey(String apiKey)](#withApiKey-java.lang.String) | Sets a specified API key to the model. |
5458
### AiModel() {#AiModel}
5559
```
5660
public AiModel()
5761
```
5862

5963

64+
### checkGrammar(Document sourceDocument, CheckGrammarOptions options) {#checkGrammar-com.aspose.words.Document-com.aspose.words.CheckGrammarOptions}
65+
```
66+
public Document checkGrammar(Document sourceDocument, CheckGrammarOptions options)
67+
```
68+
69+
70+
Checks grammar of the provided document. This operation leverages the connected AI model for checking grammar of document.
71+
72+
**Examples:**
73+
74+
Shows how to check the grammar of a document.
75+
76+
```
77+
78+
Document doc = new Document(getMyDir() + "Big document.docx");
79+
80+
String apiKey = System.getenv("API_KEY");
81+
// Use OpenAI generative language models.
82+
AiModel model = AiModel.create(AiModelType.GPT_4_O_MINI).withApiKey(apiKey);
83+
84+
CheckGrammarOptions grammarOptions = new CheckGrammarOptions();
85+
grammarOptions.setImproveStylistics(true);
86+
87+
Document proofedDoc = model.checkGrammar(doc, grammarOptions);
88+
proofedDoc.save(getArtifactsDir() + "AI.AiGrammar.docx");
89+
90+
```
91+
92+
**Parameters:**
93+
| Parameter | Type | Description |
94+
| --- | --- | --- |
95+
| sourceDocument | [Document](../../com.aspose.words/document/) | The document being checked for grammar. |
96+
| options | [CheckGrammarOptions](../../com.aspose.words/checkgrammaroptions/) | Optional settings to control how grammar will be checked. |
97+
98+
**Returns:**
99+
[Document](../../com.aspose.words/document/) - A new [Document](../../com.aspose.words/document/) with checked grammar.
60100
### create(int modelType) {#create-int}
61101
```
62102
public static AiModel create(int modelType)
@@ -72,6 +112,104 @@ public static AiModel create(int modelType)
72112

73113
**Returns:**
74114
[AiModel](../../com.aspose.words/aimodel/)
115+
### summarize(Document sourceDocument, SummarizeOptions options) {#summarize-com.aspose.words.Document-com.aspose.words.SummarizeOptions}
116+
```
117+
public abstract Document summarize(Document sourceDocument, SummarizeOptions options)
118+
```
119+
120+
121+
Generates a summary of the specified document, with options to adjust the length of the summary. This operation leverages the connected AI model for content processing.
122+
123+
**Examples:**
124+
125+
Shows how to summarize text using OpenAI and Google models.
126+
127+
```
128+
129+
Document firstDoc = new Document(getMyDir() + "Big document.docx");
130+
Document secondDoc = new Document(getMyDir() + "Document.docx");
131+
132+
String apiKey = System.getenv("API_KEY");
133+
// Use OpenAI or Google generative language models.
134+
AiModel model = ((OpenAiModel)AiModel.create(AiModelType.GPT_4_O_MINI).withApiKey(apiKey)).withOrganization("Organization").withProject("Project");
135+
136+
SummarizeOptions options = new SummarizeOptions();
137+
138+
options.setSummaryLength(SummaryLength.SHORT);
139+
Document oneDocumentSummary = model.summarize(firstDoc, options);
140+
oneDocumentSummary.save(getArtifactsDir() + "AI.AiSummarize.One.docx");
141+
142+
options.setSummaryLength(SummaryLength.LONG);
143+
Document multiDocumentSummary = model.summarize(new Document[] { firstDoc, secondDoc }, options);
144+
multiDocumentSummary.save(getArtifactsDir() + "AI.AiSummarize.Multi.docx");
145+
146+
```
147+
148+
**Parameters:**
149+
| Parameter | Type | Description |
150+
| --- | --- | --- |
151+
| sourceDocument | [Document](../../com.aspose.words/document/) | The document to be summarized. |
152+
| options | [SummarizeOptions](../../com.aspose.words/summarizeoptions/) | Optional settings to control the summary length and other parameters. |
153+
154+
**Returns:**
155+
[Document](../../com.aspose.words/document/) - A summarized version of the document's content.
156+
### summarize(Document[] sourceDocuments, SummarizeOptions options) {#summarize-com.aspose.words.Document---com.aspose.words.SummarizeOptions}
157+
```
158+
public abstract Document summarize(Document[] sourceDocuments, SummarizeOptions options)
159+
```
160+
161+
162+
Generates summaries for an array of documents, with options to control the summary length and other settings. This method utilizes the connected AI model for processing each document in the array.
163+
164+
**Examples:**
165+
166+
Shows how to summarize text using OpenAI and Google models.
167+
168+
```
169+
170+
Document firstDoc = new Document(getMyDir() + "Big document.docx");
171+
Document secondDoc = new Document(getMyDir() + "Document.docx");
172+
173+
String apiKey = System.getenv("API_KEY");
174+
// Use OpenAI or Google generative language models.
175+
AiModel model = ((OpenAiModel)AiModel.create(AiModelType.GPT_4_O_MINI).withApiKey(apiKey)).withOrganization("Organization").withProject("Project");
176+
177+
SummarizeOptions options = new SummarizeOptions();
178+
179+
options.setSummaryLength(SummaryLength.SHORT);
180+
Document oneDocumentSummary = model.summarize(firstDoc, options);
181+
oneDocumentSummary.save(getArtifactsDir() + "AI.AiSummarize.One.docx");
182+
183+
options.setSummaryLength(SummaryLength.LONG);
184+
Document multiDocumentSummary = model.summarize(new Document[] { firstDoc, secondDoc }, options);
185+
multiDocumentSummary.save(getArtifactsDir() + "AI.AiSummarize.Multi.docx");
186+
187+
```
188+
189+
**Parameters:**
190+
| Parameter | Type | Description |
191+
| --- | --- | --- |
192+
| sourceDocuments | [Document\[\]](../../com.aspose.words/document/) | An array of documents to be summarized. |
193+
| options | [SummarizeOptions](../../com.aspose.words/summarizeoptions/) | Optional settings to control the summary length and other parameters |
194+
195+
**Returns:**
196+
[Document](../../com.aspose.words/document/) - A summarized version of the document's content.
197+
### translate(Document sourceDocument, int targetLanguage) {#translate-com.aspose.words.Document-int}
198+
```
199+
public abstract Document translate(Document sourceDocument, int targetLanguage)
200+
```
201+
202+
203+
204+
205+
**Parameters:**
206+
| Parameter | Type | Description |
207+
| --- | --- | --- |
208+
| sourceDocument | [Document](../../com.aspose.words/document/) | |
209+
| targetLanguage | int | |
210+
211+
**Returns:**
212+
[Document](../../com.aspose.words/document/)
75213
### withApiKey(String apiKey) {#withApiKey-java.lang.String}
76214
```
77215
public AiModel withApiKey(String apiKey)
@@ -91,14 +229,14 @@ Shows how to summarize text using OpenAI and Google models.
91229
92230
String apiKey = System.getenv("API_KEY");
93231
// Use OpenAI or Google generative language models.
94-
IAiModelText model = ((OpenAiModel)AiModel.create(AiModelType.GPT_4_O_MINI).withApiKey(apiKey)).withOrganization("Organization").withProject("Project");
232+
AiModel model = ((OpenAiModel)AiModel.create(AiModelType.GPT_4_O_MINI).withApiKey(apiKey)).withOrganization("Organization").withProject("Project");
95233
96234
SummarizeOptions options = new SummarizeOptions();
235+
97236
options.setSummaryLength(SummaryLength.SHORT);
98237
Document oneDocumentSummary = model.summarize(firstDoc, options);
99238
oneDocumentSummary.save(getArtifactsDir() + "AI.AiSummarize.One.docx");
100239
101-
options = new SummarizeOptions();
102240
options.setSummaryLength(SummaryLength.LONG);
103241
Document multiDocumentSummary = model.summarize(new Document[] { firstDoc, secondDoc }, options);
104242
multiDocumentSummary.save(getArtifactsDir() + "AI.AiSummarize.Multi.docx");

english/java/com.aspose.words/aimodeltype/_index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ Shows how to summarize text using OpenAI and Google models.
3131
3232
String apiKey = System.getenv("API_KEY");
3333
// Use OpenAI or Google generative language models.
34-
IAiModelText model = ((OpenAiModel)AiModel.create(AiModelType.GPT_4_O_MINI).withApiKey(apiKey)).withOrganization("Organization").withProject("Project");
34+
AiModel model = ((OpenAiModel)AiModel.create(AiModelType.GPT_4_O_MINI).withApiKey(apiKey)).withOrganization("Organization").withProject("Project");
3535
3636
SummarizeOptions options = new SummarizeOptions();
37+
3738
options.setSummaryLength(SummaryLength.SHORT);
3839
Document oneDocumentSummary = model.summarize(firstDoc, options);
3940
oneDocumentSummary.save(getArtifactsDir() + "AI.AiSummarize.One.docx");
4041
41-
options = new SummarizeOptions();
4242
options.setSummaryLength(SummaryLength.LONG);
4343
Document multiDocumentSummary = model.summarize(new Document[] { firstDoc, secondDoc }, options);
4444
multiDocumentSummary.save(getArtifactsDir() + "AI.AiSummarize.Multi.docx");

0 commit comments

Comments
 (0)