This commit is contained in:
Dax Raad
2025-05-28 15:07:51 -04:00
parent 4767276a0e
commit ff786d9139
4 changed files with 275 additions and 5 deletions

View File

@@ -158,8 +158,47 @@ export namespace Server {
return c.json(sessions);
},
)
.post(
"/session_abort",
describeRoute({
description: "Abort a session",
responses: {
200: {
description: "Aborted session",
content: {
"application/json": {
schema: resolver(z.boolean()),
},
},
},
},
}),
zValidator(
"json",
z.object({
sessionID: z.string(),
}),
),
async (c) => {
const body = c.req.valid("json");
return c.json(Session.abort(body.sessionID));
},
)
.post(
"/session_chat",
describeRoute({
description: "Chat with a model",
responses: {
200: {
description: "Chat with a model",
content: {
"application/json": {
schema: resolver(SessionMessage),
},
},
},
},
}),
zValidator(
"json",
z.object({