jinysun commited on
Commit
93ddb5a
·
verified ·
1 Parent(s): 90b40ad

Update tools.py

Browse files
Files changed (1) hide show
  1. tools.py +19 -16
tools.py CHANGED
@@ -6,7 +6,7 @@ from langchain.base_language import BaseLanguageModel
6
  from tool import *
7
 
8
 
9
- def make_tools(llm: BaseLanguageModel, api_keys: dict = {}, verbose=True, image_path = None, file_path = None):
10
  serp_api_key = api_keys.get("SERP_API_KEY") or os.getenv("SERP_API_KEY")
11
  image_path = image_path
12
  file_path = file_path
@@ -17,7 +17,7 @@ def make_tools(llm: BaseLanguageModel, api_keys: dict = {}, verbose=True, image
17
  semantic_scholar_api_key = api_keys.get("SEMANTIC_SCHOLAR_API_KEY") or os.getenv(
18
  "SEMANTIC_SCHOLAR_API_KEY"
19
  )
20
-
21
  all_tools = load_tools(
22
  [
23
  #"python_repl",
@@ -26,13 +26,13 @@ def make_tools(llm: BaseLanguageModel, api_keys: dict = {}, verbose=True, image
26
  # "human"
27
  ]
28
  )
29
-
30
  all_tools += [
31
- browseruse(),
32
-
33
- rag(),
34
- codewriter(),
35
 
 
 
 
36
  Query2SMILES(chemspace_api_key),
37
  Mol2SMILES(chemspace_api_key) ,
38
  Query2CAS(),
@@ -47,24 +47,27 @@ def make_tools(llm: BaseLanguageModel, api_keys: dict = {}, verbose=True, image
47
  acceptor_predictor(),
48
  homolumo_predictor(),
49
  dap_screen(),
50
- graphconverter(),
51
  molgen(),
52
  dap_predictor(),
53
- Scholar2ResultLLM(
54
- llm=llm,
55
- openai_api_key=openai_api_key,
56
- semantic_scholar_api_key=semantic_scholar_api_key ),
57
  ]
58
-
 
 
 
 
 
 
59
  if serp_api_key:
60
  all_tools += [WebSearch(serp_api_key)
61
  ]
62
  if image_path is not None:
63
- all_tools += [Imageanalysis(image_path),
64
-
65
  ]
66
  if file_path is not None:
67
- all_tools += [pdfreader(file_path),
68
  ]
69
 
70
  return all_tools
 
 
6
  from tool import *
7
 
8
 
9
+ def make_tools(llm: BaseLanguageModel, api_keys: dict = {}, verbose=True, image_path = r"...", file_path = r"..."):
10
  serp_api_key = api_keys.get("SERP_API_KEY") or os.getenv("SERP_API_KEY")
11
  image_path = image_path
12
  file_path = file_path
 
17
  semantic_scholar_api_key = api_keys.get("SEMANTIC_SCHOLAR_API_KEY") or os.getenv(
18
  "SEMANTIC_SCHOLAR_API_KEY"
19
  )
20
+
21
  all_tools = load_tools(
22
  [
23
  #"python_repl",
 
26
  # "human"
27
  ]
28
  )
29
+
30
  all_tools += [
31
+ # browseruse(openai_api_key),
 
 
 
32
 
33
+ rag(openai_api_key),
34
+ codewriter(llm=llm ,openai_api_key= openai_api_key),
35
+ graphconverter(),
36
  Query2SMILES(chemspace_api_key),
37
  Mol2SMILES(chemspace_api_key) ,
38
  Query2CAS(),
 
47
  acceptor_predictor(),
48
  homolumo_predictor(),
49
  dap_screen(),
50
+
51
  molgen(),
52
  dap_predictor(),
53
+
 
 
 
54
  ]
55
+ if semantic_scholar_api_key:
56
+ all_tools += [ LiteratureSearch(
57
+ llm=llm,
58
+ openai_api_key=openai_api_key,
59
+ semantic_scholar_api_key=semantic_scholar_api_key ),
60
+ ]
61
+
62
  if serp_api_key:
63
  all_tools += [WebSearch(serp_api_key)
64
  ]
65
  if image_path is not None:
66
+ all_tools += [Imageanalysis(image_path, openai_api_key),
 
67
  ]
68
  if file_path is not None:
69
+ all_tools += [pdfreader(file_path, openai_api_key),
70
  ]
71
 
72
  return all_tools
73
+