Update app3.py
Browse files53 unmodified lines5455565758596061625 unmodified lines686970717273747576777853 unmodified linesst.error("Please enter a topic to generate a post.")def generate_gemini_post(role, temp):{ # Define a function to generate LinkedIn posts using the Gemini API# Example implementation:#gemini = Gemini(api_key=st.secrets["YOUR_GEMINI_API_KEY"], temperature=temp)prompt = (f"You as {role} Create a professional, engaging LinkedIn post about {topic}. "f"Adjust the tone and style based on a temperature of {temp}. "5 unmodified lines)llm = ChatGoogleGenerativeAI(model="gemini-pro")result = llm.invoke(prompt)return print(result.content)# Call Gemini API functions to generate LinkedIn post# gemini.generate_linkedin_post(topic, role)st.error("Gemini API integration is not yet implemented.")}if __name__ == "__main__":main()53 unmodified lines5455565758595 unmodified lines656667686970717273747553 unmodified linesst.error("Please enter a topic to generate a post.")def generate_gemini_post(role, temp):prompt = (f"You as {role} Create a professional, engaging LinkedIn post about {topic}. "f"Adjust the tone and style based on a temperature of {temp}. "5 unmodified lines)llm = ChatGoogleGenerativeAI(model="gemini-pro")result = llm.invoke(prompt)return print(result.content)# Call Gemini API functions to generate LinkedIn post# gemini.generate_linkedin_post(topic, role)st.error("Gemini API integration is not yet implemented.")if __name__ == "__main__":main()
app3.py+3-6