shitton of the ai changes

This commit is contained in:
2026-05-01 04:54:11 +03:00
parent d95c37a322
commit 8cff086a8e
194 changed files with 29409 additions and 8841 deletions
+11 -2
View File
@@ -1,5 +1,14 @@
import {AiProvider} from "./ai-provider";
export type AiEndpointInfo = {
provider?: AiProvider;
baseUrl?: string;
external?: boolean;
};
export type AiCapabilityInfo = {
supported?: boolean,
external?: boolean,
model?: string
};
model?: string,
endpoint?: AiEndpointInfo,
};
+13 -5
View File
@@ -1,8 +1,16 @@
import {AiCapabilityInfo} from "./ai-capability-info";
export class AiModelCapabilities {
vision?: AiCapabilityInfo;
ocr?: AiCapabilityInfo;
thinking?: AiCapabilityInfo;
tools?: AiCapabilityInfo;
}
chat: AiCapabilityInfo | undefined;
vision: AiCapabilityInfo | undefined;
ocr: AiCapabilityInfo | undefined;
thinking: AiCapabilityInfo | undefined;
extendedThinking: AiCapabilityInfo | undefined;
tools: AiCapabilityInfo | undefined;
toolRank: AiCapabilityInfo | undefined;
audio: AiCapabilityInfo | undefined;
documents: AiCapabilityInfo | undefined;
outputImages: AiCapabilityInfo | undefined;
speechToText: AiCapabilityInfo | undefined;
textToSpeech: AiCapabilityInfo | undefined;
}
+1 -2
View File
@@ -1,6 +1,5 @@
export enum AiProvider {
OLLAMA = "OLLAMA",
GEMINI = "GEMINI",
MISTRAL = "MISTRAL",
OPENAI = "OPENAI",
}
}
+2 -3
View File
@@ -1,8 +1,7 @@
export type OllamaRequest = {
uuid: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
stream: any;
stream: boolean | string | number | object | null | undefined;
done: boolean;
fromId: number;
chatId: number;
}
}
+17
View File
@@ -0,0 +1,17 @@
import type {AiProvider} from "./ai-provider";
export type StoredAiRequestStatus = "running" | "succeeded" | "failed" | "aborted";
export type StoredAiRequest = {
requestId: string;
chatId: number;
messageId: number;
responseMessageId?: number | null;
fromId: number;
provider: AiProvider;
model: string;
status: StoredAiRequestStatus;
startedAt: string;
finishedAt?: string | null;
error?: string | null;
};
+16
View File
@@ -0,0 +1,16 @@
export type StoredAttachmentKind = "image" | "document" | "audio" | "video" | "video-note";
export type StoredAttachment = {
kind: StoredAttachmentKind;
fileId: string;
fileUniqueId?: string;
fileName: string;
mimeType?: string;
cachePath: string;
sizeBytes?: number;
sha256?: string;
scope?: "user_input" | "bot_output" | "internal_artifact";
artifactKind?: "rag" | "transcript" | "tool_result" | "generated_file" | "tts_audio" | "final_text" | "error";
metadata?: Record<string, unknown>;
};
+9 -3
View File
@@ -1,9 +1,15 @@
import {StoredAttachment} from "./stored-attachment";
import type {PipelineAuditEvent} from "../ai/user-request-pipeline";
export type StoredMessage = {
chatId: number;
id: number;
replyToMessageId?: number;
fromId: number;
text?: string;
text?: string | null;
quoteText?: string | null;
date: number;
photoMaxSizeFilePath?: string[];
};
deletedByBotAt?: number | null;
attachments?: StoredAttachment[] | null;
pipelineAudit?: PipelineAuditEvent[] | null;
};
+8 -1
View File
@@ -5,4 +5,11 @@ export type StoredUser = {
lastName?: string;
userName?: string;
isPremium?: boolean;
}
langCode?: string;
interfaceLanguage?: string;
aiProvider?: string;
aiResponseLanguage?: string;
aiContextSize?: number;
aiVoiceMode?: string;
aiImageOutputMode?: string;
}