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

Update weaviate_vector.py #654

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions src/vanna/weaviate/weaviate_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class WeaviateDatabase(VannaBase):

def __init__(self, config=None):
def __init__(self, config=None,client= None):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to set the client directly, you should aim to do something like that is done for Chroma.

See here:
https://github.com/vanna-ai/vanna/blob/main/src/vanna/chromadb/chromadb_vector.py#L23

and here:
https://github.com/vanna-ai/vanna/blob/main/src/vanna/chromadb/chromadb_vector.py#L38

So basically, pass the client as part of the config, and then you likely want to update what is done here, if the client is part of the config:
https://github.com/vanna-ai/vanna/pull/654/files#diff-acb7ec3a110767dae2ec2a321b040ea390d7165a898d49c6ce310180ece936daR39

See the chroma client implementation for inspiration.

"""
Initialize the VannaEnhanced class with the provided configuration.

Expand All @@ -21,7 +21,7 @@ def __init__(self, config=None):
fastembed_model (str): Fastembed model name for text embeddings. BAAI/bge-small-en-v1.5 by default.

"""
super().__init__(config=config)
super().__init__(config=config,client= None)

if config is None:
raise ValueError("config is required")
Expand Down