Spaces:
Runtime error
Runtime error
updating to new mongon free instance
Browse files
src/ctp_slack_bot/core/config.py
CHANGED
@@ -37,6 +37,7 @@ class Settings(BaseSettings):
|
|
37 |
MONGODB_URI: SecretStr # TODO: Contemplate switching to MongoDsn type for the main URL, and separate out the credentials to SecretStr variables.
|
38 |
MONGODB_NAME: str
|
39 |
SCORE_THRESHOLD: NonNegativeFloat
|
|
|
40 |
|
41 |
# Hugging Face Configuration
|
42 |
HF_API_TOKEN: Optional[SecretStr] = None # TODO: Currently, this is unused.
|
|
|
37 |
MONGODB_URI: SecretStr # TODO: Contemplate switching to MongoDsn type for the main URL, and separate out the credentials to SecretStr variables.
|
38 |
MONGODB_NAME: str
|
39 |
SCORE_THRESHOLD: NonNegativeFloat
|
40 |
+
VECTORIZED_CHUNKS_COLLECTION_NAME: str
|
41 |
|
42 |
# Hugging Face Configuration
|
43 |
HF_API_TOKEN: Optional[SecretStr] = None # TODO: Currently, this is unused.
|
src/ctp_slack_bot/db/repositories/mongo_db_vectorized_chunk_repository.py
CHANGED
@@ -138,7 +138,7 @@ class MongoVectorizedChunkRepository(VectorRepositoryBase, VectorizedChunkReposi
|
|
138 |
|
139 |
class MongoVectorizedChunkRepositoryResource(AsyncResource):
|
140 |
async def init(self: Self, settings: Settings, mongo_db: MongoDB) -> MongoVectorizedChunkRepository:
|
141 |
-
vectorized_chunk_collection = await mongo_db.get_collection(
|
142 |
vectorized_chunk_repository = MongoVectorizedChunkRepository(settings=settings, collection=vectorized_chunk_collection)
|
143 |
await vectorized_chunk_repository.ensure_indices_exist()
|
144 |
return vectorized_chunk_repository
|
|
|
138 |
|
139 |
class MongoVectorizedChunkRepositoryResource(AsyncResource):
|
140 |
async def init(self: Self, settings: Settings, mongo_db: MongoDB) -> MongoVectorizedChunkRepository:
|
141 |
+
vectorized_chunk_collection = await mongo_db.get_collection(settings.VECTORIZED_CHUNKS_COLLECTION_NAME)
|
142 |
vectorized_chunk_repository = MongoVectorizedChunkRepository(settings=settings, collection=vectorized_chunk_collection)
|
143 |
await vectorized_chunk_repository.ensure_indices_exist()
|
144 |
return vectorized_chunk_repository
|