forked from OpenBMB/BMTools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
42 lines (32 loc) · 1.57 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from bmtools.agent.singletool import load_single_tools, STQuestionAnswerer
# Langchain
tool_name, tool_url = 'weather', "http://127.0.0.1:8079/tools/weather/"
tool_name, tool_config = load_single_tools(tool_name, tool_url)
print(tool_name, tool_config)
stqa = STQuestionAnswerer()
agent = stqa.load_tools(tool_name, tool_config, prompt_type="react-with-tool-description")
agent("write a weather report for SF today")
# BabyAGI
# tool_name, tool_url = 'weather', "http://127.0.0.1:8079/tools/weather/"
# tool_name, tool_config = load_single_tools(tool_name, tool_url)
# print(tool_name, tool_config)
# stqa = STQuestionAnswerer()
# agent = stqa.load_tools(tool_name, tool_config, prompt_type="babyagi")
# agent("write a weather report for SF today")
# Auto-GPT
# tool_name, tool_url = 'weather', "http://127.0.0.1:8079/tools/weather/"
# tool_name, tool_config = load_single_tools(tool_name, tool_url)
# print(tool_name, tool_config)
# stqa = STQuestionAnswerer()
# agent = stqa.load_tools(tool_name, tool_config, prompt_type="autogpt")
# agent.run(["write a weather report for SF today"])
"""
from bmtools.agent.singletool import load_single_tools, STQuestionAnswerer
tool_name, tool_url = 'wikipedia', "http://127.0.0.1:8079/tools/wikipedia/"
tool_name, tool_config = load_single_tools(tool_name, tool_url)
print(tool_name, tool_config)
stqa = STQuestionAnswerer()
agent = stqa.load_tools(tool_name, tool_config, prompt_type="babyagi")
# agent = stqa.load_tools(tool_name, tool_config, prompt_type="react-with-tool-description")# prompt_type="babyagi")
agent("Where is Yaoming Born?")
"""