shitton of the ai changes
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
@@ -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,6 +1,5 @@
|
||||
export enum AiProvider {
|
||||
OLLAMA = "OLLAMA",
|
||||
GEMINI = "GEMINI",
|
||||
MISTRAL = "MISTRAL",
|
||||
OPENAI = "OPENAI",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
@@ -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>;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user