Skip to content
Snippets Groups Projects
Commit ba95ca3f authored by Marcus Schiesser's avatar Marcus Schiesser
Browse files

feat(cl): Use condense plus context chat engine for FastAPI as default

parent ffdc5076
No related branches found
No related tags found
No related merge requests found
---
"create-llama": patch
---
Use condense plus context chat engine for FastAPI as default
...@@ -20,4 +20,4 @@ def get_chat_engine(): ...@@ -20,4 +20,4 @@ def get_chat_engine():
) )
index = VectorStoreIndex.from_vector_store(store, service_context) index = VectorStoreIndex.from_vector_store(store, service_context)
logger.info("Finished connecting to index from MongoDB.") logger.info("Finished connecting to index from MongoDB.")
return index.as_chat_engine(similarity_top_k=5) return index.as_chat_engine(similarity_top_k=5, chat_mode="condense_plus_context")
...@@ -22,4 +22,4 @@ def get_chat_engine(): ...@@ -22,4 +22,4 @@ def get_chat_engine():
storage_context = StorageContext.from_defaults(persist_dir=STORAGE_DIR) storage_context = StorageContext.from_defaults(persist_dir=STORAGE_DIR)
index = load_index_from_storage(storage_context, service_context=service_context) index = load_index_from_storage(storage_context, service_context=service_context)
logger.info(f"Finished loading index from {STORAGE_DIR}") logger.info(f"Finished loading index from {STORAGE_DIR}")
return index.as_chat_engine() return index.as_chat_engine(similarity_top_k=5, chat_mode="condense_plus_context")
...@@ -13,4 +13,4 @@ def get_chat_engine(): ...@@ -13,4 +13,4 @@ def get_chat_engine():
store = init_pg_vector_store_from_env() store = init_pg_vector_store_from_env()
index = VectorStoreIndex.from_vector_store(store, service_context) index = VectorStoreIndex.from_vector_store(store, service_context)
logger.info("Finished connecting to index from PGVector.") logger.info("Finished connecting to index from PGVector.")
return index.as_chat_engine(similarity_top_k=5) return index.as_chat_engine(similarity_top_k=5, chat_mode="condense_plus_context")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment