A Flask-based REST API server that provides GPT model interaction and file management capabilities.
Enhance your workflow with these detailed Git tips:
# 1. Before pushing, update your local repository:
git fetch -p # Fetch remote changes and prune deleted branches
# 2. If the main branch has new changes:
git checkout main
git pull # Update your local main branch with the latest commits
git checkout your_branch
git rebase -i main # Interactively rebase your branch to integrate changes and resolve conflicts
# 3. When starting a new feature or fix:
git checkout -b your_branch # Create a new branch based on the updated main
# Develop your feature, then repeat step 2 to stay in sync with main
git push --set-upstream origin your_branch # Push your branch to the remote repository
# 4. Once your changes are reviewed:
# Open a pull request on GitHub to merge your_branch into mainAdditional tips:
- Use descriptive commit messages.
- Frequently rebase to catch conflicts early.
- Leverage branch protection rules on GitHub for quality control.
- Consider squashing commits for a cleaner history.
- Install dependencies:
pip install -r requirements.txt- Configure environment variables:
- Create
.envfile with:OPENAI_API_URL=your_openai_api_url OPENAI_API_KEY=your_openai_api_key DEEPSEEK_API_URL=your_deepseek_api_url DEEPSEEK_API_KEY=your_deepseek_api_key
- Run the server with additional arguments:
python src/app.py --debug --host 0.0.0.0 --port 5000see more details
- Endpoint:
/ask - Method: POST
- Request Format:
{ "prompt": "Your question here" } - Response:
{ "response": "GPT response content" }
- Endpoint:
/upload - Method: POST
- Content-Type: multipart/form-data
- Parameters:
file: File to uploadpath: Target directory path
- Response:
{ "message": "File uploaded successfully" }
- Endpoint:
/list - Method: GET
- Query Parameters:
path: Directory path to list
- Response:
["file1.txt", "file2.txt", "directory1"]
- Endpoint:
/mkdir - Method: POST
- Request Format:
{ "path": "desired/directory/path" } - Response:
{ "message": "Directory created successfully" }
- 410: No prompt provided
- 411: Unknown model specified
- 420: No file part in request
- 421: No path specified
- 422: Invalid path
- 423: Path does not exist
- 424: No selected file
- 425: Path already exists
- Add Database
- [] Add an item to distinguish IOS and Android Version.
Ip: 120.25.178.24
- download private key in group chat.
the key file name is dataset_app.pem
please contact Wenjie (wduaj@cse.ust.hk)
and move it in ~/.ssh/
- Add the config in ~/.ssh/config
chmod 400 ~/.ssh/dataset_app.pem
Host ecs
HostName 120.25.178.24
Port 22
User root
IdentityFile ~/.ssh/dataset_app.pem
- Use ssh login Terminal or VSCode