LangChainGo / openai_conversation_chain.py
Last commit not found
raw
history blame
447 Bytes
from langchain import OpenAI, ConversationChain
llm = OpenAI(temperature=0)
conversation = ConversationChain(llm=llm, verbose=True)
conversation.predict(input="作为一名国内资深理财师,可以给我一些投资理财建议吗?")
conversation.predict(input="继续")
while True:
msg=input("Human:")
if msg == 'Bye':
break
conversation.predict(input=msg)
conversation.predict(input="好的")
print("Finished!")