File size: 640 Bytes
8bc7dc5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from langchain.prompts import PromptTemplate
from langchain.chains import LLMChain

def linkedIn_post_gen(topic, tone_of_voice, llm):
    
    linkedIn_post_prompt = f"Write an engagging LinkedIn Post on {topic}. The tone should be {tone_of_voice}."
        
    linkedIn_post_promptTemp = PromptTemplate(
    input_variables=["text_input"],
    template="You are a content creator and LinkedIn Posts writer :\n{text_input}\nLinkedIn Post:")
   
    linkedIn_post_extraction_chain = LLMChain(llm=llm, prompt=linkedIn_post_promptTemp)
    linkedIn_post = linkedIn_post_extraction_chain.run(linkedIn_post_prompt)
    
    return linkedIn_post