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,13 +15,14 @@ def invoke(openai_api_key, 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="Evolution of Retrieval-Augmented Generation from Naive RAG to Agentic RAG", lines = 1)
|
|
|
25 |
outputs = [gr.Textbox(label = "Output", lines = 1)],
|
26 |
title = "Multi-Agent RAG: Blog Post Generation",
|
27 |
description = os.environ["DESCRIPTION"])
|
|
|
5 |
|
6 |
LLM = "gpt-4o"
|
7 |
|
8 |
+
def invoke(openai_api_key, topic, length):
|
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, "length": length})
|
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="Evolution of Retrieval-Augmented Generation from Naive RAG to Agentic RAG", lines = 1),
|
25 |
+
gr.Number(label = "Words", value="2500")],
|
26 |
outputs = [gr.Textbox(label = "Output", lines = 1)],
|
27 |
title = "Multi-Agent RAG: Blog Post Generation",
|
28 |
description = os.environ["DESCRIPTION"])
|