Talk

Claude Agent SDK Image Attachment Support Prompt

From Wikiprompt, the free prompt encyclopedia

宝玉
Contributed by宝玉XSource

Oct 11, 2025

Claude Agent SDK Image Attachment Support Prompt A structured prompt for adding image attachment support to a Claude Agent SDK-based UI, with clear steps and reference code. It emphasizes providing complete context and reference code for the AI to execute the task efficiently.

Prompt ContentSave

🌐
1. 替换现在的发送消息组件为 {参考代码文件1} 2. 参考 {参考代码文件2} 的 async send(prompt: string, attachments?: AttachmentData[], includeSelection?: boolean) 和 {参考代码文件3} 的 export const composeUserContent = (text: string, attachments?: AttachmentData[], selection?: SelectionSnapshot | null) 实现对附件的处理 3. 点击发送后,将附件转成base64字符串后发送给websocket 4. 参考下面的代码,重写 ccsdk/ai-client.ts 的消息处理部分代码,让它支持发送附件 {官方文档示例代码docs.claude.com/en/api/agent-sdk/streaming-vs-single-mode} 请仔细思考后执行

Sign in to see the full prompt

Continue with:

By logging in, you agree to our Terms of Use and Privacy Policy

Usage

This prompt is designed for use with coding. Copy the prompt content above and paste it into your preferred AI tool.

For best results, you may customize the placeholders (indicated by square brackets or capital letters) with your specific requirements.

References

Categories:coding| twitter| claude-agent-sdk| image-attachment

Talk