Skip to content

Commit

Permalink
fix: resolve a vectorstore issue (#193)
Browse files Browse the repository at this point in the history
update max length so long titles do not lead to import failure

* fix some bugs in reflexion agent

* fix a vectorstore issue

---------

Co-authored-by: fengsh <[email protected]>
  • Loading branch information
fengsh27 and fengsh authored Aug 8, 2024
1 parent d2df88c commit 8cfa67b
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions biochatter/vectorstore_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def _load_metadata_collection(self) -> None:
using=self.alias,
)
self._col_metadata.load()

def _create_metadata_collection(self) -> None:
"""
Create metadata collection.
Expand All @@ -286,38 +286,39 @@ def _create_metadata_collection(self) -> None:
vector "embedding". The field "isDeleted" is used to specify if the
document is deleted.
"""
MAX_LENGTH = 10000
doc_id = FieldSchema(
name="id", dtype=DataType.INT64, is_primary=True, auto_id=True
)
doc_name = FieldSchema(
name="name", dtype=DataType.VARCHAR, max_length=255
name="name", dtype=DataType.VARCHAR, max_length=MAX_LENGTH
)
doc_author = FieldSchema(
name="author", dtype=DataType.VARCHAR, max_length=255
name="author", dtype=DataType.VARCHAR, max_length=MAX_LENGTH
)
doc_title = FieldSchema(
name="title", dtype=DataType.VARCHAR, max_length=1000
name="title", dtype=DataType.VARCHAR, max_length=MAX_LENGTH
)
doc_format = FieldSchema(
name="format", dtype=DataType.VARCHAR, max_length=255
)
doc_subject = FieldSchema(
name="subject", dtype=DataType.VARCHAR, max_length=255
name="subject", dtype=DataType.VARCHAR, max_length=MAX_LENGTH
)
doc_creator = FieldSchema(
name="creator", dtype=DataType.VARCHAR, max_length=255
name="creator", dtype=DataType.VARCHAR, max_length=MAX_LENGTH
)
doc_producer = FieldSchema(
name="producer", dtype=DataType.VARCHAR, max_length=255
name="producer", dtype=DataType.VARCHAR, max_length=MAX_LENGTH
)
doc_creationDate = FieldSchema(
name="creationDate", dtype=DataType.VARCHAR, max_length=64
name="creationDate", dtype=DataType.VARCHAR, max_length=1024
)
doc_modDate = FieldSchema(
name="modDate", dtype=DataType.VARCHAR, max_length=64
name="modDate", dtype=DataType.VARCHAR, max_length=1024
)
doc_source = FieldSchema(
name="source", dtype=DataType.VARCHAR, max_length=1000
name="source", dtype=DataType.VARCHAR, max_length=MAX_LENGTH
)
embedding = FieldSchema(
name="embedding",
Expand Down

0 comments on commit 8cfa67b

Please sign in to comment.