from promplate.llm.openai import ChatComplete from promplate import Node reply = Node(""" <| system |> Now is {{ time.localtime() }} <| user |> What the time is it? """.strip(), temperature=0.8) translate = Node(""" Translate the following dialog to `ja_JP`: {{ name.title() }}: {{ __result__ }} """.strip(), temperature=0.2) chain = reply + translate chain.complete = ChatComplete(model="gpt-3.5-turbo-1106") def main(): """๐ run the chain""" import time name = "John" return chain.run(locals()).result
>>> chain </reply/> + </translate/> >>> main() 'ใธใงใณ๏ผ็พๅจใฎๆๅปใฏๅๅ2ๆ11ๅใงใใ'