Aspose::Words::AI::AiModelType enum

AiModelType enum

Represents the types of AiModel that can be integrated into the document processing workflow.

enum class AiModelType

Values

NameValueDescription
Gpt4O0GPT-4o generative model type.
Gpt4OMini1GPT-4o mini generative model type.
Gpt4Turbo2GPT-4 Turbo generative model type.
Gpt35Turbo3GPT-3.5 Turbo generative model type.
Gemini15Flash4Gemini 1.5 Flash generative model type.
Gemini15Flash8B5Gemini 1.5 Flash-8B generative model type.
Gemini15Pro6Gemini 1.5 Pro generative model type.
Claude35Sonnet7Claude 3.5 Sonnet generative model type.
Claude35Haiku8Claude 3.5 Haiku generative model type.
Claude3Opus9Claude 3 Opus generative model type.
Claude3Sonnet10Claude 3 Sonnet generative model type.
Claude3Haiku11Claude 3 Haiku generative model type.

Examples

Shows how to summarize text using OpenAI and Google models.

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