Spaces:
Sleeping
Sleeping
Fran
commited on
Commit
·
e0cf105
1
Parent(s):
32b4a10
Improve linkedin post tool to fix the hard stop instead of a final answer
Browse files
tools/linkedin_post_composer.py
CHANGED
|
@@ -4,8 +4,7 @@ class LinkedInPostPromptComposerTool(Tool):
|
|
| 4 |
name = "linkedin_post_prompt_composer"
|
| 5 |
description = (
|
| 6 |
"Generates a detailed prompt by synthesizing conversation context, extracted webpage insights, "
|
| 7 |
-
"and additional instructions. This prompt
|
| 8 |
-
"a polished LinkedIn post."
|
| 9 |
)
|
| 10 |
inputs = {
|
| 11 |
"context": {
|
|
@@ -36,7 +35,7 @@ class LinkedInPostPromptComposerTool(Tool):
|
|
| 36 |
def forward(self, context: str, extracted_info: str, instructions: str = "") -> str:
|
| 37 |
prompt = (
|
| 38 |
"You are an experienced LinkedIn content strategist and influencer. Using the inputs provided, "
|
| 39 |
-
"generate a comprehensive
|
| 40 |
"1. **Compelling Hook:** Begin with a strong headline or opening line that grabs attention.\n"
|
| 41 |
"2. **Coherent Narrative:** Seamlessly blend the discussion context and the extracted information into a clear, engaging story.\n"
|
| 42 |
"3. **Actionable Insights:** Offer actionable advice or takeaways that provide real value to a professional audience.\n"
|
|
@@ -49,7 +48,12 @@ class LinkedInPostPromptComposerTool(Tool):
|
|
| 49 |
)
|
| 50 |
if instructions:
|
| 51 |
prompt += "**Additional Instructions:**\n" + instructions + "\n\n"
|
| 52 |
-
prompt +=
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
return prompt
|
| 54 |
|
| 55 |
def __init__(self, *args, **kwargs):
|
|
|
|
| 4 |
name = "linkedin_post_prompt_composer"
|
| 5 |
description = (
|
| 6 |
"Generates a detailed prompt by synthesizing conversation context, extracted webpage insights, "
|
| 7 |
+
"and additional instructions. This prompt is intended for a final answer tool that produces a polished LinkedIn post."
|
|
|
|
| 8 |
)
|
| 9 |
inputs = {
|
| 10 |
"context": {
|
|
|
|
| 35 |
def forward(self, context: str, extracted_info: str, instructions: str = "") -> str:
|
| 36 |
prompt = (
|
| 37 |
"You are an experienced LinkedIn content strategist and influencer. Using the inputs provided, "
|
| 38 |
+
"generate a comprehensive final LinkedIn post that meets the following criteria:\n\n"
|
| 39 |
"1. **Compelling Hook:** Begin with a strong headline or opening line that grabs attention.\n"
|
| 40 |
"2. **Coherent Narrative:** Seamlessly blend the discussion context and the extracted information into a clear, engaging story.\n"
|
| 41 |
"3. **Actionable Insights:** Offer actionable advice or takeaways that provide real value to a professional audience.\n"
|
|
|
|
| 48 |
)
|
| 49 |
if instructions:
|
| 50 |
prompt += "**Additional Instructions:**\n" + instructions + "\n\n"
|
| 51 |
+
prompt += (
|
| 52 |
+
"Now, **do not repeat any of the above input or instructions**. "
|
| 53 |
+
"Produce **only the final LinkedIn post** text below. "
|
| 54 |
+
"Ensure that your output is a polished, self-contained LinkedIn post without any extraneous text.\n\n"
|
| 55 |
+
"### FINAL LINKEDIN POST OUTPUT BELOW:\n"
|
| 56 |
+
)
|
| 57 |
return prompt
|
| 58 |
|
| 59 |
def __init__(self, *args, **kwargs):
|