mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
adds devui integration and samples
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using Azure.Identity;
|
||||
using Microsoft.Agents.AI.Hosting;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
builder.AddServiceDefaults();
|
||||
|
||||
builder.AddAzureChatCompletionsClient(connectionName: "foundry",
|
||||
configureSettings: settings =>
|
||||
{
|
||||
settings.TokenCredential = new DefaultAzureCredential();
|
||||
settings.EnableSensitiveTelemetryData = true;
|
||||
})
|
||||
.AddChatClient("gpt-4.1");
|
||||
|
||||
builder.AddAIAgent("writer", "You write short stories (300 words or less) about the specified topic.");
|
||||
|
||||
// Register services for OpenAI responses and conversations
|
||||
builder.Services.AddOpenAIResponses();
|
||||
builder.Services.AddOpenAIConversations();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
// Map OpenAI API endpoints — DevUI aggregator routes requests here
|
||||
app.MapOpenAIResponses();
|
||||
app.MapOpenAIConversations();
|
||||
|
||||
app.MapDefaultEndpoints();
|
||||
|
||||
app.Run();
|
||||
Reference in New Issue
Block a user