Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -32,14 +32,12 @@ def generate_response(prompt):
|
|
32 |
instruction = "Please generate a cocktail recipe based on the user's mood description.\n\n"
|
33 |
prompt = instruction + prompt
|
34 |
|
35 |
-
response = client.chat.completions.create(
|
36 |
-
model="gpt-4-0125-preview")
|
37 |
try:
|
38 |
response = client.chat.completions.create(
|
39 |
model="gpt-4-0125-preview",
|
40 |
messages=prompt,
|
41 |
max_tokens=150)
|
42 |
-
return response.choices[0].
|
43 |
except Exception as e:
|
44 |
return str(e)
|
45 |
|
|
|
32 |
instruction = "Please generate a cocktail recipe based on the user's mood description.\n\n"
|
33 |
prompt = instruction + prompt
|
34 |
|
|
|
|
|
35 |
try:
|
36 |
response = client.chat.completions.create(
|
37 |
model="gpt-4-0125-preview",
|
38 |
messages=prompt,
|
39 |
max_tokens=150)
|
40 |
+
return response.choices[0].message.content
|
41 |
except Exception as e:
|
42 |
return str(e)
|
43 |
|