Skip to content

Commit 94a40bb

Browse files
committed
Merge branch 'main' into production
2 parents 3fa5970 + 767aeeb commit 94a40bb

File tree

59 files changed

+1670
-651
lines changed

Some content is hidden

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

59 files changed

+1670
-651
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,7 @@ The **MailMerge** object which provides access to the reporting functionality is
797797
| [IFontSavingCallback](../com.aspose.words/ifontsavingcallback/) | Implement this interface if you want to receive notifications and control how Aspose.Words saves fonts when exporting a document to HTML format. |
798798
| [IHyphenationCallback](../com.aspose.words/ihyphenationcallback/) | Implemented by classes which can register hyphenation dictionaries. |
799799
| [IImageSavingCallback](../com.aspose.words/iimagesavingcallback/) | Implement this interface if you want to control how Aspose.Words saves images when saving a document to HTML. |
800+
| [IIndexFilter](../com.aspose.words/iindexfilter/) | Defines a filter for skipping items based on their indices. |
800801
| [IMailMergeCallback](../com.aspose.words/imailmergecallback/) | Implement this interface if you want to receive notifications while mail merge is performed. |
801802
| [IMailMergeDataSource](../com.aspose.words/imailmergedatasource/) | Implement this interface to allow mail merge from a custom data source, such as a list of objects. |
802803
| [IMailMergeDataSourceRoot](../com.aspose.words/imailmergedatasourceroot/) | Implement this interface to allow mail merge from a custom data source with master-detail data. |

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. (195322,6)
1129+
Returns true if this node can contain other nodes. (196492,6)
11301130

11311131
**Examples:**
11321132

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

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ Shows how to summarize text using OpenAI and Google models.
5151
| --- | --- |
5252
| [checkGrammar(Document sourceDocument, CheckGrammarOptions options)](#checkGrammar-com.aspose.words.Document-com.aspose.words.CheckGrammarOptions) | Checks grammar of the provided document. |
5353
| [create(int modelType)](#create-int) | |
54+
| [getTimeout()](#getTimeout) | Gets the number of milliseconds to wait before the request to AI model times out. |
55+
| [getUrl()](#getUrl) | Gets a URL of the model. |
56+
| [setTimeout(int value)](#setTimeout-int) | Sets the number of milliseconds to wait before the request to AI model times out. |
57+
| [setUrl(String value)](#setUrl-java.lang.String) | Sets a URL of the model. |
5458
| [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. |
5559
| [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. |
5660
| [translate(Document sourceDocument, int targetLanguage)](#translate-com.aspose.words.Document-int) | |
@@ -112,6 +116,164 @@ public static AiModel create(int modelType)
112116

113117
**Returns:**
114118
[AiModel](../../com.aspose.words/aimodel/)
119+
### getTimeout() {#getTimeout}
120+
```
121+
public int getTimeout()
122+
```
123+
124+
125+
Gets the number of milliseconds to wait before the request to AI model times out. The default value is 100,000 milliseconds (100 seconds).
126+
127+
**Examples:**
128+
129+
Shows how to change model default timeout.
130+
131+
```
132+
133+
String apiKey = System.getenv("API_KEY");
134+
AiModel model = AiModel.create(AiModelType.GPT_4_O_MINI).withApiKey(apiKey);
135+
// Default value 100000ms.
136+
model.setTimeout(250000);
137+
138+
```
139+
140+
**Returns:**
141+
int - The number of milliseconds to wait before the request to AI model times out.
142+
### getUrl() {#getUrl}
143+
```
144+
public abstract String getUrl()
145+
```
146+
147+
148+
Gets a URL of the model. The default value is specific for the model.
149+
150+
**Examples:**
151+
152+
Shows how to change model default url.
153+
154+
```
155+
156+
String apiKey = System.getenv("API_KEY");
157+
AiModel model = AiModel.create(AiModelType.GPT_4_O_MINI).withApiKey(apiKey);
158+
// Default value "https://api.openai.com/".
159+
model.setUrl("https://my.a.com/");
160+
161+
```
162+
163+
Shows how to use self-hosted AI model based on OpenAiModel.
164+
165+
```
166+
167+
public void selfHostedModel() throws Exception
168+
{
169+
Document doc = new Document(getMyDir() + "Big document.docx");
170+
171+
String apiKey = System.getenv("API_KEY");
172+
// Use OpenAI generative language models.
173+
AiModel model = new CustomAiModel().withApiKey(apiKey);
174+
model.setUrl("https://my.a.com/");
175+
176+
Document translatedDoc = model.translate(doc, Language.RUSSIAN);
177+
translatedDoc.save(getArtifactsDir() + "AI.SelfHostedModel.docx");
178+
}
179+
180+
///
181+
/// Custom self-hosted AI model.
182+
///
183+
static class CustomAiModel extends OpenAiModel
184+
{
185+
///
186+
/// Gets model name.
187+
///
188+
protected String getName() { return "my-model-24b"; }
189+
}
190+
191+
```
192+
193+
**Returns:**
194+
java.lang.String - A URL of the model.
195+
### setTimeout(int value) {#setTimeout-int}
196+
```
197+
public void setTimeout(int value)
198+
```
199+
200+
201+
Sets the number of milliseconds to wait before the request to AI model times out. The default value is 100,000 milliseconds (100 seconds).
202+
203+
**Examples:**
204+
205+
Shows how to change model default timeout.
206+
207+
```
208+
209+
String apiKey = System.getenv("API_KEY");
210+
AiModel model = AiModel.create(AiModelType.GPT_4_O_MINI).withApiKey(apiKey);
211+
// Default value 100000ms.
212+
model.setTimeout(250000);
213+
214+
```
215+
216+
**Parameters:**
217+
| Parameter | Type | Description |
218+
| --- | --- | --- |
219+
| value | int | The number of milliseconds to wait before the request to AI model times out. |
220+
221+
### setUrl(String value) {#setUrl-java.lang.String}
222+
```
223+
public abstract void setUrl(String value)
224+
```
225+
226+
227+
Sets a URL of the model. The default value is specific for the model.
228+
229+
**Examples:**
230+
231+
Shows how to change model default url.
232+
233+
```
234+
235+
String apiKey = System.getenv("API_KEY");
236+
AiModel model = AiModel.create(AiModelType.GPT_4_O_MINI).withApiKey(apiKey);
237+
// Default value "https://api.openai.com/".
238+
model.setUrl("https://my.a.com/");
239+
240+
```
241+
242+
Shows how to use self-hosted AI model based on OpenAiModel.
243+
244+
```
245+
246+
public void selfHostedModel() throws Exception
247+
{
248+
Document doc = new Document(getMyDir() + "Big document.docx");
249+
250+
String apiKey = System.getenv("API_KEY");
251+
// Use OpenAI generative language models.
252+
AiModel model = new CustomAiModel().withApiKey(apiKey);
253+
model.setUrl("https://my.a.com/");
254+
255+
Document translatedDoc = model.translate(doc, Language.RUSSIAN);
256+
translatedDoc.save(getArtifactsDir() + "AI.SelfHostedModel.docx");
257+
}
258+
259+
///
260+
/// Custom self-hosted AI model.
261+
///
262+
static class CustomAiModel extends OpenAiModel
263+
{
264+
///
265+
/// Gets model name.
266+
///
267+
protected String getName() { return "my-model-24b"; }
268+
}
269+
270+
```
271+
272+
**Parameters:**
273+
| Parameter | Type | Description |
274+
| --- | --- | --- |
275+
| value | java.lang.String | A URL of the model. |
276+
115277
### summarize(Document sourceDocument, SummarizeOptions options) {#summarize-com.aspose.words.Document-com.aspose.words.SummarizeOptions}
116278
```
117279
public abstract Document summarize(Document sourceDocument, SummarizeOptions options)

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

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ An abstract class representing the integration with Anthropic\\u2019s AI models
2929
| --- | --- |
3030
| [checkGrammar(Document sourceDocument, CheckGrammarOptions options)](#checkGrammar-com.aspose.words.Document-com.aspose.words.CheckGrammarOptions) | Checks grammar of the provided document. |
3131
| [create(int modelType)](#create-int) | |
32+
| [getTimeout()](#getTimeout) | Gets the number of milliseconds to wait before the request to AI model times out. |
33+
| [getUrl()](#getUrl) | Gets a URL of the model. |
34+
| [setTimeout(int value)](#setTimeout-int) | Sets the number of milliseconds to wait before the request to AI model times out. |
35+
| [setUrl(String value)](#setUrl-java.lang.String) | Sets a URL of the model. |
3236
| [summarize(Document sourceDocument)](#summarize-com.aspose.words.Document) | |
3337
| [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. |
3438
| [summarize(Document[] sourceDocuments)](#summarize-com.aspose.words.Document) | |
@@ -92,6 +96,78 @@ public static AiModel create(int modelType)
9296

9397
**Returns:**
9498
[AiModel](../../com.aspose.words/aimodel/)
99+
### getTimeout() {#getTimeout}
100+
```
101+
public int getTimeout()
102+
```
103+
104+
105+
Gets the number of milliseconds to wait before the request to AI model times out. The default value is 100,000 milliseconds (100 seconds).
106+
107+
**Examples:**
108+
109+
Shows how to change model default timeout.
110+
111+
```
112+
113+
String apiKey = System.getenv("API_KEY");
114+
AiModel model = AiModel.create(AiModelType.GPT_4_O_MINI).withApiKey(apiKey);
115+
// Default value 100000ms.
116+
model.setTimeout(250000);
117+
118+
```
119+
120+
**Returns:**
121+
int - The number of milliseconds to wait before the request to AI model times out.
122+
### getUrl() {#getUrl}
123+
```
124+
public String getUrl()
125+
```
126+
127+
128+
Gets a URL of the model. The default value is "https://api.anthropic.com/".
129+
130+
**Returns:**
131+
java.lang.String - A URL of the model.
132+
### setTimeout(int value) {#setTimeout-int}
133+
```
134+
public void setTimeout(int value)
135+
```
136+
137+
138+
Sets the number of milliseconds to wait before the request to AI model times out. The default value is 100,000 milliseconds (100 seconds).
139+
140+
**Examples:**
141+
142+
Shows how to change model default timeout.
143+
144+
```
145+
146+
String apiKey = System.getenv("API_KEY");
147+
AiModel model = AiModel.create(AiModelType.GPT_4_O_MINI).withApiKey(apiKey);
148+
// Default value 100000ms.
149+
model.setTimeout(250000);
150+
151+
```
152+
153+
**Parameters:**
154+
| Parameter | Type | Description |
155+
| --- | --- | --- |
156+
| value | int | The number of milliseconds to wait before the request to AI model times out. |
157+
158+
### setUrl(String value) {#setUrl-java.lang.String}
159+
```
160+
public void setUrl(String value)
161+
```
162+
163+
164+
Sets a URL of the model. The default value is "https://api.anthropic.com/".
165+
166+
**Parameters:**
167+
| Parameter | Type | Description |
168+
| --- | --- | --- |
169+
| value | java.lang.String | A URL of the model. |
170+
95171
### summarize(Document sourceDocument) {#summarize-com.aspose.words.Document}
96172
```
97173
public Document summarize(Document sourceDocument)

0 commit comments

Comments
 (0)