Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
|
4 |
-
from langchain.
|
5 |
from langchain.agents import load_tools, initialize_agent
|
6 |
from langchain.agents import AgentType
|
7 |
from langchain.tools import AIPluginTool
|
@@ -12,7 +12,7 @@ def run(prompt, plugin_json, openai_api_key):
|
|
12 |
llm = ChatOpenAI(temperature=0, max_tokens=1000)
|
13 |
tools = load_tools(["requests_all"])
|
14 |
tools += [tool]
|
15 |
-
agent_chain = initialize_agent(tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=False,
|
16 |
return agent_chain.run(prompt)
|
17 |
|
18 |
title="""
|
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
|
4 |
+
from langchain.chat_models import ChatOpenAI
|
5 |
from langchain.agents import load_tools, initialize_agent
|
6 |
from langchain.agents import AgentType
|
7 |
from langchain.tools import AIPluginTool
|
|
|
12 |
llm = ChatOpenAI(temperature=0, max_tokens=1000)
|
13 |
tools = load_tools(["requests_all"])
|
14 |
tools += [tool]
|
15 |
+
agent_chain = initialize_agent(tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=False, max_tokens_limit=4097)
|
16 |
return agent_chain.run(prompt)
|
17 |
|
18 |
title="""
|