Update app.py
Browse files
app.py
CHANGED
|
@@ -85,38 +85,34 @@ with gr.Blocks(theme=theme) as chatbot:
|
|
| 85 |
show_download_button=False
|
| 86 |
)
|
| 87 |
with gr.Row():
|
| 88 |
-
with gr.Tab("Step 1"):
|
| 89 |
|
| 90 |
with gr.Column(scale=1):
|
| 91 |
-
|
| 92 |
-
gr.Markdown(""" # Tell me what you are looking for in your character if you have any preferences""")
|
| 93 |
|
| 94 |
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
with gr.Column(scale=2):
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
respond,
|
| 115 |
-
inputs=[message_box, history_state, character_name, character_class, character_race, character_alignment],
|
| 116 |
-
outputs=[chatbot_display, history_state]
|
| 117 |
-
)
|
| 118 |
-
|
| 119 |
-
# Optional: clear textbox after sending
|
| 120 |
-
send_button.click(fn=lambda: "", inputs=None, outputs=message_box)
|
| 121 |
|
| 122 |
chatbot.launch()
|
|
|
|
| 85 |
show_download_button=False
|
| 86 |
)
|
| 87 |
with gr.Row():
|
|
|
|
| 88 |
|
| 89 |
with gr.Column(scale=1):
|
| 90 |
+
with gr.Tab("Character Preferences"):
|
|
|
|
| 91 |
|
| 92 |
|
| 93 |
+
character_name = gr.Textbox(label = "Character Name", placeholder="Type your name here…", info ="optional")
|
| 94 |
+
character_class = gr.Dropdown(['Barbarian', 'Bard', 'Cleric', 'Druid', 'Fighter', 'Monk', 'Paladin', 'Ranger', 'Rogue', 'Sorcerer', 'Warlock', 'Wizard'], label="Character Class", info="Choose one or more", multiselect=True)
|
| 95 |
+
character_race = gr.Dropdown([
|
| 96 |
+
"Aarakocra", "Aasimar", "Bugbear", "Centaur", "Changeling", "Dragonborn", "Dwarf", "Elf",
|
| 97 |
+
"Fairy", "Firbolg", "Genasi", "Githyanki", "Githzerai", "Gnome", "Goblin", "Goliath",
|
| 98 |
+
"Half-Elf", "Half-Orc", "Halfling", "Hobgoblin", "Human", "Kenku", "Kobold", "Leonin",
|
| 99 |
+
"Lizardfolk", "Minotaur", "Orc", "Owlin", "Satyr", "Shadar-kai", "Shifter", "Tabaxi",
|
| 100 |
+
"Tiefling", "Tortle", "Triton", "Warforged", "Yuan-ti"
|
| 101 |
+
], multiselect=True, label="Character Race", info="You can choose multiple")
|
| 102 |
+
character_alignment = gr.Dropdown(["Lawful Good", "Neutral Good", "Chaotic Good", "Lawful Neutral", "True Neutral", "Chaotic Neutral", "Lawful Evil", "Neutral Evil", "Chaotic Evil"], label="Character Alignment", elem_classes="alignment_radio")
|
| 103 |
+
|
| 104 |
+
with gr.Tab("Campaign Details"):
|
| 105 |
+
campaign_description = gr.Textbox(label="Describe the campaign and the current situation", lines=10)
|
| 106 |
+
party_description = gr.Textbox(label="Describe the current members of your party", lines=10)
|
| 107 |
+
|
| 108 |
+
|
| 109 |
+
|
| 110 |
with gr.Column(scale=2):
|
| 111 |
+
with gr.Column(scale=2):
|
| 112 |
+
gr.ChatInterface(
|
| 113 |
+
fn=respond,
|
| 114 |
+
additional_inputs=[character_name, character_class, character_race, character_alignment], # Pass name into function!
|
| 115 |
+
type="messages",
|
| 116 |
+
examples=None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
|
| 118 |
chatbot.launch()
|