Initialize evaluation protocols and examples; Implement one kind of eval; Update requirements

This commit is contained in:
Timothyxxx
2023-12-12 18:10:55 +08:00
parent 4b3af14b8f
commit 2ca36109b5
8 changed files with 139 additions and 50 deletions

View File

@@ -20,6 +20,18 @@ class PythonController:
print("Failed to get screenshot. Status code:", response.status_code)
return None
def get_file(self, file_path: str):
"""
Gets a file from the server.
"""
response = requests.post(self.http_server + "/file", data={"file_path": file_path})
if response.status_code == 200:
print("File downloaded successfully")
return response.content
else:
print("Failed to get file. Status code:", response.status_code)
return None
def execute_python_command(self, command: str) -> None:
"""
Executes a python command on the server.