Skip to content

Commit 154ad21

Browse files
committed
Update def prevalidation(
1 parent 08f4e56 commit 154ad21

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

operate/main.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def supports_ansi():
199199
ANSI_BRIGHT_MAGENTA = ""
200200

201201

202-
def validate_mode(
202+
def validation(
203203
model,
204204
accurate_mode,
205205
voice_mode,
@@ -212,6 +212,14 @@ def validate_mode(
212212
print("To use voice mode, please add an OpenAI API key")
213213
sys.exit(1)
214214

215+
if model == "gpt-4-vision-preview" and not OPENAI_API_KEY:
216+
print("To use `gpt-4-vision-preview` add an OpenAI API key")
217+
sys.exit(1)
218+
219+
if model == "gemini-pro-vision" and not GOOGLE_API_KEY:
220+
print("To use `gemini-pro-vision` add a Google API key")
221+
sys.exit(1)
222+
215223

216224
def main(model, accurate_mode, terminal_prompt, voice_mode=False):
217225
"""
@@ -220,7 +228,7 @@ def main(model, accurate_mode, terminal_prompt, voice_mode=False):
220228
mic = None
221229
# Initialize WhisperMic if voice_mode is True if voice_mode is True
222230

223-
validate_mode(model, accurate_mode, voice_mode)
231+
validation(model, accurate_mode, voice_mode)
224232

225233
if voice_mode:
226234
try:

0 commit comments

Comments
 (0)