Skip to content
This repository was archived by the owner on Dec 20, 2025. It is now read-only.
This repository was archived by the owner on Dec 20, 2025. It is now read-only.

Cannot pass compound messages (anthropic - caching/sub-documents) #11

Description

@Madd0g

Bug Description

Claude supports something like this:

    messages = [
      %{
        role: "user",
        content: [
          %{
            type: "document",
            source: %{type: "base64", media_type: "application/pdf", data: pdf_file_content},
            cache_control: %{type: "ephemeral"}
          },
          %{type: "text", text: prompt}
        ]
      }
    ]

It explodes trying to measure the message size. Also the IDE complains the message structure is incorrect.

Steps to Reproduce

  1. Pass a pdf.

Also, I'm not sure the cache flag is supported.

Environment

  • ExLLM Version - 0.8.1 (latest from hex)
  • Erlang/OTP 27 [erts-15.2.5] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1]
  • IEx 1.18.3 (compiled with Erlang/OTP 27)

Error Output

I changed code already to use another library, sorry.

Additional Context

Also, I just remembered that nothing worked until I copied a folder full of yml files with model specific configs into the ex_llm dependency folder.

I think that's another problem in 0.8.1, that the configs are missing entirely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions