fix web errors
This commit is contained in:
@@ -16,5 +16,4 @@ dependencies = [
|
|||||||
"docstring-parser>=0.17.0",
|
"docstring-parser>=0.17.0",
|
||||||
"jsonschema>=4.25.1",
|
"jsonschema>=4.25.1",
|
||||||
"copilotkit>=0.1.0",
|
"copilotkit>=0.1.0",
|
||||||
"ag-ui-langgraph>=0.0.4",
|
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
"""
|
"""
|
||||||
Self-hosted LangGraph agent server using CopilotKit AG-UI protocol.
|
Self-hosted LangGraph agent server using CopilotKit remote endpoint protocol.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
@@ -7,23 +7,24 @@ from fastapi import FastAPI
|
|||||||
import uvicorn
|
import uvicorn
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
from copilotkit import LangGraphAGUIAgent
|
from copilotkit import CopilotKitRemoteEndpoint, LangGraphAgent
|
||||||
from ag_ui_langgraph import add_langgraph_fastapi_endpoint
|
from copilotkit.integrations.fastapi import add_fastapi_endpoint
|
||||||
from main import graph
|
from main import graph
|
||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
||||||
app = FastAPI(title="Cavepedia Agent")
|
app = FastAPI(title="Cavepedia Agent")
|
||||||
|
|
||||||
add_langgraph_fastapi_endpoint(
|
sdk = CopilotKitRemoteEndpoint(
|
||||||
app=app,
|
agents=[
|
||||||
agent=LangGraphAGUIAgent(
|
LangGraphAgent(
|
||||||
name="vpi_1000",
|
name="vpi_1000",
|
||||||
description="AI assistant with access to cave-related information through the Cavepedia MCP server",
|
description="AI assistant with access to cave-related information through the Cavepedia MCP server",
|
||||||
graph=graph,
|
graph=graph,
|
||||||
),
|
|
||||||
path="/",
|
|
||||||
)
|
)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
add_fastapi_endpoint(app, sdk, "/copilotkit")
|
||||||
|
|
||||||
|
|
||||||
@app.get("/health")
|
@app.get("/health")
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ const serviceAdapter = new ExperimentalEmptyAdapter();
|
|||||||
const runtime = new CopilotRuntime({
|
const runtime = new CopilotRuntime({
|
||||||
remoteEndpoints: [
|
remoteEndpoints: [
|
||||||
{
|
{
|
||||||
url: process.env.LANGGRAPH_DEPLOYMENT_URL || "http://localhost:8000",
|
url: `${process.env.LANGGRAPH_DEPLOYMENT_URL || "http://localhost:8000"}/copilotkit`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export default function RootLayout({
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<body className={"antialiased"}>
|
<body className={"antialiased"}>
|
||||||
<Auth0Provider>
|
<Auth0Provider>
|
||||||
<CopilotKit runtimeUrl="/api/copilotkit">
|
<CopilotKit runtimeUrl="/api/copilotkit" agent="vpi_1000">
|
||||||
{children}
|
{children}
|
||||||
</CopilotKit>
|
</CopilotKit>
|
||||||
</Auth0Provider>
|
</Auth0Provider>
|
||||||
|
|||||||
Reference in New Issue
Block a user