Url
Contents
[
Hide
]AiModel.Url property
Gets or sets a URL of the model. The default value is specific for the model.
public abstract string Url { get; set; }
Examples
Shows how to change model default url.
string apiKey = Environment.GetEnvironmentVariable("API_KEY");
AiModel model = AiModel.Create(AiModelType.Gpt4OMini).WithApiKey(apiKey);
// Default value "https://api.openai.com/".
model.Url = "https://my.a.com/";
Shows how to check the grammar of a document.
Document doc = new Document(MyDir + "Big document.docx");
string apiKey = Environment.GetEnvironmentVariable("API_KEY");
// Use OpenAI generative language models.
AiModel model = AiModel.Create(AiModelType.Gpt4OMini).WithApiKey(apiKey);
CheckGrammarOptions grammarOptions = new CheckGrammarOptions();
grammarOptions.ImproveStylistics = true;
Document proofedDoc = model.CheckGrammar(doc, grammarOptions);
proofedDoc.Save(ArtifactsDir + "AI.AiGrammar.docx");
See Also
- class AiModel
- namespace Aspose.Words.AI
- assembly Aspose.Words