core/apps/webapp/app/routes/api.v1.conversation.$conversationId.stream.tsx
Harshith Mullapudi 8836849310 1. Remove chat and deep-search from trigger
2. Add ai/sdk for chat UI
3. Added a better model manager
2025-10-26 01:10:28 +05:30

46 lines
1.3 KiB
XML

// import { json } from "@remix-run/node";
// import { createActionApiRoute } from "~/services/routeBuilders/apiBuilder.server";
// import { UI_MESSAGE_STREAM_HEADERS } from "ai";
// import { getConversationAndHistory } from "~/services/conversation.server";
// import { z } from "zod";
// import { createResumableStreamContext } from "resumable-stream";
// export const ConversationIdSchema = z.object({
// conversationId: z.string(),
// });
// const { action, loader } = createActionApiRoute(
// {
// params: ConversationIdSchema,
// allowJWT: true,
// authorization: {
// action: "oauth",
// },
// corsStrategy: "all",
// },
// async ({ authentication, params }) => {
// const conversation = await getConversationAndHistory(
// params.conversationId,
// authentication.userId,
// );
// const lastConversation = conversation?.ConversationHistory.pop();
// if (!lastConversation) {
// return json({}, { status: 204 });
// }
// const streamContext = createResumableStreamContext({
// waitUntil: null,
// });
// return new Response(
// await streamContext.resumeExistingStream(lastConversation.id),
// { headers: UI_MESSAGE_STREAM_HEADERS },
// );
// },
// );
// export { action, loader };