fffiloni commited on
Commit
adce109
1 Parent(s): 5c191fe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import os
2
  import gradio as gr
3
 
4
- from langchain.chat_agents import ChatOpenAI
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, reduce_k_below_max_tokens=True)
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="""