--- base_model: unsloth/llama-3-8b-Instruct-bnb-4bit language: - en license: apache-2.0 tags: - llama - gguf --- # Trained For: Coding with Extractable Tags This model has been trained on coding wrapped in special tags. # Example System Prompt ``` You are a master developer, when giving the user code you complete the entire project including all files needed and a usage example. You should provide all the code needed for the entire project ready to use. Your output fill follow a XML style tag or multiple tags for multiple items. All blocks of code will be wrapped in and tags each codestart tag will contain some information on file contents. Include the paramters in the codestart tag: - type: The type of content, text, python, css, javascript, typescript, markdown, csharp etc. - isFile: If this file is to be saved in the project. - title: The title of the file, simple and concise. - file: This is the path to the file in the project. Should be valid file name and path. Required if isFile set to true. Here are some examples: CODE HERE TEXT HERE PYTHON CODE HERE CSS HERE MARKDOWN HERE You should leverage local technology instead of paid/remote services example: SQLite over MySQL unless requested to use specific technology or it is a better choice. Make sure to always use the codestart and codeend tags, you can have multiple sets of tags per response if needed. ``` # Tests: **User Input**: Write a python program for a simple restful api **Output**: ``` Here is an example of a simple RESTful API using Flask in Python: import flask from flask import request, jsonify app = flask.Flask(__name__) # A sample data store (you would replace this with your own data storage) people = [ {"id": 1, "name": "John", "age": 30}, {"id": 2, "name": "Jane", "age": 25} ] @app.route('/', methods=['GET']) def index(): return "

RESTful API

" @app.route('/api/person', methods=['GET']) def get_all_persons(): return jsonify(people) @app.route('/api/person/', methods=['GET']) def get_person(id): result = next((i for i in people if i["id"] == id), None) if not result: return "Person not found", 404 return jsonify(result) @app.route('/api/person', methods=['POST']) def add_person(): new_person = { "id": len(people) + 1, "name": request.json['name'], "age": request.json['age'] } people.append(new_person) return jsonify(new_person), 201 @app.route('/api/person/', methods=['PUT']) def update_person(id): result = next((i for i in people if i["id"] == id), None) if not result: return "Person not found", 404 result["name"] = request.json.get('name', result["name"]) result["age"] = request.json.get('age', result["age"]) return jsonify(result) @app.route('/api/person/', methods=['DELETE']) def delete_person(id): global people people[:] = [p for p in people if p["id"] != id] return "Person deleted", 200 if __name__ == '__main__': app.run() You can run this application with `python main.py` and access it through your web browser at `http://localhost:5000`. The API has the following endpoints: - GET /api/person: Returns a list of all persons. - GET /api/person/: Returns a specific person by ID. - POST /api/person: Adds a new person to the list. - PUT /api/person/: Updates an existing person. - DELETE /api/person/: Deletes a person. Please note that this is a very simple example and in a real application you would likely want to handle errors more robustly, add authentication and authorization, etc. ```