https://www.boundaryml.com logo
🟡 Bug: Valid Raw Response Gives Empty Final Outpu...
# questions
a
Experiencing a bug where as the raw response is being streamed and parsed in the playground, the output is valid. But, as soon as the entire response is parsed, the final output is empty. Looking, at the raw LLM response, everything looks correct tho. BAML version is 0.205.0
v
can you post response?
and what type you expect?
a
check DM
v
your type needs a fix 🙂
ambiguity string
should be:
ambiguity string?
since the llm is returning a null value. our parser is only looking for values where
ambiguity
is a string type and the null value doesn't end up matching so we drop that result.
a
Your suggestion fixed the issue. But now i'm confused as to why this worked. I use the same
ambiguity
type in another output class and that has never failed to produce an output even if the string is empty or null
v
i suspect the llm is returning some data that works in the second scenario:
Copy code
{
  "result": "foo",
  "bar": null
}
there's no way to cast that value into this type:
Copy code
class Foo {
   result string
   bar string
}
so we fail to parse. However, this can be cast:
Copy code
{
  "result": "foo",
  "bar": ""
}
Likely what you're seeing is just variance in the llm not working 🙂 sometimes its giving
""
othertimes
null
.
if you had instead used:
Copy code
class Foo {
   result string
   bar string @assert({{ this | length > 0 }})
}
then neither of them would parse
a
makes sense. Ty for the breakdown!
5 Views