Skip to content

[bug] TS: error 400 (cant support image/pdf) when test using pdf in an array #2782

@averrows

Description

@averrows

Product

BAML

Describe the bug

Model (gemini) return 400 when the param of test is an array of file

Unspecified error code: 400 Request failed with status code: 400 Bad Request,
{
"error": {
"code": 400,
"message": "Unsupported MIME type: image/pdf",
"status": "INVALID_ARGUMENT"
}
}

Reproduction Steps

Make a test like this

test ExtractContractStructureTest {
functions [ExtractContractStructure]
args {
contract_files [
{
file "../files/test.pdf"
}
]
}
}

on which contract files have type: (pdf | image)[]

And then it will return

Unspecified error code: 400 Request failed with status code: 400 Bad Request,
{
"error": {
"code": 400,
"message": "Unsupported MIME type: image/pdf",
"status": "INVALID_ARGUMENT"
}
}

BAML Version

0.214.0

Language/Framework

Node.js

LLM Provider

Google

LLM Model

gemini-2.5-flash-lite

Operating System

macOS

Browser

Safari

Code Editor

VS Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions