https://www.boundaryml.com logo
🟡 Issue with BAML file: 'sample.pdf' not found
# questions
e
I have the following BAML file
Copy code
class FinancialMetrics {
  revenue float @description("Total revenue in millions")
  netIncome float @description("Net income in millions")
  eps float @description("Earnings per share")
  cashFlow float @description("Operating cash flow in millions")
  keyHighlights string[] @description("Important highlights or notable events from the report")
  risks string[] @description("Key risk factors or challenges mentioned")
  quarterEndDate string @description("The date when the quarter ended")
}

function ExtractFinancialData(report: pdf) -> FinancialMetrics {
  client "anthropic/claude-sonnet-4-5-latest"
  prompt #"
    You are a financial analyst. Extract the key financial metrics and important information from this quarterly financial report.
    Focus on the most recent quarter's performance and any significant developments.

    {{ ctx.output_format }}

    {{ _.role("user") }} {{ report }}
  "#
}

test FinancialReport {
  functions [ExtractFinancialData]
  args {
    report {
      file: "sample.pdf"
    }   
  }
}
But when I run
baml-cli test
I get this:
Copy code
❯ baml-cli test
2025-10-02T15:08:20.116 [BAML INFO] Found valid cached BAML library path="/home/space_cowboy/.cache/baml/libs/0.205.0/libbaml_cffi-x86_64-unknown-linux-gnu.so"
2025-10-02T15:08:20.117 [BAML INFO] BAML (v0.205.0) loaded
Summary: 0/1 tests
⠁ Running ExtractFinancialData::FinancialReport                                                                                                                                                                                                        2025-10-02T15:08:20.132 [BAML WARN] Function ExtractFinancialData:
0.01s ERROR        ExtractFinancialData::FinancialReport
  Failed to read file ./baml_src/: "sample.pdf"

INFO: Test results:
---------------------------------------------------------
function ExtractFinancialData
1 tests (1 🛑)
  0.01s ERROR        ExtractFinancialData::FinancialReport
     ./baml_src/report.baml:23
    Failed to read file ./baml_src/: "sample.pdf"
---------------------------------------------------------
INFO: Test run completed, 1 tests (1 🛑)
Nevermind, I figured it out.
file: "sample.pdf"
should be
file "sample.pdf"
without the
:
a
hmm that seems confusing, at first glance I thought it was an error reading the test file, not the pdf file
We added some stuff around semicolons in maps in the parser, maybe we can warn if you used them
e
Yeah it wasn't clear what caused the error at first for sure