You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/message-content/tool-call-display.tsx
constimagesPrompt=`The user has attached ${images.length} image(s) to this message:\n${imageList}\n\nYou can:\n- Use the "view_image" tool to analyze the image content\n- Use the "upload_image" tool to save it to the project\n\nDetermine the appropriate action based on the user's request.`;
119
+
constimagesPrompt=`The user has attached ${images.length} image(s) to this message:\n${imageList}\n\nYou can:\n- Use the "view_image" tool with the image ID to analyze the image content\n- Use the "upload_image" tool with the image ID to save it to the project\n\nDetermine the appropriate action based on the user's request.`;
staticreadonlydescription="Uploads an image from the chat context to the project's file system. Use this tool when the user asks you to save, add, or upload an image to their project. The image will be stored in the project's public directory and can be referenced in code. After uploading, you can use the file path in your code changes.";
12
+
staticreadonlydescription="Uploads an image from the chat context to the project's file system. Use this tool when the user asks you to save, add, or upload an image to their project. The image will be stored in public/images/ directory by default and can be referenced in code. After uploading, you can use the file path in your code changes.";
12
13
staticreadonlyparameters=z.object({
13
-
image_reference: z
14
+
image_id: z
14
15
.string()
15
16
.describe(
16
-
'Reference to an image in the chat context (use the display name or index number)',
17
+
'The unique ID of the image from the available images list',
17
18
),
18
19
destination_path: z
19
20
.string()
20
21
.optional()
21
-
.describe('Destination path within the project (default: "public/assets/images")'),
22
+
.describe('Destination path within the project. Defaults to "public/images" if not specified.'),
22
23
filename: z
23
24
.string()
24
25
.optional()
@@ -38,31 +39,12 @@ export class UploadImageTool extends ClientTool {
Copy file name to clipboardExpand all lines: packages/ai/src/tools/classes/view-image.ts
+8-32Lines changed: 8 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -8,10 +8,10 @@ export class ViewImageTool extends ClientTool {
8
8
staticreadonlytoolName='view_image';
9
9
staticreadonlydescription="Retrieves and views an image from the chat context for analysis. Use this tool when the user asks you to analyze, describe, or work with an image they've attached. The image data will be returned so you can see and analyze its contents. This does NOT save the image to the project.";
10
10
staticreadonlyparameters=z.object({
11
-
image_reference: z
11
+
image_id: z
12
12
.string()
13
13
.describe(
14
-
'Reference to an image in the chat context (use the display name or index number)',
14
+
'The unique ID of the image from the available images list',
15
15
),
16
16
});
17
17
staticreadonlyicon=Icons.Image;
@@ -22,36 +22,12 @@ export class ViewImageTool extends ClientTool {
0 commit comments