-
Notifications
You must be signed in to change notification settings - Fork 20
Refactor/model configuration #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
81c3326
2c3c1f6
6da61e0
0d23b48
c1f0045
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -1,12 +1,19 @@ | ||||
| using MaIN.Core; | ||||
| using MaIN.Core.Hub; | ||||
| using MaIN.Domain.Models.Abstract; | ||||
| using MaIN.Domain.Models.Concrete; | ||||
|
|
||||
| MaINBootstrapper.Initialize(); | ||||
|
|
||||
| var model = AIHub.Model(); | ||||
| var modelContext = AIHub.Model(); | ||||
|
|
||||
| var m = model.GetModel("gemma3:4b"); | ||||
| var x = model.GetModel("llama3.2:3b"); | ||||
| await model.DownloadAsync(x.Name); | ||||
| // Get models using ModelRegistry | ||||
| var gemma = modelContext.GetModel("gemma3-4b"); | ||||
| var llama = modelContext.GetModel("llama3.2-3b"); | ||||
|
||||
| var llama = modelContext.GetModel("llama3.2-3b"); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,8 @@ | ||
| using Examples.Utils; | ||
| using MaIN.Core.Hub; | ||
| using MaIN.Domain.Configuration; | ||
| using MaIN.Domain.Models.Abstract; | ||
| using MaIN.Domain.Models.Concrete; | ||
|
|
||
| namespace Examples.Chat; | ||
|
|
||
|
|
@@ -10,8 +13,17 @@ public async Task Start() | |
| GeminiExample.Setup(); //We need to provide Gemini API key | ||
| Console.WriteLine("(Gemini) ChatExample is running!"); | ||
|
|
||
| // Get built-in Gemini 2.5 Flash model | ||
| var model = AIHub.Model().GetModel(new Gemini2_5Flash().Id); | ||
|
|
||
| // Or create the model manually if not available in the hub | ||
| var customModel = new GenericCloudModel( | ||
| "gemini-2.5-flash", | ||
| BackendType.Gemini | ||
| ); | ||
|
|
||
| await AIHub.Chat() | ||
| .WithModel("gemini-2.5-flash") | ||
| .WithModel(customModel) | ||
|
Comment on lines
+16
to
+26
|
||
| .WithMessage("Is the killer whale the smartest animal?") | ||
| .CompleteAsync(interactive: true); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,5 +1,6 @@ | ||||||
| using Examples.Utils; | ||||||
| using MaIN.Core.Hub; | ||||||
| using MaIN.Domain.Models.Concrete; | ||||||
|
|
||||||
| namespace Examples.Chat; | ||||||
|
|
||||||
|
|
@@ -13,7 +14,7 @@ public async Task Start() | |||||
| List<string> files = ["./Files/Nicolaus_Copernicus.pdf", "./Files/Galileo_Galilei.pdf"]; | ||||||
|
|
||||||
| var result = await AIHub.Chat() | ||||||
| .WithModel("gemini-2.0-flash") | ||||||
| .WithModel<Gemini2_5Flash>() | ||||||
|
||||||
| .WithModel<Gemini2_5Flash>() | |
| .WithModel<Gemini2_0Flash>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assignment to gemma is useless, since its value is never read.