Spaces:
Runtime error
Runtime error
| """ | |
| Health check routes | |
| """ | |
| import os | |
| from flask import Blueprint, jsonify, current_app | |
| health_bp = Blueprint('health', __name__) | |
| def health_check(): | |
| """ | |
| Health check endpoint | |
| """ | |
| return jsonify({ | |
| "status": "healthy", | |
| "service": "flask-openai-chat", | |
| "version": "1.0.0" | |
| }), 200 | |
| def root(): | |
| """ | |
| Root endpoint with API information | |
| """ | |
| return jsonify({ | |
| "message": "Flask OpenAI Chat API", | |
| "version": "1.0.0", | |
| "endpoints": { | |
| "chat": "/chat (POST)", | |
| "models": "/chat/models (GET)", | |
| "health": "/health (GET)" | |
| }, | |
| "documentation": "Send POST request to /chat with JSON: {'message': 'your message'}" | |
| }), 200 |