fromchatsnackimportChatthread=Chat("Respond tersely.").chat("What is chatsnack?")thread=thread.chat("Give me two practical examples.")print(thread.last)
fromchatsnackimportChat,utensil@utensildefget_weather(location:str):"""Return a tiny weather payload."""return{"location":location,"forecast":"sunny"}weather_chat=Chat("Use tools when helpful and answer briefly.",utensils=[get_weather],)
fromchatsnackimportChat,TextText(name="SnackVoice",content="Respond like a delighted snack critic.").save()critic=Chat().system("{text.SnackVoice}")print(critic.ask("Review popcorn in one sentence."))