ModernUO/Distribution/Data
Claude cc4d314bcc
feat(ai): add AI-backed NPC conversations via the Anthropic Messages API
Players can hold natural-language conversations with NPCs that have a
persona, backed by the Anthropic Messages API (default model
claude-haiku-4-5, disabled by default).

- Personas come from hand-authored templates in Data/ai-personas.json
  (matched by exact NPC name or class name walking the inheritance
  chain) or from per-NPC personas set in game with [SetPersona and
  persisted through world saves via a GenericPersistence module.
- A greeting near a persona NPC, or speaking its name, starts a
  conversation; farewells, walking away, or two minutes of silence end
  it. Speech is observed passively through EventSink.Speech, so bank,
  guard, vendor and pet keywords are unaffected.
- Requests are dispatched with async/await: HTTP I/O runs off-thread
  and continuations marshal back to the game loop through the
  EventLoopContext, so the game thread never blocks on the network.
  Replies are dropped if the session ended, the NPC was deleted, or
  the player disconnected while the request was in flight.
- Cost controls: per-player cooldown and per-minute caps, a
  server-wide concurrent request cap, bounded history and input/output
  lengths - all configurable under aiConversation.* settings.
- Replies are sanitized and split into ~120-char chunks spoken at
  ~900ms intervals; failures retry once on 429/5xx/timeout, then fall
  back to a canned in-character line.
- Staff commands: [SetPersona, [RemovePersona, [PersonaInfo (GM) and
  [AIChat status|on|off|reload|end (Admin) with token usage stats.
- The API key is only read from an environment variable
  (ANTHROPIC_API_KEY by default); ships with persona examples, a
  feature README and unit tests for the pure logic.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GPKWo5V4JXt22nQtFnat41
2026-07-11 12:24:45 +00:00
..
Bulk Orders Fixes more line ending issues (#267) 2020-09-27 13:54:56 -07:00
commands feat: Adds Network Packet Documentation (#2302) 2026-01-01 17:52:56 -08:00
Components Fixes more line ending issues (#267) 2020-09-27 13:54:56 -07:00
Decoration feat: Adds rope teleporter for New Haven Mines (#2439) 2026-05-03 17:23:31 -07:00
Items feat: Adds item graphic size to Bounds.bin and makes item graphic offset available to gumps (#2115) 2025-02-10 19:31:39 -08:00
Locations fix(admin): Fixes Tokuno Go Locations (#602) 2021-05-15 19:07:28 -07:00
Professions fix: Updates professions & new player gargish equipment (#819) 2021-10-16 10:48:58 -07:00
Spawns refactor(spawners): replace DynamicJson with typed SpawnerDto records (#2505) 2026-06-25 23:24:45 -07:00
ai-personas.json feat(ai): add AI-backed NPC conversations via the Anthropic Messages API 2026-07-11 12:24:45 +00:00
assemblies.json fix: Fixes assembly loading. (#759) 2021-09-03 23:35:44 -07:00
bodyTable.cfg Fixes more line ending issues (#267) 2020-09-27 13:54:56 -07:00
categorization.json fix: Fixes NPE in champ titles (#1434) 2023-07-28 00:39:10 -07:00
containers.cfg Fixes more line ending issues (#267) 2020-09-27 13:54:56 -07:00
expansions.json fix: Fixes expansions.json to correctly reflect name of supported feature flags (#1471) 2023-08-25 11:55:36 -07:00
map-definitions.json fix(core): Moves map definitions and cleans up loading maps, regions, and tiles (#431) 2021-01-25 11:05:52 -08:00
MLQuests.cfg Fixes more line ending issues (#267) 2020-09-27 13:54:56 -07:00
names.json Updates Data to JSON (#159) 2020-06-19 13:53:18 -07:00
npc-speeds.json fix: Reverts to RunUO speeds, fixes direction glitching, adds movement speed interpolation (#1695) 2024-03-18 14:13:41 -07:00
pageresponse.cfg Fixes more line ending issues (#267) 2020-09-27 13:54:56 -07:00
regions.json fix: Fix unguarded/termur regions in regions.json (#1723) 2024-04-07 13:30:35 -07:00
shrink.json fix(shrink): Changes shrink table to use json (#446) 2021-02-03 16:58:50 -08:00
signs.cfg Fixes more line ending issues (#267) 2020-09-27 13:54:56 -07:00
skills.json fix(throwing): grant Str/Dex stat gains for the Throwing skill (#2514) 2026-07-02 23:07:36 -07:00
teleporters.json fix: Update Hythloth teleport locations in Felucca and Trammel to new coordinates to prevent looping and stuck. (#2012) 2024-12-17 08:59:36 -08:00
treasure.cfg Fixes more line ending issues (#267) 2020-09-27 13:54:56 -07:00