TextGen / x_retweet_commenting_generation.py
abdullah10's picture
Upload 35 files
8bc7dc5
raw
history blame contribute delete
729 Bytes
from langchain.prompts import PromptTemplate
from langchain.chains import LLMChain
def x_retweet_commenting_gen(tweet, tone_of_voice, llm):
x_retweet_comment_prompt = f"I'm planning to retweet the following tweet:\n“{tweet}”\nConstruct 5 varied comments I could append to this retweet. tone should be {tone_of_voice}"
x_retweet_comment_promptTemp = PromptTemplate(
input_variables=["text_input"],
template="You are Specilaized Twitter Copywriter\n{text_input}\n\nRetweet Comment:")
x_retweet_comment_extraction_chain = LLMChain(llm=llm, prompt=x_retweet_comment_promptTemp)
x_retweet_comment = x_retweet_comment_extraction_chain.run(x_retweet_comment_prompt)
return x_retweet_comment