Update app3.py
Browse files
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 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
|
|
|
| 69 |
llm = ChatGoogleGenerativeAI(model="gemini-pro")
|
| 70 |
-
result = llm.invoke(
|
| 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)
|