Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NoOp #41

Merged
merged 4 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion vision_agent/agent/vision_agent_prompts.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VISION_AGENT_REFLECTION = """You are an advanced reasoning agent that can improve based on self refection. You will be given a previous reasoning trial in which you were given the user's question, the available tools that the agent has, the decomposed tasks and tools that the agent used to answer the question and the final answer the agent provided. You must determine if the agent's answer was correct or incorrect. If the agent's answer was correct, respond with Finish. If the agent's answer was incorrect, you must diagnose a possible reason for failure or phrasing discrepancy and devise a new, concise, high level plan that aims to mitigate the same failure with the tools avilable. Use complete sentences.
VISION_AGENT_REFLECTION = """You are an advanced reasoning agent that can improve based on self refection. You will be given a previous reasoning trial in which you were given the user's question, the available tools that the agent has, the decomposed tasks and tools that the agent used to answer the question and the final answer the agent provided. You must determine if the agent's answer was correct or incorrect. If the agent's answer was correct, respond with Finish. If the agent's answer was incorrect, you must diagnose a possible reason for failure or phrasing discrepancy and devise a new, concise, high level plan that aims to mitigate the same failure with the tools available. Use complete sentences.

User's question: {question}

Expand Down
20 changes: 20 additions & 0 deletions vision_agent/tools/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,25 @@ class Tool(ABC):
usage: Dict


class NoOp(Tool):
name = "noop_"
description = (
"'noop_' is a no-op tool that does nothing if you do not need to use a tool."
)
usage = {
"required_parameters": [],
"examples": [
{
"scenario": "If you do not want to use a tool.",
"parameters": {},
}
],
}

def __call__(self) -> None:
return None


class CLIP(Tool):
r"""CLIP is a tool that can classify or tag any image given a set if input classes
or tags.
Expand Down Expand Up @@ -612,6 +631,7 @@ def __call__(self, input: List[int]) -> float:
i: {"name": c.name, "description": c.description, "usage": c.usage, "class": c}
for i, c in enumerate(
[
NoOp,
CLIP,
GroundingDINO,
AgentGroundingSAM,
Expand Down
Loading