mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2025-01-18 02:39:47 +00:00
renamed endpoint
This commit is contained in:
parent
e97e6ca3a8
commit
d193319fa6
11
app.py
11
app.py
@ -85,7 +85,7 @@ class Gpt4AllWebUI(GPT4AllAPI):
|
|||||||
|
|
||||||
|
|
||||||
self.add_endpoint(
|
self.add_endpoint(
|
||||||
"/get_available_space", "get_available_space", self.get_available_space, methods=["GET"]
|
"/disk_usage", "disk_usage", self.disk_usage, methods=["GET"]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -469,11 +469,14 @@ class Gpt4AllWebUI(GPT4AllAPI):
|
|||||||
print(result)
|
print(result)
|
||||||
return jsonify(result)
|
return jsonify(result)
|
||||||
|
|
||||||
def get_available_space(self):
|
def disk_usage(self):
|
||||||
current_drive = Path.cwd().anchor
|
current_drive = Path.cwd().anchor
|
||||||
disk_usage = psutil.disk_usage(current_drive)
|
disk_usage = psutil.disk_usage(current_drive)
|
||||||
available_space = disk_usage.free
|
return jsonify({
|
||||||
return jsonify({"available_space":available_space})
|
"total_space":disk_usage.total,
|
||||||
|
"available_space":disk_usage.free,
|
||||||
|
"percent_usage":disk_usage.percent
|
||||||
|
})
|
||||||
|
|
||||||
def list_bindings(self):
|
def list_bindings(self):
|
||||||
bindings_dir = Path('./bindings') # replace with the actual path to the models folder
|
bindings_dir = Path('./bindings') # replace with the actual path to the models folder
|
||||||
|
@ -240,18 +240,20 @@ This Flask server provides various endpoints to manage and interact with the cha
|
|||||||
- "/help": GET request endpoint to display the help page.
|
- "/help": GET request endpoint to display the help page.
|
||||||
- "/get_all_personalities": GET request endpoint to get all personalities array
|
- "/get_all_personalities": GET request endpoint to get all personalities array
|
||||||
- "/get_personality": GET request endpoint to get speciffic data based on request
|
- "/get_personality": GET request endpoint to get speciffic data based on request
|
||||||
- "/get_available_space": GET request endpoint to retrieve the available space in the current folder's drive.
|
- "/disk_usage": GET request endpoint to retrieve the available space in the current folder's drive.
|
||||||
Method: GET
|
Method: GET
|
||||||
Description: Retrieves the available space in bytes for the current folder's drive.
|
Description: Retrieves the available space in bytes for the current folder's drive.
|
||||||
Response:
|
Response:
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
Body: JSON object with a single entry 'available_space' containing the available space in bytes.
|
Body: JSON object with a single entry 'available_space' containing the available space in bytes.
|
||||||
Example Response:
|
Example Response:
|
||||||
json
|
```json
|
||||||
Copy code
|
|
||||||
{
|
{
|
||||||
"available_space": 1234567890
|
"total_space":1000000000000,
|
||||||
|
"available_space":515358106014,
|
||||||
|
"percent_usage":51.53
|
||||||
}
|
}
|
||||||
|
```
|
||||||
Example Usage:
|
Example Usage:
|
||||||
Request: GET /disk_space
|
Request: GET /disk_space
|
||||||
Response: 200 OK
|
Response: 200 OK
|
||||||
|
Loading…
Reference in New Issue
Block a user