fix: openai env (#1400)

This commit is contained in:
nzlov
2025-02-26 17:35:49 +08:00
committed by GitHub
parent 008e8c32b8
commit ef78c36e98
2 changed files with 5 additions and 1 deletions

View File

@@ -315,6 +315,9 @@ chroma_collection = chroma_client.get_or_create_collection("documents")
vector_store = ChromaVectorStore(chroma_collection=chroma_collection)
storage_context = StorageContext.from_defaults(vector_store=vector_store)
embed_model = OpenAIEmbedding()
model = os.getenv("OPENAI_EMBED_MODEL", "")
if model:
embed_model = OpenAIEmbedding(model=model)
Settings.embed_model = embed_model