Create Embedding

Go to Product

Creates an embedding vector representing the input text.

Options

Body

Request body which must comply to the following JSON Schema:

{
  "required" : [ "input", "model" ],
  "type" : "object",
  "properties" : {
    "input" : {
      "description" : "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. The input must not exceed the max input tokens for the model (8192 tokens for `text-embedding-ada-002`), cannot be an empty string, and any array must be 2048 dimensions or less. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens.\n",
      "example" : "The quick brown fox jumped over the lazy dog",
      "oneOf" : [ {
        "title" : "string",
        "type" : "string",
        "description" : "The string that will be turned into an embedding.",
        "example" : "This is a test.",
        "default" : ""
      }, {
        "title" : "array",
        "maxItems" : 2048,
        "minItems" : 1,
        "type" : "array",
        "description" : "The array of strings that will be turned into an embedding.",
        "items" : {
          "type" : "string",
          "example" : "['This is a test.']",
          "default" : ""
        }
      }, {
        "title" : "array",
        "maxItems" : 2048,
        "minItems" : 1,
        "type" : "array",
        "description" : "The array of integers that will be turned into an embedding.",
        "example" : "[1212, 318, 257, 1332, 13]",
        "items" : {
          "type" : "integer"
        }
      }, {
        "title" : "array",
        "maxItems" : 2048,
        "minItems" : 1,
        "type" : "array",
        "description" : "The array of arrays containing integers that will be turned into an embedding.",
        "example" : "[[1212, 318, 257, 1332, 13]]",
        "items" : {
          "minItems" : 1,
          "type" : "array",
          "items" : {
            "type" : "integer"
          }
        }
      } ],
      "x-oaiExpandable" : true
    },
    "model" : {
      "description" : "model_description",
      "example" : "text-embedding-3-small",
      "anyOf" : [ {
        "type" : "string"
      }, {
        "type" : "string",
        "enum" : [ "text-embedding-ada-002", "text-embedding-3-small", "text-embedding-3-large" ]
      } ],
      "x-oaiTypeLabel" : "string"
    },
    "encoding_format" : {
      "type" : "string",
      "description" : "The format to return the embeddings in. Can be either `float` or [`base64`](https://pypi.org/project/pybase64/).",
      "example" : "float",
      "default" : "float",
      "enum" : [ "float", "base64" ]
    },
    "dimensions" : {
      "minimum" : 1,
      "type" : "integer",
      "description" : "The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models.\n"
    }
  },
  "additionalProperties" : false
}
Result Format

Specify how the response should be mapped to the table output. The following formats are available:

Raw Response: Returns the raw response in a single row with the following columns:

  • body: Response body
  • status: HTTP status code

Input Ports

Icon
Configuration data.

Output Ports

Icon
Result of the request depending on the selected Result Format.
Icon
Configuration data (this is the same as the input port; it is provided as passthrough for sequentially chaining nodes to declutter your workflow connections).

Popular Predecessors

  • No recommendations found

Popular Successors

Views

This node has no views

Workflows

Links

Developers

You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.