-
-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement anthropic-style computer tool (#225)
* feat: started working on anthropic-style computer tool * Apply suggestions from code review Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> * fix: progress on computer use * fix: added Dockerfile.server * fix: fixed vnc in computer use webui * docs: fixed docs for computer use * fix: rewrote computer_action function to not be a generator * docs: fixed server docs for computer use * docs: refactored computer use warning into seperate file * fix: optimized Dockerfile.computer for faster rebuilds * fix: refactor and misc fixes to computer use * fix: enable select tools in computer use context * fix: multiple fixes to computer use and web ui * fix: disable computer tool unless explicitly enabled * fix: removed deleted file from .dockerignore * docs: minor fix to computer use docs --------- Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
- Loading branch information
1 parent
a6b41aa
commit 175167e
Showing
34 changed files
with
965 additions
and
47 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.. warning:: | ||
|
||
The computer use interface is experimental and has serious security implications. | ||
Please use with caution and see Anthropic's documentation on `computer use <https://docs.anthropic.com/en/docs/build-with-claude/computer-use>`_ for additional guidance. |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>gptme - Computer Use</title> | ||
<meta name="permissions-policy" content="fullscreen=*" /> | ||
<style> | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
overflow: hidden; | ||
font-family: system-ui, -apple-system, sans-serif; | ||
} | ||
.container { | ||
display: flex; | ||
height: 100vh; | ||
width: 100vw; | ||
} | ||
.chat { | ||
flex: 1; | ||
border: none; | ||
height: 100vh; | ||
background: #f5f5f5; | ||
} | ||
.desktop { | ||
flex: 2; | ||
border: none; | ||
height: 100vh; | ||
} | ||
.controls { | ||
position: absolute; | ||
top: 10px; | ||
right: 10px; | ||
z-index: 1000; | ||
display: flex; | ||
gap: 10px; | ||
} | ||
button { | ||
padding: 8px 16px; | ||
border-radius: 4px; | ||
border: 1px solid #ccc; | ||
background: white; | ||
cursor: pointer; | ||
font-size: 14px; | ||
} | ||
button:hover { | ||
background: #f0f0f0; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<div class="chat"> | ||
<!-- Will be replaced with gptme chat interface --> | ||
<iframe src="/chat" style="width: 100%; height: 100%; border: none;"></iframe> | ||
</div> | ||
<iframe | ||
id="vnc" | ||
class="desktop" | ||
src="http://127.0.0.1:6080/vnc.html?&resize=scale&autoconnect=1&view_only=1&reconnect=1&reconnect_delay=2000" | ||
allow="fullscreen" | ||
></iframe> | ||
</div> | ||
<div class="controls"> | ||
<button id="toggleViewOnly">Toggle Screen Control (Off)</button> | ||
<button id="toggleFullscreen">Toggle Fullscreen</button> | ||
</div> | ||
<script> | ||
// Toggle view-only mode | ||
document.getElementById("toggleViewOnly").addEventListener("click", function() { | ||
var vncIframe = document.getElementById("vnc"); | ||
var button = document.getElementById("toggleViewOnly"); | ||
var currentSrc = vncIframe.src; | ||
if (currentSrc.includes("view_only=1")) { | ||
vncIframe.src = currentSrc.replace("view_only=1", "view_only=0"); | ||
button.innerText = "Toggle Screen Control (On)"; | ||
} else { | ||
vncIframe.src = currentSrc.replace("view_only=0", "view_only=1"); | ||
button.innerText = "Toggle Screen Control (Off)"; | ||
} | ||
}); | ||
|
||
// Toggle fullscreen | ||
document.getElementById("toggleFullscreen").addEventListener("click", function() { | ||
if (!document.fullscreenElement) { | ||
document.documentElement.requestFullscreen(); | ||
} else { | ||
document.exitFullscreen(); | ||
} | ||
}); | ||
</script> | ||
</body> | ||
</html> |
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
Oops, something went wrong.