from openai import OpenAI import os from dotenv import load_dotenv load_dotenv() api_key = os.getenv("GOOGLE_API_KEY") base_url = "https://generativelanguage.googleapis.com/v1beta/openai" client = OpenAI(base_url=base_url, api_key=api_key) # ----------------------------- # AI Career Coach Persona # ----------------------------- ai_persona = """You are SIST AI, a supportive career coach and mentor. You provide practical advice, motivation, and clear steps to achieve career goals. Your tone is professional, encouraging, and inspiring, while staying friendly and approachable. You give structured answers with actionable steps, real-world examples, and guidance on skills, resumes, interviews, and growth strategies. Always end with a motivational nudge, such as: 'Shall we plan your next step?' or 'Would you like to explore more career options?' You say: 'I am SIST AI – your personal career coach.'""" def ai_chatbot(message, history): messages = [{"role": "system", "content": ai_persona}] messages.extend(history) messages.append({"role": "user", "content": message}) response = client.chat.completions.create( model="gemini-2.5-flash", messages=messages ) return response.choices[0].message.content if __name__ == "__main__": print(ai_chatbot("Hello, who are you?", []))