Skip to content

Commit

Permalink
Adding color to the error message
Browse files Browse the repository at this point in the history
  • Loading branch information
avsthiago committed Apr 13, 2023
1 parent 539294d commit 526cb8b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions kopylot/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
import sys

import openai
import rich

openai.api_key = os.getenv("KOPYLOT_AUTH_TOKEN", "")


def validate_token() -> None:
if openai.api_key == "":
print(
"Please set your OpenAI API key as an environment variable named KOPYLOT_AUTH_TOKEN",
file=sys.stderr,
rich.print(
"[bold red]Error:[/bold red] Please set your OpenAI API key as an environment variable named"
" KOPYLOT_AUTH_TOKEN"
)
sys.exit(1)

Expand Down

0 comments on commit 526cb8b

Please sign in to comment.