PEG parser for LFM2 (#20251)

* PEG parser for LFM2

* Simplify using python_value()
This commit is contained in:
Piotr Wilkin (ilintar)
2026-03-09 01:11:22 +01:00
committed by GitHub
parent d417bc43dd
commit 97c64fbdbd
6 changed files with 231 additions and 49 deletions
+5
View File
@@ -112,6 +112,11 @@ class common_chat_peg_builder : public common_peg_parser_builder {
bool parallel_tool_calls,
bool force_tool_calls);
// Helper for Python-style function call format: name(arg1="value1", arg2=123)
// Used by LFM2 and similar templates
common_peg_parser python_style_tool_calls(const nlohmann::json & tools,
bool parallel_tool_calls);
private:
// Implementation helpers for standard_json_tools — one per JSON tool call layout mode
common_peg_parser build_json_tools_function_is_key(const nlohmann::json & tools,