Run through gpt_4v agent pipeline
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import requests
|
||||
import json
|
||||
|
||||
|
||||
class PythonController:
|
||||
def __init__(self, http_server: str):
|
||||
self.http_server = http_server
|
||||
|
||||
|
||||
def _execute_python_command(self, command: str) -> None:
|
||||
payload = json.dumps({
|
||||
"command": command
|
||||
@@ -12,7 +13,7 @@ class PythonController:
|
||||
headers = {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
|
||||
|
||||
try:
|
||||
response = requests.post(self.http_server + "/execute", headers=headers, data=payload)
|
||||
if response.status_code == 200:
|
||||
@@ -22,10 +23,11 @@ class PythonController:
|
||||
except requests.exceptions.RequestException as e:
|
||||
print("An error occurred while trying to execute the command:", e)
|
||||
|
||||
|
||||
# example usage
|
||||
if __name__ == '__main__':
|
||||
# replace with your actual server URL of the vm
|
||||
server_url = "http://192.168.7.129:5000"
|
||||
server_url = "http://192.168.7.129:5000"
|
||||
controller = PythonController(server_url)
|
||||
|
||||
# example commands
|
||||
|
||||
Reference in New Issue
Block a user