File size: 649 Bytes
e67043b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from swarms.tools.agent.singletool import load_single_tools, STQuestionAnswerer
import requests
import json

# at = "{\"entity\": \"Arthur\"s Magazine\"}"
# print(at[19])
# print(len(at))
# a = json.loads("{\"entity\": \"Arthur\"s Magazine\"}")
# print(a)

tool_name, tool_url = "wikipedia", "http://127.0.0.1:8079/tools/wikipedia/"
tools_name, tools_config = load_single_tools(tool_name, tool_url)
print(tools_name, tools_config)

qa = STQuestionAnswerer()

agent = qa.load_tools(tools_name, tools_config)

agent("Which magazine was started first, Arthur’s Magazine or First for Women?")

agent("when was the first hunger games book published?")