TextGen / linkedin_post_generation.py
abdullah10's picture
Upload 35 files
8bc7dc5
raw
history blame contribute delete
640 Bytes
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