This page provides an overview of APIs related to generating embeddings.

Embeddings are generated as part of the standard processing pipeline using the View Embeddings server. To generate embeddings manually, call POST /v1.0/embeddings on the View Embeddings server, which by default listens on port 8301.

An embeddings request includes the following properties:

  • Model string the model you wish to you for embeddings generation
  • ApiKey string the HuggingFace API key, if the model requires authentication and authorization
  • Contents array an array containing each of the contents for which embeddings should be generated

An example request is as follows:

{
    "Model": "all-MiniLM-L6-v2",
    "ApiKey": "",
    "Contents": [
        "This is a sample chunk of text, hello!",
        "Oh wow, here's another chunk of text",
        "And yet again, a third chunk of text"
    ]
}

The response is as shown below. The contents of the Embeddings array are ordered to match the input content.

{
    "Success": true,
    "Model": "all-MiniLM-L6-v2",
    "ApiKey": null,
    "Contents": [
        "This is a sample chunk of text, hello!",
        "Oh wow, here's another chunk of text",
        "And yet again, a third chunk of text"
    ],
    "Embeddings": [
        [
            -0.04482484608888626, ...
        ],
        [
            -0.014099949970841408, ...
        ],
        [
            -0.006406818050891161, ...
        ]
    ]
}