HomeGuidesRecipesAPI EndpointsRelease NotesCommunity
Log In
Guides

Understanding the Vector Generation Endpoint

Introduction

The /layar/gpt/retrieval/generateVectorsendpoint allows you to take raw text and embed it using any embedding model that is being served. This guide will go over the request parameters as well as the response.

Parameters

{
    "embedder": "e5-large-v2",
    "input_text": [
        "The London Eye is a ferris wheel at the River Thames.",
        "France's government collapsed Wednesday following a vote of no confidence in the country's prime minister, pushing the country's political future into chaos and exacerbating its budgetary and looming economic crises."
    ]
}

embedder

A string value where you can specify which embedding model to use.

input_text

A list of strings, each string in the list will be embedded and vectors returned separately for each string.

Response

{
    "embedder": "e5-large-v2",
    "data": [
        {
            "text": "The London Eye is a ferris wheel at the River Thames.",
            "embeddings": [
                0.7957934737205505,
                0.0956888422369957,
                0.6204004883766174,
                -0.4711531102657318,
                -0.10890468209981918,
               ........
            ],
            "metadata": {
                "total_tokens": 13
            }
        },
        {
            "text": "France's government collapsed Wednesday following a vote of no confidence in the country's prime minister, pushing the country's political future into chaos and exacerbating its budgetary and looming economic crises.",
            "embeddings": [
                0.03396804630756378,
                0.18781115114688873,
                0.17808157205581665,
                -0.31546786427497864,
                0.5005540251731873,
                ....
            ],
            "metadata": {
                "total_tokens": 37
            }
        }
    ]
}

embedder

The embedding model used to create the vectors.

data

An array of dictionaries containing the text of the chunk, each vector value, and metadata associated with the chunk.

text

The chunk of text provided in the request body.

embeddings

The vector values for the chunk.

metadata

A dictionary containing all metadata associated with the embedding.

📘

Available Metadata

Currently only the total tokens are provided in Layar version 1.12.