Change template to private attribute and simplify imports (#101)

---------

Co-authored-by: ian <ian@cinnamon.is>
This commit is contained in:
Duc Nguyen (john)
2023-12-08 18:10:34 +07:00
committed by GitHub
parent 1f927d3391
commit da0ac1d69f
13 changed files with 31 additions and 39 deletions

View File

@@ -1,9 +1,7 @@
import tempfile
from typing import List
from theflow.utils.modules import ObjectInitDeclaration as _
from kotaemon.base import BaseComponent, LLMInterface
from kotaemon.base import BaseComponent, LLMInterface, lazy
from kotaemon.embeddings import AzureOpenAIEmbeddings
from kotaemon.indices import VectorRetrieval
from kotaemon.llms import AzureOpenAI
@@ -21,7 +19,7 @@ class Pipeline(BaseComponent):
)
retrieving_pipeline: VectorRetrieval = VectorRetrieval.withx(
vector_store=_(ChromaVectorStore).withx(path=str(tempfile.mkdtemp())),
vector_store=lazy(ChromaVectorStore).withx(path=str(tempfile.mkdtemp())),
embedding=AzureOpenAIEmbeddings.withx(
model="text-embedding-ada-002",
deployment="embedding-deployment",