You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: interpreter/core/respond.py
+17-17Lines changed: 17 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -98,8 +98,10 @@ def respond(interpreter):
98
98
"""
99
99
)
100
100
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
+
103
105
exceptExceptionase:
104
106
error_message=str(e).lower()
105
107
if (
@@ -115,36 +117,34 @@ def respond(interpreter):
115
117
interpreter.offline==Falseand"not have access"instr(e).lower()
116
118
):
117
119
"""
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.
119
121
"""
120
122
if (
121
123
"invalid model"inerror_message
122
124
or"model does not exist"inerror_message
123
125
):
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 "
125
127
elif"groq"inerror_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 "
127
129
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"
129
131
130
-
response=input(provider_message)
132
+
print(provider_message)
133
+
134
+
response=input()
131
135
print("") # <- Aesthetic choice
132
136
133
137
ifresponse.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`")
138
140
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"
140
142
)
143
+
141
144
else:
142
-
raiseException(
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"
0 commit comments