6 lines
185 B
Python
6 lines
185 B
Python
import openai
|
|
|
|
def get_embedding(text, model="text-embedding-ada-002"):
|
|
client = openai.OpenAI();
|
|
return client.embeddings.create(input = [text], model=model).data[0].embedding
|