briyah 1.2.3 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/README.md +55 -6
  2. package/data/common/config/image_models.json +160 -97
  3. package/data/common/config/markup +1 -1
  4. package/data/common/config/model_prices.json +31 -0
  5. package/data/common/config/story_models.json +31 -11
  6. package/data/common/config/story_models_full.json +25 -7
  7. package/data/common/prompts/character/create_user_character.prompt +3 -12
  8. package/data/common/prompts/character/introduce_character.json +18 -0
  9. package/data/common/prompts/character/introduce_character.mock +4 -0
  10. package/data/common/prompts/character/introduce_character.prompt +58 -0
  11. package/data/common/prompts/character/perceive.prompt +3 -0
  12. package/data/common/prompts/character/progress_character.json +8 -4
  13. package/data/common/prompts/character/progress_character.mock +1 -0
  14. package/data/common/prompts/character/progress_character.prompt +20 -2
  15. package/data/common/prompts/character/update_portrait.json +18 -0
  16. package/data/common/prompts/character/update_portrait.mock +4 -0
  17. package/data/common/prompts/character/update_portrait.prompt +17 -1
  18. package/data/common/prompts/narrator/create_simple_plot.json +0 -0
  19. package/data/common/prompts/narrator/create_simple_plot.mock +13 -0
  20. package/data/common/prompts/narrator/create_simple_plot.prompt +35 -0
  21. package/data/common/prompts/narrator/perceive.prompt +12 -9
  22. package/data/common/prompts/narrator/progress_simple_plot.json +0 -0
  23. package/data/common/prompts/narrator/progress_simple_plot.mock +13 -0
  24. package/data/common/prompts/narrator/progress_simple_plot.prompt +40 -0
  25. package/data/common/prompts/perceive.json +1 -1
  26. package/data/common/prompts/perceive.prompt +82 -20
  27. package/data/common/prompts/story_moderator/moderate.json +1 -1
  28. package/data/common/prompts/story_moderator/moderate.prompt +26 -6
  29. package/dist-sdk/server/src/ai/LLM/anthropic.service.js +6 -4
  30. package/dist-sdk/server/src/ai/LLM/base-ai.service.d.ts +1 -1
  31. package/dist-sdk/server/src/ai/LLM/base-ai.service.js +13 -42
  32. package/dist-sdk/server/src/ai/LLM/deepseek.service.js +10 -1
  33. package/dist-sdk/server/src/ai/LLM/fal.service.js +1 -2
  34. package/dist-sdk/server/src/ai/LLM/googleai.service.js +1 -2
  35. package/dist-sdk/server/src/ai/LLM/grok.service.js +1 -2
  36. package/dist-sdk/server/src/ai/LLM/openai.service.js +1 -2
  37. package/dist-sdk/server/src/ai/LLM/together.service.js +1 -2
  38. package/dist-sdk/server/src/ai/agent-config.d.ts +2 -0
  39. package/dist-sdk/server/src/ai/agent-store.service.js +8 -0
  40. package/dist-sdk/server/src/ai/agent.d.ts +2 -0
  41. package/dist-sdk/server/src/ai/agent.js +2 -0
  42. package/dist-sdk/server/src/ai/model_prices.js +2 -1
  43. package/dist-sdk/server/src/app/user-service-factory.js +7 -3
  44. package/dist-sdk/server/src/app.controller.d.ts +15 -4
  45. package/dist-sdk/server/src/app.controller.js +171 -5
  46. package/dist-sdk/server/src/app.service.d.ts +19 -5
  47. package/dist-sdk/server/src/app.service.js +50 -4
  48. package/dist-sdk/server/src/room/message.js +5 -1
  49. package/dist-sdk/server/src/room/room-factory.d.ts +5 -1
  50. package/dist-sdk/server/src/room/room-factory.js +6 -1
  51. package/dist-sdk/server/src/room/room-store.service.d.ts +5 -1
  52. package/dist-sdk/server/src/room/room-store.service.js +13 -2
  53. package/dist-sdk/server/src/room/room.d.ts +25 -4
  54. package/dist-sdk/server/src/room/room.js +393 -96
  55. package/dist-sdk/server/src/sdk/index.d.ts +1 -1
  56. package/dist-sdk/server/src/story/story.service.d.ts +5 -4
  57. package/dist-sdk/server/src/story/story.service.js +207 -120
  58. package/dist-sdk/server/src/tools/tool-execution.service.d.ts +19 -0
  59. package/dist-sdk/server/src/tools/tool-execution.service.js +100 -0
  60. package/dist-sdk/server/src/tools/tool-store.service.d.ts +17 -0
  61. package/dist-sdk/server/src/tools/tool-store.service.js +143 -0
  62. package/dist-sdk/shared/types/app.types.d.ts +44 -5
  63. package/dist-sdk/shared/types/app.types.js +3 -0
  64. package/docs/assets/hierarchy.js +1 -1
  65. package/docs/assets/highlight.css +0 -7
  66. package/docs/assets/navigation.js +1 -1
  67. package/docs/assets/search.js +1 -1
  68. package/docs/classes/Agent.html +22 -14
  69. package/docs/classes/Briyah.html +10 -10
  70. package/docs/classes/BriyahConfigService.html +5 -5
  71. package/docs/classes/Room.html +32 -26
  72. package/docs/classes/RoomMessage.html +10 -10
  73. package/docs/enums/MessageAction.html +6 -3
  74. package/docs/hierarchy.html +1 -1
  75. package/docs/index.html +12 -5
  76. package/docs/interfaces/AgentInfo.html +3 -2
  77. package/docs/interfaces/AgentMessagesResponse.html +2 -2
  78. package/docs/interfaces/AppService.html +184 -149
  79. package/docs/interfaces/Artifact.html +3 -3
  80. package/docs/interfaces/ArtifactMetadata.html +2 -2
  81. package/docs/interfaces/AttachDocumentResponse.html +2 -2
  82. package/docs/interfaces/BriyahConfigOptions.html +7 -7
  83. package/docs/interfaces/ChapterInfo.html +2 -2
  84. package/docs/interfaces/Character.html +2 -2
  85. package/docs/interfaces/CreateAgentResponse.html +2 -2
  86. package/docs/interfaces/CreateRoomResponse.html +2 -2
  87. package/docs/interfaces/CreateStoryResponse.html +2 -2
  88. package/docs/interfaces/FileList.html +2 -2
  89. package/docs/interfaces/FileMetadata.html +3 -3
  90. package/docs/interfaces/IConfigService.html +3 -3
  91. package/docs/interfaces/LoggingOptions.html +6 -6
  92. package/docs/interfaces/Message.html +2 -2
  93. package/docs/interfaces/ModelInfo.html +2 -3
  94. package/docs/interfaces/PreparedPromptResponse.html +2 -2
  95. package/docs/interfaces/ProcessTextResponse.html +2 -2
  96. package/docs/interfaces/PromptFile.html +2 -2
  97. package/docs/interfaces/PromptFileContent.html +2 -2
  98. package/docs/interfaces/PromptFilesResponse.html +2 -2
  99. package/docs/interfaces/PromptFolder.html +2 -2
  100. package/docs/interfaces/PromptFoldersResponse.html +2 -2
  101. package/docs/interfaces/RoomDetails.html +2 -2
  102. package/docs/interfaces/RoomInfo.html +2 -2
  103. package/docs/interfaces/RoomMessagesResponse.html +2 -2
  104. package/docs/interfaces/StoryErrorEvent.html +3 -3
  105. package/docs/interfaces/StoryIdea.html +2 -2
  106. package/docs/interfaces/StoryInfo.html +5 -4
  107. package/docs/interfaces/StoryIntroduceCharacterEvent.html +3 -3
  108. package/docs/interfaces/StoryProgressChapterEvent.html +3 -3
  109. package/docs/interfaces/StoryState.html +5 -5
  110. package/docs/interfaces/StoryStateEvent.html +3 -3
  111. package/docs/interfaces/ToolDefinition.html +6 -0
  112. package/docs/interfaces/ToolParameter.html +5 -0
  113. package/docs/interfaces/ToolsResponse.html +2 -0
  114. package/docs/interfaces/Transaction.html +2 -2
  115. package/docs/interfaces/TransactionHistoryResponse.html +2 -2
  116. package/docs/modules.html +1 -1
  117. package/docs/types/PromptScope.html +1 -1
  118. package/docs/types/ToolRunResult.html +1 -0
  119. package/package.json +2 -1
package/README.md CHANGED
@@ -5,7 +5,8 @@ Briyah is an SDK for AI agents, multi-agent rooms, and interactive stories. It w
5
5
  What's in the package:
6
6
 
7
7
  - **Agents.** AI agents with a system prompt, persistent conversation history, attached documents, and per-call cost and token tracking. Histories can be summarized/compacted or cleared.
8
- - **Rooms.** Multi-agent conversations with a shared goal. Agents exchange messages at different visibility levels (speak, whisper, think, shout), draft and approve shared artifacts, and a moderator can route turns.
8
+ - **Rooms.** Multi-agent conversations with a shared goal. Agents exchange messages at different visibility levels (speak, whisper, think, shout), publish shared artifacts, run tools, commission each other for parallel research, and a moderator can route turns.
9
+ - **Tools.** User-defined functions agents can call from a room. A tool is a named async JavaScript function body with declared parameters that returns a JSON value; `helpers.fetch` is available for HTTP requests. Tools are granted per agent, and an agent may chain several tool calls privately before responding. Tool code runs in-process on the server with a timeout — only define tools you trust.
9
10
  - **Stories.** Text-based interactive fiction with a narrator, AI-played characters, and a human player. Stories progress through chapters and can introduce new characters mid-game. Story events (state updates, character suggestions, chapter transitions, errors) are delivered through an emitter the host app subscribes to.
10
11
  - **Text processing.** One-shot `processText` for non-conversational use, with cost and token counts on the result.
11
12
  - **File attachments.** Attach documents to agents as context. Supported file types vary by LLM provider.
@@ -227,6 +228,13 @@ const room = await appService.createRoom(name, goal, agentIds);
227
228
  const rooms = await appService.listRooms();
228
229
  await appService.sendRoomMessage(roomId, content, sender, action?);
229
230
 
231
+ // Tool Management
232
+ const tools = await appService.listTools();
233
+ const tool = await appService.createTool({ name, description, parameters, code, timeoutMs? });
234
+ await appService.updateTool(name, tool);
235
+ await appService.deleteTool(name);
236
+ const result = await appService.testTool(name, args); // { ok: true, result } | { ok: false, error }
237
+
230
238
  // Story Management
231
239
  const story = await appService.createStory(name, idea, userCharacterDesc, otherCharactersDesc, storyModel?);
232
240
  await appService.progressStory(storyId);
@@ -477,6 +485,46 @@ emitter.on('update', (newBalance: number) => {
477
485
  });
478
486
  ```
479
487
 
488
+ ### Example 8: Giving Agents Tools
489
+
490
+ Tools let a room agent fetch or compute data mid-conversation. Define the tool once, grant it to specific agents, and the agent invokes it on its own (via the EXECUTE room action) when a conversation calls for it. The result is returned privately to the calling agent, which may chain several calls before speaking.
491
+
492
+ ```typescript
493
+ const app = briyah.getAppService('user-123');
494
+
495
+ // 1. Define a tool. `code` is the body of an async function receiving
496
+ // (args, helpers) and returning a JSON-serializable value.
497
+ await app.createTool({
498
+ name: 'weather_lookup',
499
+ description: 'Gets the current temperature for a city',
500
+ parameters: [
501
+ { name: 'city', type: 'string', description: 'City name', required: true }
502
+ ],
503
+ code: `
504
+ const res = await helpers.fetch('https://wttr.in/' + encodeURIComponent(args.city) + '?format=j1');
505
+ const data = await res.json();
506
+ return { tempC: data.current_condition[0].temp_C };
507
+ `,
508
+ timeoutMs: 15000 // optional; default 30s, max 120s
509
+ });
510
+
511
+ // 2. Test it before any agent uses it
512
+ const test = await app.testTool('weather_lookup', { city: 'Paris' });
513
+ if (!test.ok) throw new Error(test.error);
514
+
515
+ // 3. Grant it to an agent (grants are enforced server-side)
516
+ const researcher = app.createAgent('Anthropic', 'Researcher', 'Researcher',
517
+ 'A researcher who uses tools for exact answers', 'claude-haiku-4-5');
518
+ researcher.toolNames = ['weather_lookup'];
519
+ researcher.save();
520
+
521
+ // 4. In a room, the agent calls the tool on its own when a question needs it.
522
+ // Other agents wait while it researches; a log-only 'tool' message records
523
+ // each call (visible when fetching messages with includeThoughts=true).
524
+ ```
525
+
526
+ Agents can also delegate: an agent may respond with a `commission` action naming other agents, each of which researches independently (using its own tools) and replies with a `deliver`. The commissioner receives all deliverables at once and responds before the conversation continues. No SDK calls are needed for this — it is driven by the agents themselves.
527
+
480
528
  ## Data Storage
481
529
 
482
530
  Briyah stores data in the following structure:
@@ -489,13 +537,14 @@ Briyah stores data in the following structure:
489
537
  │ └── published-agents.json # Published agent mappings
490
538
  └── user/
491
539
  └── {userId}/ # Per-user data
540
+ ├── agents/ # Agent configs and histories (one JSON per agent)
541
+ ├── rooms/ # Room metadata, message logs, artifacts (one folder per room)
542
+ ├── stories/ # Story state
543
+ ├── tools/ # User-defined tools (one JSON per tool)
492
544
  ├── prompts/ # User-specific prompts
493
545
  ├── upload/ # User file attachments
494
- └── userconfig/ # User configuration files
495
- ├── agents.json # User's agents
496
- ├── rooms.json # User's rooms
497
- ├── stories.json # User's stories
498
- └── balance.json # User's balance
546
+ ├── transactions/ # Transaction records
547
+ └── userconfig/ # User preferences and balance
499
548
  ```
500
549
 
501
550
  ## Multi-Instance Support
@@ -1,141 +1,204 @@
1
1
  [
2
- {
3
- "name": "FLUX.1 Kontext (edit)",
4
- "description": "Image-to-image editing; maintains character consistency",
5
- "type": "image-to-image",
6
- "service": "FalAI",
7
- "model": "fal-ai/flux-pro/kontext/multi",
8
- "centsPerImage": 4,
9
- "imageProperties": {
10
- "aspect_ratio": "1:1",
11
- "safety_tolerance": "2",
12
- "num_images": 1,
13
- "output_format": "png"
14
- }
15
- },
16
2
  {
17
3
  "name": "FLUX.1 Kontext",
18
- "description": "",
19
- "type": "text-to-image",
20
- "service": "FalAI",
21
- "model": "fal-ai/flux-pro/kontext/text-to-image",
22
- "centsPerImage": 4,
23
- "imageProperties": {
24
- "aspect_ratio": "1:1",
25
- "safety_tolerance": "2",
26
- "num_images": 1,
27
- "output_format": "png"
4
+ "description": "Maintains character consistency across scenes",
5
+ "generation": {
6
+ "service": "FalAI",
7
+ "model": "fal-ai/flux-pro/kontext/text-to-image",
8
+ "centsPerImage": 4,
9
+ "imageProperties": {
10
+ "aspect_ratio": "1:1",
11
+ "safety_tolerance": "2",
12
+ "num_images": 1,
13
+ "output_format": "png"
14
+ }
15
+ },
16
+ "editing": {
17
+ "service": "FalAI",
18
+ "model": "fal-ai/flux-pro/kontext/multi",
19
+ "centsPerImage": 4,
20
+ "imageProperties": {
21
+ "aspect_ratio": "1:1",
22
+ "safety_tolerance": "2",
23
+ "num_images": 1,
24
+ "output_format": "png"
25
+ }
28
26
  }
29
27
  },
30
28
  {
31
29
  "name": "GPT Image 1.5",
32
30
  "description": "High quality; consistent characters across scenes",
33
- "type": "text-to-image",
34
- "service": "OpenAI",
35
- "model": "gpt-image-1.5",
36
- "centsPerImage": 21,
37
- "imageProperties": {
38
- "size": "1024x1024",
39
- "quality": "auto",
40
- "moderation": "low"
41
- }
42
- },
43
- {
44
- "name": "GPT Image 1.5 (edit)",
45
- "description": "High quality image editing with reference images",
46
- "type": "image-to-image",
47
- "service": "OpenAI",
48
- "model": "gpt-image-1.5",
49
- "centsPerImage": 21,
50
- "imageProperties": {
51
- "size": "1024x1024"
31
+ "generation": {
32
+ "service": "OpenAI",
33
+ "model": "gpt-image-1.5",
34
+ "centsPerImage": 21,
35
+ "imageProperties": {
36
+ "size": "1024x1024",
37
+ "quality": "auto",
38
+ "moderation": "low"
39
+ }
40
+ },
41
+ "editing": {
42
+ "service": "OpenAI",
43
+ "model": "gpt-image-1.5",
44
+ "centsPerImage": 21,
45
+ "imageProperties": {
46
+ "size": "1024x1024"
47
+ }
52
48
  }
53
49
  },
54
50
  {
55
51
  "name": "GPT Image 1 Mini",
56
52
  "description": "Mediocre quality; some character consistency",
57
- "type": "text-to-image",
58
- "service": "OpenAI",
59
- "model": "gpt-image-1-mini",
60
- "centsPerImage": 10,
61
- "imageProperties": {
62
- "size": "1024x1024",
63
- "quality": "auto",
64
- "moderation": "low"
53
+ "generation": {
54
+ "service": "OpenAI",
55
+ "model": "gpt-image-1-mini",
56
+ "centsPerImage": 10,
57
+ "imageProperties": {
58
+ "size": "1024x1024",
59
+ "quality": "auto",
60
+ "moderation": "low"
61
+ }
62
+ },
63
+ "editing": {
64
+ "service": "OpenAI",
65
+ "model": "gpt-image-1-mini",
66
+ "centsPerImage": 10,
67
+ "imageProperties": {
68
+ "size": "1024x1024"
69
+ }
65
70
  }
66
71
  },
67
72
  {
68
73
  "name": "FLUX.2 MAX",
69
74
  "description": "Cheap",
70
- "type": "text-to-image",
71
- "service": "TogetherAI",
72
- "model": "black-forest-labs/FLUX.2-max",
73
- "centsPerImage": 4,
74
- "imageProperties": {
75
- "width": 1024,
76
- "height": 1024,
77
- "disable_safety_checker": false,
78
- "response_format": "base64"
75
+ "generation": {
76
+ "service": "TogetherAI",
77
+ "model": "black-forest-labs/FLUX.2-max",
78
+ "centsPerImage": 4,
79
+ "imageProperties": {
80
+ "width": 1024,
81
+ "height": 1024,
82
+ "disable_safety_checker": false,
83
+ "response_format": "base64"
84
+ }
85
+ },
86
+ "editing": {
87
+ "service": "TogetherAI",
88
+ "model": "black-forest-labs/FLUX.2-max",
89
+ "centsPerImage": 4,
90
+ "imageProperties": {
91
+ "width": 1024,
92
+ "height": 1024,
93
+ "disable_safety_checker": false,
94
+ "response_format": "base64"
95
+ }
79
96
  }
80
97
  },
81
98
  {
82
99
  "name": "Stable Diffusion 3",
83
100
  "description": "Laughably poor quality",
84
- "type": "text-to-image",
85
- "service": "TogetherAI",
86
- "model": "stabilityai/stable-diffusion-3-medium",
87
- "centsPerImage": 4,
88
- "imageProperties": {
89
- "width": 1024,
90
- "height": 1024,
91
- "disable_safety_checker": false,
92
- "response_format": "base64"
101
+ "generation": {
102
+ "service": "TogetherAI",
103
+ "model": "stabilityai/stable-diffusion-3-medium",
104
+ "centsPerImage": 4,
105
+ "imageProperties": {
106
+ "width": 1024,
107
+ "height": 1024,
108
+ "disable_safety_checker": false,
109
+ "response_format": "base64"
110
+ }
111
+ },
112
+ "editing": {
113
+ "service": "FalAI",
114
+ "model": "fal-ai/flux-pro/kontext/multi",
115
+ "centsPerImage": 4,
116
+ "imageProperties": {
117
+ "aspect_ratio": "1:1",
118
+ "safety_tolerance": "2",
119
+ "num_images": 1,
120
+ "output_format": "png"
121
+ }
93
122
  }
94
123
  },
95
124
  {
96
125
  "name": "Google Imagen 4",
97
126
  "description": "No character consistency",
98
- "type": "text-to-image",
99
- "service": "GoogleAI",
100
- "model": "imagen-4.0-generate-001",
101
- "centsPerImage": 4,
102
- "imageProperties": {
103
- "numberOfImages": 1,
104
- "aspectRatio": "1:1"
127
+ "generation": {
128
+ "service": "GoogleAI",
129
+ "model": "imagen-4.0-generate-001",
130
+ "centsPerImage": 4,
131
+ "imageProperties": {
132
+ "numberOfImages": 1,
133
+ "aspectRatio": "1:1"
134
+ }
135
+ },
136
+ "editing": {
137
+ "service": "FalAI",
138
+ "model": "fal-ai/flux-pro/kontext/multi",
139
+ "centsPerImage": 4,
140
+ "imageProperties": {
141
+ "aspect_ratio": "1:1",
142
+ "safety_tolerance": "2",
143
+ "num_images": 1,
144
+ "output_format": "png"
145
+ }
105
146
  }
106
147
  },
107
148
  {
108
149
  "name": "Nano Banana Pro",
109
150
  "description": "",
110
- "type": "text-to-image",
111
- "service": "FalAI",
112
- "model": "fal-ai/nano-banana-pro",
113
- "centsPerImage": 15,
114
- "imageProperties": {
115
- "image_size": { "width": 1024, "height": 1024 },
116
- "safety_tolerance": "2",
117
- "num_images": 1,
118
- "output_format": "png"
151
+ "generation": {
152
+ "service": "FalAI",
153
+ "model": "fal-ai/nano-banana-pro",
154
+ "centsPerImage": 15,
155
+ "imageProperties": {
156
+ "image_size": { "width": 1024, "height": 1024 },
157
+ "safety_tolerance": "2",
158
+ "num_images": 1,
159
+ "output_format": "png"
160
+ }
161
+ },
162
+ "editing": {
163
+ "service": "FalAI",
164
+ "model": "fal-ai/nano-banana-pro",
165
+ "centsPerImage": 15,
166
+ "imageProperties": {
167
+ "image_size": { "width": 1024, "height": 1024 },
168
+ "safety_tolerance": "2",
169
+ "num_images": 1,
170
+ "output_format": "png"
171
+ }
119
172
  }
120
173
  },
121
174
  {
122
175
  "name": "Nano Banana",
123
176
  "description": "",
124
- "type": "text-to-image",
125
- "service": "FalAI",
126
- "model": "fal-ai/nano-banana",
127
- "centsPerImage": 4,
128
- "imageProperties": {
129
- "image_size": { "width": 1024, "height": 1024 },
130
- "safety_tolerance": "2",
131
- "num_images": 1,
132
- "output_format": "png"
177
+ "generation": {
178
+ "service": "FalAI",
179
+ "model": "fal-ai/nano-banana",
180
+ "centsPerImage": 4,
181
+ "imageProperties": {
182
+ "image_size": { "width": 1024, "height": 1024 },
183
+ "safety_tolerance": "2",
184
+ "num_images": 1,
185
+ "output_format": "png"
186
+ }
187
+ },
188
+ "editing": {
189
+ "service": "FalAI",
190
+ "model": "fal-ai/nano-banana",
191
+ "centsPerImage": 4,
192
+ "imageProperties": {
193
+ "image_size": { "width": 1024, "height": 1024 },
194
+ "safety_tolerance": "2",
195
+ "num_images": 1,
196
+ "output_format": "png"
197
+ }
133
198
  }
134
199
  },
135
200
  {
136
201
  "name": "No images",
137
- "description": "Disable image generation (no real API calls)",
138
- "service": "",
139
- "model": ""
202
+ "description": "Disable image generation (no real API calls)"
140
203
  }
141
204
  ]
@@ -1 +1 @@
1
- 12.990938720000031
1
+ 13.132693000000032
@@ -10214,6 +10214,37 @@
10214
10214
  },
10215
10215
  "supports_output_config": true
10216
10216
  },
10217
+ "claude-fable-5": {
10218
+ "cache_creation_input_token_cost": 1.25e-05,
10219
+ "cache_creation_input_token_cost_above_1hr": 2e-05,
10220
+ "cache_read_input_token_cost": 1e-06,
10221
+ "input_cost_per_token": 1e-05,
10222
+ "litellm_provider": "anthropic",
10223
+ "max_input_tokens": 1000000,
10224
+ "max_output_tokens": 128000,
10225
+ "max_tokens": 128000,
10226
+ "mode": "chat",
10227
+ "output_cost_per_token": 5e-05,
10228
+ "search_context_cost_per_query": {
10229
+ "search_context_size_high": 0.01,
10230
+ "search_context_size_low": 0.01,
10231
+ "search_context_size_medium": 0.01
10232
+ },
10233
+ "supports_adaptive_thinking": true,
10234
+ "supports_assistant_prefill": false,
10235
+ "supports_computer_use": true,
10236
+ "supports_function_calling": true,
10237
+ "supports_pdf_input": true,
10238
+ "supports_prompt_caching": true,
10239
+ "supports_reasoning": true,
10240
+ "supports_response_schema": true,
10241
+ "supports_tool_choice": true,
10242
+ "supports_vision": true,
10243
+ "supports_xhigh_reasoning_effort": true,
10244
+ "supports_max_reasoning_effort": true,
10245
+ "supports_native_structured_output": true,
10246
+ "supports_output_config": true
10247
+ },
10217
10248
  "claude-opus-4-8": {
10218
10249
  "cache_creation_input_token_cost": 6.25e-06,
10219
10250
  "cache_creation_input_token_cost_above_1hr": 1e-05,
@@ -5,6 +5,8 @@
5
5
  "service": "Anthropic",
6
6
  "model": "claude-sonnet-4-6",
7
7
  "small_model": "claude-haiku-4-5",
8
+ "moderator_service": "Anthropic",
9
+ "moderator_model": "claude-haiku-4-5",
8
10
  "cost": "300"
9
11
  },
10
12
  {
@@ -12,30 +14,48 @@
12
14
  "description": "",
13
15
  "service": "Anthropic",
14
16
  "model": "claude-haiku-4-5",
17
+ "small_model": "claude-haiku-4-5",
18
+ "moderator_service": "Anthropic",
19
+ "moderator_model": "claude-haiku-4-5",
15
20
  "cost": "80"
16
21
  },
17
22
  {
18
- "name": "Claude Opus 4.7",
23
+ "name": "Claude Opus 4.8",
19
24
  "description": "Overkill for storytelling",
20
25
  "service": "Anthropic",
21
- "model": "claude-opus-4-7",
26
+ "model": "claude-opus-4-8",
22
27
  "small_model": "claude-haiku-4-5",
28
+ "moderator_service": "Anthropic",
29
+ "moderator_model": "claude-haiku-4-5",
23
30
  "cost": "1500"
24
31
  },
25
32
  {
26
- "name": "Grok 4.20",
33
+ "name": "Claude Fable 5",
34
+ "description": "Way overkill for storytelling",
35
+ "service": "Anthropic",
36
+ "model": "claude-fable-5",
37
+ "small_model": "claude-haiku-4-5",
38
+ "moderator_service": "Anthropic",
39
+ "moderator_model": "claude-haiku-4-5",
40
+ "cost": "3000"
41
+ },
42
+ {
43
+ "name": "Grok 4.3",
27
44
  "description": "",
28
45
  "service": "Grok",
29
- "model": "grok-4.20-0309-reasoning",
30
- "small_model": "grok-4.20-beta-0309-non-reasoning",
46
+ "model": "grok-4.3",
47
+ "moderator_service": "Grok",
48
+ "moderator_model": "grok-4.3",
31
49
  "cost": "300"
32
50
  },
33
51
  {
34
- "name": "Mock",
35
- "description": "Mock LLM for testing (no real API calls)",
36
- "service": "Mock",
37
- "model": "mock-fast-v1",
38
- "cost": "0"
52
+ "name": "DeepSeek v4",
53
+ "description": "",
54
+ "service": "DeepSeek",
55
+ "model": "deepseek-v4-pro",
56
+ "small_model": "deepseek-v4-flash",
57
+ "moderator_service": "DeepSeek",
58
+ "moderator_model": "deepseek-v4-flash",
59
+ "cost": "3"
39
60
  }
40
-
41
61
  ]
@@ -1,9 +1,10 @@
1
1
  [
2
2
  {
3
- "name": "Claude Sonnet 4.5",
3
+ "name": "Claude Sonnet 4.6",
4
4
  "description": "Best storyteller, bar none",
5
5
  "service": "Anthropic",
6
- "model": "claude-sonnet-4-5",
6
+ "model": "claude-sonnet-4-6",
7
+ "small_model": "claude-haiku-4-5",
7
8
  "cost": "300"
8
9
  },
9
10
  {
@@ -11,15 +12,25 @@
11
12
  "description": "",
12
13
  "service": "Anthropic",
13
14
  "model": "claude-haiku-4-5",
15
+ "small_model": "claude-haiku-4-5",
14
16
  "cost": "80"
15
17
  },
16
18
  {
17
- "name": "Claude Opus 4.6",
19
+ "name": "Claude Opus 4.8",
18
20
  "description": "Overkill for storytelling",
19
21
  "service": "Anthropic",
20
- "model": "claude-opus-4-6",
22
+ "model": "claude-opus-4-8",
23
+ "small_model": "claude-haiku-4-5",
21
24
  "cost": "1500"
22
25
  },
26
+ {
27
+ "name": "Claude Fable 5",
28
+ "description": "Way overkill for storytelling",
29
+ "service": "Anthropic",
30
+ "model": "claude-fable-5",
31
+ "small_model": "claude-haiku-4-5",
32
+ "cost": "3000"
33
+ },
23
34
  {
24
35
  "name": "Qwen",
25
36
  "description": "",
@@ -35,11 +46,18 @@
35
46
  "cost": "60"
36
47
  },
37
48
  {
38
- "name": "Grok 4.20",
49
+ "name": "Grok 4.3",
39
50
  "description": "",
40
51
  "service": "Grok",
41
- "model": "grok-4.20-0309-reasoning",
52
+ "model": "grok-4.3",
42
53
  "cost": "300"
54
+ },
55
+ {
56
+ "name": "DeepSeek v4",
57
+ "description": "",
58
+ "service": "DeepSeek",
59
+ "model": "deepseek-v4-pro",
60
+ "small_model": "deepseek-v4-flash",
61
+ "cost": "3"
43
62
  }
44
-
45
63
  ]
@@ -22,23 +22,15 @@ Create a detailed character profile that includes:
22
22
 
23
23
  2. **Backstory**: A rich history that explains how they became who they are today. Include key life events, relationships, and experiences that shaped them.
24
24
 
25
- 3. **Personality**: Core traits, temperament, values, beliefs, and how they typically interact with others. What makes them unique?
25
+ 3. **Special Abilities**: Any special abilities or powers that differentiate them from other characters in the story.
26
26
 
27
- 4. **Motivations**: What drives them? What are their goals, desires, fears, and needs?
27
+ 4. **Strengths**: Skills, talents, positive qualities, and what they excel at.
28
28
 
29
- 5. **Special Abilities**: Any special abilities or powers that differentiate them from other characters in the story.
30
-
31
- 6. **Strengths**: Skills, talents, positive qualities, and what they excel at.
32
-
33
- 7. **Weaknesses**: Flaws, vulnerabilities, limitations, and areas where they struggle.
34
-
35
- 8. **Relationships**: How they relate to other characters in the story (if applicable based on the scenario).
29
+ 5. **Relationships**: How they relate to other characters in the story (if applicable based on the scenario).
36
30
 
37
31
  **Important Guidelines:**
38
32
  - Make the character interesting, complex, and memorable
39
33
  - Ensure the character fits naturally within the story's setting and tone
40
- - Give the character internal conflicts and contradictions that make them feel human
41
- - Consider how the character's background influences their current behavior
42
34
  - Make sure the profile is consistent with the description provided above
43
35
  - Leave room for the player to make choices and shape the character's development
44
36
 
@@ -68,4 +60,3 @@ Example format:
68
60
  }
69
61
  }
70
62
  ```
71
- Note: Do NOT use double-quotes anywhere in the description, character_profile, or inventory; use single-quotes instead.
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "name": "introduce_character_response",
4
+ "description": "Response schema for creating a brief profile for a character introduced mid-story",
5
+ "type": "object",
6
+ "properties": {
7
+ "description": {
8
+ "type": "string",
9
+ "description": "A brief 1-2 sentence description containing only immediately observable physical characteristics"
10
+ },
11
+ "character_profile": {
12
+ "type": "string",
13
+ "description": "A short markdown-formatted character profile covering the character's role in the story, what they realistically know, and a brief personality description"
14
+ }
15
+ },
16
+ "required": ["description", "character_profile"],
17
+ "additionalProperties": false
18
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "description": "A friendly newcomer with an unassuming appearance",
3
+ "character_profile": "**Name:** New Character\n\n**Role in the Story:** A local who has just crossed paths with the main characters.\n\n**What They Know:** Only what they have personally seen in their daily routine; they know nothing of the party's secrets.\n\n**Personality:** Curious and talkative, with a plainspoken manner."
4
+ }