michal commited on
Commit
2c59bf2
·
1 Parent(s): c62c186
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -25,6 +25,7 @@ from threading import Lock
25
  from langchain.llms import OpenAI
26
  from langchain.chains.conversation.memory import ConversationBufferMemory
27
  from langchain.agents import tool, load_tools, initialize_agent
 
28
  from langchain import ConversationChain, LLMChain
29
  import whisper
30
  import warnings
@@ -89,7 +90,7 @@ def get_text(qry):
89
  return prediction_text
90
 
91
 
92
- @tool("mysearch", return_direct=True)
93
  def mysearch(query: str) -> str:
94
  """Query our own datasets.
95
  """
@@ -163,7 +164,7 @@ tmdb_bearer_token = os.environ["TMDB_BEARER_TOKEN"]
163
  TOOLS_LIST = ['serpapi', 'wolfram-alpha', 'pal-math', 'pal-colored-objects', 'news-api', 'tmdb-api',
164
  'open-meteo-api'] # 'google-search'
165
  # TOOLS_DEFAULT_LIST = ['mysearch', 'serpapi', 'pal-math']
166
- TOOLS_DEFAULT_LIST = ['mysearch']
167
  BUG_FOUND_MSG = "Congratulations, you've found a bug in this application!"
168
  AUTH_ERR_MSG = "Please paste your OpenAI key from openai.com to use this application. It is not necessary to hit a button or key after pasting it."
169
  MAX_TOKENS = 512
 
25
  from langchain.llms import OpenAI
26
  from langchain.chains.conversation.memory import ConversationBufferMemory
27
  from langchain.agents import tool, load_tools, initialize_agent
28
+ from langchain.agents import Tool
29
  from langchain import ConversationChain, LLMChain
30
  import whisper
31
  import warnings
 
90
  return prediction_text
91
 
92
 
93
+ @tool
94
  def mysearch(query: str) -> str:
95
  """Query our own datasets.
96
  """
 
164
  TOOLS_LIST = ['serpapi', 'wolfram-alpha', 'pal-math', 'pal-colored-objects', 'news-api', 'tmdb-api',
165
  'open-meteo-api'] # 'google-search'
166
  # TOOLS_DEFAULT_LIST = ['mysearch', 'serpapi', 'pal-math']
167
+ TOOLS_DEFAULT_LIST = [mysearch]
168
  BUG_FOUND_MSG = "Congratulations, you've found a bug in this application!"
169
  AUTH_ERR_MSG = "Please paste your OpenAI key from openai.com to use this application. It is not necessary to hit a button or key after pasting it."
170
  MAX_TOKENS = 512