-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SQUASHED & CHERRY PICKED from feature/anthropic-native-bash-tool
- Loading branch information
Showing
7 changed files
with
154 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from inspect_ai import Task, task | ||
from inspect_ai.dataset import Sample | ||
from inspect_ai.solver import generate, use_tools | ||
from inspect_ai.tool import tool | ||
|
||
|
||
@tool | ||
def computer(): | ||
async def execute( | ||
action: str, | ||
text: str | None = None, | ||
coordinate: list[int] | None = None, | ||
) -> str: | ||
"""Take an action using a computer. | ||
Args: | ||
action: Action to take. | ||
text: Text related to the action | ||
coordinate: Coordinate related to the action. | ||
Returns: | ||
The sound that was passed to check. | ||
""" | ||
return action | ||
|
||
return execute | ||
|
||
|
||
@task | ||
def hello_computer(): | ||
return Task( | ||
dataset=[Sample(input="Call the computer tool with the action 'screenshot'")], | ||
solver=[ | ||
use_tools([computer()]), | ||
generate(), | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters