Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -10,12 +10,14 @@ def invoke(openai_api_key, topic, word_count):
|
|
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 |
|
16 |
os.environ["OPENAI_API_KEY"] = openai_api_key
|
17 |
|
18 |
-
return get_crew(LLM).kickoff(inputs={"topic": topic, "
|
19 |
|
20 |
gr.close_all()
|
21 |
|
|
|
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 |
|
18 |
os.environ["OPENAI_API_KEY"] = openai_api_key
|
19 |
|
20 |
+
return get_crew(LLM).kickoff(inputs={"topic": topic, "word_count": word_count})
|
21 |
|
22 |
gr.close_all()
|
23 |
|