Update app.py
Browse files
app.py
CHANGED
|
@@ -19,8 +19,8 @@ def test_handler(optionSelection, prompt: str = "Write an introductory paragraph
|
|
| 19 |
#model = "gpt-35-turbo"
|
| 20 |
model = "gpt-4"
|
| 21 |
system_prompt: str = "Explain in detail to help student understand the concept.",
|
| 22 |
-
assistant_prompt: str = None,
|
| 23 |
-
|
| 24 |
messages = [
|
| 25 |
{"role": "user", "content": f"{prompt}"},
|
| 26 |
{"role": "system", "content": f"{system_prompt}"},
|
|
@@ -38,6 +38,9 @@ def test_handler(optionSelection, prompt: str = "Write an introductory paragraph
|
|
| 38 |
response = completion["choices"][0]["message"].content
|
| 39 |
return "", response
|
| 40 |
except openai.error.ServiceUnavailableError:
|
|
|
|
|
|
|
|
|
|
| 41 |
case "Azure OpenAI API":
|
| 42 |
return "", ""
|
| 43 |
case "Google PaLM API":
|
|
|
|
| 19 |
#model = "gpt-35-turbo"
|
| 20 |
model = "gpt-4"
|
| 21 |
system_prompt: str = "Explain in detail to help student understand the concept.",
|
| 22 |
+
assistant_prompt: str = None,
|
| 23 |
+
|
| 24 |
messages = [
|
| 25 |
{"role": "user", "content": f"{prompt}"},
|
| 26 |
{"role": "system", "content": f"{system_prompt}"},
|
|
|
|
| 38 |
response = completion["choices"][0]["message"].content
|
| 39 |
return "", response
|
| 40 |
except openai.error.ServiceUnavailableError:
|
| 41 |
+
print(f"Exception Name: {type(exception).__name__}")
|
| 42 |
+
print(exception)
|
| 43 |
+
return f" {optionSelection} test_handler Error - {exception}", ""
|
| 44 |
case "Azure OpenAI API":
|
| 45 |
return "", ""
|
| 46 |
case "Google PaLM API":
|