|
11 | 11 |
|
12 | 12 | builder.Services.AddTelerikBlazor();
|
13 | 13 |
|
| 14 | +#region Azure AI Inference Client registration |
| 15 | + |
| 16 | +//builder.Services.AddChatClient( |
| 17 | +// new Azure.AI.Inference.ChatCompletionsClient( |
| 18 | +// new Uri("https://models.inference.ai.azure.com"), |
| 19 | +// new AzureKeyCredential("YOUR_AZURE_OPENAI_CREDENTIAL") |
| 20 | +// ).AsChatClient("Phi-3.5-MoE-instruct")); |
| 21 | + |
| 22 | +#endregion Azure AI Inference Client registration |
| 23 | + |
| 24 | +#region OpenAI Client registration |
| 25 | + |
| 26 | +//builder.Services.AddSingleton(new OpenAIClient("YOUR_API_KEY)); |
| 27 | +//builder.Services.AddDistributedMemoryCache(); |
| 28 | +//builder.Services.AddLogging(b => b.AddConsole().SetMinimumLevel(LogLevel.Trace)); |
| 29 | + |
| 30 | +//builder.Services.AddChatClient(services => services.GetRequiredService<OpenAIClient>().AsChatClient("YOUR_MODEL_NAME")) |
| 31 | +// .UseDistributedCache() |
| 32 | +// .UseLogging(); |
| 33 | + |
| 34 | +#endregion OpenAI Client registration |
| 35 | + |
| 36 | +#region Azure OpenAI Client registration |
| 37 | + |
14 | 38 | //builder.Services.AddSingleton(new AzureOpenAIClient(
|
15 | 39 | // new Uri("YOUR_AZURE_OPENAI_ENDPOINT"),
|
16 | 40 | // new AzureKeyCredential("YOUR_AZURE_OPENAI_CREDENTIAL")));
|
17 | 41 |
|
18 |
| -builder.Services.AddChatClient(services => services.GetRequiredService<AzureOpenAIClient>().AsChatClient("gpt-4o-mini")); |
| 42 | +//builder.Services.AddChatClient(services => services.GetRequiredService<AzureOpenAIClient>().AsChatClient("gpt-4o-mini")); |
| 43 | + |
| 44 | +#endregion Azure OpenAI Client registration |
| 45 | + |
| 46 | +#region Ollama Chat Client registration |
| 47 | + |
| 48 | +//builder.Services.AddDistributedMemoryCache(); |
| 49 | +//builder.Services.AddLogging(b => b.AddConsole().SetMinimumLevel(LogLevel.Trace)); |
| 50 | + |
| 51 | +//builder.Services.AddChatClient(new OllamaChatClient(new Uri("THE_URI_OF_YOUR_CLIENT"), "llama3.1")) |
| 52 | +// .UseDistributedCache() |
| 53 | +// .UseLogging(); |
| 54 | + |
| 55 | +#endregion Ollama Chat Client registration |
19 | 56 |
|
20 | 57 | var app = builder.Build();
|
21 | 58 |
|
|
0 commit comments