<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def send_message(chat_id):
 """Send a message to a chat If a media file is found, send_media is called, else a simple text message is sent """


    files = request.files

    if files:
        res = send_media(chat_id, request)
    else:
        message = request.form.get('message')
        res = g.driver.chat_send_message(chat_id, message)

    if res:
        return jsonify(res)
    else:
        return False