import OpenAI from "openai"; import { ChatCompletionMessage, ChatCompletionUserMessageParam, ChatCompletionSystemMessageParam, } from "openai/resources"; import { TailchatWsClient } from "tailchat-client-sdk"; export interface ImageMessage { role: "user"; content: [ { type: "text"; text: string; }, { type: "image_url"; image_url: { url: string; }; }, ]; } export type AnyChatCompletion = | ChatCompletionMessage | ChatCompletionUserMessageParam | ChatCompletionSystemMessageParam; export enum ImageSize { Small = "256x256", Medium = "512x512", Large = "1024x1024" } export type validImgAmount = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10; export interface ImageRequestData { model: Model; prompt: string; n?: validImgAmount; size?: ImageSize; } export interface ImagePrompt { client: TailchatWsClient; assistant: OpenAI; message: any; prompt: string; amount?: validImgAmount; size?: ImageSize; } export type Model = | "gpt-4" | "gpt-4-vision-preview" | "stablediffusion" | "stablediffusion-cpp" | "dall-e-3" | "jina-reranker-v1-base-en" | "text-embedding-ada-002"; export type Temperature = | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 1.0 | 1.1 | 1.2 | 1.3 | 1.4 | 1.5 | 1.6 | 1.7 | 1.8 | 1.9 | 2.0; export type Messages = Array;