Skip to content

vision: Claude provider structured content with image blocks #493

@bug-ops

Description

@bug-ops

Parent: #490
Depends on: #491

Scope

Implement vision support in the Claude/Anthropic provider.

Changes

  1. crates/zeph-llm/src/claude.rs
    • Override supports_vision() -> true
    • Add AnthropicContentBlock::Image { source: ImageSource } variant
    • ImageSource: { type: "base64", media_type: String, data: String }
    • In split_messages() / request builder: when MessagePart::Image is present, switch from plain string content to StructuredContent::Blocks format containing both text and image blocks

Notes

  • Claude API expects base64-encoded images in structured content blocks
  • Supported formats: JPEG, PNG, GIF, WebP
  • Max image size: 20MB per the API docs

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestllmLLM provider related

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions