eaglelandsonce's picture
Upload 3 files
a7013cf
raw
history blame
320 Bytes
import os
from langchain.embeddings import OpenAIEmbeddings
# Function to generate title and Logline from simple chaining
def generate_vector(prompt, api_key):
os.environ["OPENAI_API_KEY"] = api_key
embeddings = OpenAIEmbeddings()
text_embedding = embeddings.embed_query(prompt)
return text_embedding