From 99af6146d5def31c59993636d60eb75a483a283b Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Sun, 18 May 2025 22:30:41 -0400 Subject: openapi --- js/src/session/session.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'js/src/session') diff --git a/js/src/session/session.ts b/js/src/session/session.ts index fb45f0e59..e86048b1c 100644 --- a/js/src/session/session.ts +++ b/js/src/session/session.ts @@ -1,5 +1,4 @@ import path from "path"; -import { z } from "zod/v3"; import { App } from "../app/"; import { Identifier } from "../id/id"; import { LLM } from "../llm/llm"; @@ -8,26 +7,27 @@ import { Log } from "../util/log"; import { convertToModelMessages, streamText, - tool, type TextUIPart, type ToolInvocationUIPart, type UIDataTypes, type UIMessage, type UIMessagePart, } from "ai"; +import { z } from "zod"; export namespace Session { const log = Log.create({ service: "session" }); - export interface Info { - id: string; - title: string; - tokens: { - input: number; - output: number; - reasoning: number; - }; - } + export const Info = z.object({ + id: Identifier.schema("session"), + title: z.string(), + tokens: z.object({ + input: z.number(), + output: z.number(), + reasoning: z.number(), + }), + }); + export type Info = z.output; export type Message = UIMessage<{ sessionID: string }>; -- cgit v1.2.3