Skip to content

Commit 5d370b5

Browse files
committed
Update generative models in various files
- Updated `ReviewScope.cs` to use `GenerativeModel.Gemini_20_Flash` instead of `GenerativeModel.Gemini_15_Flash`. - Modified `SearchScope.cs` to use `GenerativeModel.Gemini_20_Flash_Lite` instead of the default model. - Added new models to `GenerativeModel` enum in `GenerativeModel.cs`: `Gemini_20_Flash_Lite`, `Gemini_20_Flash`, and `Gemini_20_Flash_Thinking`. - Updated `GenerateContent` method in `Generator.cs` to use `GenerativeModel.Gemini_20_Flash` by default. - Updated `GenerateResponseForConversation` method in `Generator.cs` to use `GenerativeModel.Gemini_20_Flash_Lite` instead of `GenerativeModel.Gemini_15_Flash`.
1 parent 95e120e commit 5d370b5

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

Diff for: Events/ReviewScope.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public static async Task<Comment> GenerateReview(string apiKey, EnglishLevel lev
137137
promptBuilder.AppendLine("## My writting for you to review: ");
138138
promptBuilder.AppendLine(content.Trim());
139139

140-
var result = await Generator.GenerateContent(apiKey, instructionBuilder.ToString(), promptBuilder.ToString(), true, 30, GenerativeModel.Gemini_15_Flash);
140+
var result = await Generator.GenerateContent(apiKey, instructionBuilder.ToString(), promptBuilder.ToString(), true, 30, GenerativeModel.Gemini_20_Flash);
141141
return JsonConvert.DeserializeObject<Comment>(result);
142142
}
143143
}

Diff for: Events/SearchScope.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Người dùng có thể nhập vào từ hoặc cụm từ tiếng Anh để tr
117117
promptBuilder.AppendLine($"- {context.Trim()}");
118118
}
119119

120-
return await Gemini.Generator.GenerateContent(apiKey, useEnglish ? instructionforEnglish : instructionforVietnamese, promptBuilder.ToString().Trim(), false, 50);
120+
return await Gemini.Generator.GenerateContent(apiKey, useEnglish ? instructionforEnglish : instructionforVietnamese, promptBuilder.ToString().Trim(), false, 50, Gemini.GenerativeModel.Gemini_20_Flash_Lite);
121121
}
122122
}
123123
}

Diff for: Gemini/GenerativeModel.cs

+9
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,14 @@ public enum GenerativeModel
1212

1313
[Description("gemini-1.5-flash-latest")]
1414
Gemini_15_Flash = 3,
15+
16+
[Description("gemini-2.0-flash-lite-preview-02-05")]
17+
Gemini_20_Flash_Lite = 4,
18+
19+
[Description("gemini-2.0-flash")]
20+
Gemini_20_Flash = 5,
21+
22+
[Description("gemini-2.0-flash-thinking-exp-01-21")]
23+
Gemini_20_Flash_Thinking = 6,
1524
}
1625
}

Diff for: Gemini/Generator.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public static class Generator
1010
{
1111
private static readonly HttpClient Client = new();
1212

13-
public static async Task<string> GenerateContent(string apiKey, string? instruction, string query, bool useJson = true, double creativeLevel = 50, GenerativeModel model = GenerativeModel.Gemini_15_Flash)
13+
public static async Task<string> GenerateContent(string apiKey, string? instruction, string query, bool useJson = true, double creativeLevel = 50, GenerativeModel model = GenerativeModel.Gemini_20_Flash)
1414
{
1515
var endpoint = GetUriWithHeadersIfAny(apiKey, model);
1616

@@ -83,7 +83,7 @@ public static async Task<string> GenerateContent(string apiKey, string? instruct
8383

8484
public static async Task<string> GenerateResponseForConversation(string apiKey, ChatRequest.Request requestData)
8585
{
86-
var endpoint = GetUriWithHeadersIfAny(apiKey, GenerativeModel.Gemini_15_Flash);
86+
var endpoint = GetUriWithHeadersIfAny(apiKey, GenerativeModel.Gemini_20_Flash_Lite);
8787

8888
var body = new StringContent(JsonConvert.SerializeObject(requestData), Encoding.UTF8, "application/json");
8989
var response = await Client.PostAsync(endpoint, body);

0 commit comments

Comments
 (0)