|
3 | 3 |
|
4 | 4 | // Optional model provider implementations:
|
5 | 5 | // Azure models
|
6 |
| -using Azure; |
| 6 | +using Azure; |
7 | 7 | using Azure.AI.OpenAI;
|
8 | 8 | // OpenAI models
|
9 | 9 | using OpenAI;
|
10 | 10 | // GitHub models
|
11 |
| -using System.ClientModel; |
| 11 | +using System.ClientModel; |
12 | 12 |
|
13 | 13 | var builder = WebApplication.CreateBuilder(args);
|
14 | 14 |
|
15 | 15 | // Add services to the container.
|
16 | 16 | builder.Services.AddRazorComponents()
|
17 |
| - .AddInteractiveServerComponents(); |
| 17 | + .AddInteractiveServerComponents(); |
18 | 18 |
|
19 | 19 | builder.Services.AddTelerikBlazor();
|
20 | 20 |
|
|
33 | 33 |
|
34 | 34 | // Replace the innerClient below with your preferred model provider
|
35 | 35 | var innerClient = new OpenAIClient(
|
36 |
| - new ApiKeyCredential(apikey), |
37 |
| - new OpenAIClientOptions() |
38 |
| - { |
39 |
| - Endpoint = new Uri(endpoint) |
40 |
| - } |
41 |
| - ).AsChatClient(model); |
| 36 | + new ApiKeyCredential(apikey), |
| 37 | + new OpenAIClientOptions() |
| 38 | + { |
| 39 | + Endpoint = new Uri(endpoint) |
| 40 | + } |
| 41 | + ).AsChatClient(model); |
42 | 42 |
|
43 | 43 | builder.Services.AddChatClient(innerClient) // 🤖 Add the configured chat client
|
44 |
| - .UseFunctionInvocation() // 🛠️ Include tool calling |
45 |
| - .UseLogging(); //🐞 Include Logging |
| 44 | + .UseFunctionInvocation() // 🛠️ Include tool calling |
| 45 | + .UseLogging(); //🐞 Include Logging |
46 | 46 |
|
47 | 47 | var app = builder.Build();
|
48 | 48 |
|
49 | 49 | // Configure the HTTP request pipeline.
|
50 | 50 | if (!app.Environment.IsDevelopment())
|
51 | 51 | {
|
52 |
| - app.UseExceptionHandler("/Error", createScopeForErrors: true); |
53 |
| - // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. |
54 |
| - app.UseHsts(); |
| 52 | + app.UseExceptionHandler("/Error", createScopeForErrors: true); |
| 53 | + // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. |
| 54 | + app.UseHsts(); |
55 | 55 | }
|
56 | 56 |
|
57 | 57 | app.UseHttpsRedirection();
|
|
60 | 60 | app.UseAntiforgery();
|
61 | 61 |
|
62 | 62 | app.MapRazorComponents<App>()
|
63 |
| - .AddInteractiveServerRenderMode(); |
| 63 | + .AddInteractiveServerRenderMode(); |
64 | 64 |
|
65 | 65 | app.Run();
|
0 commit comments