You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
swarms/swarms/tools/wikipedia/test.py

23 lines
652 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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, Arthurs Magazine or First for Women?")
agent("when was the first hunger games book published?")