Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: collection name everywhere #310

Merged
merged 19 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
2a40d31
feat: allow switching between collections and specifying initial coll…
jonasiwnl Jul 18, 2023
09ec899
Merge branch 'feat/collection-name-everywhere' of https://github.com/…
jonasiwnl Jul 18, 2023
abe9f60
refactor: make collection name everywhere feature compatible with Bas…
jonasiwnl Jul 18, 2023
644c5a1
Merge pull request #1 from jonasiwnl/main
jonasiwnl Jul 18, 2023
201ac5d
chore: remove sentence-transformers dependency
jonasiwnl Jul 18, 2023
5bbcfbc
chore: revert changes to pyproject.toml
jonasiwnl Jul 18, 2023
52f1891
Merge branch 'main' into feat/collection-name-everywhere
cachho Jul 18, 2023
8257bf5
chore: fix merge errors, reformat, remove unused imports
jonasiwnl Jul 18, 2023
1f6b22a
Merge branch 'main' into feat/collection-name-everywhere
jonasiwnl Jul 20, 2023
8d6ec4d
chore: add default collection name to BaseAppConfig
jonasiwnl Jul 28, 2023
ce62702
Merge branch 'main' into feat/collection-name-everywhere
jonasiwnl Jul 28, 2023
ded8ab6
chore: remove default collection name redundancy
jonasiwnl Jul 28, 2023
f69966f
Merge branch 'feat/collection-name-everywhere' of https://github.com/…
jonasiwnl Jul 28, 2023
c8edfed
chore: change collection name to old default
cachho Aug 2, 2023
fee6f94
chore: old default name for compatibility
cachho Aug 2, 2023
cb04be0
refactor: unified argument order
cachho Aug 2, 2023
4dcb811
docs: fix param name
cachho Aug 2, 2023
7d2dfa0
chore: use old default collection name
cachho Aug 2, 2023
1b7b461
test: added unit tests
cachho Aug 2, 2023
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
Prev Previous commit
Next Next commit
chore: add default collection name to BaseAppConfig
  • Loading branch information
jonasiwnl committed Jul 28, 2023
commit 8d6ec4de344fe258fa9e0e0ec6ce53b8918a8b78
2 changes: 1 addition & 1 deletion docs/advanced/query_configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: '🔍 Query configurations'
| log_level | log level | string | WARNING |
| embedding_fn| embedding function | chromadb.utils.embedding_functions | \{text-embedding-ada-002\} |
| db | vector database (experimental) | BaseVectorDB | ChromaDB |
| collection_name | initial collection name for the database | string | embedchain_store |
| collection_name | initial collection name for the database | string | embedchain |


## AddConfig
Expand Down
2 changes: 1 addition & 1 deletion embedchain/config/apps/BaseAppConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(self, log_level=None, embedding_fn=None, db=None, collection_name=N
self._setup_logging(log_level)

self.db = db if db else BaseAppConfig.default_db(embedding_fn=embedding_fn, host=host, port=port)
self.collection_name = collection_name
self.collection_name = collection_name if collection_name else "embedchain"
self.id = id
return

Expand Down
2 changes: 1 addition & 1 deletion embedchain/vectordb/chroma_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def _get_or_create_db(self):
def _get_or_create_collection(self, name=None):
cachho marked this conversation as resolved.
Show resolved Hide resolved
"""Get or create the collection."""
if name is None:
name = "embedchain_store"
name = "embedchain"
return self.client.get_or_create_collection(
name=name,
embedding_function=self.embedding_fn,
Expand Down
2 changes: 1 addition & 1 deletion tests/vectordb/test_chroma_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def test_init_with_default_collection(self):
"""
app = App()

self.assertEqual(app.collection.name, "embedchain_store")
self.assertEqual(app.collection.name, "embedchain")

def test_init_with_custom_collection(self):
"""
Expand Down