import { OpenAI } from "https://deno.land/x/openai_deno@v0.9.8/mod.ts";
Creates an embedding vector representing the input text.
Parameters
ID of the model to use. You can use the OpenAI#listModels to see all of your available models, or see OpenAI's Model overview for descriptions of them.
Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. Each input must not exceed the max input tokens for the model (8191 tokens for text-embedding-ada-002
). Example Python code for counting tokens.
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.
Returns
Promise<CreateEmbeddingsResponse>
Embeddings for the input text.