codechat-bison
POST {{baseUrl}}/projects/{{projectId}}/locations/{{locationId}}/publishers/google/models/:model_id_action
Request Body
{"instances"=>[{"messages"=>[{"content"=>"Develop a Flask app for encyption and decryption"}]}]}
RESPONSES
status: OK
{"predictions":[{"safetyAttributes":[{"scores":[0.1,0.1],"blocked":false,"categories":["Finance","Health"]}],"citationMetadata":[{"citations":[]}],"groundingMetadata":[{}],"candidates":[{"author":"1","content":" ```python\nfrom flask import Flask, request, render_template\nimport base64\n\napp = Flask(__name__)\n\n@app.route('/')\ndef index():\n return render_template('index.html')\n\n@app.route('/encrypt', methods=['POST'])\ndef encrypt():\n text = request.form.get('text')\n encoded_bytes = base64.b64encode(text.encode('utf-8'))\n encoded_text = encoded_bytes.decode('utf-8')\n return render_template('index.html', encrypted_text=encoded_text)\n\n@app.route('/decrypt', methods=['POST'])\ndef decrypt():\n encoded_text = request.form.get('encrypted_text')\n decoded_bytes = base64.b64decode(encoded_text.encode('utf-8'))\n decoded_text = decoded_bytes.decode('utf-8')\n return render_template('index.html', decrypted_text=decoded_text)\n\nif __name__ == '__main__':\n app.run(debug=True)\n```"}]}],"metadata":{"tokenMetadata":{"outputTokenCount":{"totalTokens":245,"totalBillableCharacters":692},"inputTokenCount":{"totalBillableCharacters":41,"totalTokens":10}}}}