mirror of
https://github.com/Tencent/BrowserSkill.git
synced 2026-09-10 13:01:23 +08:00
Merge pull request #135 from cyhano/fix/screenshot-media-type
fix: use detected media type for screenshots instead of hard-coded image/png
This commit is contained in:
@@ -784,7 +784,11 @@ export function registerTools(deps: ToolDeps): () => void {
|
||||
additionalProperties: false,
|
||||
properties: {
|
||||
attachmentId: { type: "string", required: true },
|
||||
mediaType: { type: "string", required: true, const: "image/png" },
|
||||
mediaType: {
|
||||
type: "string",
|
||||
required: true,
|
||||
enum: ["image/png", "image/jpeg", "image/webp", "image/gif"],
|
||||
},
|
||||
bytes: { type: "integer", required: true },
|
||||
width: { type: "integer", required: true },
|
||||
height: { type: "integer", required: true },
|
||||
@@ -854,7 +858,7 @@ export function registerTools(deps: ToolDeps): () => void {
|
||||
? {
|
||||
image: {
|
||||
attachmentId: String(ref.attachmentId),
|
||||
mediaType: "image/png" as const,
|
||||
mediaType: ref.mediaType,
|
||||
bytes: ref.bytes,
|
||||
width: ref.width,
|
||||
height: ref.height,
|
||||
|
||||
Reference in New Issue
Block a user