This commit is contained in:
Dax Raad
2025-05-18 22:30:41 -04:00
parent 020e0ca039
commit 99af6146d5
80 changed files with 13944 additions and 295 deletions

View File

@@ -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<typeof Info>;
export type Message = UIMessage<{ sessionID: string }>;