mirror of
https://github.com/eliasstepanik/core.git
synced 2026-01-10 08:58:31 +00:00
* Feat: v2 * feat: add chat functionality * First cut: integrations * Feat: add conversation API * Enhance conversation handling and memory management * Feat: added conversation --------- Co-authored-by: Manoj K <saimanoj58@gmail.com>
22 lines
550 B
TypeScript
22 lines
550 B
TypeScript
import { json } from "@remix-run/node";
|
|
|
|
import { createActionApiRoute } from "~/services/routeBuilders/apiBuilder.server";
|
|
import { addToQueue, IngestBodyRequest } from "~/lib/ingest.server";
|
|
|
|
const { action, loader } = createActionApiRoute(
|
|
{
|
|
body: IngestBodyRequest,
|
|
allowJWT: true,
|
|
authorization: {
|
|
action: "ingest",
|
|
},
|
|
corsStrategy: "all",
|
|
},
|
|
async ({ body, authentication }) => {
|
|
const response = addToQueue(body, authentication.userId);
|
|
return json({ ...response });
|
|
},
|
|
);
|
|
|
|
export { action, loader };
|