Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ from crew import get_crew
|
|
5 |
|
6 |
LLM = "gpt-4o"
|
7 |
|
8 |
-
def invoke(openai_api_key, topic
|
9 |
if (openai_api_key == ""):
|
10 |
raise gr.Error("OpenAI API Key is required.")
|
11 |
if (topic == ""):
|
@@ -15,16 +15,15 @@ def invoke(openai_api_key, topic, word_count=1000):
|
|
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 |
|
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=1000, minimum=500, maximum=5000)],
|
26 |
outputs = [gr.Markdown(label = "Generated Blog Post", value=os.environ["OUTPUT"])],
|
27 |
-
title = "Multi-Agent RAG:
|
28 |
description = os.environ["DESCRIPTION"])
|
29 |
|
30 |
demo.launch()
|
|
|
5 |
|
6 |
LLM = "gpt-4o"
|
7 |
|
8 |
+
def invoke(openai_api_key, topic):
|
9 |
if (openai_api_key == ""):
|
10 |
raise gr.Error("OpenAI API Key is required.")
|
11 |
if (topic == ""):
|
|
|
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 |
|
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 |
outputs = [gr.Markdown(label = "Generated Blog Post", value=os.environ["OUTPUT"])],
|
26 |
+
title = "Multi-Agent RAG: Article Generation",
|
27 |
description = os.environ["DESCRIPTION"])
|
28 |
|
29 |
demo.launch()
|