From 2faaf0bf80336ba76cb516b0cfddcd2747f101be Mon Sep 17 00:00:00 2001 From: Alex O'Connell Date: Sat, 8 Jun 2024 13:27:35 -0400 Subject: [PATCH] re-add accidentally deleted file --- .../llama_conversation/output.gbnf | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 custom_components/llama_conversation/output.gbnf diff --git a/custom_components/llama_conversation/output.gbnf b/custom_components/llama_conversation/output.gbnf new file mode 100644 index 0000000..26069ba --- /dev/null +++ b/custom_components/llama_conversation/output.gbnf @@ -0,0 +1,29 @@ +root ::= (tosay "\n")+ functioncalls? + +tosay ::= [0-9a-zA-Z #%.?!]* +functioncalls ::= + "```homeassistant\n" (object ws)* "```" + +value ::= object | array | string | number | ("true" | "false" | "null") ws +object ::= + "{" ws ( + string ":" ws value + ("," ws string ":" ws value)* + )? "}" ws + +array ::= + "[" ws ( + value + ("," ws value)* + )? "]" ws + +string ::= + "\"" ( + [^"\\] | + "\\" (["\\/bfnrt] | "u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]) # escapes + )* "\"" ws + +number ::= ("-"? ([0-9] | [1-9] [0-9]*)) ("." [0-9]+)? ([eE] [-+]? [0-9]+)? ws + +# Optional space: by convention, applied in this grammar after literal chars when allowed +ws ::= ([ \t\n] ws)? \ No newline at end of file