UNPKG

@ui-tars/sdk

Version:

A powerful cross-platform(ANY device/platform) toolkit for building GUI automation agents for UI-TARS

51 lines 1.75 kB
import { ChatCompletionMessageParam } from 'openai/resources/chat/completions'; import { Conversation, Message } from '@ui-tars/shared/types'; import { type Factors } from './constants'; /** * Parse box string to screen coordinates * * e.g. '[0.131,0.25,0.131,0.25]' 2560x1440 -> { x: 335.36, y: 360 } * * @param boxStr box string * @param screenWidth screen width * @param screenHeight screen height * @param factors scaling factor, the training space of the target model. * @returns screen coordinates */ export declare const parseBoxToScreenCoords: ({ boxStr, screenWidth, screenHeight, factors, }: { boxStr: string; screenWidth: number; screenHeight: number; factors?: Factors; }) => { x: null; y: null; } | { x: number; y: number; }; export declare const processVlmParams: (conversations: Message[], images: string[]) => { images: string[]; conversations: Message[]; }; export declare const toVlmModelFormat: ({ conversations, systemPrompt, }: { conversations: Conversation[]; systemPrompt: string; }) => { conversations: Message[]; images: string[]; }; export declare const getSummary: (prediction: string) => string; /** * convert conversations to OpenAI ChatCompletionMessageParam * @param conversations conversations * @param images images * @returns OpenAI ChatCompletionMessageParam */ export declare const convertToOpenAIMessages: ({ conversations, images, }: { conversations: Message[]; images: string[]; }) => Array<ChatCompletionMessageParam>; export declare function replaceBase64Prefix(base64: string): string; export declare function preprocessResizeImage(image_base64: string, maxPixels: number): Promise<string>; //# sourceMappingURL=utils.d.ts.map