V5 Beta and Passing Files to Tools via sendMessage? #7561
-
I have this working, but I'm just curious whether there are "better" ways to go about passing files for tool use. Frontend: sendMessage({ text }, { body: { imageUrl } }); Backend: const { messages, imageUrl } = await c.req.json(); Then I can use The automated method works with the below setup, but it exposes the image URL to the user, which doesn't look nice. Frontend: sendMessage({ text: `${text} - Image URL: ${imageUrl}` }); Backend: inputSchema: z.object({
prompt: z
.string()
.describe("The text prompt describing what to edit on the image"),
imageUrl: z.string().url().describe("The URL of the image to edit"),
}), Any suggestions on improvements welcome, but at the moment I'm rolling with the former, and manually passing the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@nicoalbanese based on our discussion on Twitter: https://x.com/digitalandreas/status/1948362388585033777 |
Beta Was this translation helpful? Give feedback.
-
Discussed with @dancer and probably the best way to do it at the moment is by passing it through with the extra body param via |
Beta Was this translation helpful? Give feedback.
Discussed with @dancer and probably the best way to do it at the moment is by passing it through with the extra body param via
sendMessage
it seems.