This repository has been archived on 2025-03-19. You can view files and clone it, but cannot push or open issues or pull requests.
SPJGPT/get_embedding_function.py
2024-12-04 02:35:01 +00:00

10 lines
271 B
Python

from langchain_openai import OpenAIEmbeddings
import os
def get_embedding_function():
embeddings = OpenAIEmbeddings(
deployment="SPJGPT",
model="text-embedding-3-large",
api_key=os.getenv("OPENAI_API_KEY"),
)
return embeddings