Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Aspose.Words now leverages advanced AI models to enhance document processing and analysis. With the Aspose.Words.AI namespace, developers can access AI-powered features such as document summarization and analysis, document translation, and grammar checking by integrating generative language models from industry leaders.
Aspose.Words library currently supports integration with:
These models bring powerful capabilities for working with documents. By enabling seamless interaction with these AI tools, Aspose.Words simplifies complex tasks and enhances productivity for developers.
You can create a model instance using the Create method of the AiModel class.
The following code example shows how to create a new instance of AiModel class:
static System::SharedPtr<Aspose::Words::AI::AiModel> Aspose::Words::AI::AiModel::Create(Aspose::Words::AI::AiModelType modelType)
With Aspose.Words, developers can also integrate self-hosted LLMs (Large Language Models), providing an alternative to OpenAI/Anthropic/Google’s hosted services.
The following code example shows how to create a self-hosted LLM based on OpenAI’s generative language model:
void SelfHostedModel()
{
auto doc = MakeObject<Document>(MyDir + u"Big document.docx");
SharedPtr<AiModel> model = SharedPtr<CustomAiModel>()->WithApiKey(u"API_KEY");
auto translatedDoc = model->Translate(doc, Language::Russian);
translatedDoc->Save(ArtifactsDir + u"AI.SelfHostedModel.docx");
}
class CustomAiModel : public OpenAiModel
{
/// <summary>
/// Gets custom URL of the model.
/// </summary>
System::String get_Url() override
{
return u"https://localhost/";
}
/// <summary>
/// Gets model name.
/// </summary>
System::String get_Name() override
{
return u"my-model-24b";
}
}
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.