GoogleAiModel

GoogleAiModel(string)

Initializes a new instance of GoogleAiModel class.

public GoogleAiModel(string name)
ParameterTypeDescription
nameStringThe name of the model. For example, gemini-2.5-flash.

Examples

Shows how to use google AI model.

string apiKey = Environment.GetEnvironmentVariable("API_KEY");
GoogleAiModel model = new GoogleAiModel("gemini-flash-latest", apiKey);

Document doc = new Document(MyDir + "Big document.docx");
SummarizeOptions summarizeOptions = new SummarizeOptions() { SummaryLength = SummaryLength.VeryShort };
Document summary = model.Summarize(doc, summarizeOptions);

See Also


GoogleAiModel(string, string)

Initializes a new instance of GoogleAiModel class.

public GoogleAiModel(string name, string apiKey)
ParameterTypeDescription
nameStringThe name of the model. For example, gemini-2.5-flash.
apiKeyStringThe API key to use the Gemini API. Please refer to https://ai.google.dev/gemini-api/docs/api-key for details.

Examples

Shows how to use google AI model.

string apiKey = Environment.GetEnvironmentVariable("API_KEY");
GoogleAiModel model = new GoogleAiModel("gemini-flash-latest", apiKey);

Document doc = new Document(MyDir + "Big document.docx");
SummarizeOptions summarizeOptions = new SummarizeOptions() { SummaryLength = SummaryLength.VeryShort };
Document summary = model.Summarize(doc, summarizeOptions);

See Also