from langchain.prompts import PromptTemplate from langchain.chains import LLMChain def linkedIn_ads_gen(product_name, product_desc, target_audience, target_keywords, llm): linkedIn_ads_prompt = f"Generate a LinkedIn ad for {product_name}. {product_name} is {product_desc} that is targeted at {target_audience} and uses the keywords {target_keywords}. The ad should be persuasive and engaging, and it should include a call to action." linkedIn_ads_promptTemp = PromptTemplate( input_variables=["text_input"], template="You are a Professional LinkedIn Ad Copywriter:\n{text_input}\nFacebook Ad:") linkedIn_ad_extraction_chain = LLMChain(llm=llm, prompt=linkedIn_ads_promptTemp) linkedIn_ad = linkedIn_ad_extraction_chain.run(linkedIn_ads_prompt) return linkedIn_ad