</promplate/>

the prompting framework

weekly downloads monthly downloads
1 minute tutorial
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ๅˆ†ใงใ™ใ€‚'