From cb523bbe3597f0ea0fb9e84af68698d3e52937d1 Mon Sep 17 00:00:00 2001 From: Avraham Sakal Date: Fri, 2 May 2025 12:03:48 -0400 Subject: [PATCH] cleanup --- server/worker.ts | 21 --------------------- src/main.tsx | 2 -- src/routes/__root.tsx | 1 - src/routes/index.tsx | 1 - 4 files changed, 25 deletions(-) diff --git a/server/worker.ts b/server/worker.ts index 75cb3e6..29167bb 100644 --- a/server/worker.ts +++ b/server/worker.ts @@ -23,27 +23,6 @@ const app = new Hono(); const openrouter = createOpenRouter({ apiKey: import.meta.env.VITE_OPENROUTER_API_KEY || env.OPENROUTER_API_KEY, }); -const systemMessage = { - role: "system", - content: - "You are a wise old man named Dorf that answers questions succintly.", -}; - -app.post("/api/chat", async (c) => { - const input = await c.req.json(); - console.log(input); - const result = streamText({ - model: openrouter("mistral/ministral-8b"), - messages: [systemMessage, ...input.messages], - tools: {}, - }); - - // Mark the response as a v1 data stream: - c.header("X-Vercel-AI-Data-Stream", "v1"); - c.header("Content-Type", "text/plain; charset=utf-8"); - - return stream(c, (stream) => stream.pipe(result.toDataStream())); -}); const agentsByName: Record = { assistant: personalAssistantAgent, diff --git a/src/main.tsx b/src/main.tsx index bd7430a..05e4947 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -5,8 +5,6 @@ import { RouterProvider, createRouter } from "@tanstack/react-router"; import { routeTree } from "./routeTree.gen"; import "virtual:uno.css"; -// import App from "./App.tsx"; - // Create a new router instance const router = createRouter({ routeTree }); diff --git a/src/routes/__root.tsx b/src/routes/__root.tsx index bc5e20d..cdc6ede 100644 --- a/src/routes/__root.tsx +++ b/src/routes/__root.tsx @@ -1,6 +1,5 @@ import { createRootRoute, Link, Outlet } from "@tanstack/react-router"; import { TanStackRouterDevtools } from "@tanstack/react-router-devtools"; -// import "./__root.css"; export const Route = createRootRoute({ component: () => ( diff --git a/src/routes/index.tsx b/src/routes/index.tsx index b6c56ad..2333505 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -2,7 +2,6 @@ import { createFileRoute } from "@tanstack/react-router"; import { useState } from "react"; import reactLogo from "../assets/react.svg"; import viteLogo from "/vite.svg"; -// import "./index.css"; export const Route = createFileRoute("/")({ component: App,