Browse Source

add summarize

Dax Raad 9 months ago
parent
commit
e68747a64a
1 changed files with 29 additions and 0 deletions
  1. 29 0
      js/src/server/server.ts

+ 29 - 0
js/src/server/server.ts

@@ -195,6 +195,35 @@ export namespace Server {
           return c.json(Session.abort(body.sessionID));
         },
       )
+      .post(
+        "/session_summarize",
+        describeRoute({
+          description: "Summarize the session",
+          responses: {
+            200: {
+              description: "Summarize the session",
+              content: {
+                "application/json": {
+                  schema: resolver(z.boolean()),
+                },
+              },
+            },
+          },
+        }),
+        zValidator(
+          "json",
+          z.object({
+            sessionID: z.string(),
+            providerID: z.string(),
+            modelID: z.string(),
+          }),
+        ),
+        async (c) => {
+          const body = c.req.valid("json");
+          await Session.summarize(body);
+          return c.json(true);
+        },
+      )
       .post(
         "/session_chat",
         describeRoute({