no planning just auto agent test

pull/160/head
Kye 2 years ago
parent 3adac9b8ff
commit e07246fa27

@ -63,7 +63,7 @@ class Swarms:
todo_prompt = PromptTemplate.from_template("You are a boss planer in a swarm who is an expert at coming up with a todo list for a given objective and then creating an worker to help you accomplish your task. Come up with a todo list for this objective: {objective} and then spawn a worker agent to complete the task for you. Always spawn an worker agent after creating a plan and pass the objective and plan to the worker agent.")
todo_chain = LLMChain(llm=llm, prompt=todo_prompt)
tools = [
Tool(name="TODO", func=todo_chain.run, description="useful for when you need to come up with todo lists. Input: an objective to create a todo list for. Output: a todo list for that objective. Please be very clear what the objective is!"),
# Tool(name="TODO", func=todo_chain.run, description="useful for when you need to come up with todo lists. Input: an objective to create a todo list for. Output: a todo list for that objective. Please be very clear what the objective is!"),
worker_node
]
suffix = """Question: {task}\n{agent_scratchpad}"""

@ -17,11 +17,6 @@ import requests
from bs4 import BeautifulSoup
# import llama_index
# from llama_index import GPTVectorStoreIndex
# from llama_index.readers.database import DatabaseReader
# from logger import logger
from swarms.utils.logger import logger
class ToolScope(Enum):
@ -31,10 +26,6 @@ class ToolScope(Enum):
SessionGetter = Callable[[], Tuple[str, AgentExecutor]]
# openai_api_key = os.environ["OPENAI_API_KEY"]
# llm = ChatOpenAI(model_name="gpt-4", temperature=1.0, openai_api_key=openai_api_key)
def tool(
name: str,
description: str,
@ -91,13 +82,13 @@ class BaseToolSet:
class RequestsGet(BaseToolSet):
@tool(
name="Requests Get",
description="A portal to the internet. "
"Use this when you need to get specific content from a website."
"Input should be a url (i.e. https://www.google.com)."
"The output will be the text response of the GET request.",
)
# @tool(
# name="Requests Get",
# description="A portal to the internet. "
# "Use this when you need to get specific content from a website."
# "Input should be a url (i.e. https://www.google.com)."
# "The output will be the text response of the GET request.",
# )
def get(self, url: str) -> str:
"""Run the tool."""
html = requests.get(url).text
@ -1068,7 +1059,7 @@ class CodeEditor(BaseToolSet):
"ex. test.py "
"Output will be success or error message.",
)
def delete(self, inputs: str) -> str:
def delete(self, inputs: str, filepath: str) -> str:
try:
with open(filepath, "w") as f:
f.write("")

Loading…
Cancel
Save