@@ -10,6 +10,8 @@ pip install agent-framework-ag-ui
1010
1111## Quick Start
1212
13+ ### Server (Host an AI Agent)
14+
1315``` python
1416from fastapi import FastAPI
1517from agent_framework import ChatAgent
@@ -23,6 +25,7 @@ agent = ChatAgent(
2325 chat_client = AzureOpenAIChatClient(
2426 endpoint = " https://your-resource.openai.azure.com/" ,
2527 deployment_name = " gpt-4o-mini" ,
28+ api_key = " your-api-key" ,
2629 ),
2730)
2831
@@ -33,9 +36,38 @@ add_agent_framework_fastapi_endpoint(app, agent, "/")
3336# Run with: uvicorn main:app --reload
3437```
3538
39+ ### Client (Connect to an AG-UI Server)
40+
41+ ``` python
42+ import asyncio
43+ from agent_framework import TextContent
44+ from agent_framework_ag_ui import AGUIChatClient
45+
46+ async def main ():
47+ async with AGUIChatClient(endpoint = " http://localhost:8000/" ) as client:
48+ # Stream responses
49+ async for update in client.get_streaming_response(" Hello!" ):
50+ for content in update.contents:
51+ if isinstance (content, TextContent):
52+ print (content.text, end = " " , flush = True )
53+ print ()
54+
55+ asyncio.run(main())
56+ ```
57+
58+ The ` AGUIChatClient ` supports:
59+ - Streaming and non-streaming responses
60+ - Hybrid tool execution (client-side + server-side tools)
61+ - Automatic thread management for conversation continuity
62+ - Integration with ` ChatAgent ` for client-side history management
63+
3664## Documentation
3765
38- - ** [ Getting Started Tutorial] ( getting_started/ ) ** - Step-by-step guide to building your first AG-UI server and client
66+ - ** [ Getting Started Tutorial] ( getting_started/ ) ** - Step-by-step guide to building AG-UI servers and clients
67+ - Server setup with FastAPI
68+ - Client examples using ` AGUIChatClient `
69+ - Hybrid tool execution (client-side + server-side)
70+ - Thread management and conversation continuity
3971- ** [ Examples] ( agent_framework_ag_ui_examples/ ) ** - Complete examples for AG-UI features
4072
4173## Features
0 commit comments