From 9766782648617e232fbc4e40ea96a0e567c7cc73 Mon Sep 17 00:00:00 2001 From: polwex Date: Wed, 23 Jul 2025 05:41:58 +0700 Subject: something like that. man anthropic is old --- src/types/index.ts | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'src/types/index.ts') diff --git a/src/types/index.ts b/src/types/index.ts index b276457..6c16e0d 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,4 +1,3 @@ -import type OpenAI from "openai"; import type { AsyncRes } from "sortug"; export type ChatMessage = { author: string; @@ -7,23 +6,35 @@ export type ChatMessage = { reasoning?: string; }; +export type InputToken = { text: string } | { img: string }; +// me +export type RequestOptions = { + textOutput: boolean; +}; +export const defaultOptions: RequestOptions = { + textOutput: true, +}; // openai -export type OChoice = OpenAI.Chat.Completions.ChatCompletion.Choice; -export type OChunk = OpenAI.Chat.Completions.ChatCompletionChunk.Choice; -export type OMessage = OpenAI.Chat.Completions.ChatCompletionMessageParam; export type ContentType = { text: string } | { audio: Response }; -export type AIModelChoice = - | { name: "deepseek" | "chatgpt" | "claude" | "gemini" | "grok" } - | { other: { baseURL: string; apiKey: string } }; + export interface AIModelAPI { setModel: (model: string) => void; tokenizer: (text: string) => number; maxTokens: number; - send: (systemPrompt: string, input: ChatMessage[]) => AsyncRes; + send: (input: string, systemPrompt?: string) => AsyncRes; stream: ( - systemPrompt: string, - input: ChatMessage[], - handler: (data: any) => void, + input: string, + handler: (data: string) => void, + systemPrompt?: string, ) => void; } + +export type LLMChoice = + | { gemini: string } + | { claude: string } + | { chatgpt: string } + | { grok: string } + | { deepseek: string } + | { kimi: string } + | { openai: { url: string; apiKey: string; model: string } }; -- cgit v1.2.3