-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Copy link
Description
I am building a web app using Microsoft Agent Framework AG-UI and CopilotKit.
After running the MCP tools, a warning appears on the screen.Starting from agent-framework version 1.0.0b260116, this warning started appearing.
Warning: Run ended without emitting a terminal event.
It did not appear in version 1.0.0b260114.
Could you please look into this? Thank you.
Source code (Backend)
from __future__ import annotations
import logging
import os
from typing import Any
import uvicorn
from agent_framework import ChatAgent, MCPStreamableHTTPTool
from agent_framework.azure import AzureOpenAIChatClient
from agent_framework_ag_ui import (AgentFrameworkAgent,
add_agent_framework_fastapi_endpoint)
from app.config import settings
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
chat_client = AzureOpenAIChatClient(credential=AzureCliCredential())
app = FastAPI(title="CopilotKit + Microsoft Agent Framework (Python)")
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
get_datetime_mcp = MCPStreamableHTTPTool(
name="get-datetime-mcp",
url="http://localhost:8001/mcp",
)
base_agent = ChatAgent(
name="MyAgent",
instructions="You are a helpful AI Agent.",
chat_client=chat_client,
tools=[get_datetime_mcp],
)
add_agent_framework_fastapi_endpoint(
app=app,
agent=AgentFrameworkAgent(
agent=base_agent,
name="MyAgent",
description="Helpful AI Agent",
),
path="/api/v1/agents/my-agent",
)
if __name__ == "__main__":
host = os.getenv("AGENT_HOST", "0.0.0.0")
port = int(os.getenv("AGENT_PORT", "8000"))
uvicorn.run("sample4:app", host=host, port=port, reload=True)Source code (Frontend)
'use client';
import { CopilotKit } from '@copilotkit/react-core';
import { CopilotChat } from '@copilotkit/react-ui';
const Home = () => {
return (
<CopilotKit runtimeUrl="/master-agent/api/copilotkit" agent="my_agent">
<CopilotKitPage />
</CopilotKit>
);
};
const CopilotKitPage = () => {
return (
<div className="flex h-full w-full flex-1 items-center justify-center">
<div className="h-full w-full rounded-lg">
<CopilotChat
className="mx-auto h-full max-w-6xl rounded-2xl"
labels={{ initial: "Hi, I'm an agent specialized in helping you with your tasks. How can I help you?" }}
></CopilotChat>
</div>
</div>
);
};
export default Home;Version information
Python 3.13.10
agent-framework-ag-ui==1.0.0b260116
agent-framework-core==1.0.0b260116
@copilotkit/react-core: 1.51.2
@copilotkit/react-ui: 1.51.2
Thank you in advance.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Type
Projects
Status
Done
