Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,11 +8,11 @@ openai.api_key = "your-openai-secret-key"
|
|
8 |
def chatbot(input_text):
|
9 |
try:
|
10 |
response = openai.completions.create(
|
11 |
-
model="gpt-3.5-turbo", #
|
12 |
prompt=input_text,
|
13 |
max_tokens=150
|
14 |
)
|
15 |
-
return response
|
16 |
except Exception as e:
|
17 |
return f"Error: {str(e)}"
|
18 |
|
|
|
8 |
def chatbot(input_text):
|
9 |
try:
|
10 |
response = openai.completions.create(
|
11 |
+
model="gpt-3.5-turbo", # Use the model you prefer, like "gpt-4"
|
12 |
prompt=input_text,
|
13 |
max_tokens=150
|
14 |
)
|
15 |
+
return response.choices[0].text.strip() # Adjusted to match the new response structure
|
16 |
except Exception as e:
|
17 |
return f"Error: {str(e)}"
|
18 |
|