Skip to content

Commit

Permalink
fix weaviate embedded client
Browse files Browse the repository at this point in the history
  • Loading branch information
thomashacker committed Nov 29, 2023
1 parent 1e08b7f commit d03901f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions goldenverba/verba_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def setup_client(self) -> Client | None:
msg.info("Using Weaviate Embedded")
self.weaviate_type = "Weaviate Embedded"
client = weaviate.Client(
additional_headers={"X-OpenAI-Api-Key": openai.api_key},
additional_headers=additional_header,
embedded_options=EmbeddedOptions(),
)

Expand Down Expand Up @@ -418,7 +418,10 @@ def set_suggestions(self, query: str):
.do()
)

if "data" in check_results and len(check_results["data"]["Get"]["Suggestion"]) > 0:
if (
"data" in check_results
and len(check_results["data"]["Get"]["Suggestion"]) > 0
):
if query == check_results["data"]["Get"]["Suggestion"][0]["suggestion"]:
return

Expand Down

0 comments on commit d03901f

Please sign in to comment.