With the release of Aspose.Words 25.11, developers can now configure custom AI model service endpoints. This enhancement provides greater flexibility when integrating with AI-powered features, such as text summarization, grammar checking, or translation. The new properties Url and Timeout allow developers to define custom API endpoints and control request timeouts for AI models.
Configuring a Custom AI Endpoint
You can now point your AI integration to a specific service endpoint and define how long the request should wait before timing out.
The following code example shows how to do it:
// Use OpenAI generative language models as an example.
string apiKey = Environment.GetEnvironmentVariable("API_KEY");
AiModel model = AiModel.Create(AiModelType.Gpt4OMini).WithApiKey(apiKey);
// Specify the model URL. Default value "https://api.openai.com/".
model.Url = "https://my.a.com/";
// Specify the model timeout. Default value 100000ms.
model.Timeout = 250000;
// Specify the required options and use AI-powered features for text summarization, grammar checking, or translation.
...
Why Configuring AI Model Service Matters
This update empowers developers to:
- Integrate with custom AI models
- Fine-tune request performance and reliability with custom timeouts
- Maintain full control over where and how AI data is processed
By allowing flexible endpoint configuration, Aspose.Words makes it easier than ever to build intelligent document-processing solutions that align with your infrastructure and compliance requirements.
See Also
- Use Self-hosted LLM Implementations with Aspose.Words for .NET AI Functionality
- Summarize Documents with Aspose.Words
- Check Grammar in Documents With Aspose.Words for .NET AI Functionality
- Translate Documents with Aspose.Words for .NET AI Functionality
- Aspose.Words Official Documnetation
- Aspose.Words API documentation
