Skip to content

Commit

Permalink
fix base url compatibility between weaviate and verba
Browse files Browse the repository at this point in the history
  • Loading branch information
samos123 committed May 8, 2024
1 parent 32e1231 commit 290a6f3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions goldenverba/components/schema/schema_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ def verify_vectorizer(

base_url = os.getenv("OPENAI_BASE_URL", "")
if vectorizer == "text2vec-openai" and base_url:
# check if base_url ends with v1 and strip it since Weaviate automatically adds v1
if base_url.endswith("/"):
base_url = base_url.rstrip("/")
if base_url.endswith("v1"):
base_url = base_url.rstrip("v1")
if vectorizer_config == {}:
vectorizer_config = {
"text2vec-openai": {
Expand Down

0 comments on commit 290a6f3

Please sign in to comment.