Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,8 +6,6 @@ from langchain.agents import load_tools, initialize_agent
|
|
| 6 |
from langchain.agents import AgentType
|
| 7 |
from langchain.tools import AIPluginTool
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
| 11 |
def run(prompt, plugin_json, openai_api_key):
|
| 12 |
os.environ["OPENAI_API_KEY"] = openai_api_key
|
| 13 |
tool = AIPluginTool.from_plugin_url(plugin_json)
|
|
@@ -19,13 +17,14 @@ def run(prompt, plugin_json, openai_api_key):
|
|
| 19 |
|
| 20 |
title="""
|
| 21 |
<div style="text-align:center;">
|
| 22 |
-
<h1>LangChain + ChatGPT Plugins playground</h1>
|
| 23 |
-
<p>
|
| 24 |
-
This is a demo for the <a href="https://python.langchain.com/en/latest/modules/agents/tools/examples/chatgpt_plugins.html", target="_blank">ChatGPT Plugins LangChain</a> usecase<br />
|
| 25 |
-
Be aware that it currently only works with plugins that do not require auth.
|
| 26 |
-
</p>
|
| 27 |
</div>
|
| 28 |
"""
|
|
|
|
| 29 |
with gr.Blocks(css="style.css") as demo:
|
| 30 |
with gr.Column(elem_id="col-container"):
|
| 31 |
gr.HTML(title)
|
|
@@ -38,4 +37,4 @@ with gr.Blocks(css="style.css") as demo:
|
|
| 38 |
inputs=[prompt, plugin, openai_api_key],
|
| 39 |
outputs=[response]
|
| 40 |
)
|
| 41 |
-
demo.launch()
|
|
|
|
| 6 |
from langchain.agents import AgentType
|
| 7 |
from langchain.tools import AIPluginTool
|
| 8 |
|
|
|
|
|
|
|
| 9 |
def run(prompt, plugin_json, openai_api_key):
|
| 10 |
os.environ["OPENAI_API_KEY"] = openai_api_key
|
| 11 |
tool = AIPluginTool.from_plugin_url(plugin_json)
|
|
|
|
| 17 |
|
| 18 |
title="""
|
| 19 |
<div style="text-align:center;">
|
| 20 |
+
<h1>LangChain + ChatGPT Plugins playground</h1>
|
| 21 |
+
<p>
|
| 22 |
+
This is a demo for the <a href="https://python.langchain.com/en/latest/modules/agents/tools/examples/chatgpt_plugins.html", target="_blank">ChatGPT Plugins LangChain</a> usecase<br />
|
| 23 |
+
Be aware that it currently only works with plugins that do not require auth.
|
| 24 |
+
</p>
|
| 25 |
</div>
|
| 26 |
"""
|
| 27 |
+
|
| 28 |
with gr.Blocks(css="style.css") as demo:
|
| 29 |
with gr.Column(elem_id="col-container"):
|
| 30 |
gr.HTML(title)
|
|
|
|
| 37 |
inputs=[prompt, plugin, openai_api_key],
|
| 38 |
outputs=[response]
|
| 39 |
)
|
| 40 |
+
demo.queue().launch()
|