Pydantic model representing an OpenAI embedding response.
# Source: https://github.com/nerdy-tech-com-gitub/MemGPT | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
from typing import List, Literal
from pydantic import BaseModel
class EmbeddingResponse(BaseModel):
"""OpenAI embedding response model: https://platform.openai.com/docs/api-reference/embeddings/object"""
index: int # the index of the embedding in the list of embeddings
embedding: List[float]
object: Literal["embedding"] = "embedding"
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key