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
5 changes: 2 additions & 3 deletions src/agent.invoker/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"gpt-4o": "",
"GitAI": "",

"o4-mini": "",
"o4-mini-url": "",
"gpt-4o-url": "",
"AgentProjectEndpoint": "",
"Authentication": {
"ClientId": "",
"ClientSecret": "",
Expand Down
6 changes: 4 additions & 2 deletions src/agents/shipment.agents/Booking/BookingAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
using Azure.Identity;

using infrastructure;

using Microsoft.Extensions.Configuration;
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.Agents;
using Microsoft.SemanticKernel.Agents.AzureAI;
Expand All @@ -13,15 +15,15 @@
namespace shipment.agents.Capacity
{
[Experimental("SKEXP0110")]
public class BookingAgent(IMCPClientFactory clientFactory): IAgent
public class BookingAgent(IMCPClientFactory clientFactory,IConfiguration configuration): IAgent
{
public Agent CreateAgents(Kernel kernel)
{
var bookingClient = clientFactory.CreateBookingClient().GetAwaiter().GetResult();
var bookingTools = bookingClient.ListToolsAsync().GetAwaiter().GetResult();


AIProjectClient projectClient = new(new Uri("https://nucle-mbdqap7c-southeastasia.services.ai.azure.com/api/projects/nucleotidz-agents"), new DefaultAzureCredential());
AIProjectClient projectClient = new(new Uri(configuration["AgentProjectEndpoint"]), new DefaultAzureCredential());
PersistentAgentsClient agentsClient = projectClient.GetPersistentAgentsClient();
PersistentAgent definition = agentsClient.Administration.GetAgent("asst_cHq3ktGxobYrOgHCrstiVo06");
AzureAIAgent agent = new(definition, agentsClient)
Expand Down
6 changes: 4 additions & 2 deletions src/agents/shipment.agents/Capacity/CapacityAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
using Azure.Identity;

using infrastructure;

using Microsoft.Extensions.Configuration;
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.Agents;
using Microsoft.SemanticKernel.Agents.AzureAI;
Expand All @@ -12,15 +14,15 @@
namespace shipment.agents.Capacity
{
[Experimental("SKEXP0110")]
public class CapacityAgent(IMCPClientFactory clientFactory): IAgent
public class CapacityAgent(IMCPClientFactory clientFactory,IConfiguration configuration): IAgent
{
public Agent CreateAgents(Kernel kernel)
{
var capacityClient = clientFactory.CreateCapacityClient().GetAwaiter().GetResult();
var capacityTools = capacityClient.ListToolsAsync().GetAwaiter().GetResult();


AIProjectClient projectClient = new(new Uri("https://nucle-mbdqap7c-southeastasia.services.ai.azure.com/api/projects/nucleotidz-agents"), new DefaultAzureCredential());
AIProjectClient projectClient = new(new Uri(configuration["AgentProjectEndpoint"]), new DefaultAzureCredential());
PersistentAgentsClient agentsClient = projectClient.GetPersistentAgentsClient();
PersistentAgent definition = agentsClient.Administration.GetAgent("asst_QWOr2oHmxiwcsguWbiUO1szR");
AzureAIAgent agent = new(definition, agentsClient)
Expand Down
10 changes: 5 additions & 5 deletions src/agents/shipment.agents/Vessel/VesselAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
using Azure.Identity;

using infrastructure;

using Microsoft.Extensions.Configuration;
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.Agents;
using Microsoft.SemanticKernel.Agents.AzureAI;
Expand All @@ -13,15 +15,13 @@
namespace shipment.agents.Vessel
{
[Experimental("SKEXP0110")]
public class VesselAgent(IMCPClientFactory clientFactory): IAgent
public class VesselAgent(IMCPClientFactory clientFactory,IConfiguration configuration): IAgent
{
public Agent CreateAgents(Kernel kernel)
{
var vesselClient = clientFactory.CreateVesselClient().GetAwaiter().GetResult();
var vesselTools = vesselClient.ListToolsAsync().GetAwaiter().GetResult();


AIProjectClient projectClient = new(new Uri("https://nucle-mbdqap7c-southeastasia.services.ai.azure.com/api/projects/nucleotidz-agents"), new DefaultAzureCredential());
var vesselTools = vesselClient.ListToolsAsync().GetAwaiter().GetResult();
AIProjectClient projectClient = new(new Uri(configuration["AgentProjectEndpoint"]), new DefaultAzureCredential());
PersistentAgentsClient agentsClient = projectClient.GetPersistentAgentsClient();
PersistentAgent definition = agentsClient.Administration.GetAgent("asst_xByEOvS0eopXZyfkQp0AduxN");
AzureAIAgent agent = new(definition, agentsClient)
Expand Down
2 changes: 1 addition & 1 deletion src/infrastructure/DependencyInjection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
{
public static class DependencyInjection
{
public static IServiceCollection AddSemanticKernel(this IServiceCollection services, IConfiguration configuration, string connectorName = "o4-mini")
public static IServiceCollection AddSemanticKernel(this IServiceCollection services, IConfiguration configuration)
{
return services.AddTransient<Kernel>(serviceProvider =>
{
IKernelBuilder kernelBuilder = Kernel.CreateBuilder();
kernelBuilder.Services.AddAzureOpenAIChatCompletion("o4-mini",
configuration["o4-mini-url"],

Check warning on line 16 in src/infrastructure/DependencyInjection.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'endpoint' in 'IServiceCollection AzureOpenAIServiceCollectionExtensions.AddAzureOpenAIChatCompletion(IServiceCollection services, string deploymentName, string endpoint, string apiKey, string? serviceId = null, string? modelId = null, string? apiVersion = null, HttpClient? httpClient = null)'.
configuration["o4-mini"],

Check warning on line 17 in src/infrastructure/DependencyInjection.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'apiKey' in 'IServiceCollection AzureOpenAIServiceCollectionExtensions.AddAzureOpenAIChatCompletion(IServiceCollection services, string deploymentName, string endpoint, string apiKey, string? serviceId = null, string? modelId = null, string? apiVersion = null, HttpClient? httpClient = null)'.
"o4-mini",
"o4-mini");
return kernelBuilder.Build();
Expand Down
Loading