https://www.boundaryml.com logo
Parser bug with thinking
# questions
v
I think there is a small bug when using thinking models. With a generator like this:
Copy code
client<llm> Gemini25Pro {
  provider google-ai
  retry_policy Constant
  options {
    model "gemini-2.5-pro"
    api_key env.GOOGLE_API_KEY
    generationConfig {
      thinkingConfig {
          thinkingBudget 1024
          includeThoughts true
      }
    }
  }
}
I'm running a classification task. The SAP parser also reads through the thoughts, which sometimes spells out all the options e.g.
Option A: this is not a good choice because ... \n Option B: This is a good choice ...
consequently matching against Option A and Option B, leading to
[2025-07-28 14:07:06] BAML call failed with validation error (attempt 1/4): BamlValidationError(message=Failed to parse LLM response: Failed to coerce value: <root>: Too many matches for Category @stream.done @stream.not_null. Got: NO_SUITABLE_CATEGORY (1 times), 17f8ab17-11c2-4b36-a6c2-a5f28d0e387d (1 times), 6544abef-57c6-491a-83e7-8fc7d7b7bbc8 (1 times), 49c92188-e3b7-4d46-9b89-e1a289bacae9 (1 times), 78298daa-0cc3-4445-86f6-0e7fee4e22d4 (1 times)
even though the output itself is just
NO_SUITABLE_CATEGORY
g
Thanks for flagging this! Would it be possible to grab the raw response from the LLM and include it here? We may be able to use this in a unit test and for the parser.
v
sent you a dm