Skip to content

Commit

Permalink
Removed warning for missing keys for openai and anthropic keys. Only …
Browse files Browse the repository at this point in the history
…warn when such backends are created.
  • Loading branch information
yuxiang-wu committed Jun 7, 2023
1 parent 9992a8b commit 4f908bd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions chatarena/backends/anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
import anthropic
except ImportError:
is_anthropic_available = False
logging.warning("anthropic package is not installed")
# logging.warning("anthropic package is not installed")
else:
anthropic_api_key = os.environ.get('ANTHROPIC_API_KEY')
if anthropic_api_key is None:
logging.warning("Anthropic API key is not set. Please set the environment variable ANTHROPIC_API_KEY")
# logging.warning("Anthropic API key is not set. Please set the environment variable ANTHROPIC_API_KEY")
is_anthropic_available = False
else:
is_anthropic_available = True
Expand Down
6 changes: 3 additions & 3 deletions chatarena/backends/bard.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
import bardapi
except ImportError:
is_bard_available = False
logging.warning("bard package is not installed")
# logging.warning("bard package is not installed")
else:
bard_api_key = os.environ.get('_BARD_API_KEY')
if bard_api_key is None:
logging.warning(
"Bard API key is not set. Please set the environment variable _BARD_API_KEY")
# logging.warning(
# "Bard API key is not set. Please set the environment variable _BARD_API_KEY")
is_bard_available = False
else:
is_bard_available = True
Expand Down
4 changes: 2 additions & 2 deletions chatarena/backends/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
import openai
except ImportError:
is_openai_available = False
logging.warning("openai package is not installed")
# logging.warning("openai package is not installed")
else:
openai.api_key = os.environ.get("OPENAI_API_KEY")
if openai.api_key is None:
logging.warning("OpenAI API key is not set. Please set the environment variable OPENAI_API_KEY")
# logging.warning("OpenAI API key is not set. Please set the environment variable OPENAI_API_KEY")
is_openai_available = False
else:
is_openai_available = True
Expand Down

0 comments on commit 4f908bd

Please sign in to comment.