Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion english/cpp/aspose.words.ai/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The **Aspose.Words.AI** namespace enables seamless integration with large langua

| Class | Description |
| --- | --- |
| [AiModel](./aimodel/) | Represents information about a Generative Language Model. |
| [AiModel](./aimodel/) | An abstract class representing the integration with various [AI](./) models within the [Aspose.Words](../aspose.words/). |
| [AnthropicAiModel](./anthropicaimodel/) | An abstract class representing the integration with Anthropic’s [AI](./) models within the [Aspose.Words](../aspose.words/). |
| [CheckGrammarOptions](./checkgrammaroptions/) | Allows to specify various options while checking grammar of a document using [AI](./). |
| [GoogleAiModel](./googleaimodel/) | An abstract class representing the integration with Google’s [AI](./) models within the [Aspose.Words](../aspose.words/). |
Expand Down
10 changes: 7 additions & 3 deletions english/cpp/aspose.words.ai/aimodel/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
title: Aspose::Words::AI::AiModel class
linktitle: AiModel
second_title: Aspose.Words for C++ API Reference
description: 'Aspose::Words::AI::AiModel class. Represents information about a Generative Language Model in C++.'
description: 'Aspose::Words::AI::AiModel class. An abstract class representing the integration with various AI models within the Aspose.Words in C++.'
type: docs
weight: 1000
url: /cpp/aspose.words.ai/aimodel/
---
## AiModel class


Represents information about a Generative Language Model.
An abstract class representing the integration with various [AI](../) models within the [Aspose.Words](../../aspose.words/).

```cpp
class AiModel : public virtual System::Object
Expand All @@ -20,9 +20,13 @@ class AiModel : public virtual System::Object

| Method | Description |
| --- | --- |
| virtual [CheckGrammar](./checkgrammar/)(System::SharedPtr\<Aspose::Words::Document\>, System::SharedPtr\<Aspose::Words::AI::CheckGrammarOptions\>) | Checks grammar of the provided document. This operation leverages the connected [AI](../) model for checking grammar of document. |
| static [Create](./create/)(Aspose::Words::AI::AiModelType) | Creates a new instance of [AiModel](./) class. |
| [GetType](./gettype/)() const override | |
| [Is](./is/)(const System::TypeInfo\&) const override | |
| virtual [Summarize](./summarize/)(System::SharedPtr\<Aspose::Words::Document\>, System::SharedPtr\<Aspose::Words::AI::SummarizeOptions\>) | 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. |
| virtual [Summarize](./summarize/)(System::ArrayPtr\<System::SharedPtr\<Aspose::Words::Document\>\>, System::SharedPtr\<Aspose::Words::AI::SummarizeOptions\>) | 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. |
| virtual [Translate](./translate/)(System::SharedPtr\<Aspose::Words::Document\>, Aspose::Words::AI::Language) | Translates the provided document into the specified target language. This operation leverages the connected [AI](../) model for content translating. |
| static [Type](./type/)() | |
| [WithApiKey](./withapikey/)(const System::String\&) | Sets a specified API key to the model. |

Expand All @@ -37,7 +41,7 @@ auto secondDoc = System::MakeObject<Aspose::Words::Document>(get_MyDir() + u"Doc

System::String apiKey = System::Environment::GetEnvironmentVariable(u"API_KEY");
// Use OpenAI or Google generative language models.
System::SharedPtr<Aspose::Words::AI::IAiModelText> model = (System::ExplicitCast<Aspose::Words::AI::OpenAiModel>(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project");
System::SharedPtr<Aspose::Words::AI::AiModel> model = (System::ExplicitCast<Aspose::Words::AI::OpenAiModel>(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project");

auto options = System::MakeObject<Aspose::Words::AI::SummarizeOptions>();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
title: Aspose::Words::AI::IAiModelText::CheckGrammar method
title: Aspose::Words::AI::AiModel::CheckGrammar method
linktitle: CheckGrammar
second_title: Aspose.Words for C++ API Reference
description: 'Aspose::Words::AI::IAiModelText::CheckGrammar method. Checks grammar of the provided document. This operation leverages the connected AI model for checking grammar of document in C++.'
description: 'Aspose::Words::AI::AiModel::CheckGrammar method. Checks grammar of the provided document. This operation leverages the connected AI model for checking grammar of document in C++.'
type: docs
weight: 1500
url: /cpp/aspose.words.ai/iaimodeltext/checkgrammar/
weight: 2500
url: /cpp/aspose.words.ai/aimodel/checkgrammar/
---
## IAiModelText::CheckGrammar method
## AiModel::CheckGrammar method


Checks grammar of the provided document. This operation leverages the connected [AI](../../) model for checking grammar of document.

```cpp
virtual System::SharedPtr<Aspose::Words::Document> Aspose::Words::AI::IAiModelText::CheckGrammar(System::SharedPtr<Aspose::Words::Document> sourceDocument, System::SharedPtr<Aspose::Words::AI::CheckGrammarOptions> options)=0
virtual System::SharedPtr<Aspose::Words::Document> Aspose::Words::AI::AiModel::CheckGrammar(System::SharedPtr<Aspose::Words::Document> sourceDocument, System::SharedPtr<Aspose::Words::AI::CheckGrammarOptions> options=nullptr)
```


Expand All @@ -36,7 +36,7 @@ auto doc = System::MakeObject<Aspose::Words::Document>(get_MyDir() + u"Big docum

System::String apiKey = System::Environment::GetEnvironmentVariable(u"API_KEY");
// Use OpenAI generative language models.
System::SharedPtr<Aspose::Words::AI::IAiModelText> model = System::ExplicitCast<Aspose::Words::AI::OpenAiModel>(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey));
System::SharedPtr<Aspose::Words::AI::AiModel> model = Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey);

auto grammarOptions = System::MakeObject<Aspose::Words::AI::CheckGrammarOptions>();
grammarOptions->set_ImproveStylistics(true);
Expand All @@ -49,6 +49,6 @@ proofedDoc->Save(get_ArtifactsDir() + u"AI.AiGrammar.docx");

* Class [Document](../../../aspose.words/document/)
* Class [CheckGrammarOptions](../../checkgrammaroptions/)
* Interface [IAiModelText](../)
* Class [AiModel](../)
* Namespace [Aspose::Words::AI](../../)
* Library [Aspose.Words for C++](../../../)
2 changes: 1 addition & 1 deletion english/cpp/aspose.words.ai/aimodel/create/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ auto secondDoc = System::MakeObject<Aspose::Words::Document>(get_MyDir() + u"Doc

System::String apiKey = System::Environment::GetEnvironmentVariable(u"API_KEY");
// Use OpenAI or Google generative language models.
System::SharedPtr<Aspose::Words::AI::IAiModelText> model = (System::ExplicitCast<Aspose::Words::AI::OpenAiModel>(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project");
System::SharedPtr<Aspose::Words::AI::AiModel> model = (System::ExplicitCast<Aspose::Words::AI::OpenAiModel>(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project");

auto options = System::MakeObject<Aspose::Words::AI::SummarizeOptions>();

Expand Down
109 changes: 109 additions & 0 deletions english/cpp/aspose.words.ai/aimodel/summarize/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
title: Aspose::Words::AI::AiModel::Summarize method
linktitle: Summarize
second_title: Aspose.Words for C++ API Reference
description: 'Aspose::Words::AI::AiModel::Summarize method. 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 in C++.'
type: docs
weight: 4334
url: /cpp/aspose.words.ai/aimodel/summarize/
---
## AiModel::Summarize(System::ArrayPtr\<System::SharedPtr\<Aspose::Words::Document\>\>, System::SharedPtr\<Aspose::Words::AI::SummarizeOptions\>) method


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.

```cpp
virtual System::SharedPtr<Aspose::Words::Document> Aspose::Words::AI::AiModel::Summarize(System::ArrayPtr<System::SharedPtr<Aspose::Words::Document>> sourceDocuments, System::SharedPtr<Aspose::Words::AI::SummarizeOptions> options=nullptr)=0
```


| Parameter | Type | Description |
| --- | --- | --- |
| sourceDocuments | System::ArrayPtr\<System::SharedPtr\<Aspose::Words::Document\>\> | An array of documents to be summarized. |
| options | System::SharedPtr\<Aspose::Words::AI::SummarizeOptions\> | Optional settings to control the summary length and other parameters |

### ReturnValue

A summarized version of the document's content.

## Examples



Shows how to summarize text using OpenAI and [Google](../../../aspose.words.ai.google/) models.
```cpp
auto firstDoc = System::MakeObject<Aspose::Words::Document>(get_MyDir() + u"Big document.docx");
auto secondDoc = System::MakeObject<Aspose::Words::Document>(get_MyDir() + u"Document.docx");

System::String apiKey = System::Environment::GetEnvironmentVariable(u"API_KEY");
// Use OpenAI or Google generative language models.
System::SharedPtr<Aspose::Words::AI::AiModel> model = (System::ExplicitCast<Aspose::Words::AI::OpenAiModel>(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project");

auto options = System::MakeObject<Aspose::Words::AI::SummarizeOptions>();

options->set_SummaryLength(Aspose::Words::AI::SummaryLength::Short);
System::SharedPtr<Aspose::Words::Document> oneDocumentSummary = model->Summarize(firstDoc, options);
oneDocumentSummary->Save(get_ArtifactsDir() + u"AI.AiSummarize.One.docx");

options->set_SummaryLength(Aspose::Words::AI::SummaryLength::Long);
System::SharedPtr<Aspose::Words::Document> multiDocumentSummary = model->Summarize(System::MakeArray<System::SharedPtr<Aspose::Words::Document>>({firstDoc, secondDoc}), options);
multiDocumentSummary->Save(get_ArtifactsDir() + u"AI.AiSummarize.Multi.docx");
```

## See Also

* Class [Document](../../../aspose.words/document/)
* Class [SummarizeOptions](../../summarizeoptions/)
* Class [AiModel](../)
* Namespace [Aspose::Words::AI](../../)
* Library [Aspose.Words for C++](../../../)
## AiModel::Summarize(System::SharedPtr\<Aspose::Words::Document\>, System::SharedPtr\<Aspose::Words::AI::SummarizeOptions\>) method


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.

```cpp
virtual System::SharedPtr<Aspose::Words::Document> Aspose::Words::AI::AiModel::Summarize(System::SharedPtr<Aspose::Words::Document> sourceDocument, System::SharedPtr<Aspose::Words::AI::SummarizeOptions> options=nullptr)=0
```


| Parameter | Type | Description |
| --- | --- | --- |
| sourceDocument | System::SharedPtr\<Aspose::Words::Document\> | The document to be summarized. |
| options | System::SharedPtr\<Aspose::Words::AI::SummarizeOptions\> | Optional settings to control the summary length and other parameters. |

### ReturnValue

A summarized version of the document's content.

## Examples



Shows how to summarize text using OpenAI and [Google](../../../aspose.words.ai.google/) models.
```cpp
auto firstDoc = System::MakeObject<Aspose::Words::Document>(get_MyDir() + u"Big document.docx");
auto secondDoc = System::MakeObject<Aspose::Words::Document>(get_MyDir() + u"Document.docx");

System::String apiKey = System::Environment::GetEnvironmentVariable(u"API_KEY");
// Use OpenAI or Google generative language models.
System::SharedPtr<Aspose::Words::AI::AiModel> model = (System::ExplicitCast<Aspose::Words::AI::OpenAiModel>(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project");

auto options = System::MakeObject<Aspose::Words::AI::SummarizeOptions>();

options->set_SummaryLength(Aspose::Words::AI::SummaryLength::Short);
System::SharedPtr<Aspose::Words::Document> oneDocumentSummary = model->Summarize(firstDoc, options);
oneDocumentSummary->Save(get_ArtifactsDir() + u"AI.AiSummarize.One.docx");

options->set_SummaryLength(Aspose::Words::AI::SummaryLength::Long);
System::SharedPtr<Aspose::Words::Document> multiDocumentSummary = model->Summarize(System::MakeArray<System::SharedPtr<Aspose::Words::Document>>({firstDoc, secondDoc}), options);
multiDocumentSummary->Save(get_ArtifactsDir() + u"AI.AiSummarize.Multi.docx");
```

## See Also

* Class [Document](../../../aspose.words/document/)
* Class [SummarizeOptions](../../summarizeoptions/)
* Class [AiModel](../)
* Namespace [Aspose::Words::AI](../../)
* Library [Aspose.Words for C++](../../../)
51 changes: 51 additions & 0 deletions english/cpp/aspose.words.ai/aimodel/translate/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
title: Aspose::Words::AI::AiModel::Translate method
linktitle: Translate
second_title: Aspose.Words for C++ API Reference
description: 'Aspose::Words::AI::AiModel::Translate method. Translates the provided document into the specified target language. This operation leverages the connected AI model for content translating in C++.'
type: docs
weight: 4667
url: /cpp/aspose.words.ai/aimodel/translate/
---
## AiModel::Translate method


Translates the provided document into the specified target language. This operation leverages the connected [AI](../../) model for content translating.

```cpp
virtual System::SharedPtr<Aspose::Words::Document> Aspose::Words::AI::AiModel::Translate(System::SharedPtr<Aspose::Words::Document> sourceDocument, Aspose::Words::AI::Language targetLanguage)=0
```


| Parameter | Type | Description |
| --- | --- | --- |
| sourceDocument | System::SharedPtr\<Aspose::Words::Document\> | The document to be translated. |
| targetLanguage | Aspose::Words::AI::Language | The language into which the document will be translated. |

### ReturnValue

A new [Document](../../../aspose.words/document/) object containing the translated document.

## Examples



Shows how to translate text using [Google](../../../aspose.words.ai.google/) models.
```cpp
auto doc = System::MakeObject<Aspose::Words::Document>(get_MyDir() + u"Document.docx");

System::String apiKey = System::Environment::GetEnvironmentVariable(u"API_KEY");
// Use Google generative language models.
System::SharedPtr<Aspose::Words::AI::AiModel> model = Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gemini15Flash)->WithApiKey(apiKey);

System::SharedPtr<Aspose::Words::Document> translatedDoc = model->Translate(doc, Aspose::Words::AI::Language::Arabic);
translatedDoc->Save(get_ArtifactsDir() + u"AI.AiTranslate.docx");
```

## See Also

* Class [Document](../../../aspose.words/document/)
* Enum [Language](../../language/)
* Class [AiModel](../)
* Namespace [Aspose::Words::AI](../../)
* Library [Aspose.Words for C++](../../../)
2 changes: 1 addition & 1 deletion english/cpp/aspose.words.ai/aimodel/withapikey/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ auto secondDoc = System::MakeObject<Aspose::Words::Document>(get_MyDir() + u"Doc

System::String apiKey = System::Environment::GetEnvironmentVariable(u"API_KEY");
// Use OpenAI or Google generative language models.
System::SharedPtr<Aspose::Words::AI::IAiModelText> model = (System::ExplicitCast<Aspose::Words::AI::OpenAiModel>(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project");
System::SharedPtr<Aspose::Words::AI::AiModel> model = (System::ExplicitCast<Aspose::Words::AI::OpenAiModel>(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project");

auto options = System::MakeObject<Aspose::Words::AI::SummarizeOptions>();

Expand Down
2 changes: 1 addition & 1 deletion english/cpp/aspose.words.ai/aimodeltype/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ auto secondDoc = System::MakeObject<Aspose::Words::Document>(get_MyDir() + u"Doc

System::String apiKey = System::Environment::GetEnvironmentVariable(u"API_KEY");
// Use OpenAI or Google generative language models.
System::SharedPtr<Aspose::Words::AI::IAiModelText> model = (System::ExplicitCast<Aspose::Words::AI::OpenAiModel>(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project");
System::SharedPtr<Aspose::Words::AI::AiModel> model = (System::ExplicitCast<Aspose::Words::AI::OpenAiModel>(Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType::Gpt4OMini)->WithApiKey(apiKey)))->WithOrganization(u"Organization")->WithProject(u"Project");

auto options = System::MakeObject<Aspose::Words::AI::SummarizeOptions>();

Expand Down
4 changes: 4 additions & 0 deletions english/cpp/aspose.words.ai/anthropicaimodel/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ class AnthropicAiModel : public Aspose::Words::AI::AiModel,

| Method | Description |
| --- | --- |
| virtual [CheckGrammar](../aimodel/checkgrammar/)(System::SharedPtr\<Aspose::Words::Document\>, System::SharedPtr\<Aspose::Words::AI::CheckGrammarOptions\>) | Checks grammar of the provided document. This operation leverages the connected [AI](../) model for checking grammar of document. |
| static [Create](../aimodel/create/)(Aspose::Words::AI::AiModelType) | Creates a new instance of [AiModel](../aimodel/) class. |
| [GetType](./gettype/)() const override | |
| [Is](./is/)(const System::TypeInfo\&) const override | |
| [Summarize](./summarize/)(System::SharedPtr\<Aspose::Words::Document\>, System::SharedPtr\<Aspose::Words::AI::SummarizeOptions\>) override | 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. |
| [Summarize](./summarize/)(System::ArrayPtr\<System::SharedPtr\<Aspose::Words::Document\>\>, System::SharedPtr\<Aspose::Words::AI::SummarizeOptions\>) override | 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. |
| [Translate](./translate/)(System::SharedPtr\<Aspose::Words::Document\>, Aspose::Words::AI::Language) override | Translates the provided document into the specified target language. This operation leverages the connected [AI](../) model for content translating. |
| static [Type](./type/)() | |
| [WithApiKey](../aimodel/withapikey/)(const System::String\&) | Sets a specified API key to the model. |
## See Also
Expand Down
Loading