Skip to content

Commit

Permalink
optional chroma api key
Browse files Browse the repository at this point in the history
  • Loading branch information
zzstoatzz committed Oct 15, 2024
1 parent 78e0d9b commit 9ca4ba1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/raggy/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ class ChromaSettings(BaseSettings):
default="default",
description="The database to use for the Chroma Cloud client.",
)
cloud_api_key: SecretStr = Field(
cloud_api_key: SecretStr | None = Field(
default=None,
description="The API key to use for the Chroma Cloud client.",
)

Expand Down
1 change: 1 addition & 0 deletions src/raggy/vectorstores/chroma.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def get_client(client_type: ChromaClientType) -> ClientAPI:
elif client_type == "http":
return HttpClient()
elif client_type == "cloud":
assert settings.chroma.cloud_api_key is not None
return CloudClient(
tenant=settings.chroma.cloud_tenant,
database=settings.chroma.cloud_database,
Expand Down

0 comments on commit 9ca4ba1

Please sign in to comment.