GrammarCheckerContext.CheckGrammarOptions

GrammarCheckerContext CheckGrammarOptions property. Set of options used while checking grammar of a document using AI.

GrammarCheckerContext.CheckGrammarOptions property

Set of options used while checking grammar of a document using AI.

public CheckGrammarOptions CheckGrammarOptions { get; }

Examples

Shows how to create custom OpenAiModel and perform grammar checking using Fluent API.

string apiUrl = Environment.GetEnvironmentVariable("CUSTOM_OPENAI_URL", EnvironmentVariableTarget.User);
string apiName = Environment.GetEnvironmentVariable("CUSTOM_OPENAI_NAME", EnvironmentVariableTarget.User);
string apiKey = Environment.GetEnvironmentVariable("CUSTOM_OPENAI_KEY", EnvironmentVariableTarget.User);

AiModel model = OpenAiModel.Create(apiUrl, apiName, apiKey);

GrammarCheckerContext context = new GrammarCheckerContext(model);
context.CheckGrammarOptions.ImproveStylistics = true;

GrammarChecker.Create(context)
    .From(MyDir + "SimpleAI.docx")
    .To(ArtifactsDir + "CheckGrammar.docx")
    .Execute();

See Also