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

V1 #4

Merged
merged 8 commits into from
Nov 1, 2024
Merged

V1 #4

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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Run the server
If you don't have public ip and domain name, you can use `ngrok` or similar services to get a https address to the api.

The specify the server url in the `wcgw` command like so
`wcgw --server-url https://your-url/register`
`wcgw --server-url https://your-url/v1/register`

# [Optional] Local shell access with openai API key

Expand Down
252 changes: 196 additions & 56 deletions gpt_action_json_schema.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,69 @@

{
"openapi": "3.1.0",
"info": {
"title": "FastAPI",
"version": "0.1.0"
},
"servers": [
{"url": "https://wcgw.arcfu.com"}
{
"url": "https://604f-2401-4900-1c8e-e61d-40fc-eab7-f5c2-c8ad.ngrok-free.app"
}
],
"paths": {
"/write_file": {
"/v1/write_file": {
"post": {
"x-openai-isConsequential": false,
"summary": "Write File",
"operationId": "write_file_write_file__uuid__post",
"parameters": [
{
"name": "user_id",
"in": "query",
"required": true,
"schema": {
"type": "string",
"format": "uuid",
"title": "User Id"
"operationId": "write_file_v1_write_file_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/WritefileWithUUID"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "string",
"title": "Response Write File V1 Write File Post"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
],
}
}
},
"/v1/reset_shell": {
"post": {
"x-openai-isConsequential": false,
"summary": "Reset Shell",
"operationId": "reset_shell_v1_reset_shell_post",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Writefile"
"$ref": "#/components/schemas/ResetShellWithUUID"
}
}
}
},
"required": true
},
"responses": {
"200": {
Expand All @@ -43,7 +72,7 @@
"application/json": {
"schema": {
"type": "string",
"title": "Response Write File Write File Uuid Post"
"title": "Response Reset Shell V1 Reset Shell Post"
}
}
}
Expand All @@ -61,32 +90,60 @@
}
}
},
"/execute_bash": {
"/v1/bash_command": {
"post": {
"x-openai-isConsequential": false,
"summary": "Execute Bash",
"operationId": "execute_bash_execute_bash__uuid__post",
"parameters": [
{
"name": "user_id",
"in": "query",
"required": true,
"schema": {
"type": "string",
"format": "uuid",
"title": "User Id"
"summary": "Bash Command",
"operationId": "bash_command_v1_bash_command_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CommandWithUUID"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "string",
"title": "Response Bash Command V1 Bash Command Post"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
],
}
}
},
"/v1/bash_interaction": {
"post": {
"x-openai-isConsequential": false,
"summary": "Bash Interaction",
"operationId": "bash_interaction_v1_bash_interaction_post",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ExecuteBash"
"$ref": "#/components/schemas/BashInteractionWithUUID"
}
}
}
},
"required": true
},
"responses": {
"200": {
Expand All @@ -95,7 +152,7 @@
"application/json": {
"schema": {
"type": "string",
"title": "Response Execute Bash Execute Bash Uuid Post"
"title": "Response Bash Interaction V1 Bash Interaction Post"
}
}
}
Expand All @@ -116,9 +173,9 @@
},
"components": {
"schemas": {
"ExecuteBash": {
"BashInteractionWithUUID": {
"properties": {
"execute_command": {
"send_text": {
"anyOf": [
{
"type": "string"
Expand All @@ -127,27 +184,22 @@
"type": "null"
}
],
"title": "Execute Command"
"title": "Send Text"
},
"send_ascii": {
"send_specials": {
"anyOf": [
{
"items": {
"anyOf": [
{
"type": "integer"
},
{
"type": "string",
"enum": [
"Key-up",
"Key-down",
"Key-left",
"Key-right",
"Enter",
"Ctrl-c"
]
}
"type": "string",
"enum": [
"Key-up",
"Key-down",
"Key-left",
"Key-right",
"Enter",
"Ctrl-c",
"Ctrl-d",
"Ctrl-z"
]
},
"type": "array"
Expand All @@ -156,11 +208,52 @@
"type": "null"
}
],
"title": "Send Specials"
},
"send_ascii": {
"anyOf": [
{
"items": {
"type": "integer"
},
"type": "array"
},
{
"type": "null"
}
],
"title": "Send Ascii"
},
"user_id": {
"type": "string",
"format": "uuid",
"title": "User Id"
}
},
"type": "object",
"title": "ExecuteBash"
"required": [
"user_id"
],
"title": "BashInteractionWithUUID"
},
"CommandWithUUID": {
"properties": {
"command": {
"type": "string",
"title": "Command"
},
"user_id": {
"type": "string",
"format": "uuid",
"title": "User Id"
}
},
"type": "object",
"required": [
"command",
"user_id"
],
"title": "CommandWithUUID"
},
"HTTPValidationError": {
"properties": {
Expand All @@ -175,6 +268,29 @@
"type": "object",
"title": "HTTPValidationError"
},
"ResetShellWithUUID": {
"properties": {
"should_reset": {
"type": "boolean",
"enum": [
true
],
"const": true,
"title": "Should Reset",
"default": true
},
"user_id": {
"type": "string",
"format": "uuid",
"title": "User Id"
}
},
"type": "object",
"required": [
"user_id"
],
"title": "ResetShellWithUUID"
},
"ValidationError": {
"properties": {
"loc": {
Expand Down Expand Up @@ -225,7 +341,31 @@
"file_content"
],
"title": "Writefile"
},
"WritefileWithUUID": {
"properties": {
"file_path": {
"type": "string",
"title": "File Path"
},
"file_content": {
"type": "string",
"title": "File Content"
},
"user_id": {
"type": "string",
"format": "uuid",
"title": "User Id"
}
},
"type": "object",
"required": [
"file_path",
"file_content",
"user_id"
],
"title": "WritefileWithUUID"
}
}
}
}
}
Loading
Loading