fix builds
All checks were successful
Build and Push Agent Docker Image / build (push) Successful in 55s
Build and Push Web Docker Image / build (push) Successful in 3m35s

This commit is contained in:
2025-12-13 00:18:50 +01:00
förälder 17802994a5
incheckning 4fd346cb20
2 ändrade filer med 10 tillägg och 26 borttagningar

Visa fil

@@ -17,8 +17,10 @@ app = FastAPI(title="Cavepedia Agent")
def build_agents(context):
"""Build agents with auth context from frontend."""
"""Build agents with auth context from properties."""
# Get user roles from frontend properties
user_roles = context.get("properties", {}).get("auth0_user_roles", [])
return [
LangGraphAgent(
name="vpi_1000",

Visa fil

@@ -5,36 +5,18 @@ import {
} from "@copilotkit/runtime";
import { NextRequest } from "next/server";
import { auth0 } from "@/lib/auth0";
// 1. You can use any service adapter here for multi-agent support. We use
// the empty adapter since we're only using one agent.
const serviceAdapter = new ExperimentalEmptyAdapter();
// 3. Build a Next.js API route that handles the CopilotKit runtime requests.
export const POST = async (req: NextRequest) => {
// Get Auth0 session
const session = await auth0.getSession();
// Extract roles from session
const userRoles = session?.user?.roles || [];
console.log("[copilotkit] session exists:", !!session);
console.log("[copilotkit] userRoles:", userRoles);
// 2. Create the CopilotRuntime instance with remote endpoint
const runtime = new CopilotRuntime({
remoteEndpoints: [
{
url: `${process.env.LANGGRAPH_DEPLOYMENT_URL || "http://localhost:8000"}/copilotkit`,
},
],
// Pass auth context as properties to the remote endpoint
properties: {
auth0_user_roles: userRoles,
const runtime = new CopilotRuntime({
remoteEndpoints: [
{
url: `${process.env.LANGGRAPH_DEPLOYMENT_URL || "http://localhost:8000"}/copilotkit`,
},
});
],
});
export const POST = async (req: NextRequest) => {
const { handleRequest } = copilotRuntimeNextJSAppRouterEndpoint({
runtime,
serviceAdapter,