// File generated from our OpenAPI spec by sdkgen. See CONTRIBUTING.md for details. import { APIResource } from '../core/resource'; import * as TopLevelAPI from './top-level'; import { APIPromise } from '../core/api-promise'; import { RequestOptions } from '../internal/request-options'; export class Embeddings extends APIResource { /** * Create embeddings for text or images using the specified model, encoding format, * and normalization. * * Args: params: The parameters for creating embeddings. * * Returns: EmbeddingCreateResponse: The response containing the embeddings. */ create( body: EmbeddingCreateParams, options?: RequestOptions, ): APIPromise { return this._client.post('/v1/embeddings', { body, ...options }); } } /** * Enumeration of encoding formats. */ export type EncodingFormat = 'float' | 'float16' | 'base64' | 'binary' | 'ubinary' | 'int8' | 'uint8'; export interface EmbeddingCreateParams { /** * The model to use for creating embeddings. */ model: string; /** * The input to create embeddings for. */ input: string | Array; /** * The number of dimensions to use for the embeddings. */ dimensions?: number | null; /** * The prompt to use for the embedding creation. */ prompt?: string | null; /** * Whether to normalize the embeddings. */ normalized?: boolean; /** * The encoding format(s) of the embeddings. Can be a single format or a list of * formats. */ encoding_format?: EncodingFormat | Array; } export declare namespace Embeddings { export { type EncodingFormat as EncodingFormat, type EmbeddingCreateParams as EmbeddingCreateParams }; }