Skip to content

Send gen_ai.embeddings.input with appropriate format #7972

Open
0 of 4 issues completed
Open

Description

As per the GenAI RFC:

The attribute is a union discriminated by the type property. The type property is one of "text", "texts", "tokens", or "token_batches".

If the type is "text", then the value is a simple string, as in

{
    "type": "text",
    "value": "Hello, world!",
}

If the type is "texts", the value is a string array, as in

{
    "type": "texts",
    "value": ["First text", "Second text", "Third text"],
}

If the type is "tokens", then the value is an array of integers, as in

{
    "type": "tokens",
    "value": [5, 8, 13, 21, 34],
}

Finally, if the type is "token_batches", then the value is a 2-dimensional array of integers, as in

{
    "type": "token_batches",
    "value": [[5, 8, 13, 21, 34], [8, 13, 21, 34, 55]],
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions