cleanup
This commit is contained in:
@@ -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<string, Agent> = {
|
||||
assistant: personalAssistantAgent,
|
||||
|
||||
Reference in New Issue
Block a user