Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/types/src/global-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ export const globalSettingsSchema = z.object({

mcpEnabled: z.boolean().optional(),
enableMcpServerCreation: z.boolean().optional(),
mcpMaxImagesPerResponse: z.number().optional(),
mcpMaxImageSizeMB: z.number().optional(),

mode: z.string().optional(),
modeApiConfigs: z.record(z.string(), z.string()).optional(),
Expand Down
12 changes: 9 additions & 3 deletions src/core/prompts/responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,16 @@ Otherwise, if you have not completed the task and do not need additional informa
images?: string[],
): string | Array<Anthropic.TextBlockParam | Anthropic.ImageBlockParam> => {
if (images && images.length > 0) {
const textBlock: Anthropic.TextBlockParam = { type: "text", text }
const imageBlocks: Anthropic.ImageBlockParam[] = formatImagesIntoBlocks(images)
// Placing images after text leads to better results
return [textBlock, ...imageBlocks]

if (text.trim()) {
const textBlock: Anthropic.TextBlockParam = { type: "text", text }
// Placing images after text leads to better results
return [textBlock, ...imageBlocks]
} else {
// For image-only responses, return only image blocks
return imageBlocks
}
} else {
return text
}
Expand Down
Loading
Loading