Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/together/lib/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ def main(
os.environ.setdefault("TOGETHER_LOG", "debug")
setup_logging() # Must run this again here to allow the new logging configuration to take effect

if api_key == "":
click.secho(
"Error: api key missing.\n\nThe api_key must be set either by passing --api-key to the command or by setting the TOGETHER_API_KEY environment variable",
fg="red",
)
click.secho("\nYou can find your api key at https://api.together.xyz/settings/api-keys", fg="yellow")
sys.exit(1)

try:
ctx.obj = together.Together(
api_key=api_key,
Expand Down