ollama/harmony
code4me2 0b7d8eda68 harmony: handle embedded analysis segments in tool call JSON
Models using the harmony parser may output analysis/thinking segments
before JSON arguments in tool calls. For example:

  <|channel|>analysis<|message|>I need to list files.{"path": "/tmp"}

Previously this would fail JSON parsing. Now the parser:
- Extracts and strips harmony analysis segments before JSON
- Preserves the thinking content separately
- Uses brace-matching to extract complete JSON objects

This brings the harmony parser in line with Qwen3VL and Cogito parsers
which already handle mixed thinking/tool call content via event-based
parsing.
2025-12-24 22:08:22 -08:00
..
harmonyparser.go harmony: handle embedded analysis segments in tool call JSON 2025-12-24 22:08:22 -08:00
harmonyparser_test.go harmony: handle embedded analysis segments in tool call JSON 2025-12-24 22:08:22 -08:00