@ui-tars/sdk
Version:
A powerful cross-platform(ANY device/platform) toolkit for building GUI automation agents for UI-TARS
47 lines • 1.86 kB
TypeScript
import { type ClientOptions } from 'openai';
import { type ChatCompletionCreateParamsNonStreaming, type ChatCompletionCreateParamsBase, type ChatCompletionMessageParam } from 'openai/resources/chat/completions';
import { Model, type InvokeParams, type InvokeOutput } from './types';
import { UITarsModelVersion } from '@ui-tars/shared/types';
type OpenAIChatCompletionCreateParams = Omit<ClientOptions, 'maxRetries'> & Pick<ChatCompletionCreateParamsBase, 'model' | 'max_tokens' | 'temperature' | 'top_p'>;
export interface UITarsModelConfig extends OpenAIChatCompletionCreateParams {
/** Whether to use OpenAI Response API instead of Chat Completions API */
useResponsesApi?: boolean;
}
export interface ThinkingVisionProModelConfig extends ChatCompletionCreateParamsNonStreaming {
thinking?: {
type: 'enabled' | 'disabled';
};
}
export declare class UITarsModel extends Model {
protected readonly modelConfig: UITarsModelConfig;
constructor(modelConfig: UITarsModelConfig);
get useResponsesApi(): boolean;
private headImageContext;
/** [widthFactor, heightFactor] */
get factors(): [number, number];
get modelName(): string;
/**
* reset the model state
*/
reset(): void;
/**
* call real LLM / VLM Model
* @param params
* @param options
* @returns
*/
protected invokeModelProvider(uiTarsVersion: UITarsModelVersion | undefined, params: {
messages: Array<ChatCompletionMessageParam>;
previousResponseId?: string;
}, options: {
signal?: AbortSignal;
}, headers?: Record<string, string>): Promise<{
prediction: string;
costTime?: number;
costTokens?: number;
responseId?: string;
}>;
invoke(params: InvokeParams): Promise<InvokeOutput>;
}
export {};
//# sourceMappingURL=Model.d.ts.map