VivekDS commited on
Commit
3b51958
·
verified ·
1 Parent(s): 87b3b49

Update app3.py

Browse files
Files changed (1) hide show
  1. app3.py +11 -10
app3.py CHANGED
@@ -57,17 +57,18 @@ def generate_gemini_post(role, temp):
57
  { # Define a function to generate LinkedIn posts using the Gemini API
58
  # Example implementation:
59
  #gemini = Gemini(api_key=st.secrets["YOUR_GEMINI_API_KEY"], temperature=temp)
60
- user_input = (
61
- f"You as {role} Create a professional, engaging LinkedIn post about {topic}."+
62
- f"Adjust the tone and style based on a temperature of {temp}. " +
63
- "It should start with an attention grabbing hook based on audience pain. "+
64
- "Then a line to agitate the user. This should be in the next line. "+
65
- "The post should be concise, informative, and suitable for a professional audience. "+
66
- "It should provide value, insights, or thought-provoking content related to the topic. "+
67
- "And only contain 3 points. "+
68
- )
 
69
  llm = ChatGoogleGenerativeAI(model="gemini-pro")
70
- result = llm.invoke(user_input)
71
  return print(result.content)
72
  # Call Gemini API functions to generate LinkedIn post
73
  # gemini.generate_linkedin_post(topic, role)
 
57
  { # Define a function to generate LinkedIn posts using the Gemini API
58
  # Example implementation:
59
  #gemini = Gemini(api_key=st.secrets["YOUR_GEMINI_API_KEY"], temperature=temp)
60
+ prompt = (
61
+ f"You as {role} Create a professional, engaging LinkedIn post about {topic}. "
62
+ f"Adjust the tone and style based on a temperature of {temp}. "
63
+ "It should start with an attention grabbing hook based on audience pain. "
64
+ "Then a line to agitate the user. This should be in the next line. "
65
+ "The post should be concise, informative, and suitable for a professional audience. "
66
+ "It should provide value, insights, or thought-provoking content related to the topic. "
67
+ "And only contain 3 points. "
68
+
69
+ )
70
  llm = ChatGoogleGenerativeAI(model="gemini-pro")
71
+ result = llm.invoke(prompt)
72
  return print(result.content)
73
  # Call Gemini API functions to generate LinkedIn post
74
  # gemini.generate_linkedin_post(topic, role)