You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
323 B
11 lines
323 B
# This file contains the function that embeds the input into a vector
|
|
from chromadb import EmbeddingFunction
|
|
|
|
|
|
def openai_embed(self, input, api_key, model_name):
|
|
openai = EmbeddingFunction.OpenAIEmbeddingFunction(
|
|
api_key=api_key, model_name=model_name
|
|
)
|
|
embedding = openai(input)
|
|
return embedding
|