Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions deploy/k8s/base/chatbot/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ spec:
metadata:
labels:
app: crapi-chatbot
spec:
containers:
- name: crapi-chatbot
image: crapi/crapi-chatbot:latest
Expand Down
1 change: 1 addition & 0 deletions deploy/k8s/base/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ kubectl apply -n crapi -f ./identity
kubectl apply -n crapi -f ./community
kubectl apply -n crapi -f ./workshop
kubectl apply -n crapi -f ./web
kubectl apply -n crapi -f ./chatbot
3 changes: 1 addition & 2 deletions services/chatbot/src/chatbot_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,10 @@ def document_loader():
loader_cls=UnstructuredMarkdownLoader,
)
documents = loader.load()
app.logger.debug("Loaded %s documents", len(documents))
app.logger.debug("Loaded %s documents in db", len(documents))
text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=100)
texts = text_splitter.split_documents(documents)
embeddings = get_embeddings()
os.system("rm -rf ./db")
db = Chroma.from_documents(texts, embeddings, persist_directory="./db")
db.persist()
retriever = db.as_retriever(search_kwargs={"k": target_source_chunks})
Expand Down