Download this file
| 1 | package chat |
| 2 | |
| 3 | import ( |
| 4 | "fmt" |
| 5 | "strings" |
| 6 | ) |
| 7 | |
| 8 | // The turn's note on what is on (spec 2026-11-26-assistant-abilities |
| 9 | // §6.1): instance-written and model-facing, reviewed as code, not copy. |
| 10 | const ( |
| 11 | noteWebListed = "You can look things up on the public web with web_lookup. Do it for questions about the world instead of saying you can't." |
| 12 | noteOffFormat = "Off for this person, set by %s: %s. If they ask for one of these, say in one line that you can't here and that %s can turn it on." |
| 13 | ) |
| 14 | |
| 15 | // abilitiesNote is the lines a person turn's note starts with: web_lookup |
| 16 | // when it is listed for them, and what is off, by whom; "" with neither. |
| 17 | func (t *txn) abilitiesNote(person string, listed bool) (string, error) { |
| 18 | sw, err := t.switches(person) |
| 19 | if err != nil { |
| 20 | return "", err |
| 21 | } |
| 22 | var lines []string |
| 23 | if listed && sw.Can("web") { |
| 24 | lines = append(lines, noteWebListed) |
| 25 | } |
| 26 | if off := sw.Off(); len(off) > 0 { |
| 27 | names := make([]string, len(off)) |
| 28 | for i, k := range off { |
| 29 | names[i] = t.s.abilityName(k) |
| 30 | } |
| 31 | ask := sw.Ask() |
| 32 | if ask == "" { |
| 33 | ask = "the person who runs their Base" |
| 34 | } |
| 35 | lines = append(lines, fmt.Sprintf(noteOffFormat, ask, strings.Join(names, ", "), ask)) |
| 36 | } |
| 37 | return strings.Join(lines, "\n"), nil |
| 38 | } |
| 39 | |