GoogleAiModel
Contents
[
Hide
]GoogleAiModel(string)
Initializes a new instance of GoogleAiModel class.
public GoogleAiModel(string name)
| Parameter | Type | Description |
|---|---|---|
| name | String | The 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
- class GoogleAiModel
- namespace Aspose.Words.AI
- assembly Aspose.Words
GoogleAiModel(string, string)
Initializes a new instance of GoogleAiModel class.
public GoogleAiModel(string name, string apiKey)
| Parameter | Type | Description |
|---|---|---|
| name | String | The name of the model. For example, gemini-2.5-flash. |
| apiKey | String | The 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
- class GoogleAiModel
- namespace Aspose.Words.AI
- assembly Aspose.Words