Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -30,8 +30,9 @@ def create_assistant_json(uploaded_file, assistant_name, assistant_message):
|
|
30 |
def generate_cocktail(mood, sweetness, sour, savory, bitter, flavor_association, drinking_experience, soberness_level, allergies, additional_requests):
|
31 |
client = openai.OpenAI(api_key=os.environ["API_TOKEN"])
|
32 |
instruction = "Please provide a cocktail recipe given the mood and preference of the user.\n\n"
|
33 |
-
user_prompt = f"Mood: {mood}\nTaste: Sweetness {sweetness}/10, Sour {sour}/10, Savory {savory}/10, Bitter {bitter}/10\nFlavor Association: {flavor_association}\nDrinking Experience: {drinking_experience}\nLevel of Soberness: {soberness_level}\nAllergies: {allergies}\nAdditional Requests: {additional_requests}\n\nMake sure to avoid all allergic ingredients.\n\
|
34 |
-
|
|
|
35 |
|
36 |
messages=[
|
37 |
{"role": "system", "content": "You are a helpful bartender assistant."},
|
|
|
30 |
def generate_cocktail(mood, sweetness, sour, savory, bitter, flavor_association, drinking_experience, soberness_level, allergies, additional_requests):
|
31 |
client = openai.OpenAI(api_key=os.environ["API_TOKEN"])
|
32 |
instruction = "Please provide a cocktail recipe given the mood and preference of the user.\n\n"
|
33 |
+
user_prompt = f"Mood: {mood}\nTaste: Sweetness {sweetness}/10, Sour {sour}/10, Savory {savory}/10, Bitter {bitter}/10\nFlavor Association: {flavor_association}\nDrinking Experience: {drinking_experience}\nLevel of Soberness: {soberness_level}\nAllergies: {allergies}\nAdditional Requests: {additional_requests}\n\nMake sure to avoid all allergic ingredients.\n\n"
|
34 |
+
output_format = "Please strictly follow this output format:\n\nCocktail Name:[name]\nIngredients:[ingredients]\nInstruction:[instruction]\nNotes:[notes]"
|
35 |
+
prompt = instruction + user_prompt + output_format
|
36 |
|
37 |
messages=[
|
38 |
{"role": "system", "content": "You are a helpful bartender assistant."},
|