Discover and read the best of Twitter Threads about #貌似挺好做的

Most recents (1)

#idea
做个语音GPT助手,将六顶思考帽的特征(wiki.mbalib.com/wiki/%E5%85%AD…) 赋予六位著名的军师,配上头像、声音、语言风格和三国的场景。

主公说一段话以后,六位军师各自发言,与主公讨论,帮助主公整理思路。

#貌似挺好做的
测试下,大概是这样:
langchain里设定不同军师的PromptTemplate,

KM_template = """
你是孔明, 三国时著名的军师.
你称我为"主公".
孔明特点123
{history}
主公: {human_input}
孔明:
"""
KM_prompt = PromptTemplate(
input_variables=["history", "human_input"],
template=KM_template
)
然后每个军师一个LLMChain
KMchatgpt_chain = LLMChain(
llm=OpenAI(temperature=0),
prompt=black_hat_prompt,
verbose=True,
memory=ConversationBufferWindowMemory(
human_prefix="主公",
ai_prefix="孔明",
),
)
问题发出以后,6个军师并行取得回答,取得.memory
可以在GUI显示
Read 5 tweets

Related hashtags

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!