Skip to content

Commit

Permalink
Fix type checks
Browse files Browse the repository at this point in the history
  • Loading branch information
janheinrichmerker authored Mar 5, 2024
1 parent bfef3d8 commit 3be424e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions chatnoir_api/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,26 +70,26 @@ def __init__(self,
self.retries = retries
self.backoff_seconds = backoff_seconds

if type(ws_host) == tuple:
if isinstance(ws_host, tuple):
print(f"ChatNoir Chat uses ws_host from environment {ws_host[1]}")
self.ws_host = ws_host[0]
else:
self.ws_host = ws_host
if type(api_key) == tuple:
if isinstance(api_key, tuple):
print(f"ChatNoir Chat uses API key from {api_key[1]}")
self.api_key = api_key[0]
else:
print("ChatNoir Chat uses API key from parameters")
self.api_key = api_key

if type(model) == tuple:
if isinstance(model, tuple):
print(f"ChatNoir Chat uses model '{model[0]}' from {model[1]}")
self.model = model[0]
else:
print("ChatNoir Chat uses model '{model}' from from parameters")
self.model = model

if type(endpoint) == tuple:
if isinstance(endpoint, tuple):
print(f"ChatNoir Chat uses endpoint '{endpoint[0]}' " +
"from {endpoint[1]}")
self.endpoint = endpoint[0]
Expand Down

0 comments on commit 3be424e

Please sign in to comment.