Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions 0-Agents/AgentsWebUI/Components/Pages/Agent01.razor
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@

protected override Task OnInitializedAsync()
{
var apiKey = Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OPEN_ROUTER_API_KEY is not set in.");
var apiKey = Configuration["OpenRouter:ApiKey"] ?? Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OpenRouter:ApiKey (or OPEN_ROUTER_API_KEY) is not configured.");

var openAIClientOptions = new OpenAIClientOptions
{
Expand Down
4 changes: 2 additions & 2 deletions 0-Agents/AgentsWebUI/Components/Pages/Agent02.razor
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@

protected override Task OnInitializedAsync()
{
var apiKey = Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OPEN_ROUTER_API_KEY is not set in.");
var apiKey = Configuration["OpenRouter:ApiKey"] ?? Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OpenRouter:ApiKey (or OPEN_ROUTER_API_KEY) is not configured.");

var openAIClientOptions = new OpenAIClientOptions
{
Expand Down
4 changes: 2 additions & 2 deletions 0-Agents/AgentsWebUI/Components/Pages/Agent03.razor
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@

protected override Task OnInitializedAsync()
{
var apiKey = Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OPEN_ROUTER_API_KEY is not set in.");
var apiKey = Configuration["OpenRouter:ApiKey"] ?? Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OpenRouter:ApiKey (or OPEN_ROUTER_API_KEY) is not configured.");

var openAIClientOptions = new OpenAIClientOptions
{
Expand Down
4 changes: 2 additions & 2 deletions 0-Agents/AgentsWebUI/Components/Pages/Agent04.razor
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@

protected override Task OnInitializedAsync()
{
var apiKey = Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OPEN_ROUTER_API_KEY is not set in.");
var apiKey = Configuration["OpenRouter:ApiKey"] ?? Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OpenRouter:ApiKey (or OPEN_ROUTER_API_KEY) is not configured.");

var openAIClientOptions = new OpenAIClientOptions
{
Expand Down
4 changes: 2 additions & 2 deletions 0-Agents/AgentsWebUI/Components/Pages/Agent05.razor
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@

protected override Task OnInitializedAsync()
{
var apiKey = Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OPEN_ROUTER_API_KEY is not set in.");
var apiKey = Configuration["OpenRouter:ApiKey"] ?? Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OpenRouter:ApiKey (or OPEN_ROUTER_API_KEY) is not configured.");

var openAIClientOptions = new OpenAIClientOptions
{
Expand Down
4 changes: 2 additions & 2 deletions 0-Agents/AgentsWebUI/Components/Pages/Agent06.razor
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@

protected override Task OnInitializedAsync()
{
var apiKey = Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OPEN_ROUTER_API_KEY is not set in.");
var apiKey = Configuration["OpenRouter:ApiKey"] ?? Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OpenRouter:ApiKey (or OPEN_ROUTER_API_KEY) is not configured.");

var openAIClientOptions = new OpenAIClientOptions
{
Expand Down
4 changes: 2 additions & 2 deletions 0-Agents/AgentsWebUI/Components/Pages/Agent07.razor
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@

protected override Task OnInitializedAsync()
{
var apiKey = Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OPEN_ROUTER_API_KEY is not set in.");
var apiKey = Configuration["OpenRouter:ApiKey"] ?? Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OpenRouter:ApiKey (or OPEN_ROUTER_API_KEY) is not configured.");

var openAIClientOptions = new OpenAIClientOptions
{
Expand Down
4 changes: 2 additions & 2 deletions 0-Agents/AgentsWebUI/Components/Pages/Agent08.razor
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@

protected override Task OnInitializedAsync()
{
var apiKey = Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OPEN_ROUTER_API_KEY is not set in.");
var apiKey = Configuration["OpenRouter:ApiKey"] ?? Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OpenRouter:ApiKey (or OPEN_ROUTER_API_KEY) is not configured.");

var openAIClientOptions = new OpenAIClientOptions
{
Expand Down
8 changes: 4 additions & 4 deletions 0-Agents/AgentsWebUI/Components/Pages/Agent09.razor
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@
log = string.Empty;
isLoading = true;

var apiKey = Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OPEN_ROUTER_API_KEY is not set in.");
var apiKey = Configuration["OpenRouter:ApiKey"] ?? Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OpenRouter:ApiKey (or OPEN_ROUTER_API_KEY) is not configured.");

var openAIClientOptions = new OpenAIClientOptions
{
Expand Down Expand Up @@ -164,8 +164,8 @@
foreach (var t in mcpTools)
log += $"Tool: {t.Title}- {t.Name} <br /> {JsonSerializer.Serialize(t.AdditionalProperties)} <hr />";

var apiKey = Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OPEN_ROUTER_API_KEY is not set in.");
var apiKey = Configuration["OpenRouter:ApiKey"] ?? Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OpenRouter:ApiKey (or OPEN_ROUTER_API_KEY) is not configured.");

var openAIClientOptions = new OpenAIClientOptions
{
Expand Down
4 changes: 2 additions & 2 deletions 0-Agents/AgentsWebUI/Components/Pages/Agent10.razor
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@

protected override Task OnInitializedAsync()
{
var apiKey = Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OPEN_ROUTER_API_KEY is not set in.");
var apiKey = Configuration["OpenRouter:ApiKey"] ?? Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OpenRouter:ApiKey (or OPEN_ROUTER_API_KEY) is not configured.");

var openAIClientOptions = new OpenAIClientOptions
{
Expand Down
4 changes: 2 additions & 2 deletions 0-Agents/AgentsWebUI/Components/Pages/Agent11.razor
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@

protected override async Task OnInitializedAsync()
{
var apiKey = Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OPEN_ROUTER_API_KEY is not set in.");
var apiKey = Configuration["OpenRouter:ApiKey"] ?? Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OpenRouter:ApiKey (or OPEN_ROUTER_API_KEY) is not configured.");

var openAIClientOptions = new OpenAIClientOptions
{
Expand Down
4 changes: 2 additions & 2 deletions 0-Agents/AgentsWebUI/Components/Pages/Agent12.razor
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@

protected override async Task OnInitializedAsync()
{
var apiKey = Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OPEN_ROUTER_API_KEY is not set in.");
var apiKey = Configuration["OpenRouter:ApiKey"] ?? Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OpenRouter:ApiKey (or OPEN_ROUTER_API_KEY) is not configured.");

var openAIClientOptions = new OpenAIClientOptions
{
Expand Down
4 changes: 2 additions & 2 deletions 0-Agents/AgentsWebUI/Components/Pages/Agent13.razor
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@

var serviceProvider = services.BuildServiceProvider();

var apiKey = Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OPEN_ROUTER_API_KEY is not set in.");
var apiKey = Configuration["OpenRouter:ApiKey"] ?? Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OpenRouter:ApiKey (or OPEN_ROUTER_API_KEY) is not configured.");

var openAIClientOptions = new OpenAIClientOptions
{
Expand Down
4 changes: 2 additions & 2 deletions 0-Agents/AgentsWebUI/Components/Pages/Agent14.razor
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@

protected override Task OnInitializedAsync()
{
var apiKey = Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OPEN_ROUTER_API_KEY is not set in.");
var apiKey = Configuration["OpenRouter:ApiKey"] ?? Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OpenRouter:ApiKey (or OPEN_ROUTER_API_KEY) is not configured.");

var openAIClientOptions = new OpenAIClientOptions
{
Expand Down
4 changes: 2 additions & 2 deletions 0-Agents/AgentsWebUI/Components/Pages/Agent15.razor
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ outputSchema:

protected override Task OnInitializedAsync()
{
var apiKey = Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OPEN_ROUTER_API_KEY is not set in.");
var apiKey = Configuration["OpenRouter:ApiKey"] ?? Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OpenRouter:ApiKey (or OPEN_ROUTER_API_KEY) is not configured.");

var openAIClientOptions = new OpenAIClientOptions
{
Expand Down
4 changes: 2 additions & 2 deletions 0-Agents/AgentsWebUI/Components/Pages/Agent16.razor
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@

protected override Task OnInitializedAsync()
{
var apiKey = Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OPEN_ROUTER_API_KEY is not set in.");
var apiKey = Configuration["OpenRouter:ApiKey"] ?? Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OpenRouter:ApiKey (or OPEN_ROUTER_API_KEY) is not configured.");

var openAIClientOptions = new OpenAIClientOptions
{
Expand Down
4 changes: 2 additions & 2 deletions 0-Agents/AgentsWebUI/Components/Pages/Agent17.razor
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@

protected override Task OnInitializedAsync()
{
var apiKey = Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OPEN_ROUTER_API_KEY is not set.");
var apiKey = Configuration["OpenRouter:ApiKey"] ?? Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OpenRouter:ApiKey (or OPEN_ROUTER_API_KEY) is not configured.");
var openAIClientOptions = new OpenAIClientOptions { Endpoint = new Uri(endpoint) };
var credential = new ApiKeyCredential(apiKey);
var chatClient = new ChatClient(modelName, credential, openAIClientOptions);
Expand Down
4 changes: 2 additions & 2 deletions 0-Agents/AgentsWebUI/Components/Pages/Agent18.razor
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@

protected override Task OnInitializedAsync()
{
var apiKey = Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OPEN_ROUTER_API_KEY is not set.");
var apiKey = Configuration["OpenRouter:ApiKey"] ?? Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OpenRouter:ApiKey (or OPEN_ROUTER_API_KEY) is not configured.");
var openAIClientOptions = new OpenAIClientOptions { Endpoint = new Uri(endpoint) };
var credential = new ApiKeyCredential(apiKey);

Expand Down
4 changes: 2 additions & 2 deletions 0-Agents/AgentsWebUI/Components/Pages/Agent19.razor
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@

protected override Task OnInitializedAsync()
{
var apiKey = Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OPEN_ROUTER_API_KEY is not set.");
var apiKey = Configuration["OpenRouter:ApiKey"] ?? Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OpenRouter:ApiKey (or OPEN_ROUTER_API_KEY) is not configured.");
var openAIClientOptions = new OpenAIClientOptions { Endpoint = new Uri(endpoint) };
var credential = new ApiKeyCredential(apiKey);

Expand Down
4 changes: 2 additions & 2 deletions 0-Agents/AgentsWebUI/Components/Pages/Agent20.razor
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@

protected override Task OnInitializedAsync()
{
var apiKey = Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OPEN_ROUTER_API_KEY is not set.");
var apiKey = Configuration["OpenRouter:ApiKey"] ?? Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OpenRouter:ApiKey (or OPEN_ROUTER_API_KEY) is not configured.");
var openAIClientOptions = new OpenAIClientOptions { Endpoint = new Uri(endpoint) };
var credential = new ApiKeyCredential(apiKey);

Expand Down
4 changes: 2 additions & 2 deletions 0-Agents/AgentsWebUI/Components/Pages/Agent21.razor
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@

protected override Task OnInitializedAsync()
{
var apiKey = Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OPEN_ROUTER_API_KEY is not set.");
var apiKey = Configuration["OpenRouter:ApiKey"] ?? Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OpenRouter:ApiKey (or OPEN_ROUTER_API_KEY) is not configured.");
var openAIClientOptions = new OpenAIClientOptions { Endpoint = new Uri(endpoint) };
var credential = new ApiKeyCredential(apiKey);
var chatClient = new ChatClient(modelName, credential, openAIClientOptions);
Expand Down
4 changes: 2 additions & 2 deletions 0-Agents/AgentsWebUI/Components/Pages/Agent22.razor
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@

protected override Task OnInitializedAsync()
{
var apiKey = Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OPEN_ROUTER_API_KEY is not set.");
var apiKey = Configuration["OpenRouter:ApiKey"] ?? Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OpenRouter:ApiKey (or OPEN_ROUTER_API_KEY) is not configured.");
var openAIClientOptions = new OpenAIClientOptions { Endpoint = new Uri(endpoint) };
var credential = new ApiKeyCredential(apiKey);

Expand Down
4 changes: 2 additions & 2 deletions 0-Agents/AgentsWebUI/Components/Pages/Agent23.razor
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@

protected override Task OnInitializedAsync()
{
var apiKey = Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OPEN_ROUTER_API_KEY is not set.");
var apiKey = Configuration["OpenRouter:ApiKey"] ?? Configuration["OPEN_ROUTER_API_KEY"] ??
throw new InvalidOperationException("OpenRouter:ApiKey (or OPEN_ROUTER_API_KEY) is not configured.");
var openAIClientOptions = new OpenAIClientOptions { Endpoint = new Uri(endpoint) };
var credential = new ApiKeyCredential(apiKey);

Expand Down
4 changes: 3 additions & 1 deletion 0-Agents/AgentsWebUI/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"OPEN_ROUTER_API_KEY": "YOUR_OPENROUTER_API_KEY",
"OpenRouter": {
"ApiKey": "YOUR_OPENROUTER_API_KEY"
},
"Logging": {
"LogLevel": {
"Default": "Information",
Expand Down