briyah 1.3.0 → 1.3.2
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.
- package/data/common/config/markup +1 -1
- package/data/common/config/model_prices.json +44176 -41660
- package/data/common/config/story_models.json +2 -2
- package/dist-sdk/server/src/ai/LLM/anthropic.service.js +10 -5
- package/docs/classes/Agent.html +15 -15
- package/docs/classes/Briyah.html +14 -14
- package/docs/classes/BriyahConfigService.html +5 -5
- package/docs/classes/Room.html +27 -27
- package/docs/classes/RoomMessage.html +10 -10
- package/docs/enums/MessageAction.html +3 -3
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +2 -2
- package/docs/interfaces/AgentInfo.html +2 -2
- package/docs/interfaces/AgentMessagesResponse.html +2 -2
- package/docs/interfaces/AppService.html +119 -119
- package/docs/interfaces/Artifact.html +3 -3
- package/docs/interfaces/ArtifactMetadata.html +2 -2
- package/docs/interfaces/AttachDocumentResponse.html +2 -2
- package/docs/interfaces/BriyahConfigOptions.html +9 -9
- package/docs/interfaces/ChapterInfo.html +2 -2
- package/docs/interfaces/Character.html +2 -2
- package/docs/interfaces/CreateAgentResponse.html +2 -2
- package/docs/interfaces/CreateRoomResponse.html +2 -2
- package/docs/interfaces/CreateStoryResponse.html +2 -2
- package/docs/interfaces/FileList.html +2 -2
- package/docs/interfaces/FileMetadata.html +3 -3
- package/docs/interfaces/IConfigService.html +3 -3
- package/docs/interfaces/LoggingOptions.html +6 -6
- package/docs/interfaces/Message.html +2 -2
- package/docs/interfaces/ModelInfo.html +2 -2
- package/docs/interfaces/NativeToolDefinition.html +7 -7
- package/docs/interfaces/PreparedPromptResponse.html +2 -2
- package/docs/interfaces/ProcessTextResponse.html +2 -2
- package/docs/interfaces/PromptFile.html +2 -2
- package/docs/interfaces/PromptFileContent.html +2 -2
- package/docs/interfaces/PromptFilesResponse.html +2 -2
- package/docs/interfaces/PromptFolder.html +2 -2
- package/docs/interfaces/PromptFoldersResponse.html +2 -2
- package/docs/interfaces/RoomDetails.html +2 -2
- package/docs/interfaces/RoomInfo.html +2 -2
- package/docs/interfaces/RoomMessageUpdate.html +2 -2
- package/docs/interfaces/RoomMessagesResponse.html +2 -2
- package/docs/interfaces/SendMessageResult.html +2 -2
- package/docs/interfaces/StoryErrorEvent.html +3 -3
- package/docs/interfaces/StoryIdea.html +2 -2
- package/docs/interfaces/StoryInfo.html +3 -3
- package/docs/interfaces/StoryIntroduceCharacterEvent.html +3 -3
- package/docs/interfaces/StoryProgressChapterEvent.html +3 -3
- package/docs/interfaces/StoryState.html +5 -5
- package/docs/interfaces/StoryStateEvent.html +3 -3
- package/docs/interfaces/ToolDefinition.html +2 -2
- package/docs/interfaces/ToolHelpers.html +3 -3
- package/docs/interfaces/ToolParameter.html +2 -2
- package/docs/interfaces/ToolSummary.html +2 -2
- package/docs/interfaces/ToolsResponse.html +2 -2
- package/docs/interfaces/Transaction.html +2 -2
- package/docs/interfaces/TransactionHistoryResponse.html +2 -2
- package/docs/modules.html +1 -1
- package/docs/types/PromptScope.html +1 -1
- package/docs/types/ToolContext.html +2 -2
- package/docs/types/ToolRunResult.html +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
|
-
"name": "Claude Sonnet
|
|
3
|
+
"name": "Claude Sonnet 5",
|
|
4
4
|
"description": "Best storyteller, bar none",
|
|
5
5
|
"service": "Anthropic",
|
|
6
|
-
"model": "claude-sonnet-
|
|
6
|
+
"model": "claude-sonnet-5",
|
|
7
7
|
"small_model": "claude-haiku-4-5",
|
|
8
8
|
"moderator_service": "Anthropic",
|
|
9
9
|
"moderator_model": "claude-haiku-4-5",
|
|
@@ -149,12 +149,16 @@ let AnthropicAiService = class AnthropicAiService extends base_ai_service_1.Base
|
|
|
149
149
|
documentMessages[documentMessages.length - 1].content.length > 0) {
|
|
150
150
|
documentMessages[documentMessages.length - 1].content[0]['cache_control'] = cacheConfig;
|
|
151
151
|
}
|
|
152
|
-
let
|
|
152
|
+
let schemaInstruction = '';
|
|
153
153
|
if (jsonSchema) {
|
|
154
|
-
|
|
154
|
+
schemaInstruction =
|
|
155
155
|
'\n\nIMPORTANT: You MUST respond with ONLY valid JSON that conforms to the provided schema. Do not include any explanatory text, markdown formatting, or other content before or after the JSON. Your entire response should be parseable as JSON.\n\nJSON Schema:\n' +
|
|
156
156
|
JSON.stringify(jsonSchema, null, 2);
|
|
157
157
|
}
|
|
158
|
+
let instructionText = promptInstructions || agent.systemInstruction;
|
|
159
|
+
if (jsonSchema && !cacheConfig) {
|
|
160
|
+
instructionText += schemaInstruction;
|
|
161
|
+
}
|
|
158
162
|
const systemBlocks = [];
|
|
159
163
|
if (instructionText)
|
|
160
164
|
systemBlocks.push({ type: 'text', text: instructionText });
|
|
@@ -174,10 +178,11 @@ let AnthropicAiService = class AnthropicAiService extends base_ai_service_1.Base
|
|
|
174
178
|
messageHistory[messageHistory.length - 1].content[0]['cache_control'] = cacheConfig;
|
|
175
179
|
}
|
|
176
180
|
const messages = [...documentMessages, ...messageHistory];
|
|
177
|
-
if (prompt) {
|
|
181
|
+
if (prompt || (jsonSchema && cacheConfig)) {
|
|
182
|
+
const promptText = jsonSchema && cacheConfig ? (prompt || '') + schemaInstruction : prompt;
|
|
178
183
|
messages.push({
|
|
179
184
|
role: 'user',
|
|
180
|
-
content: [{ type: 'text', text:
|
|
185
|
+
content: [{ type: 'text', text: promptText }],
|
|
181
186
|
});
|
|
182
187
|
}
|
|
183
188
|
const tools = [];
|
|
@@ -318,7 +323,7 @@ let AnthropicAiService = class AnthropicAiService extends base_ai_service_1.Base
|
|
|
318
323
|
}
|
|
319
324
|
throw new Error(`Failed to get valid response after ${maxRetries} attempts. Last error: ${lastError?.message || 'Unknown error'}`);
|
|
320
325
|
}
|
|
321
|
-
static EFFORT_CONFIG_MODEL_VERSIONS = ['4-7', '4-8', 'fable'];
|
|
326
|
+
static EFFORT_CONFIG_MODEL_VERSIONS = ['4-7', '4-8', 'fable', 'sonnet-5'];
|
|
322
327
|
usesEffortConfig(modelName) {
|
|
323
328
|
return AnthropicAiService_1.EFFORT_CONFIG_MODEL_VERSIONS.some((v) => modelName.includes(v));
|
|
324
329
|
}
|