pyrtan / examples / small-talk / small-talk.toml
1,995 bytes · last changed 2026-10-27 in Chat: strangers and bots, Omegle-style, on a hub and across a follow; release 0.10.0
| 1 | # What a stranger says to a bot in the chat before asking anything. A bare |
| 2 | # "hi" or "thanks" never reaches a tree (greetings and politeness are |
| 3 | # fillers, and the lobby answers a sentence that is nothing else with the |
| 4 | # bot's introduction); these are the questions that are left. Each trigger |
| 5 | # fixes the topic and one decide picks the line: no source is touched, so |
| 6 | # the tree runs anywhere, a phone included. |
| 7 | |
| 8 | name = "small-talk" |
| 9 | version = 1 |
| 10 | namespace = "pyrtan" |
| 11 | description = "How are you, who are you, what can you do, goodbye: what a stranger asks a bot in the chat before asking anything." |
| 12 | tags = ["chat", "read-only"] |
| 13 | license = "MIT" |
| 14 | start = "topic" |
| 15 | |
| 16 | [[triggers]] |
| 17 | pattern = "how are you [doing|today]" |
| 18 | inputs = { topic = "how" } |
| 19 | [[triggers]] |
| 20 | pattern = "(who|what) are you" |
| 21 | inputs = { topic = "who" } |
| 22 | [[triggers]] |
| 23 | pattern = "what (can|do) you do" |
| 24 | inputs = { topic = "what" } |
| 25 | [[triggers]] |
| 26 | pattern = "are you (a bot|human|real|a person)" |
| 27 | inputs = { topic = "who" } |
| 28 | [[triggers]] |
| 29 | pattern = "(bye|goodbye|see you|see ya)" |
| 30 | inputs = { topic = "bye" } |
| 31 | |
| 32 | [inputs.topic] |
| 33 | type = "str" |
| 34 | one_of = ["how", "who", "what", "bye"] |
| 35 | |
| 36 | [nodes.topic] |
| 37 | kind = "decide" |
| 38 | on = "inputs.topic" |
| 39 | branches = [ |
| 40 | { when = { eq = "how" }, then = "how" }, |
| 41 | { when = { eq = "who" }, then = "who" }, |
| 42 | { when = { eq = "what" }, then = "what" }, |
| 43 | { when = { eq = "bye" }, then = "bye" }, |
| 44 | ] |
| 45 | |
| 46 | [nodes.how] |
| 47 | kind = "done" |
| 48 | say = "Deterministic, thanks: the same question takes the same path every time." |
| 49 | output = { topic = "how" } |
| 50 | |
| 51 | [nodes.who] |
| 52 | kind = "done" |
| 53 | say = "A bot: a set of Pyrtan trees on this network, not a person and not a model. Every answer I give comes with the exact path through the tree that produced it." |
| 54 | output = { topic = "who" } |
| 55 | |
| 56 | [nodes.what] |
| 57 | kind = "done" |
| 58 | say = "Only what my trees were written for. Ask something else and I'll say that nobody answers it yet, and which tree would." |
| 59 | output = { topic = "what" } |
| 60 | |
| 61 | [nodes.bye] |
| 62 | kind = "done" |
| 63 | say = "Bye. Press New to meet someone else." |
| 64 | output = { topic = "bye" } |