bstraehle commited on
Commit
84e183d
·
verified ·
1 Parent(s): 7e15169

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -5,13 +5,11 @@ from crew import get_crew
5
 
6
  LLM = "gpt-4o"
7
 
8
- def invoke(openai_api_key, topic, word_count):
9
  if (openai_api_key == ""):
10
  raise gr.Error("OpenAI API Key is required.")
11
  if (topic == ""):
12
  raise gr.Error("Topic is required.")
13
- if (word_count == ""):
14
- raise gr.Error("Word Count is required.")
15
 
16
  agentops.init(os.environ["AGENTOPS_API_KEY"])
17
 
@@ -24,7 +22,7 @@ gr.close_all()
24
  demo = gr.Interface(fn = invoke,
25
  inputs = [gr.Textbox(label = "OpenAI API Key", type = "password", lines = 1),
26
  gr.Textbox(label = "Topic", value=os.environ["TOPIC"], lines = 1),
27
- gr.Number(label = "Word Count", value="2500", minimum="500", maximum="5000")],
28
  outputs = [gr.Textbox(label = "Generated Blog Post", value=os.environ["OUTPUT"], lines = 1)],
29
  title = "Multi-Agent RAG: Blog Post Generation",
30
  description = os.environ["DESCRIPTION"])
 
5
 
6
  LLM = "gpt-4o"
7
 
8
+ def invoke(openai_api_key, topic, word_count=500):
9
  if (openai_api_key == ""):
10
  raise gr.Error("OpenAI API Key is required.")
11
  if (topic == ""):
12
  raise gr.Error("Topic is required.")
 
 
13
 
14
  agentops.init(os.environ["AGENTOPS_API_KEY"])
15
 
 
22
  demo = gr.Interface(fn = invoke,
23
  inputs = [gr.Textbox(label = "OpenAI API Key", type = "password", lines = 1),
24
  gr.Textbox(label = "Topic", value=os.environ["TOPIC"], lines = 1),
25
+ gr.Number(label = "Word Count", value="500", minimum="500", maximum="5000")],
26
  outputs = [gr.Textbox(label = "Generated Blog Post", value=os.environ["OUTPUT"], lines = 1)],
27
  title = "Multi-Agent RAG: Blog Post Generation",
28
  description = os.environ["DESCRIPTION"])