Chatbot-Documents / src /embeddings.py
amitcoolll's picture
Initial RAG document chatbot deployment
c4233b7
raw
history blame contribute delete
297 Bytes
from typing import List
from src.openai_client import get_client
from src.config import EMBED_MODEL
def embed_texts(texts: List[str]) -> List[List[float]]:
client = get_client()
resp = client.embeddings.create(model=EMBED_MODEL, input=texts)
return [d.embedding for d in resp.data]