Refactor agents api integration

This commit is contained in:
ramnique 2025-03-20 17:05:13 +05:30 committed by Ramnique Singh
parent 0e31098d58
commit a02c830fb0
14 changed files with 131 additions and 1121 deletions

View file

@ -1,8 +1,8 @@
import { Metadata } from "next";
import { App } from "./app";
import { USE_RAG } from "@/app/lib/feature_flags";
export const dynamic = 'force-dynamic';
import { projectsCollection } from "@/app/lib/mongodb";
import { notFound } from "next/navigation";
export const metadata: Metadata = {
title: "Workflow"
@ -13,8 +13,18 @@ export default async function Page({
}: {
params: { projectId: string };
}) {
const project = await projectsCollection.findOne({
_id: params.projectId,
});
if (!project) {
notFound();
}
const toolWebhookUrl = project.webhookUrl ?? '';
return <App
projectId={params.projectId}
useRag={USE_RAG}
mcpServerUrls={project.mcpServers ?? []}
toolWebhookUrl={toolWebhookUrl}
/>;
}