Skip to content

Commit 76e87ec

Browse files
committed
Better access messaging
1 parent 6a5bf74 commit 76e87ec

File tree

2 files changed

+872
-832
lines changed

2 files changed

+872
-832
lines changed

interpreter/core/respond.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,10 @@ def respond(interpreter):
9898
"""
9999
)
100100
break
101-
# Provide extra information on how to change API keys, if we encounter that error
102-
# (Many people writing GitHub issues were struggling with this)
101+
102+
# Provide extra information on how to change API keys, if we encounter that error
103+
# (Many people writing GitHub issues were struggling with this)
104+
103105
except Exception as e:
104106
error_message = str(e).lower()
105107
if (
@@ -115,36 +117,34 @@ def respond(interpreter):
115117
interpreter.offline == False and "not have access" in str(e).lower()
116118
):
117119
"""
118-
Check for invalid model in error message and then fallback to groq, then OpenAI.
120+
Check for invalid model in error message and then fallback.
119121
"""
120122
if (
121123
"invalid model" in error_message
122124
or "model does not exist" in error_message
123125
):
124-
provider_message = f" The model '{interpreter.llm.model}' does not exist or is invalid. Please check the model name and try again.\n\nWould you like to try an alternative model instead? (y/n)\n\n "
126+
provider_message = f"\n\nThe model '{interpreter.llm.model}' does not exist or is invalid. Please check the model name and try again.\n\nWould you like to try Open Interpreter's hosted `i` model instead? (y/n)\n\n "
125127
elif "groq" in error_message:
126-
provider_message = f" You do not have access to {interpreter.llm.model}. Please check with Groq for more details.\n\nWould you like to try an alternative model instead? (y/n)\n\n "
128+
provider_message = f"\n\nYou do not have access to {interpreter.llm.model}. Please check with Groq for more details.\n\nWould you like to try Open Interpreter's hosted `i` model instead? (y/n)\n\n "
127129
else:
128-
provider_message = f" You do not have access to {interpreter.llm.model}. You will need to add a payment method and purchase credits for the OpenAI API billing page (different from ChatGPT) to use `GPT-4`.\n\nhttps://platform.openai.com/account/billing/overview\n\nWould you like to try GPT-3.5-TURBO instead? (y/n)\n\n "
130+
provider_message = f"\n\nYou do not have access to {interpreter.llm.model}. If you are using an OpenAI model, you may need to add a payment method and purchase credits for the OpenAI API billing page (this is different from ChatGPT Plus).\n\nhttps://platform.openai.com/account/billing/overview\n\nWould you like to try Open Interpreter's hosted `i` model instead? (y/n)\n\n"
129131

130-
response = input(provider_message)
132+
print(provider_message)
133+
134+
response = input()
131135
print("") # <- Aesthetic choice
132136

133137
if response.strip().lower() == "y":
134-
interpreter.llm.model = "gpt-3.5-turbo-1106"
135-
interpreter.llm.context_window = 16000
136-
interpreter.llm.max_tokens = 4096
137-
interpreter.llm.supports_functions = True
138+
interpreter.llm.model = "i"
139+
display_markdown_message(f"> Model set to `i`")
138140
display_markdown_message(
139-
f"> Model set to `{interpreter.llm.model}`"
141+
"***Note:*** *Conversations with this model will be used to train our open-source model.*\n"
140142
)
143+
141144
else:
142-
raise Exception(
143-
"\n\nYou will need to add a payment method and purchase credits for the OpenAI API billing page (different from ChatGPT) to use GPT-4.\n\nhttps://platform.openai.com/account/billing/overview"
144-
)
145+
raise
145146
elif interpreter.offline and not interpreter.os:
146-
print(traceback.format_exc())
147-
raise Exception("Error occurred. " + str(e))
147+
raise
148148
else:
149149
raise
150150

0 commit comments

Comments
 (0)