Skip to content

Commit

Permalink
formatting fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonalaird committed Mar 20, 2024
1 parent a7f4b58 commit 88ac6a2
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions vision_agent/tools/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ class CLIP(Tool):
"Here are some exmaples of how to use the tool, the examples are in the format of User Question: which will have the user's question in quotes followed by the parameters in JSON format, which is the parameters you need to output to call the API to solve the user's question.\n"
)
usage = {
"required_parameters": [{"name": "prompt", "type": "List[str]"}, {"name": "image", "type": "str"}],
"required_parameters": [
{"name": "prompt", "type": "List[str]"},
{"name": "image", "type": "str"},
],
"examples": [
{
"scenario": "Can you classify this image as a cat? Image name: cat.jpg",
Expand Down Expand Up @@ -120,7 +123,10 @@ class GroundingDINO(Tool):
'An example output would be: [{"label": ["car"], "score": [0.99], "bbox": [[0.1, 0.2, 0.3, 0.4]]}]\n'
)
usage = {
"required_parameters": [{"name": "prompt", "type": "str"}, {"name": "image", "type": "str"}],
"required_parameters": [
{"name": "prompt", "type": "str"},
{"name": "image", "type": "str"},
],
"examples": [
{
"scenario": "Can you build me a car detector?",
Expand All @@ -132,7 +138,10 @@ class GroundingDINO(Tool):
},
{
"scenario": "Detect the red shirts and green shirst. Image name: shirts.jpg",
"parameters": {"prompt": "red shirt. green shirt", "image": "shirts.jpg"},
"parameters": {
"prompt": "red shirt. green shirt",
"image": "shirts.jpg",
},
},
],
}
Expand Down Expand Up @@ -193,7 +202,10 @@ class GroundingSAM(Tool):
"Here are some exmaples of how to use the tool, the examples are in the format of User Question: which will have the user's question in quotes followed by the parameters in JSON format, which is the parameters you need to output to call the API to solve the user's question.\n"
)
usage = {
"required_parameters": [{"name": "prompt", "type": "List[str]"}, {"name": "image", "type": "str"}],
"required_parameters": [
{"name": "prompt", "type": "List[str]"},
{"name": "image", "type": "str"},
],
"examples": [
{
"scenario": "Can you build me a car segmentor?",
Expand All @@ -205,9 +217,12 @@ class GroundingSAM(Tool):
},
{
"scenario": "Can you build me a tool that segments red shirts and green shirts? Image name: shirts.jpg",
"parameters": {"prompt": ["red shirt", "green shirt"], "image": "shirts.jpg"},
"parameters": {
"prompt": ["red shirt", "green shirt"],
"image": "shirts.jpg",
},
},
]
],
}

def __call__(self, prompt: List[str], image: Union[str, ImageType]) -> List[Dict]:
Expand Down

0 comments on commit 88ac6a2

Please sign in to comment.