CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
embeddings.d.mts113 linesDownload Raw Back to resources
1import { APIResource } from "../core/resource.mjs";2import { APIPromise } from "../core/api-promise.mjs";3import { RequestOptions } from "../internal/request-options.mjs";4export declare class Embeddings extends APIResource {5    /**6     * Creates an embedding vector representing the input text.7     *8     * @example9     * ```ts10     * const createEmbeddingResponse =11     *   await client.embeddings.create({12     *     input: 'The quick brown fox jumped over the lazy dog',13     *     model: 'text-embedding-3-small',14     *   });15     * ```16     */17    create(body: EmbeddingCreateParams, options?: RequestOptions): APIPromise<CreateEmbeddingResponse>;18}19export interface CreateEmbeddingResponse {20    /**21     * The list of embeddings generated by the model.22     */23    data: Array<Embedding>;24    /**25     * The name of the model used to generate the embedding.26     */27    model: string;28    /**29     * The object type, which is always "list".30     */31    object: 'list';32    /**33     * The usage information for the request.34     */35    usage: CreateEmbeddingResponse.Usage;36}37export declare namespace CreateEmbeddingResponse {38    /**39     * The usage information for the request.40     */41    interface Usage {42        /**43         * The number of tokens used by the prompt.44         */45        prompt_tokens: number;46        /**47         * The total number of tokens used by the request.48         */49        total_tokens: number;50    }51}52/**53 * Represents an embedding vector returned by embedding endpoint.54 */55export interface Embedding {56    /**57     * The embedding vector, which is a list of floats. The length of vector depends on58     * the model as listed in the59     * [embedding guide](https://platform.openai.com/docs/guides/embeddings).60     */61    embedding: Array<number>;62    /**63     * The index of the embedding in the list of embeddings.64     */65    index: number;66    /**67     * The object type, which is always "embedding".68     */69    object: 'embedding';70}71export type EmbeddingModel = 'text-embedding-ada-002' | 'text-embedding-3-small' | 'text-embedding-3-large';72export interface EmbeddingCreateParams {73    /**74     * Input text to embed, encoded as a string or array of tokens. To embed multiple75     * inputs in a single request, pass an array of strings or array of token arrays.76     * The input must not exceed the max input tokens for the model (8192 tokens for77     * all embedding models), cannot be an empty string, and any array must be 204878     * dimensions or less.79     * [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken)80     * for counting tokens. In addition to the per-input token limit, all embedding81     * models enforce a maximum of 300,000 tokens summed across all inputs in a single82     * request.83     */84    input: string | Array<string> | Array<number> | Array<Array<number>>;85    /**86     * ID of the model to use. You can use the87     * [List models](https://platform.openai.com/docs/api-reference/models/list) API to88     * see all of your available models, or see our89     * [Model overview](https://platform.openai.com/docs/models) for descriptions of90     * them.91     */92    model: (string & {}) | EmbeddingModel;93    /**94     * The number of dimensions the resulting output embeddings should have. Only95     * supported in `text-embedding-3` and later models.96     */97    dimensions?: number;98    /**99     * The format to return the embeddings in. Can be either `float` or100     * [`base64`](https://pypi.org/project/pybase64/).101     */102    encoding_format?: 'float' | 'base64';103    /**104     * A unique identifier representing your end-user, which can help OpenAI to monitor105     * and detect abuse.106     * [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids).107     */108    user?: string;109}110export declare namespace Embeddings {111    export { type CreateEmbeddingResponse as CreateEmbeddingResponse, type Embedding as Embedding, type EmbeddingModel as EmbeddingModel, type EmbeddingCreateParams as EmbeddingCreateParams, };112}113//# sourceMappingURL=embeddings.d.mts.map
basant307/AI_Governance_Project · CoolFace