Skip to content

Commit a3ac318

Browse files
committed
Move comment about API key info into correct scope
1 parent 511fb76 commit a3ac318

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

interpreter/core/respond.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,16 @@ def respond(interpreter):
100100
)
101101
break
102102

103-
# Provide extra information on how to change API keys, if we encounter that error
104-
# (Many people writing GitHub issues were struggling with this)
105-
106103
except Exception as e:
107104
error_message = str(e).lower()
108105
if (
109106
interpreter.offline == False
110107
and ("auth" in error_message or
111108
"api key" in error_message)
112109
):
110+
# Provide extra information on how to change API keys, if
111+
# we encounter that error (Many people writing GitHub
112+
# issues were struggling with this)
113113
output = traceback.format_exc()
114114
raise Exception(
115115
f"{output}\n\nThere might be an issue with your API key(s).\n\nTo reset your API key (we'll use OPENAI_API_KEY for this example, but you may need to reset your ANTHROPIC_API_KEY, HUGGINGFACE_API_KEY, etc):\n Mac/Linux: 'export OPENAI_API_KEY=your-key-here'. Update your ~/.zshrc on MacOS or ~/.bashrc on Linux with the new key if it has already been persisted there.,\n Windows: 'setx OPENAI_API_KEY your-key-here' then restart terminal.\n\n"

0 commit comments

Comments
 (0)