forked from CopilotKit/CopilotKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.py
More file actions
28 lines (22 loc) · 743 Bytes
/
Copy pathdemo.py
File metadata and controls
28 lines (22 loc) · 743 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""Demo"""
from dotenv import load_dotenv
load_dotenv() # pylint: disable=wrong-import-position
from fastapi import FastAPI
import uvicorn
from copilotkit.integrations.fastapi import add_fastapi_endpoint
from copilotkit import CopilotKitSDK, LangGraphAgent
from copilotkit.demos.wait_user_input.agent import graph
app = FastAPI()
sdk = CopilotKitSDK(
agents=[
LangGraphAgent(
name="weather_agent",
description="This agent deals with everything weather related",
graph=graph,
)
],
)
add_fastapi_endpoint(app, sdk, "/copilotkit")
def main():
"""Run the uvicorn server."""
uvicorn.run("copilotkit.demos.wait_user_input.demo:app", host="127.0.0.1", port=8000, reload=True)