UNPKG

@xsai/embed

Version:

extra-small AI SDK.

41 lines (37 loc) 1.12 kB
import { CommonRequestOptions } from '@xsai/shared'; interface EmbedOptions extends CommonRequestOptions { [key: string]: unknown; input: string; } interface EmbedResponse { data: { embedding: number[]; index: number; object: 'embedding'; }[]; model: string; object: 'list' | (string & {}); system_fingerprint?: string; usage: EmbedResponseUsage; } interface EmbedResponseUsage { prompt_tokens: number; total_tokens: number; } interface EmbedResult { embedding: number[]; input: string; usage: EmbedResponseUsage; } declare const embed: (options: EmbedOptions) => Promise<EmbedResult>; interface EmbedManyOptions extends CommonRequestOptions { [key: string]: unknown; input: string[]; } interface EmbedManyResult { embeddings: number[][]; input: string[]; usage: EmbedResponseUsage; } declare const embedMany: (options: EmbedManyOptions) => Promise<EmbedManyResult>; export { type EmbedManyOptions, type EmbedManyResult, type EmbedOptions, type EmbedResponse, type EmbedResponseUsage, type EmbedResult, embed, embedMany };