from flask import Flask, request, jsonify
def generate_prompt(user_input, ai_model="ChatGPT"):
return f"Generate a professional and detailed AI prompt for {ai_model} based on the following input: '{user_input}'. The prompt should be structured, engaging, and optimized for the best response. Output only the generated prompt without additional explanations."
app = Flask(__name__)
@app.route('/generate', methods=['POST'])
def generate():
data = request.json
user_input = data.get("input", "")
ai_model = data.get("ai_model", "ChatGPT")
if not user_input:
return jsonify({"error": "Input text is required."}), 400
prompt = generate_prompt(user_input, ai_model)
return jsonify({"generated_prompt": prompt})
if __name__ == '__main__':
app.run(debug=True)
Field Selectors - Empowering Your Career Choices Field Selectors is a comprehensive platform dedicated to guiding students and professionals in making informed career decisions. Our mission is to provide valuable insights, resources, and opportunities, focusing on a variety of career fields and educational scholarships. Whether you’re exploring potential career paths, looking for scholarship opportunities, or seeking personalized guidance, Field Selectors serves as a one-stop destination to unlo
0 Comments