TheMaisk commited on
Commit
27a436f
·
verified ·
1 Parent(s): d2f8d7f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -14
app.py CHANGED
@@ -9,26 +9,21 @@ client = Client()
9
  def generate_writing_prompt(user_input):
10
  response = client.chat.completions.create(
11
  model="gpt-3.5-turbo",
12
- messages=[{"role": "user", "content": user_input}],
 
 
 
13
  )
14
  return response.choices[0].message.content
15
 
16
- # Gradio userinterface...
17
- interface = gr.Interface(
18
  fn=generate_writing_prompt,
19
- inputs=gr.Textbox(lines=3, placeholder="Enter a genre, tone, or initial plot point..."),
20
- outputs="text",
21
- title="Creative Writing Assistant 📝",
22
- description="Unleash your creativity! Get inspired with unique story ideas, prompts, and plot twists.",
23
  theme="huggingface",
24
- examples=[
25
- ["A story about a lost civilization discovering technology."],
26
- ["Compose a poem about the changing seasons."],
27
- ["A suspense thriller set in an abandoned mansion."],
28
- ]
29
  )
30
 
31
-
32
  # Launch the interface
33
  if __name__ == "__main__":
34
- interface.launch()
 
9
  def generate_writing_prompt(user_input):
10
  response = client.chat.completions.create(
11
  model="gpt-3.5-turbo",
12
+ messages=[
13
+ {"role": "system", "content": "Du bist Alex, ein kreativer Assistent. Antworte immer auf Deutsch und hilf bei der Erstellung von kreativen Schreibideen und Eingabeaufforderungen."},
14
+ {"role": "user", "content": user_input}
15
+ ],
16
  )
17
  return response.choices[0].message.content
18
 
19
+ # Gradio chatbot interface
20
+ chatbot = gr.ChatInterface(
21
  fn=generate_writing_prompt,
22
+ title="Kreativer Schreibassistent Alex 📝",
23
+ description="Entfessle deine Kreativität! Chatte mit Alex, um einzigartige Geschichten, Ideen und Plot-Twists zu erhalten.",
 
 
24
  theme="huggingface",
 
 
 
 
 
25
  )
26
 
 
27
  # Launch the interface
28
  if __name__ == "__main__":
29
+ chatbot.launch()