mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
fix and unify devui samples (#5025)
This commit is contained in:
committed by
GitHub
Unverified
parent
cee0a458fe
commit
2cb78ea12e
@@ -20,6 +20,7 @@ from agent_framework import (
|
||||
)
|
||||
from agent_framework.devui import serve
|
||||
from agent_framework.foundry import FoundryChatClient
|
||||
from azure.identity.aio import AzureCliCredential
|
||||
from dotenv import load_dotenv
|
||||
from typing_extensions import Never
|
||||
|
||||
@@ -80,14 +81,13 @@ def main():
|
||||
|
||||
# Create Azure OpenAI chat client
|
||||
client = FoundryChatClient(
|
||||
api_key=os.environ.get("AZURE_OPENAI_API_KEY"),
|
||||
model=os.environ["FOUNDRY_MODEL"],
|
||||
endpoint=os.environ.get("AZURE_OPENAI_ENDPOINT"),
|
||||
api_version=os.environ.get("AZURE_OPENAI_API_VERSION", "2024-10-21"),
|
||||
project_endpoint=os.environ.get("FOUNDRY_PROJECT_ENDPOINT"),
|
||||
credential=AzureCliCredential(),
|
||||
)
|
||||
|
||||
# Create agents
|
||||
weather_agent = Agent(
|
||||
weather_assistant = Agent(
|
||||
name="weather-assistant",
|
||||
description="Provides weather information and time",
|
||||
instructions=(
|
||||
@@ -120,7 +120,7 @@ def main():
|
||||
)
|
||||
|
||||
# Collect entities for serving
|
||||
entities = [weather_agent, simple_agent, basic_workflow]
|
||||
entities = [weather_assistant, simple_agent, basic_workflow]
|
||||
|
||||
logger.info("Starting DevUI on http://localhost:8090")
|
||||
logger.info("Entities available:")
|
||||
|
||||
Reference in New Issue
Block a user