summaryrefslogtreecommitdiff
path: root/src/types/index.ts
diff options
context:
space:
mode:
authorpolwex <polwex@sortug.com>2025-07-23 05:41:58 +0700
committerpolwex <polwex@sortug.com>2025-07-23 05:41:58 +0700
commit9766782648617e232fbc4e40ea96a0e567c7cc73 (patch)
tree084943c250a0ad6d7a3227a6b10b237ee07b2388 /src/types/index.ts
parent42dd99bfac9777a4ecc6700b87edf26a5c984de6 (diff)
something like that. man anthropic is old
Diffstat (limited to 'src/types/index.ts')
-rw-r--r--src/types/index.ts33
1 files changed, 22 insertions, 11 deletions
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<string[]>;
+ send: (input: string, systemPrompt?: string) => AsyncRes<string>;
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 } };