Repository navigation
Fix sporadic JSON tool-call detection and add parser hardening for mixed text/tool outputs - #205
Conversation
|
I've addressed the parsing problems in this library in Swift LM Response Parser, which parses reasoning and tool-use output from all models implemented in MLX Swift LM and emits a stream of Open Responses events. I created a demo of it in this PR in MLX Swift Examples and submitted a proposal for how it could be used with MLX Swift LM. If you're able to test it for your use case, please post your feedback here or in an issue in the repo. |
f12106b to
9d0a255
Compare
d92b72e to
c4ff041
Compare
davidkoski
left a comment
There was a problem hiding this comment.
Looks good, but please remove the override in Evaluate -- I think it is not necessary (maybe no longer necessary).
2d84821 to
70e00c8
Compare
70e00c8 to
93cdb1d
Compare
Updated, let me know if now is good to go. Thanks. |
…-explore#205) * fix(mimo): bound vision work by evaluated frames and layers * Match MiMo media reservations to bounded native working memory
Proposed changes
This PR fixes sporadic cases where models output raw JSON tool calls (without wrapper tags) and the stream showed raw JSON instead of emitting a toolCall. It also hardens parser behavior to avoid regressions with normal text/JSON and mixed tagged + untagged content.
ToolCallProcessor primarily relied on tagged boundaries for streaming detection. When models (e.g. Qwen2.5 Instruct) occasionally emitted bare JSON tool calls, the content could bypass tool extraction and appear as raw text.
Checklist
Put an
xin the boxes that apply.pre-commit run --all-filesto format my code / installed pre-commit prior to committing changes