From e90f4f4b235bd4f8d32e5dfb01d3671cf44ad7eb Mon Sep 17 00:00:00 2001 From: Dan-wanna-M Date: Sat, 12 Oct 2024 23:05:07 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20Dan-wann?= =?UTF-8?q?a-M/formatron@d915899ffcfacd2ca32a06b1619cb623dfbccb45=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- v0.4.6/.nojekyll | 0 v0.4.6/RWKV_8py.html | 167 + v0.4.6/RWKV_8py.js | 6 + v0.4.6/RWKV_8py_source.html | 271 ++ v0.4.6/____init_____8py.html | 144 + v0.4.6/____init_____8py_source.html | 135 + v0.4.6/__utils_8py.html | 168 ++ v0.4.6/__utils_8py.js | 8 + v0.4.6/__utils_8py_source.html | 214 ++ v0.4.6/annotated.html | 177 ++ v0.4.6/annotated_dup.js | 60 + v0.4.6/bc_s.png | Bin 0 -> 676 bytes v0.4.6/bc_sd.png | Bin 0 -> 635 bytes v0.4.6/classes.html | 166 + ...fig_1_1EngineGenerationConfig-members.html | 138 + ...n_1_1config_1_1EngineGenerationConfig.html | 210 ++ ...ron_1_1config_1_1EngineGenerationConfig.js | 5 + ...1extractor_1_1ChoiceExtractor-members.html | 140 + ...atron_1_1extractor_1_1ChoiceExtractor.html | 323 ++ ...rmatron_1_1extractor_1_1ChoiceExtractor.js | 7 + ...matron_1_1extractor_1_1ChoiceExtractor.png | Bin 0 -> 1367 bytes ...ron_1_1extractor_1_1Extractor-members.html | 143 + ...ssformatron_1_1extractor_1_1Extractor.html | 364 +++ ...lassformatron_1_1extractor_1_1Extractor.js | 10 + ...assformatron_1_1extractor_1_1Extractor.png | Bin 0 -> 3105 bytes ...extractor_1_1LiteralExtractor-members.html | 141 + ...tron_1_1extractor_1_1LiteralExtractor.html | 317 ++ ...matron_1_1extractor_1_1LiteralExtractor.js | 8 + ...atron_1_1extractor_1_1LiteralExtractor.png | Bin 0 -> 961 bytes ...actor_1_1NonterminalExtractor-members.html | 140 + ..._1_1extractor_1_1NonterminalExtractor.html | 297 ++ ...on_1_1extractor_1_1NonterminalExtractor.js | 7 + ...n_1_1extractor_1_1NonterminalExtractor.png | Bin 0 -> 2831 bytes ...tractor_1_1SubstringExtractor-members.html | 142 + ...on_1_1extractor_1_1SubstringExtractor.html | 374 +++ ...tron_1_1extractor_1_1SubstringExtractor.js | 9 + ...ron_1_1extractor_1_1SubstringExtractor.png | Bin 0 -> 1397 bytes ...mats_1_1json_1_1JsonExtractor-members.html | 141 + ...n_1_1formats_1_1json_1_1JsonExtractor.html | 397 +++ ...ron_1_1formats_1_1json_1_1JsonExtractor.js | 8 + ...on_1_1formats_1_1json_1_1JsonExtractor.png | Bin 0 -> 1377 bytes ...ts_1_1regex_1_1RegexExtractor-members.html | 140 + ...1_1formats_1_1regex_1_1RegexExtractor.html | 323 ++ ...n_1_1formats_1_1regex_1_1RegexExtractor.js | 7 + ..._1_1formats_1_1regex_1_1RegexExtractor.png | Bin 0 -> 1408 bytes ...ron_1_1formatter_1_1Formatter-members.html | 155 + ...ssformatron_1_1formatter_1_1Formatter.html | 740 +++++ ...lassformatron_1_1formatter_1_1Formatter.js | 22 + ...assformatron_1_1formatter_1_1Formatter.png | Bin 0 -> 926 bytes ...1_1formatter_1_1FormatterBase-members.html | 145 + ...rmatron_1_1formatter_1_1FormatterBase.html | 441 +++ ...formatron_1_1formatter_1_1FormatterBase.js | 12 + ...ormatron_1_1formatter_1_1FormatterBase.png | Bin 0 -> 932 bytes ...formatter_1_1FormatterBuilder-members.html | 159 + ...tron_1_1formatter_1_1FormatterBuilder.html | 943 ++++++ ...matron_1_1formatter_1_1FormatterBuilder.js | 26 + ...egrations_1_1RWKV_1_1PIPELINE-members.html | 139 + ...n_1_1integrations_1_1RWKV_1_1PIPELINE.html | 262 ++ ...ron_1_1integrations_1_1RWKV_1_1PIPELINE.js | 6 + ...on_1_1integrations_1_1RWKV_1_1PIPELINE.png | Bin 0 -> 769 bytes ...ons_1_1RWKV_1_1PIPELINE__ARGS-members.html | 138 + ...ntegrations_1_1RWKV_1_1PIPELINE__ARGS.html | 251 ++ ...1integrations_1_1RWKV_1_1PIPELINE__ARGS.js | 5 + ...integrations_1_1RWKV_1_1PIPELINE__ARGS.png | Bin 0 -> 991 bytes ...1exllamav2_1_1FormatterFilter-members.html | 153 + ...tions_1_1exllamav2_1_1FormatterFilter.html | 577 ++++ ...rations_1_1exllamav2_1_1FormatterFilter.js | 20 + ...ations_1_1exllamav2_1_1FormatterFilter.png | Bin 0 -> 938 bytes ..._1_1FormattersLogitsProcessor-members.html | 145 + ...sformers_1_1FormattersLogitsProcessor.html | 402 +++ ...ansformers_1_1FormattersLogitsProcessor.js | 12 + ...nsformers_1_1FormattersLogitsProcessor.png | Bin 0 -> 1044 bytes ..._1_1FormattersLogitsProcessor-members.html | 148 + ..._1_1vllm_1_1FormattersLogitsProcessor.html | 486 +++ ...ns_1_1vllm_1_1FormattersLogitsProcessor.js | 15 + ...1dict__inference_1_1FieldInfo-members.html | 140 + ...hemas_1_1dict__inference_1_1FieldInfo.html | 278 ++ ...schemas_1_1dict__inference_1_1FieldInfo.js | 7 + ...chemas_1_1dict__inference_1_1FieldInfo.png | Bin 0 -> 1005 bytes ..._1_1json__schema_1_1FieldInfo-members.html | 141 + ...1schemas_1_1json__schema_1_1FieldInfo.html | 309 ++ ...1_1schemas_1_1json__schema_1_1FieldInfo.js | 8 + ..._1schemas_1_1json__schema_1_1FieldInfo.png | Bin 0 -> 1037 bytes ...as_1_1pydantic_1_1ClassSchema-members.html | 138 + ...1_1schemas_1_1pydantic_1_1ClassSchema.html | 219 ++ ...n_1_1schemas_1_1pydantic_1_1ClassSchema.js | 5 + ..._1_1schemas_1_1pydantic_1_1ClassSchema.png | Bin 0 -> 1502 bytes ...emas_1_1pydantic_1_1FieldInfo-members.html | 143 + ...n_1_1schemas_1_1pydantic_1_1FieldInfo.html | 324 ++ ...ron_1_1schemas_1_1pydantic_1_1FieldInfo.js | 10 + ...chemas_1_1schema_1_1FieldInfo-members.html | 138 + ...ron_1_1schemas_1_1schema_1_1FieldInfo.html | 208 ++ ...atron_1_1schemas_1_1schema_1_1FieldInfo.js | 5 + ...tron_1_1schemas_1_1schema_1_1FieldInfo.png | Bin 0 -> 1555 bytes ..._1schemas_1_1schema_1_1Schema-members.html | 138 + ...matron_1_1schemas_1_1schema_1_1Schema.html | 215 ++ ...ormatron_1_1schemas_1_1schema_1_1Schema.js | 5 + ...rmatron_1_1schemas_1_1schema_1_1Schema.png | Bin 0 -> 1058 bytes ...1_1schema_1_1TypeWithMetadata-members.html | 141 + ...schemas_1_1schema_1_1TypeWithMetadata.html | 280 ++ ..._1schemas_1_1schema_1_1TypeWithMetadata.js | 8 + v0.4.6/clipboard.js | 61 + v0.4.6/closed.png | Bin 0 -> 132 bytes v0.4.6/config_8py.html | 154 + v0.4.6/config_8py.js | 4 + v0.4.6/config_8py_source.html | 154 + v0.4.6/cookie.js | 58 + v0.4.6/dict__inference_8py.html | 165 + v0.4.6/dict__inference_8py.js | 6 + v0.4.6/dict__inference_8py_source.html | 238 ++ .../dir_07d5411bfb9a2f8bc3eb64bb16ab190f.html | 144 + .../dir_07d5411bfb9a2f8bc3eb64bb16ab190f.js | 6 + .../dir_2f7731174e12724dc50b600c6c8c5f5c.html | 148 + .../dir_2f7731174e12724dc50b600c6c8c5f5c.js | 8 + .../dir_68267d1309a1af8e8297ef4c3efbcdba.html | 140 + .../dir_68267d1309a1af8e8297ef4c3efbcdba.js | 4 + .../dir_86ec2f274a7c7757cb321bd1b4c1dbf4.html | 150 + .../dir_86ec2f274a7c7757cb321bd1b4c1dbf4.js | 9 + .../dir_fcf8421df2b1fac2914241030b544a7c.html | 155 + .../dir_fcf8421df2b1fac2914241030b544a7c.js | 10 + v0.4.6/doc.svg | 12 + v0.4.6/docd.svg | 12 + v0.4.6/doxygen-awesome.css | 2677 +++++++++++++++++ v0.4.6/doxygen.css | 1838 +++++++++++ v0.4.6/doxygen.svg | 28 + v0.4.6/doxygen_crawl.html | 499 +++ v0.4.6/dynsections.js | 205 ++ v0.4.6/exllamav2_8py.html | 167 + v0.4.6/exllamav2_8py.js | 6 + v0.4.6/exllamav2_8py_source.html | 320 ++ v0.4.6/extractor_8py.html | 166 + v0.4.6/extractor_8py.js | 8 + v0.4.6/extractor_8py_source.html | 387 +++ v0.4.6/files.html | 160 + v0.4.6/files_dup.js | 4 + v0.4.6/folderclosed.svg | 11 + v0.4.6/folderclosedd.svg | 11 + v0.4.6/folderopen.svg | 17 + v0.4.6/folderopend.svg | 12 + v0.4.6/formats_2____init_____8py.html | 147 + v0.4.6/formats_2____init_____8py_source.html | 137 + v0.4.6/formatter_8py.html | 159 + v0.4.6/formatter_8py.js | 6 + v0.4.6/formatter_8py_source.html | 743 +++++ v0.4.6/functions.html | 293 ++ v0.4.6/functions_func.html | 250 ++ v0.4.6/functions_vars.html | 193 ++ v0.4.6/hierarchy.html | 167 + v0.4.6/hierarchy.js | 44 + v0.4.6/index.html | 134 + v0.4.6/integrations_2____init_____8py.html | 147 + ...integrations_2____init_____8py_source.html | 137 + v0.4.6/jquery.js | 34 + v0.4.6/json_8py.html | 179 ++ v0.4.6/json_8py.js | 10 + v0.4.6/json_8py_source.html | 679 +++++ v0.4.6/json__schema_8py.html | 210 ++ v0.4.6/json__schema_8py.js | 23 + v0.4.6/json__schema_8py_source.html | 579 ++++ v0.4.6/menu.js | 134 + v0.4.6/menudata.js | 95 + v0.4.6/minus.svg | 8 + v0.4.6/minusd.svg | 8 + v0.4.6/namespaceformatron.html | 158 + v0.4.6/namespaceformatron.js | 9 + v0.4.6/namespaceformatron_1_1config.html | 148 + v0.4.6/namespaceformatron_1_1config.js | 4 + v0.4.6/namespaceformatron_1_1extractor.html | 160 + v0.4.6/namespaceformatron_1_1extractor.js | 8 + v0.4.6/namespaceformatron_1_1formats.html | 151 + v0.4.6/namespaceformatron_1_1formats.js | 5 + ...namespaceformatron_1_1formats_1_1json.html | 342 +++ .../namespaceformatron_1_1formats_1_1json.js | 10 + ...amespaceformatron_1_1formats_1_1regex.html | 148 + .../namespaceformatron_1_1formats_1_1regex.js | 4 + v0.4.6/namespaceformatron_1_1formatter.html | 153 + v0.4.6/namespaceformatron_1_1formatter.js | 6 + .../namespaceformatron_1_1integrations.html | 159 + v0.4.6/namespaceformatron_1_1integrations.js | 14 + ...paceformatron_1_1integrations_1_1RWKV.html | 184 ++ ...espaceformatron_1_1integrations_1_1RWKV.js | 6 + ...eformatron_1_1integrations_1_1__utils.html | 276 ++ ...ormatron_1_1integrations_1_1exllamav2.html | 215 ++ ...eformatron_1_1integrations_1_1exllamav2.js | 6 + ...atron_1_1integrations_1_1transformers.html | 243 ++ ...rmatron_1_1integrations_1_1transformers.js | 7 + ...paceformatron_1_1integrations_1_1vllm.html | 210 ++ ...espaceformatron_1_1integrations_1_1vllm.js | 6 + v0.4.6/namespaceformatron_1_1schemas.html | 157 + v0.4.6/namespaceformatron_1_1schemas.js | 7 + ...rmatron_1_1schemas_1_1dict__inference.html | 210 ++ ...formatron_1_1schemas_1_1dict__inference.js | 6 + ...eformatron_1_1schemas_1_1json__schema.html | 872 ++++++ ...aceformatron_1_1schemas_1_1json__schema.js | 23 + ...spaceformatron_1_1schemas_1_1pydantic.html | 227 ++ ...mespaceformatron_1_1schemas_1_1pydantic.js | 7 + ...mespaceformatron_1_1schemas_1_1schema.html | 152 + ...namespaceformatron_1_1schemas_1_1schema.js | 6 + v0.4.6/namespacemembers.html | 200 ++ v0.4.6/namespacemembers_func.html | 186 ++ v0.4.6/namespacemembers_vars.html | 138 + v0.4.6/namespaces.html | 178 ++ v0.4.6/namespaces_dup.js | 4 + v0.4.6/nav_f.png | Bin 0 -> 153 bytes v0.4.6/nav_fd.png | Bin 0 -> 169 bytes v0.4.6/nav_g.png | Bin 0 -> 95 bytes v0.4.6/nav_h.png | Bin 0 -> 98 bytes v0.4.6/nav_hd.png | Bin 0 -> 114 bytes v0.4.6/navtree.css | 149 + v0.4.6/navtree.js | 483 +++ v0.4.6/navtreedata.js | 60 + v0.4.6/navtreeindex0.js | 253 ++ v0.4.6/navtreeindex1.js | 253 ++ v0.4.6/navtreeindex2.js | 21 + v0.4.6/open.png | Bin 0 -> 123 bytes v0.4.6/plus.svg | 9 + v0.4.6/plusd.svg | 9 + v0.4.6/pydantic_8py.html | 173 ++ v0.4.6/pydantic_8py.js | 7 + v0.4.6/pydantic_8py_source.html | 309 ++ v0.4.6/regex_8py.html | 157 + v0.4.6/regex_8py.js | 4 + v0.4.6/regex_8py_source.html | 190 ++ v0.4.6/resize.js | 145 + v0.4.6/schema_8py.html | 161 + v0.4.6/schema_8py.js | 6 + v0.4.6/schema_8py_source.html | 203 ++ v0.4.6/schemas_2____init_____8py.html | 147 + v0.4.6/schemas_2____init_____8py_source.html | 142 + v0.4.6/search/all_0.js | 74 + v0.4.6/search/all_1.js | 9 + v0.4.6/search/all_10.js | 12 + v0.4.6/search/all_11.js | 9 + v0.4.6/search/all_12.js | 6 + v0.4.6/search/all_13.js | 4 + v0.4.6/search/all_14.js | 4 + v0.4.6/search/all_2.js | 5 + v0.4.6/search/all_3.js | 21 + v0.4.6/search/all_4.js | 4 + v0.4.6/search/all_5.js | 12 + v0.4.6/search/all_6.js | 34 + v0.4.6/search/all_7.js | 8 + v0.4.6/search/all_8.js | 4 + v0.4.6/search/all_9.js | 5 + v0.4.6/search/all_a.js | 7 + v0.4.6/search/all_b.js | 5 + v0.4.6/search/all_c.js | 4 + v0.4.6/search/all_d.js | 5 + v0.4.6/search/all_e.js | 7 + v0.4.6/search/all_f.js | 8 + v0.4.6/search/classes_0.js | 5 + v0.4.6/search/classes_1.js | 5 + v0.4.6/search/classes_2.js | 9 + v0.4.6/search/classes_3.js | 4 + v0.4.6/search/classes_4.js | 4 + v0.4.6/search/classes_5.js | 4 + v0.4.6/search/classes_6.js | 5 + v0.4.6/search/classes_7.js | 4 + v0.4.6/search/classes_8.js | 5 + v0.4.6/search/classes_9.js | 4 + v0.4.6/search/close.svg | 18 + v0.4.6/search/files_0.js | 5 + v0.4.6/search/files_1.js | 4 + v0.4.6/search/files_2.js | 4 + v0.4.6/search/files_3.js | 5 + v0.4.6/search/files_4.js | 4 + v0.4.6/search/files_5.js | 5 + v0.4.6/search/files_6.js | 4 + v0.4.6/search/files_7.js | 5 + v0.4.6/search/files_8.js | 4 + v0.4.6/search/files_9.js | 4 + v0.4.6/search/files_a.js | 4 + v0.4.6/search/functions_0.js | 35 + v0.4.6/search/functions_1.js | 9 + v0.4.6/search/functions_10.js | 4 + v0.4.6/search/functions_11.js | 4 + v0.4.6/search/functions_2.js | 5 + v0.4.6/search/functions_3.js | 16 + v0.4.6/search/functions_4.js | 5 + v0.4.6/search/functions_5.js | 8 + v0.4.6/search/functions_6.js | 7 + v0.4.6/search/functions_7.js | 4 + v0.4.6/search/functions_8.js | 5 + v0.4.6/search/functions_9.js | 4 + v0.4.6/search/functions_a.js | 5 + v0.4.6/search/functions_b.js | 5 + v0.4.6/search/functions_c.js | 6 + v0.4.6/search/functions_d.js | 4 + v0.4.6/search/functions_e.js | 7 + v0.4.6/search/functions_f.js | 5 + v0.4.6/search/mag.svg | 24 + v0.4.6/search/mag_d.svg | 24 + v0.4.6/search/mag_sel.svg | 31 + v0.4.6/search/mag_seld.svg | 31 + v0.4.6/search/namespaces_0.js | 21 + v0.4.6/search/search.css | 291 ++ v0.4.6/search/search.js | 694 +++++ v0.4.6/search/searchdata.js | 30 + v0.4.6/search/variables_0.js | 40 + v0.4.6/search/variables_1.js | 5 + v0.4.6/search/variables_2.js | 6 + v0.4.6/search/variables_3.js | 4 + v0.4.6/search/variables_4.js | 4 + v0.4.6/search/variables_5.js | 4 + v0.4.6/search/variables_6.js | 5 + v0.4.6/search/variables_7.js | 4 + v0.4.6/splitbar.png | Bin 0 -> 314 bytes v0.4.6/splitbard.png | Bin 0 -> 282 bytes v0.4.6/sync_off.png | Bin 0 -> 853 bytes v0.4.6/sync_on.png | Bin 0 -> 845 bytes v0.4.6/tab_a.png | Bin 0 -> 142 bytes v0.4.6/tab_ad.png | Bin 0 -> 135 bytes v0.4.6/tab_b.png | Bin 0 -> 169 bytes v0.4.6/tab_bd.png | Bin 0 -> 173 bytes v0.4.6/tab_h.png | Bin 0 -> 177 bytes v0.4.6/tab_hd.png | Bin 0 -> 180 bytes v0.4.6/tab_s.png | Bin 0 -> 184 bytes v0.4.6/tab_sd.png | Bin 0 -> 188 bytes v0.4.6/tabs.css | 1 + v0.4.6/transformers_8py.html | 170 ++ v0.4.6/transformers_8py.js | 7 + v0.4.6/transformers_8py_source.html | 287 ++ v0.4.6/vllm_8py.html | 167 + v0.4.6/vllm_8py.js | 6 + v0.4.6/vllm_8py_source.html | 295 ++ 325 files changed, 36776 insertions(+) create mode 100644 v0.4.6/.nojekyll create mode 100644 v0.4.6/RWKV_8py.html create mode 100644 v0.4.6/RWKV_8py.js create mode 100644 v0.4.6/RWKV_8py_source.html create mode 100644 v0.4.6/____init_____8py.html create mode 100644 v0.4.6/____init_____8py_source.html create mode 100644 v0.4.6/__utils_8py.html create mode 100644 v0.4.6/__utils_8py.js create mode 100644 v0.4.6/__utils_8py_source.html create mode 100644 v0.4.6/annotated.html create mode 100644 v0.4.6/annotated_dup.js create mode 100644 v0.4.6/bc_s.png create mode 100644 v0.4.6/bc_sd.png create mode 100644 v0.4.6/classes.html create mode 100644 v0.4.6/classformatron_1_1config_1_1EngineGenerationConfig-members.html create mode 100644 v0.4.6/classformatron_1_1config_1_1EngineGenerationConfig.html create mode 100644 v0.4.6/classformatron_1_1config_1_1EngineGenerationConfig.js create mode 100644 v0.4.6/classformatron_1_1extractor_1_1ChoiceExtractor-members.html create mode 100644 v0.4.6/classformatron_1_1extractor_1_1ChoiceExtractor.html create mode 100644 v0.4.6/classformatron_1_1extractor_1_1ChoiceExtractor.js create mode 100644 v0.4.6/classformatron_1_1extractor_1_1ChoiceExtractor.png create mode 100644 v0.4.6/classformatron_1_1extractor_1_1Extractor-members.html create mode 100644 v0.4.6/classformatron_1_1extractor_1_1Extractor.html create mode 100644 v0.4.6/classformatron_1_1extractor_1_1Extractor.js create mode 100644 v0.4.6/classformatron_1_1extractor_1_1Extractor.png create mode 100644 v0.4.6/classformatron_1_1extractor_1_1LiteralExtractor-members.html create mode 100644 v0.4.6/classformatron_1_1extractor_1_1LiteralExtractor.html create mode 100644 v0.4.6/classformatron_1_1extractor_1_1LiteralExtractor.js create mode 100644 v0.4.6/classformatron_1_1extractor_1_1LiteralExtractor.png create mode 100644 v0.4.6/classformatron_1_1extractor_1_1NonterminalExtractor-members.html create mode 100644 v0.4.6/classformatron_1_1extractor_1_1NonterminalExtractor.html create mode 100644 v0.4.6/classformatron_1_1extractor_1_1NonterminalExtractor.js create mode 100644 v0.4.6/classformatron_1_1extractor_1_1NonterminalExtractor.png create mode 100644 v0.4.6/classformatron_1_1extractor_1_1SubstringExtractor-members.html create mode 100644 v0.4.6/classformatron_1_1extractor_1_1SubstringExtractor.html create mode 100644 v0.4.6/classformatron_1_1extractor_1_1SubstringExtractor.js create mode 100644 v0.4.6/classformatron_1_1extractor_1_1SubstringExtractor.png create mode 100644 v0.4.6/classformatron_1_1formats_1_1json_1_1JsonExtractor-members.html create mode 100644 v0.4.6/classformatron_1_1formats_1_1json_1_1JsonExtractor.html create mode 100644 v0.4.6/classformatron_1_1formats_1_1json_1_1JsonExtractor.js create mode 100644 v0.4.6/classformatron_1_1formats_1_1json_1_1JsonExtractor.png create mode 100644 v0.4.6/classformatron_1_1formats_1_1regex_1_1RegexExtractor-members.html create mode 100644 v0.4.6/classformatron_1_1formats_1_1regex_1_1RegexExtractor.html create mode 100644 v0.4.6/classformatron_1_1formats_1_1regex_1_1RegexExtractor.js create mode 100644 v0.4.6/classformatron_1_1formats_1_1regex_1_1RegexExtractor.png create mode 100644 v0.4.6/classformatron_1_1formatter_1_1Formatter-members.html create mode 100644 v0.4.6/classformatron_1_1formatter_1_1Formatter.html create mode 100644 v0.4.6/classformatron_1_1formatter_1_1Formatter.js create mode 100644 v0.4.6/classformatron_1_1formatter_1_1Formatter.png create mode 100644 v0.4.6/classformatron_1_1formatter_1_1FormatterBase-members.html create mode 100644 v0.4.6/classformatron_1_1formatter_1_1FormatterBase.html create mode 100644 v0.4.6/classformatron_1_1formatter_1_1FormatterBase.js create mode 100644 v0.4.6/classformatron_1_1formatter_1_1FormatterBase.png create mode 100644 v0.4.6/classformatron_1_1formatter_1_1FormatterBuilder-members.html create mode 100644 v0.4.6/classformatron_1_1formatter_1_1FormatterBuilder.html create mode 100644 v0.4.6/classformatron_1_1formatter_1_1FormatterBuilder.js create mode 100644 v0.4.6/classformatron_1_1integrations_1_1RWKV_1_1PIPELINE-members.html create mode 100644 v0.4.6/classformatron_1_1integrations_1_1RWKV_1_1PIPELINE.html create mode 100644 v0.4.6/classformatron_1_1integrations_1_1RWKV_1_1PIPELINE.js create mode 100644 v0.4.6/classformatron_1_1integrations_1_1RWKV_1_1PIPELINE.png create mode 100644 v0.4.6/classformatron_1_1integrations_1_1RWKV_1_1PIPELINE__ARGS-members.html create mode 100644 v0.4.6/classformatron_1_1integrations_1_1RWKV_1_1PIPELINE__ARGS.html create mode 100644 v0.4.6/classformatron_1_1integrations_1_1RWKV_1_1PIPELINE__ARGS.js create mode 100644 v0.4.6/classformatron_1_1integrations_1_1RWKV_1_1PIPELINE__ARGS.png create mode 100644 v0.4.6/classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter-members.html create mode 100644 v0.4.6/classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html create mode 100644 v0.4.6/classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.js create mode 100644 v0.4.6/classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.png create mode 100644 v0.4.6/classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor-members.html create mode 100644 v0.4.6/classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html create mode 100644 v0.4.6/classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.js create mode 100644 v0.4.6/classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.png create mode 100644 v0.4.6/classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor-members.html create mode 100644 v0.4.6/classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html create mode 100644 v0.4.6/classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.js create mode 100644 v0.4.6/classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo-members.html create mode 100644 v0.4.6/classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo.html create mode 100644 v0.4.6/classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo.js create mode 100644 v0.4.6/classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo.png create mode 100644 v0.4.6/classformatron_1_1schemas_1_1json__schema_1_1FieldInfo-members.html create mode 100644 v0.4.6/classformatron_1_1schemas_1_1json__schema_1_1FieldInfo.html create mode 100644 v0.4.6/classformatron_1_1schemas_1_1json__schema_1_1FieldInfo.js create mode 100644 v0.4.6/classformatron_1_1schemas_1_1json__schema_1_1FieldInfo.png create mode 100644 v0.4.6/classformatron_1_1schemas_1_1pydantic_1_1ClassSchema-members.html create mode 100644 v0.4.6/classformatron_1_1schemas_1_1pydantic_1_1ClassSchema.html create mode 100644 v0.4.6/classformatron_1_1schemas_1_1pydantic_1_1ClassSchema.js create mode 100644 v0.4.6/classformatron_1_1schemas_1_1pydantic_1_1ClassSchema.png create mode 100644 v0.4.6/classformatron_1_1schemas_1_1pydantic_1_1FieldInfo-members.html create mode 100644 v0.4.6/classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.html create mode 100644 v0.4.6/classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.js create mode 100644 v0.4.6/classformatron_1_1schemas_1_1schema_1_1FieldInfo-members.html create mode 100644 v0.4.6/classformatron_1_1schemas_1_1schema_1_1FieldInfo.html create mode 100644 v0.4.6/classformatron_1_1schemas_1_1schema_1_1FieldInfo.js create mode 100644 v0.4.6/classformatron_1_1schemas_1_1schema_1_1FieldInfo.png create mode 100644 v0.4.6/classformatron_1_1schemas_1_1schema_1_1Schema-members.html create mode 100644 v0.4.6/classformatron_1_1schemas_1_1schema_1_1Schema.html create mode 100644 v0.4.6/classformatron_1_1schemas_1_1schema_1_1Schema.js create mode 100644 v0.4.6/classformatron_1_1schemas_1_1schema_1_1Schema.png create mode 100644 v0.4.6/classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata-members.html create mode 100644 v0.4.6/classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata.html create mode 100644 v0.4.6/classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata.js create mode 100644 v0.4.6/clipboard.js create mode 100644 v0.4.6/closed.png create mode 100644 v0.4.6/config_8py.html create mode 100644 v0.4.6/config_8py.js create mode 100644 v0.4.6/config_8py_source.html create mode 100644 v0.4.6/cookie.js create mode 100644 v0.4.6/dict__inference_8py.html create mode 100644 v0.4.6/dict__inference_8py.js create mode 100644 v0.4.6/dict__inference_8py_source.html create mode 100644 v0.4.6/dir_07d5411bfb9a2f8bc3eb64bb16ab190f.html create mode 100644 v0.4.6/dir_07d5411bfb9a2f8bc3eb64bb16ab190f.js create mode 100644 v0.4.6/dir_2f7731174e12724dc50b600c6c8c5f5c.html create mode 100644 v0.4.6/dir_2f7731174e12724dc50b600c6c8c5f5c.js create mode 100644 v0.4.6/dir_68267d1309a1af8e8297ef4c3efbcdba.html create mode 100644 v0.4.6/dir_68267d1309a1af8e8297ef4c3efbcdba.js create mode 100644 v0.4.6/dir_86ec2f274a7c7757cb321bd1b4c1dbf4.html create mode 100644 v0.4.6/dir_86ec2f274a7c7757cb321bd1b4c1dbf4.js create mode 100644 v0.4.6/dir_fcf8421df2b1fac2914241030b544a7c.html create mode 100644 v0.4.6/dir_fcf8421df2b1fac2914241030b544a7c.js create mode 100644 v0.4.6/doc.svg create mode 100644 v0.4.6/docd.svg create mode 100644 v0.4.6/doxygen-awesome.css create mode 100644 v0.4.6/doxygen.css create mode 100644 v0.4.6/doxygen.svg create mode 100644 v0.4.6/doxygen_crawl.html create mode 100644 v0.4.6/dynsections.js create mode 100644 v0.4.6/exllamav2_8py.html create mode 100644 v0.4.6/exllamav2_8py.js create mode 100644 v0.4.6/exllamav2_8py_source.html create mode 100644 v0.4.6/extractor_8py.html create mode 100644 v0.4.6/extractor_8py.js create mode 100644 v0.4.6/extractor_8py_source.html create mode 100644 v0.4.6/files.html create mode 100644 v0.4.6/files_dup.js create mode 100644 v0.4.6/folderclosed.svg create mode 100644 v0.4.6/folderclosedd.svg create mode 100644 v0.4.6/folderopen.svg create mode 100644 v0.4.6/folderopend.svg create mode 100644 v0.4.6/formats_2____init_____8py.html create mode 100644 v0.4.6/formats_2____init_____8py_source.html create mode 100644 v0.4.6/formatter_8py.html create mode 100644 v0.4.6/formatter_8py.js create mode 100644 v0.4.6/formatter_8py_source.html create mode 100644 v0.4.6/functions.html create mode 100644 v0.4.6/functions_func.html create mode 100644 v0.4.6/functions_vars.html create mode 100644 v0.4.6/hierarchy.html create mode 100644 v0.4.6/hierarchy.js create mode 100644 v0.4.6/index.html create mode 100644 v0.4.6/integrations_2____init_____8py.html create mode 100644 v0.4.6/integrations_2____init_____8py_source.html create mode 100644 v0.4.6/jquery.js create mode 100644 v0.4.6/json_8py.html create mode 100644 v0.4.6/json_8py.js create mode 100644 v0.4.6/json_8py_source.html create mode 100644 v0.4.6/json__schema_8py.html create mode 100644 v0.4.6/json__schema_8py.js create mode 100644 v0.4.6/json__schema_8py_source.html create mode 100644 v0.4.6/menu.js create mode 100644 v0.4.6/menudata.js create mode 100644 v0.4.6/minus.svg create mode 100644 v0.4.6/minusd.svg create mode 100644 v0.4.6/namespaceformatron.html create mode 100644 v0.4.6/namespaceformatron.js create mode 100644 v0.4.6/namespaceformatron_1_1config.html create mode 100644 v0.4.6/namespaceformatron_1_1config.js create mode 100644 v0.4.6/namespaceformatron_1_1extractor.html create mode 100644 v0.4.6/namespaceformatron_1_1extractor.js create mode 100644 v0.4.6/namespaceformatron_1_1formats.html create mode 100644 v0.4.6/namespaceformatron_1_1formats.js create mode 100644 v0.4.6/namespaceformatron_1_1formats_1_1json.html create mode 100644 v0.4.6/namespaceformatron_1_1formats_1_1json.js create mode 100644 v0.4.6/namespaceformatron_1_1formats_1_1regex.html create mode 100644 v0.4.6/namespaceformatron_1_1formats_1_1regex.js create mode 100644 v0.4.6/namespaceformatron_1_1formatter.html create mode 100644 v0.4.6/namespaceformatron_1_1formatter.js create mode 100644 v0.4.6/namespaceformatron_1_1integrations.html create mode 100644 v0.4.6/namespaceformatron_1_1integrations.js create mode 100644 v0.4.6/namespaceformatron_1_1integrations_1_1RWKV.html create mode 100644 v0.4.6/namespaceformatron_1_1integrations_1_1RWKV.js create mode 100644 v0.4.6/namespaceformatron_1_1integrations_1_1__utils.html create mode 100644 v0.4.6/namespaceformatron_1_1integrations_1_1exllamav2.html create mode 100644 v0.4.6/namespaceformatron_1_1integrations_1_1exllamav2.js create mode 100644 v0.4.6/namespaceformatron_1_1integrations_1_1transformers.html create mode 100644 v0.4.6/namespaceformatron_1_1integrations_1_1transformers.js create mode 100644 v0.4.6/namespaceformatron_1_1integrations_1_1vllm.html create mode 100644 v0.4.6/namespaceformatron_1_1integrations_1_1vllm.js create mode 100644 v0.4.6/namespaceformatron_1_1schemas.html create mode 100644 v0.4.6/namespaceformatron_1_1schemas.js create mode 100644 v0.4.6/namespaceformatron_1_1schemas_1_1dict__inference.html create mode 100644 v0.4.6/namespaceformatron_1_1schemas_1_1dict__inference.js create mode 100644 v0.4.6/namespaceformatron_1_1schemas_1_1json__schema.html create mode 100644 v0.4.6/namespaceformatron_1_1schemas_1_1json__schema.js create mode 100644 v0.4.6/namespaceformatron_1_1schemas_1_1pydantic.html create mode 100644 v0.4.6/namespaceformatron_1_1schemas_1_1pydantic.js create mode 100644 v0.4.6/namespaceformatron_1_1schemas_1_1schema.html create mode 100644 v0.4.6/namespaceformatron_1_1schemas_1_1schema.js create mode 100644 v0.4.6/namespacemembers.html create mode 100644 v0.4.6/namespacemembers_func.html create mode 100644 v0.4.6/namespacemembers_vars.html create mode 100644 v0.4.6/namespaces.html create mode 100644 v0.4.6/namespaces_dup.js create mode 100644 v0.4.6/nav_f.png create mode 100644 v0.4.6/nav_fd.png create mode 100644 v0.4.6/nav_g.png create mode 100644 v0.4.6/nav_h.png create mode 100644 v0.4.6/nav_hd.png create mode 100644 v0.4.6/navtree.css create mode 100644 v0.4.6/navtree.js create mode 100644 v0.4.6/navtreedata.js create mode 100644 v0.4.6/navtreeindex0.js create mode 100644 v0.4.6/navtreeindex1.js create mode 100644 v0.4.6/navtreeindex2.js create mode 100644 v0.4.6/open.png create mode 100644 v0.4.6/plus.svg create mode 100644 v0.4.6/plusd.svg create mode 100644 v0.4.6/pydantic_8py.html create mode 100644 v0.4.6/pydantic_8py.js create mode 100644 v0.4.6/pydantic_8py_source.html create mode 100644 v0.4.6/regex_8py.html create mode 100644 v0.4.6/regex_8py.js create mode 100644 v0.4.6/regex_8py_source.html create mode 100644 v0.4.6/resize.js create mode 100644 v0.4.6/schema_8py.html create mode 100644 v0.4.6/schema_8py.js create mode 100644 v0.4.6/schema_8py_source.html create mode 100644 v0.4.6/schemas_2____init_____8py.html create mode 100644 v0.4.6/schemas_2____init_____8py_source.html create mode 100644 v0.4.6/search/all_0.js create mode 100644 v0.4.6/search/all_1.js create mode 100644 v0.4.6/search/all_10.js create mode 100644 v0.4.6/search/all_11.js create mode 100644 v0.4.6/search/all_12.js create mode 100644 v0.4.6/search/all_13.js create mode 100644 v0.4.6/search/all_14.js create mode 100644 v0.4.6/search/all_2.js create mode 100644 v0.4.6/search/all_3.js create mode 100644 v0.4.6/search/all_4.js create mode 100644 v0.4.6/search/all_5.js create mode 100644 v0.4.6/search/all_6.js create mode 100644 v0.4.6/search/all_7.js create mode 100644 v0.4.6/search/all_8.js create mode 100644 v0.4.6/search/all_9.js create mode 100644 v0.4.6/search/all_a.js create mode 100644 v0.4.6/search/all_b.js create mode 100644 v0.4.6/search/all_c.js create mode 100644 v0.4.6/search/all_d.js create mode 100644 v0.4.6/search/all_e.js create mode 100644 v0.4.6/search/all_f.js create mode 100644 v0.4.6/search/classes_0.js create mode 100644 v0.4.6/search/classes_1.js create mode 100644 v0.4.6/search/classes_2.js create mode 100644 v0.4.6/search/classes_3.js create mode 100644 v0.4.6/search/classes_4.js create mode 100644 v0.4.6/search/classes_5.js create mode 100644 v0.4.6/search/classes_6.js create mode 100644 v0.4.6/search/classes_7.js create mode 100644 v0.4.6/search/classes_8.js create mode 100644 v0.4.6/search/classes_9.js create mode 100644 v0.4.6/search/close.svg create mode 100644 v0.4.6/search/files_0.js create mode 100644 v0.4.6/search/files_1.js create mode 100644 v0.4.6/search/files_2.js create mode 100644 v0.4.6/search/files_3.js create mode 100644 v0.4.6/search/files_4.js create mode 100644 v0.4.6/search/files_5.js create mode 100644 v0.4.6/search/files_6.js create mode 100644 v0.4.6/search/files_7.js create mode 100644 v0.4.6/search/files_8.js create mode 100644 v0.4.6/search/files_9.js create mode 100644 v0.4.6/search/files_a.js create mode 100644 v0.4.6/search/functions_0.js create mode 100644 v0.4.6/search/functions_1.js create mode 100644 v0.4.6/search/functions_10.js create mode 100644 v0.4.6/search/functions_11.js create mode 100644 v0.4.6/search/functions_2.js create mode 100644 v0.4.6/search/functions_3.js create mode 100644 v0.4.6/search/functions_4.js create mode 100644 v0.4.6/search/functions_5.js create mode 100644 v0.4.6/search/functions_6.js create mode 100644 v0.4.6/search/functions_7.js create mode 100644 v0.4.6/search/functions_8.js create mode 100644 v0.4.6/search/functions_9.js create mode 100644 v0.4.6/search/functions_a.js create mode 100644 v0.4.6/search/functions_b.js create mode 100644 v0.4.6/search/functions_c.js create mode 100644 v0.4.6/search/functions_d.js create mode 100644 v0.4.6/search/functions_e.js create mode 100644 v0.4.6/search/functions_f.js create mode 100644 v0.4.6/search/mag.svg create mode 100644 v0.4.6/search/mag_d.svg create mode 100644 v0.4.6/search/mag_sel.svg create mode 100644 v0.4.6/search/mag_seld.svg create mode 100644 v0.4.6/search/namespaces_0.js create mode 100644 v0.4.6/search/search.css create mode 100644 v0.4.6/search/search.js create mode 100644 v0.4.6/search/searchdata.js create mode 100644 v0.4.6/search/variables_0.js create mode 100644 v0.4.6/search/variables_1.js create mode 100644 v0.4.6/search/variables_2.js create mode 100644 v0.4.6/search/variables_3.js create mode 100644 v0.4.6/search/variables_4.js create mode 100644 v0.4.6/search/variables_5.js create mode 100644 v0.4.6/search/variables_6.js create mode 100644 v0.4.6/search/variables_7.js create mode 100644 v0.4.6/splitbar.png create mode 100644 v0.4.6/splitbard.png create mode 100644 v0.4.6/sync_off.png create mode 100644 v0.4.6/sync_on.png create mode 100644 v0.4.6/tab_a.png create mode 100644 v0.4.6/tab_ad.png create mode 100644 v0.4.6/tab_b.png create mode 100644 v0.4.6/tab_bd.png create mode 100644 v0.4.6/tab_h.png create mode 100644 v0.4.6/tab_hd.png create mode 100644 v0.4.6/tab_s.png create mode 100644 v0.4.6/tab_sd.png create mode 100644 v0.4.6/tabs.css create mode 100644 v0.4.6/transformers_8py.html create mode 100644 v0.4.6/transformers_8py.js create mode 100644 v0.4.6/transformers_8py_source.html create mode 100644 v0.4.6/vllm_8py.html create mode 100644 v0.4.6/vllm_8py.js create mode 100644 v0.4.6/vllm_8py_source.html diff --git a/v0.4.6/.nojekyll b/v0.4.6/.nojekyll new file mode 100644 index 00000000..e69de29b diff --git a/v0.4.6/RWKV_8py.html b/v0.4.6/RWKV_8py.html new file mode 100644 index 00000000..14dd168b --- /dev/null +++ b/v0.4.6/RWKV_8py.html @@ -0,0 +1,167 @@ + + + + + + + + +Formatron: src/formatron/integrations/RWKV.py File Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
RWKV.py File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + + + +

+Classes

class  formatron.integrations.RWKV.PIPELINE_ARGS
 A wrapper for the arguments of the pipeline of RWKV. More...
 
class  formatron.integrations.RWKV.PIPELINE
 A wrapper for the pipeline of RWKV. More...
 
+ + + + + + + + + +

+Namespaces

namespace  formatron
 
namespace  formatron.integrations
 This subpackage contains integrations with other frameworks and libraries.
 
namespace  formatron.integrations.RWKV
 This module integrates the RWKV library by providing convenience utilities.
 
+ + + + +

+Functions

kbnf.Vocabulary formatron.integrations.RWKV.create_engine_vocabulary (str WORD_NAME, tokenizer)
 Create a vocabulary for the KBNF engine.
 
+
+
+ + + + diff --git a/v0.4.6/RWKV_8py.js b/v0.4.6/RWKV_8py.js new file mode 100644 index 00000000..7b50d036 --- /dev/null +++ b/v0.4.6/RWKV_8py.js @@ -0,0 +1,6 @@ +var RWKV_8py = +[ + [ "formatron.integrations.RWKV.PIPELINE_ARGS", "classformatron_1_1integrations_1_1RWKV_1_1PIPELINE__ARGS.html", "classformatron_1_1integrations_1_1RWKV_1_1PIPELINE__ARGS" ], + [ "formatron.integrations.RWKV.PIPELINE", "classformatron_1_1integrations_1_1RWKV_1_1PIPELINE.html", "classformatron_1_1integrations_1_1RWKV_1_1PIPELINE" ], + [ "create_engine_vocabulary", "RWKV_8py.html#a2fc99d20bbcc438cc823a728cbc999ea", null ] +]; \ No newline at end of file diff --git a/v0.4.6/RWKV_8py_source.html b/v0.4.6/RWKV_8py_source.html new file mode 100644 index 00000000..1f14b54f --- /dev/null +++ b/v0.4.6/RWKV_8py_source.html @@ -0,0 +1,271 @@ + + + + + + + + +Formatron: src/formatron/integrations/RWKV.py Source File + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
RWKV.py
+
+
+Go to the documentation of this file.
1"""
+
2This module integrates the RWKV library by providing convenience utilities.
+
3"""
+
4import kbnf
+
5import rwkv.utils
+
6from kbnf import Token
+
7
+
8from formatron.config import EngineGenerationConfig
+
9from formatron.formatter import FormatterBuilder
+
10
+
11
+
12class PIPELINE_ARGS(rwkv.utils.PIPELINE_ARGS):
+
13 """
+
14 A wrapper for the arguments of the pipeline of RWKV.
+
15 """
+
+ +
17 def __init__(self,
+
+
18 temperature=1.0,
+
19 top_p=0.2,
+
20 top_k=0,
+
21 alpha_frequency=0.2,
+
22 alpha_presence=0.2,
+
23 alpha_decay=0.996,
+
24 token_ban=[],
+
25 token_stop=[],
+
26 chunk_len=256,
+
27 engine_gen_config=EngineGenerationConfig()):
+
28 super().__init__(temperature, top_p, top_k, alpha_frequency, alpha_presence, alpha_decay, token_ban, token_stop,
+
29 chunk_len)
+
30 self.engine_gen_config = engine_gen_config
+ +
32
+
33def create_engine_vocabulary(WORD_NAME: str, tokenizer) -> kbnf.Vocabulary: # NOSONAR
+
+
+
34 """
+
35 Create a vocabulary for the KBNF engine.
+
36 """
+
+
37 assert WORD_NAME == 'rwkv_vocab_v20230424', "Only world vocabulary is supported!"
+
38 return kbnf.Vocabulary({k: Token(v) for k, v in tokenizer.idx2token.items()},
+
39 {k: v.decode("UTF-8", errors="replace") for k, v in
+
40 tokenizer.idx2token.items()})
+
41
+
42
+
43class PIPELINE(rwkv.utils.PIPELINE): # NOSONAR
+
+
44 """
+
45 A wrapper for the pipeline of RWKV.
+
46 """
+
+ +
48 def __init__(self, model, WORD_NAME, formatter_builder: FormatterBuilder = None): # NOSONAR
+
+
49 super().__init__(model, WORD_NAME)
+
50 vocabulary = create_engine_vocabulary(WORD_NAME, self.tokenizer)
+
51 formatter = formatter_builder.build(vocabulary, lambda tokens: self.tokenizer.decode(tokens))
+
52 if formatter is not None:
+
53 self.formatter = formatter
+
54 else:
+
55 self.formatter = None
+
56
+
57 def generate(self, ctx, token_count=100, args=PIPELINE_ARGS(), callback=None, state=None):
+
+
+
58 all_tokens = []
+
59 out_last = 0
+
60 out_str = ''
+
61 occurrence = {}
+
62 if args.engine_gen_config.reset_at_beginning and self.formatter and self.formatter.is_completed():
+
63 self.formatter.reset()
+
64 for i in range(token_count):
+
65 # forward & adjust prob.
+
66 tokens = self.encode(ctx) if i == 0 else [token]
+
67 if self.formatter is not None:
+
68 if i == 0 and args.engine_gen_config.read_prompt:
+
69 for token in tokens:
+
70 self.formatter.accept_token(token)
+
71 while len(tokens) > 0:
+
72 out, state = self.model.forward(tokens[:args.chunk_len], state)
+
73 tokens = tokens[args.chunk_len:]
+
74 if self.formatter and self.formatter.is_completed():
+
75 break
+
76 for n in args.token_ban:
+
77 out[n] = -float('inf')
+
78 for n in occurrence:
+
79 out[n] -= (args.alpha_presence + occurrence[n] * args.alpha_frequency)
+
80 if self.formatter is not None:
+
81 formatter = self.formatter
+
82 formatter.compute_allowed_tokens()
+
83 out = out[:len(self.tokenizer.idx2token) + 1] # account for the padding `0` token
+
84 out = formatter.mask_logits(out)
+
85 # sampler
+
86 token = self.sample_logits(out, temperature=args.temperature, top_p=args.top_p, top_k=args.top_k)
+
87 if self.formatter:
+
88 self.formatter.accept_token(token)
+
89 if token in args.token_stop:
+
90 break
+
91 all_tokens += [token]
+
92 for xxx in occurrence:
+
93 occurrence[xxx] *= args.alpha_decay
+
94
+
95 ttt = self.decode([token])
+
96 www = 1
+
97 if ttt in ' \t0123456789':
+
98 www = 0
+
99 if token not in occurrence:
+
100 occurrence[token] = www
+
101 else:
+
102 occurrence[token] += www
+
103 # print(occurrence) # debug
+
104
+
105 # output
+
106 tmp = self.decode(all_tokens[out_last:])
+
107 if '\ufffd' not in tmp: # is valid utf-8 string?
+
108 if callback:
+
109 callback(tmp)
+
110 out_str += tmp
+
111 out_last = i + 1
+
112 if self.formatter and self.formatter.is_completed():
+
113 break
+
114 return out_str
+
+
+
A wrapper for the arguments of the pipeline of RWKV.
Definition RWKV.py:16
+
__init__(self, temperature=1.0, top_p=0.2, top_k=0, alpha_frequency=0.2, alpha_presence=0.2, alpha_decay=0.996, token_ban=[], token_stop=[], chunk_len=256, engine_gen_config=EngineGenerationConfig())
Definition RWKV.py:28
+ +
A wrapper for the pipeline of RWKV.
Definition RWKV.py:47
+ +
generate(self, ctx, token_count=100, args=PIPELINE_ARGS(), callback=None, state=None)
Definition RWKV.py:58
+
__init__(self, model, WORD_NAME, FormatterBuilder formatter_builder=None)
Definition RWKV.py:49
+
Configuration classes for Formatron.
Definition config.py:1
+
This module contains the Formatter class and its related classes.
Definition formatter.py:1
+
kbnf.Vocabulary create_engine_vocabulary(str WORD_NAME, tokenizer)
Create a vocabulary for the KBNF engine.
Definition RWKV.py:37
+ +
+
+ + + + diff --git a/v0.4.6/____init_____8py.html b/v0.4.6/____init_____8py.html new file mode 100644 index 00000000..07c3648b --- /dev/null +++ b/v0.4.6/____init_____8py.html @@ -0,0 +1,144 @@ + + + + + + + + +Formatron: src/formatron/__init__.py File Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
__init__.py File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Namespaces

namespace  formatron
 
+
+
+ + + + diff --git a/v0.4.6/____init_____8py_source.html b/v0.4.6/____init_____8py_source.html new file mode 100644 index 00000000..1f11b7b4 --- /dev/null +++ b/v0.4.6/____init_____8py_source.html @@ -0,0 +1,135 @@ + + + + + + + + +Formatron: src/formatron/__init__.py Source File + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
__init__.py
+
+ +
+ + + + diff --git a/v0.4.6/__utils_8py.html b/v0.4.6/__utils_8py.html new file mode 100644 index 00000000..897600b9 --- /dev/null +++ b/v0.4.6/__utils_8py.html @@ -0,0 +1,168 @@ + + + + + + + + +Formatron: src/formatron/integrations/_utils.py File Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
_utils.py File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + + + + +

+Namespaces

namespace  formatron
 
namespace  formatron.integrations
 This subpackage contains integrations with other frameworks and libraries.
 
namespace  formatron.integrations._utils
 
+ + + + + + + + + + +

+Functions

bytes formatron.integrations._utils._multiple_replace (typing.Dict[bytes, bytes] replacements, re.Pattern[bytes] regex, bytes text)
 
 formatron.integrations._utils._autodetect_processors (typing.Dict[str, int] vocab)
 
typing.Dict[int, bytes] formatron.integrations._utils.get_original_characters (typing.Dict[str, int] vocab)
 
 formatron.integrations._utils.huggingface_bytelevel_decoder ()
 I hate legacy code.
 
+ + + +

+Variables

 formatron.integrations._utils.Processors = set[typing.Literal["sentencepiece", "<0xHH>", "dot_G"]]
 
+
+
+ + + + diff --git a/v0.4.6/__utils_8py.js b/v0.4.6/__utils_8py.js new file mode 100644 index 00000000..83181b22 --- /dev/null +++ b/v0.4.6/__utils_8py.js @@ -0,0 +1,8 @@ +var __utils_8py = +[ + [ "_autodetect_processors", "__utils_8py.html#a76ded8fc3ee5ad369ec55b595ae74153", null ], + [ "_multiple_replace", "__utils_8py.html#abf64c53a323448aedc1361d01515226a", null ], + [ "get_original_characters", "__utils_8py.html#ad30a176c08ead38cba6e7f425c7c6c08", null ], + [ "huggingface_bytelevel_decoder", "__utils_8py.html#a91dd89b0d6aecbea162244c5592f374b", null ], + [ "Processors", "__utils_8py.html#ad5e049a7fd2978958881877de9eb6c1a", null ] +]; \ No newline at end of file diff --git a/v0.4.6/__utils_8py_source.html b/v0.4.6/__utils_8py_source.html new file mode 100644 index 00000000..2ff0e904 --- /dev/null +++ b/v0.4.6/__utils_8py_source.html @@ -0,0 +1,214 @@ + + + + + + + + +Formatron: src/formatron/integrations/_utils.py Source File + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
_utils.py
+
+
+Go to the documentation of this file.
1import re
+
2import typing
+
3from functools import lru_cache
+
4
+
5
+
+
6def _multiple_replace(replacements: typing.Dict[bytes, bytes], regex: re.Pattern[bytes], text: bytes) -> bytes:
+
7 # For each match, look-up corresponding value in dictionary
+
8 return regex.sub(lambda mo: replacements[mo.group()], text)
+
9
+
10
+
+
11Processors = set[typing.Literal["sentencepiece", "<0xHH>", "dot_G"]]
+
12
+
13
+
+
14def _autodetect_processors(vocab: typing.Dict[str, int]):
+
15 result = set()
+
16 llama_present = any(i.find('<0xF0>') != -1 for i in vocab.keys())
+
17 underscore_present = (len([1 for i in vocab.keys() if i.find('\u2581') != -1]) / len(vocab)) > 0.2
+
18 g_present = (len([1 for i in vocab.keys() if i.find('\u0120') != -1]) / len(vocab)) > 0.2
+
19 if llama_present:
+
20 result.add("<0xHH>")
+
21 if underscore_present:
+
22 result.add("sentencepiece")
+
23 elif g_present:
+
24 result.add("dot_G")
+
25 return result
+
26
+
27
+
+
+
28def get_original_characters(vocab: typing.Dict[str, int]) -> typing.Dict[int, bytes]:
+
29 old_char_to_new_char = {}
+
30 assert len(set(vocab.values())) == len(vocab), "Vocabulary contains duplicate token IDs!"
+
31 processors = _autodetect_processors(vocab)
+
32 for i in processors:
+
33 if i == "sentencepiece":
+
34 old_char_to_new_char["\u2581".encode("UTF-8")] = b" "
+
35 elif i == "dot_G":
+
36 old_char_to_new_char.update(huggingface_bytelevel_decoder())
+
37 elif i == "<0xHH>":
+
38 for j in range(256):
+
39 old_char_to_new_char[("<0x" + f"{j:02x}".upper() + ">").encode("UTF-8")] = bytes([j])
+
40 else:
+
41 raise ValueError(f"{i} is not a valid processor name!")
+
42 # Create a regular expression from the dictionary keys with longest keys first to avoid conflicts
+
43 regex = re.compile(b"(%s)" % b"|".join(sorted(list(map(re.escape, old_char_to_new_char.keys())), key=lambda x: len(x), reverse=True)))
+
44 new_vocab = {}
+
45 for k in vocab:
+
46 token_id = vocab[k]
+
47 new_k = _multiple_replace(old_char_to_new_char, regex, k.encode("UTF-8"))
+
48 new_vocab[token_id] = new_k
+
49 return new_vocab
+
50
+
51
+
52@lru_cache()
+
+ +
54 """
+
55 I hate legacy code.
+
+
56 """
+
57 bs = list(range(ord("!"), ord("~")+1))+list(range(ord("¡"), ord("¬")+1))+list(range(ord("®"), ord("ÿ")+1))
+
58 cs = bs[:]
+
59 n = 0
+
60 for b in range(2**8):
+
61 if b not in bs:
+
62 bs.append(b)
+
63 cs.append(2**8+n)
+
64 n += 1
+
65 cs = [chr(n).encode("UTF-8") for n in cs]
+
66 for i in range(len(bs)):
+
67 bs[i] = bytes([bs[i]])
+
68 return dict(zip(cs, bs))
+
+
_autodetect_processors(typing.Dict[str, int] vocab)
Definition _utils.py:14
+
huggingface_bytelevel_decoder()
I hate legacy code.
Definition _utils.py:56
+
bytes _multiple_replace(typing.Dict[bytes, bytes] replacements, re.Pattern[bytes] regex, bytes text)
Definition _utils.py:6
+
typing.Dict[int, bytes] get_original_characters(typing.Dict[str, int] vocab)
Definition _utils.py:28
+
+
+ + + + diff --git a/v0.4.6/annotated.html b/v0.4.6/annotated.html new file mode 100644 index 00000000..3582b8aa --- /dev/null +++ b/v0.4.6/annotated.html @@ -0,0 +1,177 @@ + + + + + + + + +Formatron: Class List + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Class List
+
+
+
Here are the classes, structs, unions and interfaces with brief descriptions:
+
[detail level 1234]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 Nformatron
 NconfigConfiguration classes for Formatron
 CEngineGenerationConfigConfiguration for how an KBNF engine should be used in text generation
 NextractorExtractors for extracting data from generated strings
 CChoiceExtractorAn extractor that uses multiple extractors to extract data
 CExtractorAn abstract extractor that extracts data from a string and offers its KBNF rules definition
 CLiteralExtractorAn extractor that extracts a literal string
 CNonterminalExtractorAn extractor that extracts data corresponding to a nonterminal
 CSubstringExtractorAn extractor that extracts a substring of a given string from the input string
 NformatsThis subpackage contains modules that operate with concrete formats, like json
 NjsonThe module defines the JsonExtractor class, which is used to extract data from a string in JSON format
 CJsonExtractorAn extractor that loads json data to an object from a string
 NregexThis module contains the RegexExtractor class, which is used to extract data using a regular expression
 CRegexExtractorAn extractor that extracts a string using a regular expression
 NformatterThis module contains the Formatter class and its related classes
 CFormatter
 CFormatterBaseAn abstract Formatter that enforces a format on the string generated by a language model
 CFormatterBuilderA builder for creating a Formatter
 NintegrationsThis subpackage contains integrations with other frameworks and libraries
 Nexllamav2This module integrates the ExLlamaV2 library by providing convenience utilities
 CFormatterFilterExLlamaV2Filter that uses a formatter to mask logits
 NRWKVThis module integrates the RWKV library by providing convenience utilities
 CPIPELINEA wrapper for the pipeline of RWKV
 CPIPELINE_ARGSA wrapper for the arguments of the pipeline of RWKV
 NtransformersThis module integrates the transformers library by providing convenience utilities
 CFormattersLogitsProcessorLogit processor that uses formatters to mask batch logits
 NvllmThis module integrates the vllm library by providing convenience utilities
 CFormattersLogitsProcessorLogit processor that uses formatters to mask batch logits
 NschemasThis subpackage contains modules that define schemas creation from various sources
 Ndict_inferenceThis module contains utilities for inferring schemas from dictionaries
 CFieldInfo
 Njson_schemaThis module contains utilities for creating schemas from JSON schemas
 CFieldInfo
 NpydanticA module that implements the Schema interface using pydantic
 CClassSchemaA wrapper for pydantic BaseModel that implements the Schema interface
 CFieldInfoA wrapper for pydantic FieldInfo
 NschemaThis module contains the Schema abstract class and FieldInfo abstract class
 CFieldInfo
 CSchemaAn abstract schema that describes some data
 CTypeWithMetadata
+
+
+
+ + + + diff --git a/v0.4.6/annotated_dup.js b/v0.4.6/annotated_dup.js new file mode 100644 index 00000000..218fb15d --- /dev/null +++ b/v0.4.6/annotated_dup.js @@ -0,0 +1,60 @@ +var annotated_dup = +[ + [ "formatron", "namespaceformatron.html", [ + [ "config", "namespaceformatron_1_1config.html", [ + [ "EngineGenerationConfig", "classformatron_1_1config_1_1EngineGenerationConfig.html", "classformatron_1_1config_1_1EngineGenerationConfig" ] + ] ], + [ "extractor", "namespaceformatron_1_1extractor.html", [ + [ "ChoiceExtractor", "classformatron_1_1extractor_1_1ChoiceExtractor.html", "classformatron_1_1extractor_1_1ChoiceExtractor" ], + [ "Extractor", "classformatron_1_1extractor_1_1Extractor.html", "classformatron_1_1extractor_1_1Extractor" ], + [ "LiteralExtractor", "classformatron_1_1extractor_1_1LiteralExtractor.html", "classformatron_1_1extractor_1_1LiteralExtractor" ], + [ "NonterminalExtractor", "classformatron_1_1extractor_1_1NonterminalExtractor.html", "classformatron_1_1extractor_1_1NonterminalExtractor" ], + [ "SubstringExtractor", "classformatron_1_1extractor_1_1SubstringExtractor.html", "classformatron_1_1extractor_1_1SubstringExtractor" ] + ] ], + [ "formats", "namespaceformatron_1_1formats.html", [ + [ "json", "namespaceformatron_1_1formats_1_1json.html", [ + [ "JsonExtractor", "classformatron_1_1formats_1_1json_1_1JsonExtractor.html", "classformatron_1_1formats_1_1json_1_1JsonExtractor" ] + ] ], + [ "regex", "namespaceformatron_1_1formats_1_1regex.html", [ + [ "RegexExtractor", "classformatron_1_1formats_1_1regex_1_1RegexExtractor.html", "classformatron_1_1formats_1_1regex_1_1RegexExtractor" ] + ] ] + ] ], + [ "formatter", "namespaceformatron_1_1formatter.html", [ + [ "Formatter", "classformatron_1_1formatter_1_1Formatter.html", "classformatron_1_1formatter_1_1Formatter" ], + [ "FormatterBase", "classformatron_1_1formatter_1_1FormatterBase.html", "classformatron_1_1formatter_1_1FormatterBase" ], + [ "FormatterBuilder", "classformatron_1_1formatter_1_1FormatterBuilder.html", "classformatron_1_1formatter_1_1FormatterBuilder" ] + ] ], + [ "integrations", "namespaceformatron_1_1integrations.html", [ + [ "exllamav2", "namespaceformatron_1_1integrations_1_1exllamav2.html", [ + [ "FormatterFilter", "classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html", "classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter" ] + ] ], + [ "RWKV", "namespaceformatron_1_1integrations_1_1RWKV.html", [ + [ "PIPELINE", "classformatron_1_1integrations_1_1RWKV_1_1PIPELINE.html", "classformatron_1_1integrations_1_1RWKV_1_1PIPELINE" ], + [ "PIPELINE_ARGS", "classformatron_1_1integrations_1_1RWKV_1_1PIPELINE__ARGS.html", "classformatron_1_1integrations_1_1RWKV_1_1PIPELINE__ARGS" ] + ] ], + [ "transformers", "namespaceformatron_1_1integrations_1_1transformers.html", [ + [ "FormattersLogitsProcessor", "classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html", "classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor" ] + ] ], + [ "vllm", "namespaceformatron_1_1integrations_1_1vllm.html", [ + [ "FormattersLogitsProcessor", "classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html", "classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor" ] + ] ] + ] ], + [ "schemas", "namespaceformatron_1_1schemas.html", [ + [ "dict_inference", "namespaceformatron_1_1schemas_1_1dict__inference.html", [ + [ "FieldInfo", "classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo.html", "classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo" ] + ] ], + [ "json_schema", "namespaceformatron_1_1schemas_1_1json__schema.html", [ + [ "FieldInfo", "classformatron_1_1schemas_1_1json__schema_1_1FieldInfo.html", "classformatron_1_1schemas_1_1json__schema_1_1FieldInfo" ] + ] ], + [ "pydantic", "namespaceformatron_1_1schemas_1_1pydantic.html", [ + [ "ClassSchema", "classformatron_1_1schemas_1_1pydantic_1_1ClassSchema.html", "classformatron_1_1schemas_1_1pydantic_1_1ClassSchema" ], + [ "FieldInfo", "classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.html", "classformatron_1_1schemas_1_1pydantic_1_1FieldInfo" ] + ] ], + [ "schema", "namespaceformatron_1_1schemas_1_1schema.html", [ + [ "FieldInfo", "classformatron_1_1schemas_1_1schema_1_1FieldInfo.html", "classformatron_1_1schemas_1_1schema_1_1FieldInfo" ], + [ "Schema", "classformatron_1_1schemas_1_1schema_1_1Schema.html", "classformatron_1_1schemas_1_1schema_1_1Schema" ], + [ "TypeWithMetadata", "classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata.html", "classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata" ] + ] ] + ] ] + ] ] +]; \ No newline at end of file diff --git a/v0.4.6/bc_s.png b/v0.4.6/bc_s.png new file mode 100644 index 0000000000000000000000000000000000000000..224b29aa9847d5a4b3902efd602b7ddf7d33e6c2 GIT binary patch literal 676 zcmV;V0$crwP)y__>=_9%My z{n931IS})GlGUF8K#6VIbs%684A^L3@%PlP2>_sk`UWPq@f;rU*V%rPy_ekbhXT&s z(GN{DxFv}*vZp`F>S!r||M`I*nOwwKX+BC~3P5N3-)Y{65c;ywYiAh-1*hZcToLHK ztpl1xomJ+Yb}K(cfbJr2=GNOnT!UFA7Vy~fBz8?J>XHsbZoDad^8PxfSa0GDgENZS zuLCEqzb*xWX2CG*b&5IiO#NzrW*;`VC9455M`o1NBh+(k8~`XCEEoC1Ybwf;vr4K3 zg|EB<07?SOqHp9DhLpS&bzgo70I+ghB_#)K7H%AMU3v}xuyQq9&Bm~++VYhF09a+U zl7>n7Jjm$K#b*FONz~fj;I->Bf;ule1prFN9FovcDGBkpg>)O*-}eLnC{6oZHZ$o% zXKW$;0_{8hxHQ>l;_*HATI(`7t#^{$(zLe}h*mqwOc*nRY9=?Sx4OOeVIfI|0V(V2 zBrW#G7Ss9wvzr@>H*`r>zE z+e8bOBgqIgldUJlG(YUDviMB`9+DH8n-s9SXRLyJHO1!=wY^79WYZMTa(wiZ!zP66 zA~!21vmF3H2{ngD;+`6j#~6j;$*f*G_2ZD1E;9(yaw7d-QnSCpK(cR1zU3qU0000< KMNUMnLSTYoA~SLT literal 0 HcmV?d00001 diff --git a/v0.4.6/bc_sd.png b/v0.4.6/bc_sd.png new file mode 100644 index 0000000000000000000000000000000000000000..31ca888dc71049713b35c351933a8d0f36180bf1 GIT binary patch literal 635 zcmV->0)+jEP)Jwi0r1~gdSq#w{Bu1q z`craw(p2!hu$4C_$Oc3X(sI6e=9QSTwPt{G) z=htT&^~&c~L2~e{r5_5SYe7#Is-$ln>~Kd%$F#tC65?{LvQ}8O`A~RBB0N~`2M+waajO;5>3B&-viHGJeEK2TQOiPRa zfDKyqwMc4wfaEh4jt>H`nW_Zidwk@Bowp`}(VUaj-pSI(-1L>FJVsX}Yl9~JsqgsZ zUD9(rMwf23Gez6KPa|wwInZodP-2}9@fK0Ga_9{8SOjU&4l`pH4@qlQp83>>HT$xW zER^U>)MyV%t(Lu=`d=Y?{k1@}&r7ZGkFQ%z%N+sE9BtYjovzxyxCPxN6&@wLK{soQ zSmkj$aLI}miuE^p@~4}mg9OjDfGEkgY4~^XzLRUBB*O{+&vq<3v(E%+k_i%=`~j%{ Vj14gnt9}3g002ovPDHLkV1n!oC4m3{ literal 0 HcmV?d00001 diff --git a/v0.4.6/classes.html b/v0.4.6/classes.html new file mode 100644 index 00000000..32ba1f5c --- /dev/null +++ b/v0.4.6/classes.html @@ -0,0 +1,166 @@ + + + + + + + + +Formatron: Class Index + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ + + + + + diff --git a/v0.4.6/classformatron_1_1config_1_1EngineGenerationConfig-members.html b/v0.4.6/classformatron_1_1config_1_1EngineGenerationConfig-members.html new file mode 100644 index 00000000..8427d896 --- /dev/null +++ b/v0.4.6/classformatron_1_1config_1_1EngineGenerationConfig-members.html @@ -0,0 +1,138 @@ + + + + + + + + +Formatron: Member List + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
formatron.config.EngineGenerationConfig Member List
+
+
+ +

This is the complete list of members for formatron.config.EngineGenerationConfig, including all inherited members.

+ + + +
read_promptformatron.config.EngineGenerationConfigstatic
reset_at_beginningformatron.config.EngineGenerationConfigstatic
+
+ + + + diff --git a/v0.4.6/classformatron_1_1config_1_1EngineGenerationConfig.html b/v0.4.6/classformatron_1_1config_1_1EngineGenerationConfig.html new file mode 100644 index 00000000..d9a5dc8d --- /dev/null +++ b/v0.4.6/classformatron_1_1config_1_1EngineGenerationConfig.html @@ -0,0 +1,210 @@ + + + + + + + + +Formatron: formatron.config.EngineGenerationConfig Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
formatron.config.EngineGenerationConfig Class Reference
+
+
+ +

Configuration for how an KBNF engine should be used in text generation. + More...

+ + + + + + + + +

+Static Public Attributes

bool read_prompt = False
 Whether to accept the prompt tokens when a generation begins.
 
bool reset_at_beginning = True
 Whether to reset the engine when a new generation begins.
 
+

Detailed Description

+

Configuration for how an KBNF engine should be used in text generation.

+ +

Definition at line 14 of file config.py.

+

Member Data Documentation

+ +

◆ read_prompt

+ +
+
+ + + + + +
+ + + + +
bool formatron.config.EngineGenerationConfig.read_prompt = False
+
+static
+
+ +

Whether to accept the prompt tokens when a generation begins.

+ +

Definition at line 21 of file config.py.

+ +
+
+ +

◆ reset_at_beginning

+ +
+
+ + + + + +
+ + + + +
bool formatron.config.EngineGenerationConfig.reset_at_beginning = True
+
+static
+
+ +

Whether to reset the engine when a new generation begins.

+ +

Definition at line 22 of file config.py.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/v0.4.6/classformatron_1_1config_1_1EngineGenerationConfig.js b/v0.4.6/classformatron_1_1config_1_1EngineGenerationConfig.js new file mode 100644 index 00000000..c82682e7 --- /dev/null +++ b/v0.4.6/classformatron_1_1config_1_1EngineGenerationConfig.js @@ -0,0 +1,5 @@ +var classformatron_1_1config_1_1EngineGenerationConfig = +[ + [ "read_prompt", "classformatron_1_1config_1_1EngineGenerationConfig.html#af0b93e2a9f55937e342c649c1f177695", null ], + [ "reset_at_beginning", "classformatron_1_1config_1_1EngineGenerationConfig.html#a95ef45b001b9c45f86bd3699a5675ad4", null ] +]; \ No newline at end of file diff --git a/v0.4.6/classformatron_1_1extractor_1_1ChoiceExtractor-members.html b/v0.4.6/classformatron_1_1extractor_1_1ChoiceExtractor-members.html new file mode 100644 index 00000000..ddf86bf2 --- /dev/null +++ b/v0.4.6/classformatron_1_1extractor_1_1ChoiceExtractor-members.html @@ -0,0 +1,140 @@ + + + + + + + + +Formatron: Member List + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
formatron.extractor.ChoiceExtractor Member List
+
+
+ +

This is the complete list of members for formatron.extractor.ChoiceExtractor, including all inherited members.

+ + + + + +
__init__(self, typing.Iterable[Extractor] choices, str capture_name, str nonterminal)formatron.extractor.ChoiceExtractor
_choicesformatron.extractor.ChoiceExtractorprotected
extract(self, str input_str)formatron.extractor.ChoiceExtractor
kbnf_definition(self)formatron.extractor.ChoiceExtractor
+
+ + + + diff --git a/v0.4.6/classformatron_1_1extractor_1_1ChoiceExtractor.html b/v0.4.6/classformatron_1_1extractor_1_1ChoiceExtractor.html new file mode 100644 index 00000000..3654c9a3 --- /dev/null +++ b/v0.4.6/classformatron_1_1extractor_1_1ChoiceExtractor.html @@ -0,0 +1,323 @@ + + + + + + + + +Formatron: formatron.extractor.ChoiceExtractor Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
formatron.extractor.ChoiceExtractor Class Reference
+
+
+ +

An extractor that uses multiple extractors to extract data. + More...

+
+Inheritance diagram for formatron.extractor.ChoiceExtractor:
+
+
+ + +formatron.extractor.NonterminalExtractor +formatron.extractor.Extractor + +
+ + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 __init__ (self, typing.Iterable[Extractor] choices, str capture_name, str nonterminal)
 Initialize the choice extractor.
 
typing.Optional[tuple[str, typing.Any]] extract (self, str input_str)
 Extract data from the input string using the first succeeding extractor.
 
- Public Member Functions inherited from formatron.extractor.NonterminalExtractor
str nonterminal (self)
 Get the nonterminal of the extractor.
 
str kbnf_reference (self)
 
- Public Member Functions inherited from formatron.extractor.Extractor
 __str__ (self)
 
typing.Optional[str] capture_name (self)
 Get the name of the capture, or None if the extractor does not capture.
 
+ + + + + + + + + +

+Protected Attributes

 _choices
 
- Protected Attributes inherited from formatron.extractor.NonterminalExtractor
 _nonterminal
 
- Protected Attributes inherited from formatron.extractor.Extractor
 _capture_name
 
+ + + +

Properties

str kbnf_definition (self)
 
+

Detailed Description

+

An extractor that uses multiple extractors to extract data.

+

It stops at the first succeeding extractor.

+ +

Definition at line 194 of file extractor.py.

+

Constructor & Destructor Documentation

+ +

◆ __init__()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
formatron.extractor.ChoiceExtractor.__init__ ( self,
typing.Iterable[Extractor] choices,
str capture_name,
str nonterminal )
+
+ +

Initialize the choice extractor.

+
Parameters
+ + + + +
choicesThe extractors to choose from. The order determines the extractors' priority.
capture_nameThe name of the capture, or None if the extractor does not capture.
nonterminalThe nonterminal representing the extractor.
+
+
+ +

Reimplemented from formatron.extractor.NonterminalExtractor.

+ +

Definition at line 204 of file extractor.py.

+ +
+
+

Member Function Documentation

+ +

◆ extract()

+ +
+
+ + + + + + + + + + + +
typing.Optional[tuple[str, typing.Any]] formatron.extractor.ChoiceExtractor.extract ( self,
str input_str )
+
+ +

Extract data from the input string using the first succeeding extractor.

+
Parameters
+ + +
input_strThe input string.
+
+
+
Returns
The remaining string and the extracted data, or None if all extractors failed.
+ +

Reimplemented from formatron.extractor.Extractor.

+ +

Definition at line 216 of file extractor.py.

+ +
+
+ +

◆ kbnf_definition()

+ +
+
+ + + + + + + +
str formatron.extractor.ChoiceExtractor.kbnf_definition ( self)
+
+ +

Reimplemented from formatron.extractor.Extractor.

+ +

Definition at line 231 of file extractor.py.

+ +
+
+

Member Data Documentation

+ +

◆ _choices

+ +
+
+ + + + + +
+ + + + +
formatron.extractor.ChoiceExtractor._choices
+
+protected
+
+ +

Definition at line 206 of file extractor.py.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/v0.4.6/classformatron_1_1extractor_1_1ChoiceExtractor.js b/v0.4.6/classformatron_1_1extractor_1_1ChoiceExtractor.js new file mode 100644 index 00000000..d4cba727 --- /dev/null +++ b/v0.4.6/classformatron_1_1extractor_1_1ChoiceExtractor.js @@ -0,0 +1,7 @@ +var classformatron_1_1extractor_1_1ChoiceExtractor = +[ + [ "__init__", "classformatron_1_1extractor_1_1ChoiceExtractor.html#a1a91b31475c7348a3cf9fab97c6d26f0", null ], + [ "extract", "classformatron_1_1extractor_1_1ChoiceExtractor.html#acfd6ee4d6b1ea910dd6f89a4c0fca41f", null ], + [ "kbnf_definition", "classformatron_1_1extractor_1_1ChoiceExtractor.html#a5fe06cd727f3313d5e52a7ea6b81d5c4", null ], + [ "_choices", "classformatron_1_1extractor_1_1ChoiceExtractor.html#a6ea971d4c6915dc2b5ece64cd010a087", null ] +]; \ No newline at end of file diff --git a/v0.4.6/classformatron_1_1extractor_1_1ChoiceExtractor.png b/v0.4.6/classformatron_1_1extractor_1_1ChoiceExtractor.png new file mode 100644 index 0000000000000000000000000000000000000000..3c2b9a95d054264f5271c74332e9b8338daf5e9b GIT binary patch literal 1367 zcmb7EYfO_@82%8Lz*Hbc#3C_VWWgd}8(^)7NDl}jiEH!Qb8(N;2XNcTzNpCwzeH+e7Te&P#|-1mN|Wg{|Yi1OU4~@KFbo3T+l@j5N!x4bfpb^ua~zQ(=gE z>9wGDFxhT~r##B(W#-E|r4w}j{mpjK5pyVHkJxz})%x++0VPyQ9ENzt)&*>niX7AAuhpPa)O$0blE z>ZvGx0pZUJvX}4VATuRFHBxoGSe|YvfRU^_9?;l(Ql4`&*}q}M+cViiyhKc?i(nnF zTDBGF?J0sJ!+Cuc|B`L}Q{naZvU7ko4$}4_gR~83nS_8ePr?^~@c{}TKIhtWW5pYQ zp>tV4Tjf7mE;>sC)TpgQ9LO5`Y2 z%4#HLp>X`qs?<|`GL*8F;h&(tI(CyIcGT7wM~-B-d*I3FeCT_INCrX)bzQkPv3E8L zbVq)Qc=RaOm#J~)^0)Dm=iLV1z4Q_dOG_*P9EOjIGG4DZAx|`zMk$ib20vCp9I z#X;uu$bQ3Qv|^uOvWGQr%~!Gv()t2tC-%&fm}@}qeUb+zO&Qa6tr?>^gwfHq+Y^jA zy?NsN<;$JbuXp!z@dI|^*z54%*V`+RHyRjIN#vVZJSX722N?+7YVq$PYcc)8m8@{S zr4*`_+H^F;X$Tex`Irq62fB>3Ttz0C?(Wm|wZVG1BEa4M0d6wqsrE~^VeryaTbGHovw z|3B5P-9}NlOXRID?Ody2-d$ad5AKzhGvdJ~ONYY81gsHNsS%{=yii$VJ2sR^iiQ^! zAc}rir|AycYj%d1&$X{ql~Y7YmS~I}j8&93p_&x*`8xC4OG*Rioc*D&(DfTb7)T$&Su4|( zA+zjaYk;$JkhhGqg5$P#$VV`(CiKsJZMxfeM9m_$@qWQCo{cx8TKgRca#TaTB)~hv tjo{`gtwdIo!*4x0ss$~iIe5kPl$`7=k8vSy(!yULfRB!k5=W+8`WvVKtDgV> literal 0 HcmV?d00001 diff --git a/v0.4.6/classformatron_1_1extractor_1_1Extractor-members.html b/v0.4.6/classformatron_1_1extractor_1_1Extractor-members.html new file mode 100644 index 00000000..fcf13948 --- /dev/null +++ b/v0.4.6/classformatron_1_1extractor_1_1Extractor-members.html @@ -0,0 +1,143 @@ + + + + + + + + +Formatron: Member List + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
formatron.extractor.Extractor Member List
+
+ +
+ + + + diff --git a/v0.4.6/classformatron_1_1extractor_1_1Extractor.html b/v0.4.6/classformatron_1_1extractor_1_1Extractor.html new file mode 100644 index 00000000..3da627d1 --- /dev/null +++ b/v0.4.6/classformatron_1_1extractor_1_1Extractor.html @@ -0,0 +1,364 @@ + + + + + + + + +Formatron: formatron.extractor.Extractor Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
formatron.extractor.Extractor Class Reference
+
+
+ +

An abstract extractor that extracts data from a string and offers its KBNF rules definition. + More...

+
+Inheritance diagram for formatron.extractor.Extractor:
+
+
+ + +formatron.extractor.LiteralExtractor +formatron.extractor.NonterminalExtractor +formatron.extractor.ChoiceExtractor +formatron.extractor.SubstringExtractor +formatron.formats.json.JsonExtractor +formatron.formats.regex.RegexExtractor + +
+ + + + + + + + + + + + + + +

+Public Member Functions

 __init__ (self, typing.Optional[str] capture_name=None)
 Initialize an extractor.
 
typing.Optional[tuple[str, typing.Any]] extract (self, str input_str)
 Extract data from the input string, or None if the extraction failed.
 
str kbnf_reference (self)
 
 __str__ (self)
 
str kbnf_definition (self)
 
+ + + +

+Protected Attributes

 _capture_name
 
+ + + + +

Properties

typing.Optional[str] capture_name (self)
 Get the name of the capture, or None if the extractor does not capture.
 
+

Detailed Description

+

An abstract extractor that extracts data from a string and offers its KBNF rules definition.

+ +

Definition at line 14 of file extractor.py.

+

Constructor & Destructor Documentation

+ +

◆ __init__()

+ +
+
+ + + + + + + + + + + +
formatron.extractor.Extractor.__init__ ( self,
typing.Optional[str] capture_name = None )
+
+ +

Initialize an extractor.

+
Parameters
+ + +
capture_nameThe name of the capture, or None if the extractor does not capture.
+
+
+ +

Reimplemented in formatron.extractor.ChoiceExtractor, formatron.extractor.LiteralExtractor, formatron.extractor.NonterminalExtractor, formatron.extractor.SubstringExtractor, formatron.formats.json.JsonExtractor, and formatron.formats.regex.RegexExtractor.

+ +

Definition at line 21 of file extractor.py.

+ +
+
+

Member Function Documentation

+ +

◆ __str__()

+ +
+
+ + + + + + + +
formatron.extractor.Extractor.__str__ ( self)
+
+ +

Definition at line 69 of file extractor.py.

+ +
+
+ +

◆ capture_name()

+ +
+
+ + + + + + + +
typing.Optional[str] formatron.extractor.Extractor.capture_name ( self)
+
+ +

Get the name of the capture, or None if the extractor does not capture.

+ +

Definition at line 35 of file extractor.py.

+ +
+
+ +

◆ extract()

+ +
+
+ + + + + + + + + + + +
typing.Optional[tuple[str, typing.Any]] formatron.extractor.Extractor.extract ( self,
str input_str )
+
+ +

Extract data from the input string, or None if the extraction failed.

+
Parameters
+ + +
input_strThe input string.
+
+
+
Returns
The remaining string and the extracted data, or None if the extraction failed.
+ +

Reimplemented in formatron.extractor.ChoiceExtractor, formatron.extractor.LiteralExtractor, formatron.extractor.SubstringExtractor, formatron.formats.json.JsonExtractor, and formatron.formats.regex.RegexExtractor.

+ +

Definition at line 48 of file extractor.py.

+ +
+
+ +

◆ kbnf_definition()

+ +
+
+ + + + + + + +
str formatron.extractor.Extractor.kbnf_definition ( self)
+
+
+ +

◆ kbnf_reference()

+ +
+
+ + + + + + + +
str formatron.extractor.Extractor.kbnf_reference ( self)
+
+ +

Reimplemented in formatron.extractor.LiteralExtractor, and formatron.extractor.NonterminalExtractor.

+ +

Definition at line 67 of file extractor.py.

+ +
+
+

Member Data Documentation

+ +

◆ _capture_name

+ +
+
+ + + + + +
+ + + + +
formatron.extractor.Extractor._capture_name
+
+protected
+
+ +

Definition at line 22 of file extractor.py.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/v0.4.6/classformatron_1_1extractor_1_1Extractor.js b/v0.4.6/classformatron_1_1extractor_1_1Extractor.js new file mode 100644 index 00000000..4cd6703f --- /dev/null +++ b/v0.4.6/classformatron_1_1extractor_1_1Extractor.js @@ -0,0 +1,10 @@ +var classformatron_1_1extractor_1_1Extractor = +[ + [ "__init__", "classformatron_1_1extractor_1_1Extractor.html#a569fc7895a82f4d4b59866719219d4e0", null ], + [ "__str__", "classformatron_1_1extractor_1_1Extractor.html#afe6a1f745fd56540ccff5fdc5d00f0a5", null ], + [ "capture_name", "classformatron_1_1extractor_1_1Extractor.html#abb72e0428a8b5835d075ebd889703e13", null ], + [ "extract", "classformatron_1_1extractor_1_1Extractor.html#a9efb2a75cf5fc5e0919c235aa1435469", null ], + [ "kbnf_definition", "classformatron_1_1extractor_1_1Extractor.html#ae9abcfb6c5bae5b352de8a97f94be049", null ], + [ "kbnf_reference", "classformatron_1_1extractor_1_1Extractor.html#abf347fc566ceca08b0845a5146347a5e", null ], + [ "_capture_name", "classformatron_1_1extractor_1_1Extractor.html#a3299dc34a7276ab8ab553513048211d3", null ] +]; \ No newline at end of file diff --git a/v0.4.6/classformatron_1_1extractor_1_1Extractor.png b/v0.4.6/classformatron_1_1extractor_1_1Extractor.png new file mode 100644 index 0000000000000000000000000000000000000000..b040c88be7f866b3882538d173fd692fb8cbfdb3 GIT binary patch literal 3105 zcmcIm2~?9;7Dm+8Q4z)}P_}4As1{jNh{zHKMpx^z+f{O}9`|iY z)}`!;moHy}bI-0%?t*uJ_$)j$!UXJ>K2TF)pNYwu`$79ZJd(Lg!kXn6Mc(DZT8%f8D^+R^Y!z8_7i~l_yvzLzjZHjo^sS@u zXdESP48ZSKUwPGo!)}xb)IWZno9pUgUnBI=x$#-=ll|uw_Il*y=C0HRHn^%B@LX?^ z0T(zY02)>TQwKOX3hPC2Kcb}$)wBkewXJ*$0wtV2EnFjNZhlzEF~#lHQt6} z3f!E4I-Cons^~9xy+b%g3oTSJ$q~Kdv<0I>4>2_gjZSYK#NK=hlJC7@#qMoJcqf2m z(R~+4nBKVhTc3Z4%aibQ3m|pFD0S?6-c~W#+*;Z!6wi-=LvD%jYQ_4L--PSm#Q9rn z{|~~!zj$Ef)#AR^?_c=7ki>>6kNanmRcCg^LdmeO4BJa58{CW`^|iSs5P3dr8aR?0{l}o9NO_$Yi zGO-Tg60wX$qns+TW$(5{_#o`0ePQYUz-ihb3wrLs=gf(K{6Vuj1L0<(cD#d*1HryoAG**S0V zpuxrKXh5KYsby)~Tk+4H1w486=;sq=?`Ew!8f9sFfAbdeWd)tci=L;(HlIlT^!$TM zU;D0bas98A+;-zh(&=CE)9L)0W%>(X9eqH##r)>bCvf?gw6%#!b4BZ z?Ap7gt5rLAP%Rs7@u;QV$iyza$FR*21FYJat~sT98rj(#UnrQ#b1F?#w$!&&ovlk2 zcQ!lIRiy>n4z$z z55j>6LY)n-(f5WHxvE!=qCqQ4bPd-xMNGY6hfjtY_{EHKJDc0s5mCpQpzi?Zg~bE} zN1C~sl306vW>G8A(@_4=p@4A$BPO{}CH;CK?R@MdY=ozOjYwQyc8Gn_K8&SxZ^^I} z%&c!%$aWM_j)!EEQZ>UjtInlp@kqw-A+ln!icqw4=^jV+D#TIrpfDDNtLKW81RvYh z3c9L4AcW(eYBbA0B)IK)0Y&=TD>OX)8ge3K!1unuk(=IcHG%8E0pp*~i0hbSxz+A*G50ns-}|#I^#SsKBguWK`<9Q?Zor zRg0<=NpL5=+O*d5$U)Y z96lHWxj00CWDK-eu|$hGm_j^Yra#AC`LZX2J<83hwehsgU<~KXpQrdlD-_9t5%kzZ z1iV5x5RRyxLY*$<9wdAE;Z^Tpl2^^PY2|9jwD-1*os}igGwtI_3htgluw6CvsoR>I zs}fl!uM5EO=&G%;c}2d1$!ch}Pc$wsV^>%EU|_Fzp=wMWH5j3ZMH>NT(Rw1B91|i{ zjyqMz63w5|=&Iv#!L;{T-l`66numAK(k zebe!VDn3S3%nI6r$@k0BP;Kms+O$?w#+18iI}v73Sok`~2B(;O+5DzK&lvL#EihTn zBe+G*OD65`V#qX|KO^_Z^b+N98Y6Tw7o)P9ZDbwxq-HGqa-kKH5z-$ij%9uzVpI#P zFIb`U2|9RvnVOsGJG5&}_WTAKLpM^U79;f)Tge;*HUazYb&b(TXB4jaz1S+UrC)-g z9jzbloF3&x_D^K`i-JGV$rXbM;!;g~!0Tgd2-QF*MPBrbRL)pv5Ai`0iVY@B?!k^# z^(R#fO`{&{XG19m8I3!zSyxmW@$ofe1{NM&_ytmr>94p0V-`Z;LX_w&5WH*;@~4lW z(mHmZA)8HkT3*JIeN$HSr1T7^8VLc9d9KBFfP#)@&JM=# z>4m9bc^yB32D*8Jtqf7EKDxk+Cu4t-wnzA?zZUXGtS=;@^v87O^78w_9O0fEm9CPx z5#%O|t0r{!eA77m8eKQYI^hqf(Dj(!S4Gv=sHD|Y>f5?6xB}NZ)Tx#DxDklm1+r}= z=tfh9mrdJ_z?-*wAh08lau%d)wpDAO5fivMhX(10MPK9hm_EI5l#O zn^W!A8x8Nz?;{Za?KTDb)knhRj$i;y1)d87B73iVOX324&i_#c*eZD*_ZYN~A3msT e=5P(mdlI4&5C6P73H+Hi2|5tEzvfRTF8mcd@J7M_ literal 0 HcmV?d00001 diff --git a/v0.4.6/classformatron_1_1extractor_1_1LiteralExtractor-members.html b/v0.4.6/classformatron_1_1extractor_1_1LiteralExtractor-members.html new file mode 100644 index 00000000..ab761c01 --- /dev/null +++ b/v0.4.6/classformatron_1_1extractor_1_1LiteralExtractor-members.html @@ -0,0 +1,141 @@ + + + + + + + + +Formatron: Member List + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
formatron.extractor.LiteralExtractor Member List
+
+ +
+ + + + diff --git a/v0.4.6/classformatron_1_1extractor_1_1LiteralExtractor.html b/v0.4.6/classformatron_1_1extractor_1_1LiteralExtractor.html new file mode 100644 index 00000000..170a9aa4 --- /dev/null +++ b/v0.4.6/classformatron_1_1extractor_1_1LiteralExtractor.html @@ -0,0 +1,317 @@ + + + + + + + + +Formatron: formatron.extractor.LiteralExtractor Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
formatron.extractor.LiteralExtractor Class Reference
+
+
+ +

An extractor that extracts a literal string. + More...

+
+Inheritance diagram for formatron.extractor.LiteralExtractor:
+
+
+ + +formatron.extractor.Extractor + +
+ + + + + + + + + + + + + + +

+Public Member Functions

 __init__ (self, str literal)
 Initialize the literal extractor.
 
typing.Optional[tuple[str, str]] extract (self, str input_str)
 Extract the literal from the input string, or None if the literal is not found.
 
- Public Member Functions inherited from formatron.extractor.Extractor
 __str__ (self)
 
typing.Optional[str] capture_name (self)
 Get the name of the capture, or None if the extractor does not capture.
 
+ + + + + + +

+Protected Attributes

 _literal
 
- Protected Attributes inherited from formatron.extractor.Extractor
 _capture_name
 
+ + + + + +

Properties

str kbnf_reference (self)
 
str kbnf_definition (self)
 
+

Detailed Description

+

An extractor that extracts a literal string.

+ +

Definition at line 143 of file extractor.py.

+

Constructor & Destructor Documentation

+ +

◆ __init__()

+ +
+
+ + + + + + + + + + + +
formatron.extractor.LiteralExtractor.__init__ ( self,
str literal )
+
+ +

Initialize the literal extractor.

+

It never captures since capturing a literal is redundant.

+
Parameters
+ + +
literalThe literal string to extract.
+
+
+ +

Reimplemented from formatron.extractor.Extractor.

+ +

Definition at line 151 of file extractor.py.

+ +
+
+

Member Function Documentation

+ +

◆ extract()

+ +
+
+ + + + + + + + + + + +
typing.Optional[tuple[str, str]] formatron.extractor.LiteralExtractor.extract ( self,
str input_str )
+
+ +

Extract the literal from the input string, or None if the literal is not found.

+ +

Reimplemented from formatron.extractor.Extractor.

+ +

Definition at line 158 of file extractor.py.

+ +
+
+ +

◆ kbnf_definition()

+ +
+
+ + + + + + + +
str formatron.extractor.LiteralExtractor.kbnf_definition ( self)
+
+ +

Reimplemented from formatron.extractor.Extractor.

+ +

Definition at line 185 of file extractor.py.

+ +
+
+ +

◆ kbnf_reference()

+ +
+
+ + + + + + + +
str formatron.extractor.LiteralExtractor.kbnf_reference ( self)
+
+ +

Reimplemented from formatron.extractor.Extractor.

+ +

Definition at line 172 of file extractor.py.

+ +
+
+

Member Data Documentation

+ +

◆ _literal

+ +
+
+ + + + + +
+ + + + +
formatron.extractor.LiteralExtractor._literal
+
+protected
+
+ +

Definition at line 153 of file extractor.py.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/v0.4.6/classformatron_1_1extractor_1_1LiteralExtractor.js b/v0.4.6/classformatron_1_1extractor_1_1LiteralExtractor.js new file mode 100644 index 00000000..54b36a81 --- /dev/null +++ b/v0.4.6/classformatron_1_1extractor_1_1LiteralExtractor.js @@ -0,0 +1,8 @@ +var classformatron_1_1extractor_1_1LiteralExtractor = +[ + [ "__init__", "classformatron_1_1extractor_1_1LiteralExtractor.html#ab4da390ad7efaf5a3aab0e0ccb78fab3", null ], + [ "extract", "classformatron_1_1extractor_1_1LiteralExtractor.html#af80f5dc8710b59ced091d9b12afd828c", null ], + [ "kbnf_definition", "classformatron_1_1extractor_1_1LiteralExtractor.html#ada2b4df1008ae73880c5e1d35fca5939", null ], + [ "kbnf_reference", "classformatron_1_1extractor_1_1LiteralExtractor.html#acfc1bf5ad7fc06acef35ad8897ddf273", null ], + [ "_literal", "classformatron_1_1extractor_1_1LiteralExtractor.html#a333e99fa481e15e9d907d35cda8ee728", null ] +]; \ No newline at end of file diff --git a/v0.4.6/classformatron_1_1extractor_1_1LiteralExtractor.png b/v0.4.6/classformatron_1_1extractor_1_1LiteralExtractor.png new file mode 100644 index 0000000000000000000000000000000000000000..5d5bcb2ad83c3529c39187aaea31d027527a3fc9 GIT binary patch literal 961 zcmeAS@N?(olHy`uVBq!ia0vp^mw>o~gBeIJ4RU=5q@)9ULR|m<{|{uoc=NTi|Il&^ z1I+@7>1SR%c<=xyZhAIs2~du+B*-tA0mugfbEer>7#Ns+JY5_^Dj46+eLd-umVm3c zb*S0<|3{ANKVjOrVq=M)_tzIiJSDD){Cp?f}thVMxYcDsH5Pppyg z?|OulPAAWtv98rxIwdHa;SaBQ!@d{(FUww^TWP;^cVNDstd{Fh<`4cFj1}rr81@Kz zG2G)+Wq98r)KKokdBA!h%Y(TAOdtGEq#Mj7+Y(=Jvw6Pi449+>^p{HI^Tr^rNhPNq z-&0RyUz_=7_Z&4(-REBCFWIkC$*iq+Ub*JRmb}cWsfNdoeKOoO^+ZZkuS7*lDT7LTGB0dX_)xW2mt76w%<{5Ol+v{w{*;q64T%*?$ zw6f>lxADGyNoD0z*`+@t=4i>D%ROrqn04yX>C8!2KDAvs_ON35H}J__Q02QU03Gnlb5cyt^K-DFSfW=^8AgZCZ4xGK3E<$ zscs_7W9m~>P67ju_pm_;>w)_P%rCnCP08E-ZqBdZUD98lU0E0uV#DwsZ)l+hX2s+w zL9e)j&RKqU(Rey%bGeh|^ErDrYb`yVr$0-+U3QC~@AvxUnoH|quFDYIzvp=cl{&-vuXXAZ@o_Js$06gCj0QKC#7%FrkBnA%)6?0k6F=PZ|>wfKjNgO zfBP9=vRx;fJ+buurJdFlXM1N~^F8COEU%U8zE=45>9bB(-ah~N+-vQTKRU58KX+c* z^L)8iyLsH^xWHNM8Ahuo*JeIh?j_y+IMyoWefI7xGmm^cSe^OgyoPUo+RyF$yNf>b z`TgBGakkRFD}84V&gO~{y&N`q>3ZJi)8VnxSIN)adg;pCr*)?{mt;P9w%qLboZSjj wiq74%UO1)r+&#{vbBe$D&G!Ok4$=RNEnl_x^|)s!0W%wer>mdKI;Vst00Pq3*8l(j literal 0 HcmV?d00001 diff --git a/v0.4.6/classformatron_1_1extractor_1_1NonterminalExtractor-members.html b/v0.4.6/classformatron_1_1extractor_1_1NonterminalExtractor-members.html new file mode 100644 index 00000000..5930adda --- /dev/null +++ b/v0.4.6/classformatron_1_1extractor_1_1NonterminalExtractor-members.html @@ -0,0 +1,140 @@ + + + + + + + + +Formatron: Member List + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
formatron.extractor.NonterminalExtractor Member List
+
+
+ +

This is the complete list of members for formatron.extractor.NonterminalExtractor, including all inherited members.

+ + + + + +
__init__(self, str nonterminal, typing.Optional[str] capture_name=None)formatron.extractor.NonterminalExtractor
_nonterminalformatron.extractor.NonterminalExtractorprotected
kbnf_reference(self)formatron.extractor.NonterminalExtractor
nonterminal(self)formatron.extractor.NonterminalExtractor
+
+ + + + diff --git a/v0.4.6/classformatron_1_1extractor_1_1NonterminalExtractor.html b/v0.4.6/classformatron_1_1extractor_1_1NonterminalExtractor.html new file mode 100644 index 00000000..3a95b534 --- /dev/null +++ b/v0.4.6/classformatron_1_1extractor_1_1NonterminalExtractor.html @@ -0,0 +1,297 @@ + + + + + + + + +Formatron: formatron.extractor.NonterminalExtractor Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
formatron.extractor.NonterminalExtractor Class Reference
+
+
+ +

An extractor that extracts data corresponding to a nonterminal. + More...

+
+Inheritance diagram for formatron.extractor.NonterminalExtractor:
+
+
+ + +formatron.extractor.Extractor +formatron.extractor.ChoiceExtractor +formatron.extractor.SubstringExtractor +formatron.formats.json.JsonExtractor +formatron.formats.regex.RegexExtractor + +
+ + + + + + + + + + + + + + + + +

+Public Member Functions

 __init__ (self, str nonterminal, typing.Optional[str] capture_name=None)
 Initialize the nonterminal extractor.
 
- Public Member Functions inherited from formatron.extractor.Extractor
typing.Optional[tuple[str, typing.Any]] extract (self, str input_str)
 Extract data from the input string, or None if the extraction failed.
 
 __str__ (self)
 
str kbnf_definition (self)
 
typing.Optional[str] capture_name (self)
 Get the name of the capture, or None if the extractor does not capture.
 
+ + + + + + +

+Protected Attributes

 _nonterminal
 
- Protected Attributes inherited from formatron.extractor.Extractor
 _capture_name
 
+ + + + + + +

Properties

str nonterminal (self)
 Get the nonterminal of the extractor.
 
str kbnf_reference (self)
 
+

Detailed Description

+

An extractor that extracts data corresponding to a nonterminal.

+ +

Definition at line 98 of file extractor.py.

+

Constructor & Destructor Documentation

+ +

◆ __init__()

+ +
+
+ + + + + + + + + + + + + + + + +
formatron.extractor.NonterminalExtractor.__init__ ( self,
str nonterminal,
typing.Optional[str] capture_name = None )
+
+ +

Initialize the nonterminal extractor.

+ +

Reimplemented from formatron.extractor.Extractor.

+ +

Reimplemented in formatron.extractor.ChoiceExtractor, formatron.extractor.SubstringExtractor, formatron.formats.json.JsonExtractor, and formatron.formats.regex.RegexExtractor.

+ +

Definition at line 103 of file extractor.py.

+ +
+
+

Member Function Documentation

+ +

◆ kbnf_reference()

+ +
+
+ + + + + + + +
str formatron.extractor.NonterminalExtractor.kbnf_reference ( self)
+
+ +

Reimplemented from formatron.extractor.Extractor.

+ +

Definition at line 134 of file extractor.py.

+ +
+
+ +

◆ nonterminal()

+ +
+
+ + + + + + + +
str formatron.extractor.NonterminalExtractor.nonterminal ( self)
+
+ +

Get the nonterminal of the extractor.

+ +

Definition at line 121 of file extractor.py.

+ +
+
+

Member Data Documentation

+ +

◆ _nonterminal

+ +
+
+ + + + + +
+ + + + +
formatron.extractor.NonterminalExtractor._nonterminal
+
+protected
+
+ +

Definition at line 106 of file extractor.py.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/v0.4.6/classformatron_1_1extractor_1_1NonterminalExtractor.js b/v0.4.6/classformatron_1_1extractor_1_1NonterminalExtractor.js new file mode 100644 index 00000000..0d8f3ae0 --- /dev/null +++ b/v0.4.6/classformatron_1_1extractor_1_1NonterminalExtractor.js @@ -0,0 +1,7 @@ +var classformatron_1_1extractor_1_1NonterminalExtractor = +[ + [ "__init__", "classformatron_1_1extractor_1_1NonterminalExtractor.html#a45c14f79c14b539837ebdd26c3b5567b", null ], + [ "kbnf_reference", "classformatron_1_1extractor_1_1NonterminalExtractor.html#a8c8a8f47ad90f6b9e4206ab6a56f302e", null ], + [ "nonterminal", "classformatron_1_1extractor_1_1NonterminalExtractor.html#a1dd1fabcef2e668d00bf6ebb38dd017f", null ], + [ "_nonterminal", "classformatron_1_1extractor_1_1NonterminalExtractor.html#a5c4c968b45e328b8caa4b2795ecc00fe", null ] +]; \ No newline at end of file diff --git a/v0.4.6/classformatron_1_1extractor_1_1NonterminalExtractor.png b/v0.4.6/classformatron_1_1extractor_1_1NonterminalExtractor.png new file mode 100644 index 0000000000000000000000000000000000000000..60397d378479bc9a7033980f6530f8034cbb91c3 GIT binary patch literal 2831 zcmc&$3s4hx8VALb69n74D<~pbRF0tn1{Hyj)FMaGmUz;IL5L~x(pp1#Lm-LP5!4Pu z3=cz;NUe>RP~aK?DUY;7h)N&`$6*K|P-K%3-bn~~?rmbP)4SqY`#Xl=cJ93Ez)R(b)Vpb6Z=-Jp z+1VZNhN-uyKOs>Sy6+Qvukf_OWeKd>0U$~)l8lKU?~!^e!*A9;!?e2Qu{Cmo8rP?FeZwCF$E2h|fwqcT9L?+1uw|#yrlMEhIcl0;OoGF_7L5 zmcrrG)AJdnulc2*`a>|V)*5!P?EH`xIkP;U7zanZDAoK)z%Qd<7Ow~}>4#vW3sxgj z9PxKu26vwcD6rpXkol`k6!oiYV(I;`iyiCy+@;@#f~T{ z;bl!8$xB6{;`)>f1=b09 zFkgGX9U7;PLpbcTo;gsPcu)Z0zfO=7dbx-;jt?G z-iOzaW|sfR^rVgY&vEF$YV(p(yL7{yFSz~J{t_bBBf>-K-b;kqJTf6z84bf?kWv`X z$ol9V3$S-v8hz3NxV_e%|2#SLQS&Ly1{ft1DVuF=ZNGw1wq@{hP4FFfb}n1${7}wb z$%aukZMQEvamt4=8Qb=6%_lTT$;tNi^6rzMY|r~iG^k*8#ve-}8sg}q z9HiSp^vku13AD%~1Yu{FJ;fLBtMJKPuHtiSHjRQ&_X(U0?KgE9!V+vK!RiJ>W8`!i z4{(=%PeQ6hSLd5TI~$ye|epLy@(bg7wt7k&rWU05 zR|sQ8FIO9+}0|Tb_Q& z3p4{fVWvx5x`D-Fc@6hrff1^pbF@vC84KjRnS}uX!2QWrwQaG0W;YFHdHw_I~MeZ$>-DCj=Ln66)Jsb)mEB=R01Qh}DK+PHhzU@#8594z-~*T_cl0PpZ(jdwtkA zuKKeqNKnCMkq~qoFmhie{4Ntj6MLoHDJ_J|b};6Gj9N|NkaP3WnD--^PNjnG2jm5) zSizkn9~C+2+3~zEV5AK;I|CZLlxscv=g3;dbm7#R5HB)sMe547j=D1dYT|Gy#!yRa z;nhY7R~28DWKb5mSbH1Kx9S=F1T<%O+>2l1hbF#;D%gZiF&mAG;><%5QTUzEo`!mo zX~<7tijGDZ>X~kZL#xa4nnWSvvJ#_;PMh9EQ5`l0>as|NQu01WdILRS;2g-&9H;N- zMSpEz)pX!d{pcVikFGQO<|5+EE8c6%=gdRK^b0|5NNx)?4vRDC?{ilVK;KpfQA!a` z#nhEr+=n1=YshM)Zz|dyA)3uJaG1L8h}tTD(zVb>7QYL9#`PSO_`_A8rNcNA{RtTq z_CxwArgJ8WuZsSKY%Q&_sb)ra&@`nh2J8pbyyX2u8%`) zKCsvmz2u`J9ac&2taKNvC`Gw}30qf+zFU!c#D67qr~9(Trur={nh~&BH94x7MwUKrA2}U9auv8+ zhCb>87NHxREm=fv;O2dKvj7-@zFV$40ch%z&9YI`fO5^JI)ny6wIFXvp8{1B*?oXsNKgk!=xz)x8#l{$EMb5b(f;9+L@ f&gaE_#^wk_`TJwTTRmI@<8ghoAlpg}So6 literal 0 HcmV?d00001 diff --git a/v0.4.6/classformatron_1_1extractor_1_1SubstringExtractor-members.html b/v0.4.6/classformatron_1_1extractor_1_1SubstringExtractor-members.html new file mode 100644 index 00000000..7500de40 --- /dev/null +++ b/v0.4.6/classformatron_1_1extractor_1_1SubstringExtractor-members.html @@ -0,0 +1,142 @@ + + + + + + + + +Formatron: Member List + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
formatron.extractor.SubstringExtractor Member List
+
+
+ +

This is the complete list of members for formatron.extractor.SubstringExtractor, including all inherited members.

+ + + + + + + +
__init__(self, str string, str capture_name, str nonterminal, *, bool extract_empty_substring=False)formatron.extractor.SubstringExtractor
_stringformatron.extractor.SubstringExtractorprotected
_suffix_automatonformatron.extractor.SubstringExtractorprotected
extract(self, str input_str)formatron.extractor.SubstringExtractor
extract_empty_substringformatron.extractor.SubstringExtractor
kbnf_definition(self)formatron.extractor.SubstringExtractor
+
+ + + + diff --git a/v0.4.6/classformatron_1_1extractor_1_1SubstringExtractor.html b/v0.4.6/classformatron_1_1extractor_1_1SubstringExtractor.html new file mode 100644 index 00000000..6cbcce47 --- /dev/null +++ b/v0.4.6/classformatron_1_1extractor_1_1SubstringExtractor.html @@ -0,0 +1,374 @@ + + + + + + + + +Formatron: formatron.extractor.SubstringExtractor Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
formatron.extractor.SubstringExtractor Class Reference
+
+
+ +

An extractor that extracts a substring of a given string from the input string. + More...

+
+Inheritance diagram for formatron.extractor.SubstringExtractor:
+
+
+ + +formatron.extractor.NonterminalExtractor +formatron.extractor.Extractor + +
+ + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 __init__ (self, str string, str capture_name, str nonterminal, *, bool extract_empty_substring=False)
 Initialize the substring extractor.
 
typing.Optional[tuple[str, str]] extract (self, str input_str)
 Extract the longest substring of a given string from the input string.
 
- Public Member Functions inherited from formatron.extractor.NonterminalExtractor
str nonterminal (self)
 Get the nonterminal of the extractor.
 
str kbnf_reference (self)
 
- Public Member Functions inherited from formatron.extractor.Extractor
 __str__ (self)
 
typing.Optional[str] capture_name (self)
 Get the name of the capture, or None if the extractor does not capture.
 
+ + + +

+Public Attributes

 extract_empty_substring
 
+ + + + + + + + + + + +

+Protected Attributes

 _suffix_automaton
 
 _string
 
- Protected Attributes inherited from formatron.extractor.NonterminalExtractor
 _nonterminal
 
- Protected Attributes inherited from formatron.extractor.Extractor
 _capture_name
 
+ + + +

Properties

str kbnf_definition (self)
 
+

Detailed Description

+

An extractor that extracts a substring of a given string from the input string.

+ +

Definition at line 240 of file extractor.py.

+

Constructor & Destructor Documentation

+ +

◆ __init__()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
formatron.extractor.SubstringExtractor.__init__ ( self,
str string,
str capture_name,
str nonterminal,
* ,
bool extract_empty_substring = False )
+
+ +

Initialize the substring extractor.

+
Parameters
+ + + + +
stringThe string to extract.
capture_nameThe name of the capture, or None if the extractor does not capture.
extract_empty_substringWhether to extract empty substring as a valid substring.
+
+
+ +

Reimplemented from formatron.extractor.NonterminalExtractor.

+ +

Definition at line 249 of file extractor.py.

+ +
+
+

Member Function Documentation

+ +

◆ extract()

+ +
+
+ + + + + + + + + + + +
typing.Optional[tuple[str, str]] formatron.extractor.SubstringExtractor.extract ( self,
str input_str )
+
+ +

Extract the longest substring of a given string from the input string.

+

If extract_empty_substring is True, empty string is always a valid substring, so the returned string could be empty and None will never be returned. Otherwise, empty string is not a valid substring, so the returned string could not be empty and None will be returned if the input string does not contain the given string.

+ +

Reimplemented from formatron.extractor.Extractor.

+ +

Definition at line 261 of file extractor.py.

+ +
+
+ +

◆ kbnf_definition()

+ +
+
+ + + + + + + +
str formatron.extractor.SubstringExtractor.kbnf_definition ( self)
+
+ +

Reimplemented from formatron.extractor.Extractor.

+ +

Definition at line 284 of file extractor.py.

+ +
+
+

Member Data Documentation

+ +

◆ _string

+ +
+
+ + + + + +
+ + + + +
formatron.extractor.SubstringExtractor._string
+
+protected
+
+ +

Definition at line 252 of file extractor.py.

+ +
+
+ +

◆ _suffix_automaton

+ +
+
+ + + + + +
+ + + + +
formatron.extractor.SubstringExtractor._suffix_automaton
+
+protected
+
+ +

Definition at line 251 of file extractor.py.

+ +
+
+ +

◆ extract_empty_substring

+ +
+
+ + + + +
formatron.extractor.SubstringExtractor.extract_empty_substring
+
+ +

Definition at line 253 of file extractor.py.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/v0.4.6/classformatron_1_1extractor_1_1SubstringExtractor.js b/v0.4.6/classformatron_1_1extractor_1_1SubstringExtractor.js new file mode 100644 index 00000000..a03e0a41 --- /dev/null +++ b/v0.4.6/classformatron_1_1extractor_1_1SubstringExtractor.js @@ -0,0 +1,9 @@ +var classformatron_1_1extractor_1_1SubstringExtractor = +[ + [ "__init__", "classformatron_1_1extractor_1_1SubstringExtractor.html#a843997315c77b9c7c6eb84ba7e02ff83", null ], + [ "extract", "classformatron_1_1extractor_1_1SubstringExtractor.html#a1263c299229be0cd9d310e8d97401cd9", null ], + [ "kbnf_definition", "classformatron_1_1extractor_1_1SubstringExtractor.html#a13801ce1a7da7bf804317ea15f6e172e", null ], + [ "_string", "classformatron_1_1extractor_1_1SubstringExtractor.html#a3781b75c6c8c12f89fd70ea405e11293", null ], + [ "_suffix_automaton", "classformatron_1_1extractor_1_1SubstringExtractor.html#a97cb3468674873adfc85bc17ff1a9a97", null ], + [ "extract_empty_substring", "classformatron_1_1extractor_1_1SubstringExtractor.html#a46d19c58ebefdba4c325f86c1ff17284", null ] +]; \ No newline at end of file diff --git a/v0.4.6/classformatron_1_1extractor_1_1SubstringExtractor.png b/v0.4.6/classformatron_1_1extractor_1_1SubstringExtractor.png new file mode 100644 index 0000000000000000000000000000000000000000..91adc842591522e4469651b3a7efdb4dc34935bc GIT binary patch literal 1397 zcmb7^4N%f|7{~u=*^5DWu1Pwx7nW~CYL|$x-liKgL&6jjF<-{CVU`e}7+TB9)Uz@f zqQcHAF%q%)b`lCsPr1PGPDxEOZG==vOMEF`(&26|ce`D8``!J1&-485x#zj(bKiTe z;c;Js*1N0+004x=1QV>*V!dr^?X2&*Ra#%Gam9xo4_RJbwz@ATW*FDos{(z!&O&(I zFUQ8ltpEESMc!G-K1aZX1J?MDgRm{r0l;bi8+_<^x{X77WAhXAc+lHRk8dOK_C54vvZZ153*{sf35Q4=G$N+0GE9b;e05?lq*FJJUgL2ff*kX?`(z1puUS%Bnzxi;P# z7)weA+G4t^7SltG=$|aS$rP=VcV?$Ou+Z!eM5(woZ9&ovKz|wqxL@dFcYzVJ1(4{~ zK%5)V9x(ko<^3j29gKeQGBl~3i|q}Ph8Fd2!GkYC!(@tu9g;qme&zF2XvQOsf!LuW z^S|XR=g^`jTi$F}610te9LZ@ff*|kwo-<@85o+LPt~MD_)bd>l&w+YxhV1f9rs64# zanK`l)CVyG1~Yd)q%IL;4+pyw5Mogk_*iSYCTwM`K{+RH?u(SuYC+XA zWZtuyrJAJlyRKNp3xz+nwC%64(kMj@+H$pZ+;AJ%GswRH92|PYglV zxJJ_F-R9wn?+K!6T#1618lW~`kYm2ccd4*7T^ZFrB|f`;57oqzU+y&e& z*+<-x7FK%)>DS2L=|Gg!>^nzJ54%m&2m@Bv@0O7g+#*eKX&Kx3T&Hy3y}kLfalGF0 z`lme-E|vz4;X|#mg`RRF?!ub7#Vs(6|7PIrUNjH~9}mw$i|E3zIZb+iaUHic!R`X* zqayup9iPwLbhyM}mE%qRS&E~hsktsUmjPBkXRk|z;}1v%=3x~cj>DZ5B<~izY+hYk z{H&%W;PI@qE*H}w@EVQ8<@0#HFNnf{`oDEtJ5j!V1^j{_ltXJ#KW;jM?V^(>Xz}LC z-jtKC>jVcMyv})*X%J=I7@7oMx;tB%7B~Phi0FIAQWyVJbmMfqVgyZzx74G{si7ID zLsjaLQ@U8^zQDl7OViA^&Cv)t$n!U&Zp5JHvl}g>xuAl9u37FHIwzk7|KwFQO7CEZ z34&rcEc-!T?Sf32b>~Q>m3mBIL@3FuZViz1v&bRTTG6Kic_U&h={P(03QgdXpSw7^ zICVaoM>Ce> + + + + + + + +Formatron: Member List + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
formatron.formats.json.JsonExtractor Member List
+
+
+ +

This is the complete list of members for formatron.formats.json.JsonExtractor, including all inherited members.

+ + + + + + +
__init__(self, str nonterminal, typing.Optional[str] capture_name, schemas.schema.Schema|collections.abc.Sequence schema, typing.Callable[[str], schemas.schema.Schema] to_object)formatron.formats.json.JsonExtractor
_rule_strformatron.formats.json.JsonExtractorprotected
_to_objectformatron.formats.json.JsonExtractorprotected
extract(self, str input_str)formatron.formats.json.JsonExtractor
kbnf_definition(self)formatron.formats.json.JsonExtractor
+
+ + + + diff --git a/v0.4.6/classformatron_1_1formats_1_1json_1_1JsonExtractor.html b/v0.4.6/classformatron_1_1formats_1_1json_1_1JsonExtractor.html new file mode 100644 index 00000000..a884a40e --- /dev/null +++ b/v0.4.6/classformatron_1_1formats_1_1json_1_1JsonExtractor.html @@ -0,0 +1,397 @@ + + + + + + + + +Formatron: formatron.formats.json.JsonExtractor Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
formatron.formats.json.JsonExtractor Class Reference
+
+
+ +

An extractor that loads json data to an object from a string. + More...

+
+Inheritance diagram for formatron.formats.json.JsonExtractor:
+
+
+ + +formatron.extractor.NonterminalExtractor +formatron.extractor.Extractor + +
+ + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 __init__ (self, str nonterminal, typing.Optional[str] capture_name, schemas.schema.Schema|collections.abc.Sequence schema, typing.Callable[[str], schemas.schema.Schema] to_object)
 Create a json extractor from a given schema or a list of supported types.
 
typing.Optional[tuple[str, schemas.schema.Schema]] extract (self, str input_str)
 Extract a schema instance from a string.
 
- Public Member Functions inherited from formatron.extractor.NonterminalExtractor
str nonterminal (self)
 Get the nonterminal of the extractor.
 
str kbnf_reference (self)
 
- Public Member Functions inherited from formatron.extractor.Extractor
 __str__ (self)
 
typing.Optional[str] capture_name (self)
 Get the name of the capture, or None if the extractor does not capture.
 
+ + + + + + + + + + + +

+Protected Attributes

 _to_object
 
 _rule_str
 
- Protected Attributes inherited from formatron.extractor.NonterminalExtractor
 _nonterminal
 
- Protected Attributes inherited from formatron.extractor.Extractor
 _capture_name
 
+ + + +

Properties

 kbnf_definition (self)
 
+

Detailed Description

+

An extractor that loads json data to an object from a string.

+ +

Definition at line 420 of file json.py.

+

Constructor & Destructor Documentation

+ +

◆ __init__()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
formatron.formats.json.JsonExtractor.__init__ ( self,
str nonterminal,
typing.Optional[str] capture_name,
schemas.schema.Schema|collections.abc.Sequence schema,
typing.Callable[[str], schemas.schema.Schema] to_object )
+
+ +

Create a json extractor from a given schema or a list of supported types.

+
   Currently, the following data types are supported:
+
- bool
+
- int
+
    +
  • positive int
  • +
  • negative int
  • +
  • nonnegative int
  • +
  • nonpositive int
    - float
    +
  • +
  • positive float
  • +
  • negative float
  • +
  • nonnegative float
  • +
  • nonpositive float
    - str
    +
  • +
  • optionally with min_length, max_length and pattern constraints
      +
    • length is measured in UTF-8 character number after json parsing
    • +
    • Warning: too large difference between min_length and max_length can lead to enormous memory consumption!
    • +
    • pattern is mutually exclusive with min_length and max_length
    • +
    • pattern will be compiled to a regular expression so all caveats of regular expressions apply
    • +
    • pattern currently is automatically anchored at both ends
    • +
    • the generated json could be invalid if the pattern allows invalid content between the json string's quotes.
        +
      • for example, pattern=".*" will allow '"' to appear in the json string which is forbidden by JSON standard.
        - NoneType
        +
        - typing.Any
        +
      • +
      +
    • +
    +
  • +
+

Subclasses of collections.abc.Mapping[str,T] and typing.Mapping[str,T] where T is a supported type,

    +
  • Subclasses of collections.abc.Sequence[T] and typing.Sequence[T] where T is a supported type.
      +
    • optionally with minItems, maxItems, prefixItems constraints
    • +
    • Warning: too large difference between minItems and maxItems can lead to very slow performance!
    • +
    • Warning: By json schema definition, prefixItems by default allows additional items and missing items in the prefixItems, which may not be the desired behavior and can lead to very slow performance if prefixItems is long!
    • +
    +
  • +
  • tuple[T1,T2,...] where T1,T2,... are supported types. The order, type and number of elements will be preserved.
  • +
  • typing.Literal[x1,x2,...] where x1, x2, ... are instances of int, string, bool or NoneType, or another typing.Literal[y1,y2,...]
  • +
  • typing.Union[T1,T2,...] where T1,T2,... are supported types.
  • +
  • schemas.Schema where all its fields' data types are supported. Recursive schema definitions are supported as well.
      +
    • Warning: while not required field is supported, they can lead to very slow performance and/or enormous memory consumption if there are too many of them!
    • +
    +
  • +
+
Parameters
+ + + + +
nonterminalThe nonterminal representing the extractor.
capture_nameThe capture name of the extractor, or None if the extractor does not capture.
to_objectA callable to convert the extracted string to a schema instance.
+
+
+ +

Reimplemented from formatron.extractor.NonterminalExtractor.

+ +

Definition at line 472 of file json.py.

+ +
+
+

Member Function Documentation

+ +

◆ extract()

+ +
+
+ + + + + + + + + + + +
typing.Optional[tuple[str, schemas.schema.Schema]] formatron.formats.json.JsonExtractor.extract ( self,
str input_str )
+
+ +

Extract a schema instance from a string.

+
Parameters
+ + +
input_strThe input string to extract from.
+
+
+
Returns
A tuple of the remaining string and the extracted schema instance, or None if extraction failed.
+ +

Reimplemented from formatron.extractor.Extractor.

+ +

Definition at line 486 of file json.py.

+ +
+
+ +

◆ kbnf_definition()

+ +
+
+ + + + + + + +
formatron.formats.json.JsonExtractor.kbnf_definition ( self)
+
+ +

Reimplemented from formatron.extractor.Extractor.

+ +

Definition at line 540 of file json.py.

+ +
+
+

Member Data Documentation

+ +

◆ _rule_str

+ +
+
+ + + + + +
+ + + + +
formatron.formats.json.JsonExtractor._rule_str
+
+protected
+
+ +

Definition at line 476 of file json.py.

+ +
+
+ +

◆ _to_object

+ +
+
+ + + + + +
+ + + + +
formatron.formats.json.JsonExtractor._to_object
+
+protected
+
+ +

Definition at line 475 of file json.py.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/v0.4.6/classformatron_1_1formats_1_1json_1_1JsonExtractor.js b/v0.4.6/classformatron_1_1formats_1_1json_1_1JsonExtractor.js new file mode 100644 index 00000000..90fc9ea6 --- /dev/null +++ b/v0.4.6/classformatron_1_1formats_1_1json_1_1JsonExtractor.js @@ -0,0 +1,8 @@ +var classformatron_1_1formats_1_1json_1_1JsonExtractor = +[ + [ "__init__", "classformatron_1_1formats_1_1json_1_1JsonExtractor.html#a7a51edd3cc7c24370c809d91e07771dc", null ], + [ "extract", "classformatron_1_1formats_1_1json_1_1JsonExtractor.html#a6ad701c17988fe32b164135ebd39c783", null ], + [ "kbnf_definition", "classformatron_1_1formats_1_1json_1_1JsonExtractor.html#ace660f78408893ab8fb7facd410a9d60", null ], + [ "_rule_str", "classformatron_1_1formats_1_1json_1_1JsonExtractor.html#aecf88428e414da080f11ed0ab1e13a65", null ], + [ "_to_object", "classformatron_1_1formats_1_1json_1_1JsonExtractor.html#a2e72d806c8dffc0136231b81eb724355", null ] +]; \ No newline at end of file diff --git a/v0.4.6/classformatron_1_1formats_1_1json_1_1JsonExtractor.png b/v0.4.6/classformatron_1_1formats_1_1json_1_1JsonExtractor.png new file mode 100644 index 0000000000000000000000000000000000000000..66ed8cca096daa42b484e9b85a7ea6531db6d658 GIT binary patch literal 1377 zcma)+e^AnA9LKR=XU@#lc}F^|Zd#Eo(KJI#%XAHfV2}_hq#{|S(?CE%qHSF^D_sQH zCTKayOojX%73OmO`kvw?o4+t-A(G;c(##PE``X?9*nd5D&*$?zpU-oj&poeuKhICm z*dyzl+?^m0$U4+F5qQwgfwRSNC1}^KQX@d;5sf((X}8hR>8CKeF%6aw6Od2 z=;$aI59}e9EuYT9V+jy&|8WGZDEbouSv7@LE@;F;CATZ_{g1FQX0ha(EkD}ep5@Z+&KY8TJs>^XXWt@u|t&}fb^fGLrniq z|Kr+NyP9q&jVX0NBudn`2dVi&1D0h(eA$`yBEHnFr|^#4{jnZekEO4 z8|r+cjA_Fwy9TS08t!eY^~6V}>x(#M@+~jvyoV6>KB`1Xh*h>v9o7;%zEIcNM3qti(lEn7Wr)!x5?tjmXQGFE_FmwB zGP-55IhPZmmzooPE-TKYqiXY)8|5(^g;|~4*|rDL{*n5LedxL%#8taz3RR>K>E!zx zUl4DWT{=NW8MsxFrZdC!Aj%6hegX`yC|9)9!#6jvkHg}}ciRigxX%_k>2BO%f4a;X zz+?jS4PQRRi8E76d}D6-3$!1pUSov3Oifnh`IovMcd@d^`G$omR)U4qaFk^^n^ULO zd&|FWfSW+b;~v1g6nRV+6<_KiCJi+DA&*i|%5_!Se^H1@`Ihn=Mntc;XoJ(vUPD{+ z4RaJgIDId*Z-`Z$r=Gu}TI@dnjDWCHwUbG`3-$0@>0Q!|1FdMj!gP}F#A@3en401? z-9|;viwx(-W68n~En@GkVEHZ-C^}RvwgdomMsaupqeA%4OXf^}Ntps5tX+lV+?#Uq zXbJr!vHqv!&iOxL}6VPB62_D@)6ysvlX7*XU=8_caA2FXF*ql{!8D^+t zhRxV5og#cH5|4$8jZpx1V|lf+23LGCt$Q;q&QmFwR&^p1J>%LMIAgbY*uawPI?=YC z+B^|{=?m#xICX5cE@1bxW`JxWChvKelVLlDp<5d@NT#7H&KJXbgC>*=H>Gkg7vQ~+F#?Hn+u}|||NDbVa>i2d3`V<)J=-Vu zWj_|#app0KuDfpFg-G$E%qnG6WLKJyG3vXbMw2p6!fWzY%7Y0VcX{UuQw+hU%^rBt z6nLva0v0Y?|EBtnWeA&J@#2 + + + + + + + +Formatron: Member List + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
formatron.formats.regex.RegexExtractor Member List
+
+
+ +

This is the complete list of members for formatron.formats.regex.RegexExtractor, including all inherited members.

+ + + + + +
__init__(self, str regex, str capture_name, str nonterminal)formatron.formats.regex.RegexExtractor
_regexformatron.formats.regex.RegexExtractorprotected
extract(self, str input_str)formatron.formats.regex.RegexExtractor
kbnf_definition(self)formatron.formats.regex.RegexExtractor
+
+ + + + diff --git a/v0.4.6/classformatron_1_1formats_1_1regex_1_1RegexExtractor.html b/v0.4.6/classformatron_1_1formats_1_1regex_1_1RegexExtractor.html new file mode 100644 index 00000000..7f54ebb4 --- /dev/null +++ b/v0.4.6/classformatron_1_1formats_1_1regex_1_1RegexExtractor.html @@ -0,0 +1,323 @@ + + + + + + + + +Formatron: formatron.formats.regex.RegexExtractor Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
formatron.formats.regex.RegexExtractor Class Reference
+
+
+ +

An extractor that extracts a string using a regular expression. + More...

+
+Inheritance diagram for formatron.formats.regex.RegexExtractor:
+
+
+ + +formatron.extractor.NonterminalExtractor +formatron.extractor.Extractor + +
+ + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 __init__ (self, str regex, str capture_name, str nonterminal)
 Initialize the regex extractor.
 
typing.Optional[tuple[str, re.Match|None]] extract (self, str input_str)
 Extract the string using the regular expression.
 
- Public Member Functions inherited from formatron.extractor.NonterminalExtractor
str nonterminal (self)
 Get the nonterminal of the extractor.
 
str kbnf_reference (self)
 
- Public Member Functions inherited from formatron.extractor.Extractor
 __str__ (self)
 
typing.Optional[str] capture_name (self)
 Get the name of the capture, or None if the extractor does not capture.
 
+ + + + + + + + + +

+Protected Attributes

 _regex
 
- Protected Attributes inherited from formatron.extractor.NonterminalExtractor
 _nonterminal
 
- Protected Attributes inherited from formatron.extractor.Extractor
 _capture_name
 
+ + + +

Properties

str kbnf_definition (self)
 
+

Detailed Description

+

An extractor that extracts a string using a regular expression.

+ +

Definition at line 13 of file regex.py.

+

Constructor & Destructor Documentation

+ +

◆ __init__()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
formatron.formats.regex.RegexExtractor.__init__ ( self,
str regex,
str capture_name,
str nonterminal )
+
+ +

Initialize the regex extractor.

+
Parameters
+ + + + +
regexThe regular expression for extraction.
capture_nameThe name of the capture, or None if the extractor does not capture.
nonterminalThe nonterminal representing the extractor.
+
+
+ +

Reimplemented from formatron.extractor.NonterminalExtractor.

+ +

Definition at line 23 of file regex.py.

+ +
+
+

Member Function Documentation

+ +

◆ extract()

+ +
+
+ + + + + + + + + + + +
typing.Optional[tuple[str, re.Match | None]] formatron.formats.regex.RegexExtractor.extract ( self,
str input_str )
+
+ +

Extract the string using the regular expression.

+

Specifically, the first match(if any) of the regex pattern in the input string is returned.

+
Parameters
+ + +
input_strThe input string.
+
+
+
Returns
The remaining string and the extracted re.Match object, or None if the extraction failed.
+ +

Reimplemented from formatron.extractor.Extractor.

+ +

Definition at line 36 of file regex.py.

+ +
+
+ +

◆ kbnf_definition()

+ +
+
+ + + + + + + +
str formatron.formats.regex.RegexExtractor.kbnf_definition ( self)
+
+ +

Reimplemented from formatron.extractor.Extractor.

+ +

Definition at line 50 of file regex.py.

+ +
+
+

Member Data Documentation

+ +

◆ _regex

+ +
+
+ + + + + +
+ + + + +
formatron.formats.regex.RegexExtractor._regex
+
+protected
+
+ +

Definition at line 25 of file regex.py.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/v0.4.6/classformatron_1_1formats_1_1regex_1_1RegexExtractor.js b/v0.4.6/classformatron_1_1formats_1_1regex_1_1RegexExtractor.js new file mode 100644 index 00000000..e0fcf116 --- /dev/null +++ b/v0.4.6/classformatron_1_1formats_1_1regex_1_1RegexExtractor.js @@ -0,0 +1,7 @@ +var classformatron_1_1formats_1_1regex_1_1RegexExtractor = +[ + [ "__init__", "classformatron_1_1formats_1_1regex_1_1RegexExtractor.html#a6fc2f05d044cce49935c415248de5e5a", null ], + [ "extract", "classformatron_1_1formats_1_1regex_1_1RegexExtractor.html#a73a98b3762aa24d4319e84c1123493c7", null ], + [ "kbnf_definition", "classformatron_1_1formats_1_1regex_1_1RegexExtractor.html#a7b5fa1eb57e55ccf46d7762e1a6d0b9a", null ], + [ "_regex", "classformatron_1_1formats_1_1regex_1_1RegexExtractor.html#a1df60401933eef6cf5a1ff041f11ec46", null ] +]; \ No newline at end of file diff --git a/v0.4.6/classformatron_1_1formats_1_1regex_1_1RegexExtractor.png b/v0.4.6/classformatron_1_1formats_1_1regex_1_1RegexExtractor.png new file mode 100644 index 0000000000000000000000000000000000000000..7d3c40de02a4dde64dbfbf9fe7d5d92f18e2254b GIT binary patch literal 1408 zcmchXdsNbQ6u^J3P&6OMHMNK4@zIuIB@J{U;&QN}5VKsEVUp&YnlBnLEUQ&(trCtU zprQ6s5kxEu%$Z;>&7WlDE0Pk;$c#q`KSckynYab8`5#aCC%k?DfGogc*CzaAXQ&+IG=;d~+&ZNjjMfv1#cQD_ z>daG_3Xe4gV*=rjOW7O_>ZgRnoPzfpg>^2vL?cIZENU>rwZ>3E!OBb8?Wf>#TjWCT z&DoYZ61-!&arzK-sKvK!SM^i@e^zkEIu0^s4#YMMhCQ2lS|Kq#&h*gELe=ran5guI ztVxRRRccAq#5T+dwNRzoNYYCLx-8XfG85imb^BOq41{<5;6q}V6Y$^xXgsjJ47Qd z21Nf18TlrpTcU(`p002teU7&!;*-XIra}W5;It8!$VZ9}vijCjl||Zmqee`S$Q2hV zwxS#N-EBm?7%IaI%03eiadK|6*s-rmnpa~+6bE*q)!Lh={`aejYobzeIjHjsYhSZ@ zg$};8CC|&EgTn*DnpCmEu71B@U6}^meZSZCePn5K8eRCLa^F2vd@lIHfH>`Kw%1ms z9pthcCaE?xLtKJqT1u(nRTCPxo@~jqxs2(6@4zu5W&D$d)S)brQMywq*Y&mzDBd|o zZwTnxXoQ`qb|jYvHjIIRnLZ!7Qwpw!bg%IM-uUbQLcPpEiXD9s_xZDFXrB2fxZ{dl zJLW%m{TnIfwj`vRO!4a~&rd&nm1!$V6aEb#(kHjVrEh_=PBT_=(!}mnvmeRSVBq67 z^){NmFuoQ%>1l#37ZpzgH0C%7bUb5CUQQWNT=d9Fd(c0MktqFX+glUBxOKUETZpOJ zKN{?n2K9xkV+2xVXi?*n-KA<*dP$)tG6pi}qKKlVFf{eV-K*&fYSj15JVsSqf!Bbm z;G8xiK(lGMM=7AvN6ylO*CS=cU0=7n6;+A82uOjw_MT})t1ga%vGeEYW=s^#VoNO8 zf~Y%-K#7Gf(b1|lzVYE*11mw0(|V+Bps$u9TTWk^`0K!Xv95L)l6)n*_?7Zvl&S_X z9&coc*m$bz{{SBQVKNUNze~6#Iewf*-iE!6N{TpTaG+bOg8ZqwR*L-n$E%-3E*q_u z2B*a8XXi9u;;<-@V;pBP56rx00)LqWk66QMS<;m_PFovSz>&S3R3}l{8J5Cjvf?(w zv|NMA<>jliF=uxz2@dB>?Qd~82y3zrFY*=-B`-V59{zn#cHULia5**O)6RX#+5@$y zv`&nxd8n#yZ6bq1J74vxpf|3x`G}dkEnPN-NDgbtL!sU3pCY#+N27yYds*ZXr<}bz zxvHLg`sKKrD2Ex*t<^!zXY`orN)r;A?ZuC7-VRFJ4a|&H4}!l})RD^H8!xBoo<-HE zCd#<5fxJKCA9}R%L;OvUT&7i?d4R;AKgVJVpExgcZ@IyxNBBm%m$--D!eYgixf`DD rmKEX<|5P86r~8#278UA8xMKxYUpq!fihaPd?MeWTBVxrdl*4}kgTJ}g literal 0 HcmV?d00001 diff --git a/v0.4.6/classformatron_1_1formatter_1_1Formatter-members.html b/v0.4.6/classformatron_1_1formatter_1_1Formatter-members.html new file mode 100644 index 00000000..701944e6 --- /dev/null +++ b/v0.4.6/classformatron_1_1formatter_1_1Formatter-members.html @@ -0,0 +1,155 @@ + + + + + + + + +Formatron: Member List + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
formatron.formatter.Formatter Member List
+
+ +
+ + + + diff --git a/v0.4.6/classformatron_1_1formatter_1_1Formatter.html b/v0.4.6/classformatron_1_1formatter_1_1Formatter.html new file mode 100644 index 00000000..718df119 --- /dev/null +++ b/v0.4.6/classformatron_1_1formatter_1_1Formatter.html @@ -0,0 +1,740 @@ + + + + + + + + +Formatron: formatron.formatter.Formatter Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
formatron.formatter.Formatter Class Reference
+
+
+
+Inheritance diagram for formatron.formatter.Formatter:
+
+
+ + +formatron.formatter.FormatterBase + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 __init__ (self, list[Extractor] extractors, kbnf.Engine engine, typing.Callable[[list[int]], str] decode_callback, str grammar_str)
 Initialize the formatter.
 
kbnf.AcceptTokenResult accept_token (self, int token_id)
 Accept a token from the language model.
 
kbnf.AcceptTokenResult accept_bytes (self, bytes _bytes)
 Accept a bytes object from the language model.
 
None compute_allowed_tokens (self)
 Compute the allowed tokens based on the current state.
 
typing.Any mask_logits (self, logits)
 Mask the logits based on the current state.
 
typing.Sequence[int] get_allowed_tokens_since_last_computation (self)
 Get the allowed tokens since the last computation(in other words, the last call to compute_allowed_tokens).
 
bool is_completed (self)
 Check if the generation is completed.
 
None reset (self)
 Reset the formatter to the initial state.
 
 __str__ (self)
 
+ + + + + + +

+Protected Member Functions

str _obtain_accepted_output (self)
 
None _on_completion (self, str generated_output)
 Perform actions when the generation is completed.
 
+ + + + + + + + + + + + + +

+Protected Attributes

 _extractors
 
 _engine
 
 _token_id_or_bytes
 
 _decode_callback
 
 _grammar_str
 
 _captures
 
+ + + + + + + +

Properties

 grammar_str (self)
 Get the KBNF grammar string.
 
dict[str, typing.Any]|None captures (self)
 Get the captures from the generated string.
 
+

Detailed Description

+
+

Definition at line 112 of file formatter.py.

+

Constructor & Destructor Documentation

+ +

◆ __init__()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
formatron.formatter.Formatter.__init__ ( self,
list[Extractor] extractors,
kbnf.Engine engine,
typing.Callable[[list[int]], str] decode_callback,
str grammar_str )
+
+ +

Initialize the formatter.

+
Parameters
+ + + + + +
extractorsThe matchers to extract data from the generated string.
engineThe KBNF engine to enforce the format.
decode_callbackThe callback to decode the token IDs to a string.
grammar_strThe KBNF grammar string.
+
+
+ +

Definition at line 122 of file formatter.py.

+ +
+
+

Member Function Documentation

+ +

◆ __str__()

+ +
+
+ + + + + + + +
formatron.formatter.Formatter.__str__ ( self)
+
+ +

Definition at line 262 of file formatter.py.

+ +
+
+ +

◆ _obtain_accepted_output()

+ +
+
+ + + + + +
+ + + + + + + +
str formatron.formatter.Formatter._obtain_accepted_output ( self)
+
+protected
+
+ +

Definition at line 155 of file formatter.py.

+ +
+
+ +

◆ _on_completion()

+ +
+
+ + + + + +
+ + + + + + + + + + + +
None formatron.formatter.Formatter._on_completion ( self,
str generated_output )
+
+protected
+
+ +

Perform actions when the generation is completed.

+ +

Reimplemented from formatron.formatter.FormatterBase.

+ +

Definition at line 209 of file formatter.py.

+ +
+
+ +

◆ accept_bytes()

+ +
+
+ + + + + + + + + + + +
kbnf.AcceptTokenResult formatron.formatter.Formatter.accept_bytes ( self,
bytes _bytes )
+
+ +

Accept a bytes object from the language model.

+
Parameters
+ + +
_bytesThe bytes object.
+
+
+ +

Reimplemented from formatron.formatter.FormatterBase.

+ +

Definition at line 184 of file formatter.py.

+ +
+
+ +

◆ accept_token()

+ +
+
+ + + + + + + + + + + +
kbnf.AcceptTokenResult formatron.formatter.Formatter.accept_token ( self,
int token_id )
+
+ +

Accept a token from the language model.

+
Parameters
+ + +
token_idThe token ID.
+
+
+
Returns
The result of accepting the token.
+ +

Reimplemented from formatron.formatter.FormatterBase.

+ +

Definition at line 147 of file formatter.py.

+ +
+
+ +

◆ captures()

+ +
+
+ + + + + + + +
dict[str, typing.Any] | None formatron.formatter.Formatter.captures ( self)
+
+ +

Get the captures from the generated string.

+

Note that the captures are only available for one extractor if:

    +
  • The extractor has a capture name.
  • +
  • Formatter.is_completed() returns True.
  • +
  • The extractor successfully extracts the data.
      +
    • This means the extractor identifies the correct string span to extract and whatever post-processing the extractor does on the extracted string is successful.
    • +
    +
  • +
+

Captures are obtained by calling Extractor.extract method on the generated string in the sequence of extractors appended to the formatter. Note that the previous extractors does not 'see' the semantics of the later extractors. For example, consider the following formatter: python @code f = FormatterBuilder() f.append_line(f"{f.regex('.*?', capture_name='a')}{f.regex('.*', capture_name='b')}") f = f.build() @endcode The b extractor will always corresponding to None because the a extractor will always extract the whole string. This behavior is different from what a typical regular expression engine would do!

+ +

Reimplemented from formatron.formatter.FormatterBase.

+ +

Definition at line 252 of file formatter.py.

+ +
+
+ +

◆ compute_allowed_tokens()

+ +
+
+ + + + + + + +
None formatron.formatter.Formatter.compute_allowed_tokens ( self)
+
+ +

Compute the allowed tokens based on the current state.

+ +

Reimplemented from formatron.formatter.FormatterBase.

+ +

Definition at line 192 of file formatter.py.

+ +
+
+ +

◆ get_allowed_tokens_since_last_computation()

+ +
+
+ + + + + + + +
typing.Sequence[int] formatron.formatter.Formatter.get_allowed_tokens_since_last_computation ( self)
+
+ +

Get the allowed tokens since the last computation(in other words, the last call to compute_allowed_tokens).

+
Returns
The allowed tokens.
+ +

Reimplemented from formatron.formatter.FormatterBase.

+ +

Definition at line 198 of file formatter.py.

+ +
+
+ +

◆ grammar_str()

+ +
+
+ + + + + + + +
formatron.formatter.Formatter.grammar_str ( self)
+
+ +

Get the KBNF grammar string.

+ +

Definition at line 142 of file formatter.py.

+ +
+
+ +

◆ is_completed()

+ +
+
+ + + + + + + +
bool formatron.formatter.Formatter.is_completed ( self)
+
+ +

Check if the generation is completed.

+

This means the generation is ended by the engine. If the generation is ended by integration-specific stop conditions like max_new_tokens, the generation is not considered completed by this method.

+ +

Reimplemented from formatron.formatter.FormatterBase.

+ +

Definition at line 206 of file formatter.py.

+ +
+
+ +

◆ mask_logits()

+ +
+
+ + + + + + + + + + + +
typing.Any formatron.formatter.Formatter.mask_logits ( self,
logits )
+
+ +

Mask the logits based on the current state.

+
Parameters
+ + +
logitsThe logits to mask.
+
+
+
Returns
The masked logits.
+ +

Reimplemented from formatron.formatter.FormatterBase.

+ +

Definition at line 195 of file formatter.py.

+ +
+
+ +

◆ reset()

+ +
+
+ + + + + + + +
None formatron.formatter.Formatter.reset ( self)
+
+ +

Reset the formatter to the initial state.

+ +

Reimplemented from formatron.formatter.FormatterBase.

+ +

Definition at line 257 of file formatter.py.

+ +
+
+

Member Data Documentation

+ +

◆ _captures

+ +
+
+ + + + + +
+ + + + +
formatron.formatter.Formatter._captures
+
+protected
+
+ +

Definition at line 129 of file formatter.py.

+ +
+
+ +

◆ _decode_callback

+ +
+
+ + + + + +
+ + + + +
formatron.formatter.Formatter._decode_callback
+
+protected
+
+ +

Definition at line 127 of file formatter.py.

+ +
+
+ +

◆ _engine

+ +
+
+ + + + + +
+ + + + +
formatron.formatter.Formatter._engine
+
+protected
+
+ +

Definition at line 125 of file formatter.py.

+ +
+
+ +

◆ _extractors

+ +
+
+ + + + + +
+ + + + +
formatron.formatter.Formatter._extractors
+
+protected
+
+ +

Definition at line 124 of file formatter.py.

+ +
+
+ +

◆ _grammar_str

+ +
+
+ + + + + +
+ + + + +
formatron.formatter.Formatter._grammar_str
+
+protected
+
+ +

Definition at line 128 of file formatter.py.

+ +
+
+ +

◆ _token_id_or_bytes

+ +
+
+ + + + + +
+ + + + +
formatron.formatter.Formatter._token_id_or_bytes
+
+protected
+
+ +

Definition at line 126 of file formatter.py.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/v0.4.6/classformatron_1_1formatter_1_1Formatter.js b/v0.4.6/classformatron_1_1formatter_1_1Formatter.js new file mode 100644 index 00000000..34951ff8 --- /dev/null +++ b/v0.4.6/classformatron_1_1formatter_1_1Formatter.js @@ -0,0 +1,22 @@ +var classformatron_1_1formatter_1_1Formatter = +[ + [ "__init__", "classformatron_1_1formatter_1_1Formatter.html#a369269f53f32be2f1d92663670354515", null ], + [ "__str__", "classformatron_1_1formatter_1_1Formatter.html#a827c993f0ac74abff6276b3af6058e3f", null ], + [ "_obtain_accepted_output", "classformatron_1_1formatter_1_1Formatter.html#ae4be840a942f608c1a0c256dbf68901b", null ], + [ "_on_completion", "classformatron_1_1formatter_1_1Formatter.html#ac6f7e3f96c6318689c5cd0d44a1cdde7", null ], + [ "accept_bytes", "classformatron_1_1formatter_1_1Formatter.html#a178a37715ce463e6e57c530166c7ec6d", null ], + [ "accept_token", "classformatron_1_1formatter_1_1Formatter.html#a839eb7550ee4afbd305b25ddcca5c4dc", null ], + [ "captures", "classformatron_1_1formatter_1_1Formatter.html#af69cc99bea2c85c4ca5af0ecc01c5db1", null ], + [ "compute_allowed_tokens", "classformatron_1_1formatter_1_1Formatter.html#a538f36e08b749716e6dd4c50679e2ee1", null ], + [ "get_allowed_tokens_since_last_computation", "classformatron_1_1formatter_1_1Formatter.html#a5d565301d527fd3a56ca86a98df9afaf", null ], + [ "grammar_str", "classformatron_1_1formatter_1_1Formatter.html#a2519969e1338beb864169289a6f36bb9", null ], + [ "is_completed", "classformatron_1_1formatter_1_1Formatter.html#ac15aeec180daa5c78ad3c9bd93bd2b5b", null ], + [ "mask_logits", "classformatron_1_1formatter_1_1Formatter.html#a1068b4fa2167039fe04519ec4db65278", null ], + [ "reset", "classformatron_1_1formatter_1_1Formatter.html#a10ff1aac8dcd90e1bd983d2f6580a964", null ], + [ "_captures", "classformatron_1_1formatter_1_1Formatter.html#a43964a72280fd307cd74528657beeca3", null ], + [ "_decode_callback", "classformatron_1_1formatter_1_1Formatter.html#a9535e6eb6b8001d6f5fc90ee549ecacb", null ], + [ "_engine", "classformatron_1_1formatter_1_1Formatter.html#a73ef6ac966b418215e6c216a90520860", null ], + [ "_extractors", "classformatron_1_1formatter_1_1Formatter.html#a77fc80d958ed5878393546c1a24d75e5", null ], + [ "_grammar_str", "classformatron_1_1formatter_1_1Formatter.html#aac1bf058d35745650f1838ea64b66ad2", null ], + [ "_token_id_or_bytes", "classformatron_1_1formatter_1_1Formatter.html#adf232d46083546ae3363e4ce007a335b", null ] +]; \ No newline at end of file diff --git a/v0.4.6/classformatron_1_1formatter_1_1Formatter.png b/v0.4.6/classformatron_1_1formatter_1_1Formatter.png new file mode 100644 index 0000000000000000000000000000000000000000..3c639a81d764fb9b08deeff3d08642a8da08dc37 GIT binary patch literal 926 zcmeAS@N?(olHy`uVBq!ia0vp^=YY6_gBeK9IH1xFq@)9ULR|m<{|{uoc=NTi|Il&^ z1I+@7>1SR%c<=xyZhAIs2~du+B*-tA0mugfbEer>7#Nr}JzX3_Dj46+y*O#Hf`BXk z+*M!x{@1@3Y3kA8Hh0$Cw*h+}E^&LZN#?>i?WI$U_(aOT2YSese_yerZ+CUbzlrCb zEh&B;((o$&-8=ge`md(!++Mdf9LPT0|N4yezpY;?x1Rl1ZuLJ+x;`TP=C}P~rzgpO zw*U7}V{Y2oyOUO*`*fw6 z`JKD}*;hV(CpYy zrT)};xqt5G>sQSC*Q6II?L4>P%*AytgEqag`E~8$`sKkhpUsGRyXNodr@M;PC%rzp zi~DTde1E$VGxj&HwlvRIuh?Wg_syrb(FM9U_gR;|FrEAK$o_@Fll#?|TTku%;<%~y z#;Zv4zT;MRf9b#26Z1uCx7F^G?-Hvu#rLl&{#8;odHTJ%TiZ(5_ls;w^GPq8P_xSa z?zA|sYtOUfHpJgNbH;A|6+`20uU9i>x~hWwXEg8J+p^uf%m?xd*d^LGmc0AEu;$pM zpPM94rW?#%lfzI*bjX1MwqPbOCfK`FdYxW*1cd~-Pg=BTdGNjHeLJh?+>tPtuIhO! z-CA>HrnQy(&cDCaCq-LLDmn1I^x52~Z>x3YS8iHa{BPE;XA{5r_^Di%oMss{_q3;{ zZ*{TN)Xct>SI^zrAG6N7TxnOy{N`P%OBa@R-2vt#22WQ%mvv4FO#rLL(oX;Y literal 0 HcmV?d00001 diff --git a/v0.4.6/classformatron_1_1formatter_1_1FormatterBase-members.html b/v0.4.6/classformatron_1_1formatter_1_1FormatterBase-members.html new file mode 100644 index 00000000..7afbf402 --- /dev/null +++ b/v0.4.6/classformatron_1_1formatter_1_1FormatterBase-members.html @@ -0,0 +1,145 @@ + + + + + + + + +Formatron: Member List + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
formatron.formatter.FormatterBase Member List
+
+ +
+ + + + diff --git a/v0.4.6/classformatron_1_1formatter_1_1FormatterBase.html b/v0.4.6/classformatron_1_1formatter_1_1FormatterBase.html new file mode 100644 index 00000000..72479ff7 --- /dev/null +++ b/v0.4.6/classformatron_1_1formatter_1_1FormatterBase.html @@ -0,0 +1,441 @@ + + + + + + + + +Formatron: formatron.formatter.FormatterBase Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
formatron.formatter.FormatterBase Class Reference
+
+
+ +

An abstract Formatter that enforces a format on the string generated by a language model. + More...

+
+Inheritance diagram for formatron.formatter.FormatterBase:
+
+
+ + +formatron.formatter.Formatter + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 accept_token (self, int token_id)
 Accept a token from the language model.
 
None accept_bytes (self, bytes _bytes)
 Accept a bytes object from the language model.
 
None compute_allowed_tokens (self)
 Compute the allowed tokens based on the current state.
 
typing.Any mask_logits (self, logits)
 Mask the logits based on the current state.
 
typing.Sequence[int] get_allowed_tokens_since_last_computation (self)
 Get the allowed tokens since the last computation(in other words, the last call to compute_allowed_tokens).
 
bool is_completed (self)
 Check if the generated string satisfies the format and hence the generation is completed.
 
dict[str, typing.Any|None] captures (self)
 
None reset (self)
 Reset the formatter to the initial state.
 
+ + + + +

+Protected Member Functions

None _on_completion (self, str generated_output)
 Perform actions when the generation is completed.
 
+

Detailed Description

+

An abstract Formatter that enforces a format on the string generated by a language model.

+ +

Definition at line 24 of file formatter.py.

+

Member Function Documentation

+ +

◆ _on_completion()

+ +
+
+ + + + + +
+ + + + + + + + + + + +
None formatron.formatter.FormatterBase._on_completion ( self,
str generated_output )
+
+protected
+
+ +

Perform actions when the generation is completed.

+ +

Reimplemented in formatron.formatter.Formatter.

+ +

Definition at line 80 of file formatter.py.

+ +
+
+ +

◆ accept_bytes()

+ +
+
+ + + + + + + + + + + +
None formatron.formatter.FormatterBase.accept_bytes ( self,
bytes _bytes )
+
+ +

Accept a bytes object from the language model.

+
Parameters
+ + +
_bytesThe bytes object.
+
+
+ +

Reimplemented in formatron.formatter.Formatter.

+ +

Definition at line 42 of file formatter.py.

+ +
+
+ +

◆ accept_token()

+ +
+
+ + + + + + + + + + + +
formatron.formatter.FormatterBase.accept_token ( self,
int token_id )
+
+ +

Accept a token from the language model.

+
Parameters
+ + +
token_idThe token ID.
+
+
+
Returns
The result of accepting the token.
+ +

Reimplemented in formatron.formatter.Formatter.

+ +

Definition at line 34 of file formatter.py.

+ +
+
+ +

◆ captures()

+ +
+
+ + + + + + + +
dict[str, typing.Any|None] formatron.formatter.FormatterBase.captures ( self)
+
+ +

Reimplemented in formatron.formatter.Formatter.

+ +

Definition at line 98 of file formatter.py.

+ +
+
+ +

◆ compute_allowed_tokens()

+ +
+
+ + + + + + + +
None formatron.formatter.FormatterBase.compute_allowed_tokens ( self)
+
+ +

Compute the allowed tokens based on the current state.

+ +

Reimplemented in formatron.formatter.Formatter.

+ +

Definition at line 48 of file formatter.py.

+ +
+
+ +

◆ get_allowed_tokens_since_last_computation()

+ +
+
+ + + + + + + +
typing.Sequence[int] formatron.formatter.FormatterBase.get_allowed_tokens_since_last_computation ( self)
+
+ +

Get the allowed tokens since the last computation(in other words, the last call to compute_allowed_tokens).

+
Returns
The allowed tokens.
+ +

Reimplemented in formatron.formatter.Formatter.

+ +

Definition at line 66 of file formatter.py.

+ +
+
+ +

◆ is_completed()

+ +
+
+ + + + + + + +
bool formatron.formatter.FormatterBase.is_completed ( self)
+
+ +

Check if the generated string satisfies the format and hence the generation is completed.

+ +

Reimplemented in formatron.formatter.Formatter.

+ +

Definition at line 72 of file formatter.py.

+ +
+
+ +

◆ mask_logits()

+ +
+
+ + + + + + + + + + + +
typing.Any formatron.formatter.FormatterBase.mask_logits ( self,
logits )
+
+ +

Mask the logits based on the current state.

+
Parameters
+ + +
logitsThe logits to mask.
+
+
+
Returns
The masked logits.
+ +

Reimplemented in formatron.formatter.Formatter.

+ +

Definition at line 58 of file formatter.py.

+ +
+
+ +

◆ reset()

+ +
+
+ + + + + + + +
None formatron.formatter.FormatterBase.reset ( self)
+
+ +

Reset the formatter to the initial state.

+ +

Reimplemented in formatron.formatter.Formatter.

+ +

Definition at line 104 of file formatter.py.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/v0.4.6/classformatron_1_1formatter_1_1FormatterBase.js b/v0.4.6/classformatron_1_1formatter_1_1FormatterBase.js new file mode 100644 index 00000000..9eda475d --- /dev/null +++ b/v0.4.6/classformatron_1_1formatter_1_1FormatterBase.js @@ -0,0 +1,12 @@ +var classformatron_1_1formatter_1_1FormatterBase = +[ + [ "_on_completion", "classformatron_1_1formatter_1_1FormatterBase.html#a469880a21192928e82823cc340a22ce2", null ], + [ "accept_bytes", "classformatron_1_1formatter_1_1FormatterBase.html#ac0f91549079380a53228322dd4473cf1", null ], + [ "accept_token", "classformatron_1_1formatter_1_1FormatterBase.html#a87d1513c3f70fdee18d65fae4f71101d", null ], + [ "captures", "classformatron_1_1formatter_1_1FormatterBase.html#ab6682619840e83727264a945953fe964", null ], + [ "compute_allowed_tokens", "classformatron_1_1formatter_1_1FormatterBase.html#a927b160d994d43c4e38807f94ea69069", null ], + [ "get_allowed_tokens_since_last_computation", "classformatron_1_1formatter_1_1FormatterBase.html#ab77855193118e33bf8247c5709a0f485", null ], + [ "is_completed", "classformatron_1_1formatter_1_1FormatterBase.html#ac9af60077533ed0f3c9f42ee3a132899", null ], + [ "mask_logits", "classformatron_1_1formatter_1_1FormatterBase.html#ae8db7e92a900322ae5aa603b5c8f386f", null ], + [ "reset", "classformatron_1_1formatter_1_1FormatterBase.html#a522c78b1404697a99313f9edffa7a2a4", null ] +]; \ No newline at end of file diff --git a/v0.4.6/classformatron_1_1formatter_1_1FormatterBase.png b/v0.4.6/classformatron_1_1formatter_1_1FormatterBase.png new file mode 100644 index 0000000000000000000000000000000000000000..6ad4c9bb3791b53d1947c5afa2be9c6a79b0ce6b GIT binary patch literal 932 zcmeAS@N?(olHy`uVBq!ia0vp^=YY6_gBeK9IH1xFq@)9ULR|m<{|{uoc=NTi|Il&^ z1I+@7>1SR%c<=xyZhAIs2~du+B*-tA0mugfbEer>7#NuKJzX3_Dj46+y*O#Hf`BXk z^;H-C|37NIn1%D=ieTfLd{?FYvRw2|Grrw3Dah-w!zs(>fgE$^6o2!2@np{C@P8iZ z#g~>A>p6T~Kd1Pg>%A3|r``LtHSX!0&+k9HwmRKcuUi|LyZQgzbN6!|>%X3o`+u8; z_rCM>|9>wonYFddd!5zOsXuw4`mfc8S>2U9OFe(-w1P@!7Fut&&>Ar4i#U?$Kk_DM5uYP9st zoEh$P{LC5c)qYiPzdm|bSd@GqsN>9;Zt*g#mRD65ie&U@=hQ`(j&d)Q_yU!`b zUJ3p=m0!=C#WO_cE+vQ zec{dbpHE`biw~^xv;I-o#J>CTNxl2~Sg%idyF0i&?y{!(Kjyi!_SjqAU753lf708- zVdr-h+FW~it={qZ%SG33T)pXA#(z6_XT|DsFE8KpjjJlZCUr@+MlN^*h_y1q#lWBb_vLA})rY=8KxAaq_ z+HC9T>v!f$MxKA-QZ#qrnTxMtK#IFBuRK$HW^LKEe?>dr-RXQ%weg+P|NrwqQj&Aa zwmrKd|33Fsj{5GJ+H#ep?tUt&rf)a-S$>p%aplS1lP~>Jm1~tWS7wHn?)n;kp>o#? z)3VYyHJ}>%S99#(pY*Z`H7opMS@%twvV{Fxotx@QW=>hp qPhKxPCWV9iWHj%biSK2DKg^YN%Fm?yHU|Uq6N9I#pUXO@geCy3;LfN3 literal 0 HcmV?d00001 diff --git a/v0.4.6/classformatron_1_1formatter_1_1FormatterBuilder-members.html b/v0.4.6/classformatron_1_1formatter_1_1FormatterBuilder-members.html new file mode 100644 index 00000000..831187ec --- /dev/null +++ b/v0.4.6/classformatron_1_1formatter_1_1FormatterBuilder-members.html @@ -0,0 +1,159 @@ + + + + + + + + +Formatron: Member List + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
formatron.formatter.FormatterBuilder Member List
+
+
+ +

This is the complete list of members for formatron.formatter.FormatterBuilder, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + +
__init__(self)formatron.formatter.FormatterBuilder
_add_capture_name(self, NonterminalExtractor extractor)formatron.formatter.FormatterBuilderprotected
_add_extractor(self, str extractor_type, typing.Callable[[str], Extractor] create_extractor)formatron.formatter.FormatterBuilderprotected
_assert_capture_name_valid(self, str capture_name)formatron.formatter.FormatterBuilderprotected
_capture_namesformatron.formatter.FormatterBuilderprotected
_counterformatron.formatter.FormatterBuilderprotected
_create_nonterminal(self, str name)formatron.formatter.FormatterBuilderprotected
_extractorsformatron.formatter.FormatterBuilderprotected
_formatter_builder_counterformatron.formatter.FormatterBuilderprotectedstatic
_instance_idformatron.formatter.FormatterBuilderprotected
_main_ruleformatron.formatter.FormatterBuilderprotected
_nonterminal_to_extractorformatron.formatter.FormatterBuilderprotected
_rulesformatron.formatter.FormatterBuilderprotected
append_line(self, str line)formatron.formatter.FormatterBuilder
append_multiline_str(self, str lines)formatron.formatter.FormatterBuilder
append_str(self, str string)formatron.formatter.FormatterBuilder
build(self, kbnf.Vocabulary vocabulary, typing.Callable[[list[int]], str] decode, kbnf.Config engine_config=None)formatron.formatter.FormatterBuilder
choose(self, *Extractor|str extractors, str capture_name=None)formatron.formatter.FormatterBuilder
extractor(self, typing.Callable[[str], Extractor] create_extractor)formatron.formatter.FormatterBuilder
json(self, typing.Type[Schema]|collections.abc.Sequence schema, *, str capture_name=None)formatron.formatter.FormatterBuilder
regex(self, str regex, *, str capture_name=None)formatron.formatter.FormatterBuilder
str(self, *, typing.Union[str, list[str]] stop=None, typing.Optional[str] capture_name=None)formatron.formatter.FormatterBuilder
substr(self, str string, *, str capture_name=None, bool extract_empty_substring=False)formatron.formatter.FormatterBuilder
+
+ + + + diff --git a/v0.4.6/classformatron_1_1formatter_1_1FormatterBuilder.html b/v0.4.6/classformatron_1_1formatter_1_1FormatterBuilder.html new file mode 100644 index 00000000..d39c0f8a --- /dev/null +++ b/v0.4.6/classformatron_1_1formatter_1_1FormatterBuilder.html @@ -0,0 +1,943 @@ + + + + + + + + +Formatron: formatron.formatter.FormatterBuilder Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
formatron.formatter.FormatterBuilder Class Reference
+
+
+ +

A builder for creating a Formatter. + More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 __init__ (self)
 Initialize the formatter builder.
 
None append_line (self, str line)
 Append a line to the format.
 
None append_multiline_str (self, str lines)
 Appends a multiline string to the format, preserving the first line's leading whitespaces and remove any common leading whitespaces from subsequent lines.
 
None append_str (self, str string)
 Append a string to the format without any post-processing.
 
ChoiceExtractor choose (self, *Extractor|str extractors, str capture_name=None)
 Create a choice extractor.
 
Extractor extractor (self, typing.Callable[[str], Extractor] create_extractor)
 Create a custom extractor.
 
JsonExtractor json (self, typing.Type[Schema]|collections.abc.Sequence schema, *, str capture_name=None)
 Create a JSON extractor.
 
RegexExtractor regex (self, str regex, *, str capture_name=None)
 Create a regex extractor.
 
Extractor str (self, *, typing.Union[str, list[str]] stop=None, typing.Optional[str] capture_name=None)
 Create a string extractor.
 
Extractor substr (self, str string, *, str capture_name=None, bool extract_empty_substring=False)
 Create a substring extractor.
 
Formatter build (self, kbnf.Vocabulary vocabulary, typing.Callable[[list[int]], str] decode, kbnf.Config engine_config=None)
 Build a formatter from the builder.
 
+ + + + + + + + + +

+Protected Member Functions

 _assert_capture_name_valid (self, str capture_name)
 
str _create_nonterminal (self, str name)
 
None _add_capture_name (self, NonterminalExtractor extractor)
 
 _add_extractor (self, str extractor_type, typing.Callable[[str], Extractor] create_extractor)
 
+ + + + + + + + + + + + + + + +

+Protected Attributes

 _counter
 
 _main_rule
 
 _rules
 
 _capture_names
 
 _nonterminal_to_extractor
 
 _extractors
 
 _instance_id
 
+ + + +

+Static Protected Attributes

int _formatter_builder_counter
 
+

Detailed Description

+

A builder for creating a Formatter.

+ +

Definition at line 274 of file formatter.py.

+

Constructor & Destructor Documentation

+ +

◆ __init__()

+ +
+
+ + + + + + + +
formatron.formatter.FormatterBuilder.__init__ ( self)
+
+ +

Initialize the formatter builder.

+ +

Definition at line 283 of file formatter.py.

+ +
+
+

Member Function Documentation

+ +

◆ _add_capture_name()

+ +
+
+ + + + + +
+ + + + + + + + + + + +
None formatron.formatter.FormatterBuilder._add_capture_name ( self,
NonterminalExtractor extractor )
+
+protected
+
+ +

Definition at line 369 of file formatter.py.

+ +
+
+ +

◆ _add_extractor()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + +
formatron.formatter.FormatterBuilder._add_extractor ( self,
str extractor_type,
typing.Callable[[str], Extractor] create_extractor )
+
+protected
+
+ +

Definition at line 395 of file formatter.py.

+ +
+
+ +

◆ _assert_capture_name_valid()

+ +
+
+ + + + + +
+ + + + + + + + + + + +
formatron.formatter.FormatterBuilder._assert_capture_name_valid ( self,
str capture_name )
+
+protected
+
+ +

Definition at line 294 of file formatter.py.

+ +
+
+ +

◆ _create_nonterminal()

+ +
+
+ + + + + +
+ + + + + + + + + + + +
str formatron.formatter.FormatterBuilder._create_nonterminal ( self,
str name )
+
+protected
+
+ +

Definition at line 364 of file formatter.py.

+ +
+
+ +

◆ append_line()

+ +
+
+ + + + + + + + + + + +
None formatron.formatter.FormatterBuilder.append_line ( self,
str line )
+
+ +

Append a line to the format.

+

Specifically, a newline character is appended to the input.

   Note that if you need a literal `$`, you need to escape it by adding a backslash: `\\$`.
+
+

Definition at line 305 of file formatter.py.

+ +
+
+ +

◆ append_multiline_str()

+ +
+
+ + + + + + + + + + + +
None formatron.formatter.FormatterBuilder.append_multiline_str ( self,
str lines )
+
+ +

Appends a multiline string to the format, preserving the first line's leading whitespaces and remove any common leading whitespaces from subsequent lines.

+

Note that tabs and spaces are both treated as whitespace, but they are not equal: the lines " hello" and "\\thello" are considered to have no common leading whitespace.

+

Entirely blank lines are normalized to a newline character.

+

Note that if you need a literal $, you need to escape it by adding a backslash: \\$.

+ +

Definition at line 319 of file formatter.py.

+ +
+
+ +

◆ append_str()

+ +
+
+ + + + + + + + + + + +
None formatron.formatter.FormatterBuilder.append_str ( self,
str string )
+
+ +

Append a string to the format without any post-processing.

+
   Note that if you need a literal `$`, you need to escape it by adding a backslash: `\\$`.
+
+

Definition at line 328 of file formatter.py.

+ +
+
+ +

◆ build()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
Formatter formatron.formatter.FormatterBuilder.build ( self,
kbnf.Vocabulary vocabulary,
typing.Callable[[list[int]], str] decode,
kbnf.Config engine_config = None )
+
+ +

Build a formatter from the builder.

+

The builder will not be consumed and can be used again.

+
Parameters
+ + + + +
vocabularyThe KBNF engine vocabulary for the formatter.
decodeThe callback to decode the token IDs to a string.
engine_configThe KBNF engine configuration.
+
+
+
Returns
The formatter.
+ +

Definition at line 503 of file formatter.py.

+ +
+
+ +

◆ choose()

+ +
+
+ + + + + + + + + + + + + + + + +
ChoiceExtractor formatron.formatter.FormatterBuilder.choose ( self,
*Extractor | str extractors,
str capture_name = None )
+
+ +

Create a choice extractor.

+
   Check out the ChoiceExtractor docs for more details.
+
Parameters
+ + + +
extractorsThe extractors to choose from.
capture_nameThe capture name of the extractor, or None if the extractor does not capture.
+
+
+
Returns
The choice extractor.
+ +

Definition at line 385 of file formatter.py.

+ +
+
+ +

◆ extractor()

+ +
+
+ + + + + + + + + + + +
Extractor formatron.formatter.FormatterBuilder.extractor ( self,
typing.Callable[[str], Extractor] create_extractor )
+
+ +

Create a custom extractor.

+
Parameters
+ + + +
create_extractorcallable with signature (extractor_nonterminal: str)->Extractor that create the extractor. extractor_nonterminal is the auto-generated nonterminal reference for the extractor.
capture_nameThe capture name of the extractor, or None if the extractor does not capture.
+
+
+ +

Definition at line 412 of file formatter.py.

+ +
+
+ +

◆ json()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
JsonExtractor formatron.formatter.FormatterBuilder.json ( self,
typing.Type[Schema]|collections.abc.Sequence schema,
* ,
str capture_name = None )
+
+ +

Create a JSON extractor.

+

Check out the JsonExtractor docs for more details.

+
Parameters
+ + + +
schemaThe schema for extraction.
capture_nameThe capture name of the extractor, or None if the extractor does not capture.
+
+
+
Returns
The JSON extractor.
+ +

Definition at line 424 of file formatter.py.

+ +
+
+ +

◆ regex()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
RegexExtractor formatron.formatter.FormatterBuilder.regex ( self,
str regex,
* ,
str capture_name = None )
+
+ +

Create a regex extractor.

+
   Check out the RegexExtractor docs for more details.
+
Parameters
+ + + +
regexThe regular expression for extraction.
capture_nameThe capture name of the extractor, or None if the extractor does not capture.
+
+
+
Returns
The regex extractor.
+ +

Definition at line 450 of file formatter.py.

+ +
+
+ +

◆ str()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
Extractor formatron.formatter.FormatterBuilder.str ( self,
* ,
typing.Union[str, list[str]] stop = None,
typing.Optional[str] capture_name = None )
+
+ +

Create a string extractor.

+
   The extractor will extract all text until(inclusive) one of the stop strings is encountered.
+
Parameters
+ + + +
stopThe strings for the extractors to stop at. They will be included in text generation and extraction.
capture_nameThe capture name of the extractor, or None if the extractor does not capture.
+
+
+
Returns
The string extractor.
+ +

Definition at line 465 of file formatter.py.

+ +
+
+ +

◆ substr()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Extractor formatron.formatter.FormatterBuilder.substr ( self,
str string,
* ,
str capture_name = None,
bool extract_empty_substring = False )
+
+ +

Create a substring extractor.

+
   The extractor will extract a substring of the input string.
+
Parameters
+ + + + +
stringThe string to extract.
capture_nameThe capture name of the extractor, or None if the extractor does not capture.
extract_empty_substringWhether to extract an empty substring as a valid substring.
+
+
+
Returns
The substring extractor.
+ +

Definition at line 488 of file formatter.py.

+ +
+
+

Member Data Documentation

+ +

◆ _capture_names

+ +
+
+ + + + + +
+ + + + +
formatron.formatter.FormatterBuilder._capture_names
+
+protected
+
+ +

Definition at line 287 of file formatter.py.

+ +
+
+ +

◆ _counter

+ +
+
+ + + + + +
+ + + + +
formatron.formatter.FormatterBuilder._counter
+
+protected
+
+ +

Definition at line 284 of file formatter.py.

+ +
+
+ +

◆ _extractors

+ +
+
+ + + + + +
+ + + + +
formatron.formatter.FormatterBuilder._extractors
+
+protected
+
+ +

Definition at line 289 of file formatter.py.

+ +
+
+ +

◆ _formatter_builder_counter

+ +
+
+ + + + + +
+ + + + +
int formatron.formatter.FormatterBuilder._formatter_builder_counter
+
+staticprotected
+
+ +

Definition at line 278 of file formatter.py.

+ +
+
+ +

◆ _instance_id

+ +
+
+ + + + + +
+ + + + +
formatron.formatter.FormatterBuilder._instance_id
+
+protected
+
+ +

Definition at line 290 of file formatter.py.

+ +
+
+ +

◆ _main_rule

+ +
+
+ + + + + +
+ + + + +
formatron.formatter.FormatterBuilder._main_rule
+
+protected
+
+ +

Definition at line 285 of file formatter.py.

+ +
+
+ +

◆ _nonterminal_to_extractor

+ +
+
+ + + + + +
+ + + + +
formatron.formatter.FormatterBuilder._nonterminal_to_extractor
+
+protected
+
+ +

Definition at line 288 of file formatter.py.

+ +
+
+ +

◆ _rules

+ +
+
+ + + + + +
+ + + + +
formatron.formatter.FormatterBuilder._rules
+
+protected
+
+ +

Definition at line 286 of file formatter.py.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/v0.4.6/classformatron_1_1formatter_1_1FormatterBuilder.js b/v0.4.6/classformatron_1_1formatter_1_1FormatterBuilder.js new file mode 100644 index 00000000..493b78d3 --- /dev/null +++ b/v0.4.6/classformatron_1_1formatter_1_1FormatterBuilder.js @@ -0,0 +1,26 @@ +var classformatron_1_1formatter_1_1FormatterBuilder = +[ + [ "__init__", "classformatron_1_1formatter_1_1FormatterBuilder.html#abb13104747355cae16e6ad0c3067fac8", null ], + [ "_add_capture_name", "classformatron_1_1formatter_1_1FormatterBuilder.html#a1e97daf55b4149be6aaa5dd747ed6146", null ], + [ "_add_extractor", "classformatron_1_1formatter_1_1FormatterBuilder.html#a6e495e90b9da81108b6627166872bbbb", null ], + [ "_assert_capture_name_valid", "classformatron_1_1formatter_1_1FormatterBuilder.html#ab5ad5186f55d35e3abd2d5c213302a25", null ], + [ "_create_nonterminal", "classformatron_1_1formatter_1_1FormatterBuilder.html#aefe18951a4dc243909a22dd49b62fe21", null ], + [ "append_line", "classformatron_1_1formatter_1_1FormatterBuilder.html#aa57e56f8d74b03eb4559106d189970c3", null ], + [ "append_multiline_str", "classformatron_1_1formatter_1_1FormatterBuilder.html#a0e4da27aacaa16880ed463a9f86edff4", null ], + [ "append_str", "classformatron_1_1formatter_1_1FormatterBuilder.html#a171eca2a241aaf0f5f1fa8c117694337", null ], + [ "build", "classformatron_1_1formatter_1_1FormatterBuilder.html#aae2d235fef43c64305c076edbed41da5", null ], + [ "choose", "classformatron_1_1formatter_1_1FormatterBuilder.html#a5594cefa0b28af7f159f374486e51618", null ], + [ "extractor", "classformatron_1_1formatter_1_1FormatterBuilder.html#a8b6c87737912e390a1411d0b85080947", null ], + [ "json", "classformatron_1_1formatter_1_1FormatterBuilder.html#ad2a182c94ddec53d22aefe64f57d6514", null ], + [ "regex", "classformatron_1_1formatter_1_1FormatterBuilder.html#af34f97f7f62d2a1de4f9e863b1834619", null ], + [ "str", "classformatron_1_1formatter_1_1FormatterBuilder.html#ad467a40f82a47dff9bb2b95d1300ace0", null ], + [ "substr", "classformatron_1_1formatter_1_1FormatterBuilder.html#ab98ad2c47fcb7be56521d3eadb4e643b", null ], + [ "_capture_names", "classformatron_1_1formatter_1_1FormatterBuilder.html#a68daf6b6bbd2f32843352dc6ea1f4b8f", null ], + [ "_counter", "classformatron_1_1formatter_1_1FormatterBuilder.html#a937af7ea452c8183053dc3e12cd44e1c", null ], + [ "_extractors", "classformatron_1_1formatter_1_1FormatterBuilder.html#a4c10094d828cde5bf73bbd5d3d11e582", null ], + [ "_formatter_builder_counter", "classformatron_1_1formatter_1_1FormatterBuilder.html#aa8758ea6ca6a84da7583b28522e447a9", null ], + [ "_instance_id", "classformatron_1_1formatter_1_1FormatterBuilder.html#a8a5b16f094013fb3926acfadd30c4456", null ], + [ "_main_rule", "classformatron_1_1formatter_1_1FormatterBuilder.html#a3c3ba1934b9207c412202c5ef29b002a", null ], + [ "_nonterminal_to_extractor", "classformatron_1_1formatter_1_1FormatterBuilder.html#a870a5075cfd903c77e5ee58b6c304e03", null ], + [ "_rules", "classformatron_1_1formatter_1_1FormatterBuilder.html#a62c61ad02e40526b73ca460d0cf1d12c", null ] +]; \ No newline at end of file diff --git a/v0.4.6/classformatron_1_1integrations_1_1RWKV_1_1PIPELINE-members.html b/v0.4.6/classformatron_1_1integrations_1_1RWKV_1_1PIPELINE-members.html new file mode 100644 index 00000000..d8516a74 --- /dev/null +++ b/v0.4.6/classformatron_1_1integrations_1_1RWKV_1_1PIPELINE-members.html @@ -0,0 +1,139 @@ + + + + + + + + +Formatron: Member List + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
formatron.integrations.RWKV.PIPELINE Member List
+
+
+ +

This is the complete list of members for formatron.integrations.RWKV.PIPELINE, including all inherited members.

+ + + + +
__init__(self, model, WORD_NAME, FormatterBuilder formatter_builder=None)formatron.integrations.RWKV.PIPELINE
formatterformatron.integrations.RWKV.PIPELINE
generate(self, ctx, token_count=100, args=PIPELINE_ARGS(), callback=None, state=None)formatron.integrations.RWKV.PIPELINE
+
+ + + + diff --git a/v0.4.6/classformatron_1_1integrations_1_1RWKV_1_1PIPELINE.html b/v0.4.6/classformatron_1_1integrations_1_1RWKV_1_1PIPELINE.html new file mode 100644 index 00000000..db2c63dd --- /dev/null +++ b/v0.4.6/classformatron_1_1integrations_1_1RWKV_1_1PIPELINE.html @@ -0,0 +1,262 @@ + + + + + + + + +Formatron: formatron.integrations.RWKV.PIPELINE Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
formatron.integrations.RWKV.PIPELINE Class Reference
+
+
+ +

A wrapper for the pipeline of RWKV. + More...

+
+Inheritance diagram for formatron.integrations.RWKV.PIPELINE:
+
+
+ +
+ + + + + + +

+Public Member Functions

 __init__ (self, model, WORD_NAME, FormatterBuilder formatter_builder=None)
 
 generate (self, ctx, token_count=100, args=PIPELINE_ARGS(), callback=None, state=None)
 
+ + + +

+Public Attributes

 formatter
 
+

Detailed Description

+

A wrapper for the pipeline of RWKV.

+ +

Definition at line 47 of file RWKV.py.

+

Constructor & Destructor Documentation

+ +

◆ __init__()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
formatron.integrations.RWKV.PIPELINE.__init__ ( self,
model,
WORD_NAME,
FormatterBuilder formatter_builder = None )
+
+ +

Definition at line 49 of file RWKV.py.

+ +
+
+

Member Function Documentation

+ +

◆ generate()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
formatron.integrations.RWKV.PIPELINE.generate ( self,
ctx,
token_count = 100,
args = PIPELINE_ARGS(),
callback = None,
state = None )
+
+ +

Definition at line 58 of file RWKV.py.

+ +
+
+

Member Data Documentation

+ +

◆ formatter

+ +
+
+ + + + +
formatron.integrations.RWKV.PIPELINE.formatter
+
+ +

Definition at line 54 of file RWKV.py.

+ +
+
+
The documentation for this class was generated from the following file:
    +
  • src/formatron/integrations/RWKV.py
  • +
+
+
+ + + + diff --git a/v0.4.6/classformatron_1_1integrations_1_1RWKV_1_1PIPELINE.js b/v0.4.6/classformatron_1_1integrations_1_1RWKV_1_1PIPELINE.js new file mode 100644 index 00000000..53140380 --- /dev/null +++ b/v0.4.6/classformatron_1_1integrations_1_1RWKV_1_1PIPELINE.js @@ -0,0 +1,6 @@ +var classformatron_1_1integrations_1_1RWKV_1_1PIPELINE = +[ + [ "__init__", "classformatron_1_1integrations_1_1RWKV_1_1PIPELINE.html#aa646fb0bf5f3674d1daba91dd0320017", null ], + [ "generate", "classformatron_1_1integrations_1_1RWKV_1_1PIPELINE.html#a96f5091b6a8cc681e698a1a4cecdbd1f", null ], + [ "formatter", "classformatron_1_1integrations_1_1RWKV_1_1PIPELINE.html#a363de79042e852aa9e8388507d29265a", null ] +]; \ No newline at end of file diff --git a/v0.4.6/classformatron_1_1integrations_1_1RWKV_1_1PIPELINE.png b/v0.4.6/classformatron_1_1integrations_1_1RWKV_1_1PIPELINE.png new file mode 100644 index 0000000000000000000000000000000000000000..864725ac07d1a6edacd19f04eb1a5965085da849 GIT binary patch literal 769 zcmeAS@N?(olHy`uVBq!ia0vp^FM&9KgBeJk)>)JTq@)9ULR|m<{|{uoc=NTi|Il&^ z1I+@7>1SR%c<=xyZhAIs2~du+B*-tA0mugfbEer>7#Ns(JY5_^Dj46+y7A#rYsq%mMJ+-a1*1KPwd!1+ApW{_s zKg;B}6>H|rv)k71DqCXGc3)nVSEuqa`x5XP;gl@*^Sth>q0 zusCxf(*dAT27_s0nhZTlUAY*5x``0FKY8X&ktWYeEKy4)nM@N~snWaDE9>})?`y9X zNj%K5*^qzPu+`(%p3}iEBcF#)%baL?NBE|QhrH}tWB30ZA(P&nNVdGBbADp4p>X3C z)5=Se=G{&I?|*Px%iGA)tLHDRK3o?nyM4NA|_w5%$-M3$_N*^y( z{d$^Be@kA*oX781s?>(XbL)7nf9<`bF2?H;=a;p{x~|He%P)wp4xi+=#8t}^7{p$e iB6dxhHS_F({|swgrObQ}-Te(rtPGy6elF{r5}E*tJa7&G literal 0 HcmV?d00001 diff --git a/v0.4.6/classformatron_1_1integrations_1_1RWKV_1_1PIPELINE__ARGS-members.html b/v0.4.6/classformatron_1_1integrations_1_1RWKV_1_1PIPELINE__ARGS-members.html new file mode 100644 index 00000000..1edd95c6 --- /dev/null +++ b/v0.4.6/classformatron_1_1integrations_1_1RWKV_1_1PIPELINE__ARGS-members.html @@ -0,0 +1,138 @@ + + + + + + + + +Formatron: Member List + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
formatron.integrations.RWKV.PIPELINE_ARGS Member List
+
+
+ +

This is the complete list of members for formatron.integrations.RWKV.PIPELINE_ARGS, including all inherited members.

+ + + +
__init__(self, temperature=1.0, top_p=0.2, top_k=0, alpha_frequency=0.2, alpha_presence=0.2, alpha_decay=0.996, token_ban=[], token_stop=[], chunk_len=256, engine_gen_config=EngineGenerationConfig())formatron.integrations.RWKV.PIPELINE_ARGS
engine_gen_configformatron.integrations.RWKV.PIPELINE_ARGS
+
+ + + + diff --git a/v0.4.6/classformatron_1_1integrations_1_1RWKV_1_1PIPELINE__ARGS.html b/v0.4.6/classformatron_1_1integrations_1_1RWKV_1_1PIPELINE__ARGS.html new file mode 100644 index 00000000..03f1a537 --- /dev/null +++ b/v0.4.6/classformatron_1_1integrations_1_1RWKV_1_1PIPELINE__ARGS.html @@ -0,0 +1,251 @@ + + + + + + + + +Formatron: formatron.integrations.RWKV.PIPELINE_ARGS Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
formatron.integrations.RWKV.PIPELINE_ARGS Class Reference
+
+
+ +

A wrapper for the arguments of the pipeline of RWKV. + More...

+
+Inheritance diagram for formatron.integrations.RWKV.PIPELINE_ARGS:
+
+
+ +
+ + + + +

+Public Member Functions

 __init__ (self, temperature=1.0, top_p=0.2, top_k=0, alpha_frequency=0.2, alpha_presence=0.2, alpha_decay=0.996, token_ban=[], token_stop=[], chunk_len=256, engine_gen_config=EngineGenerationConfig())
 
+ + + +

+Public Attributes

 engine_gen_config
 
+

Detailed Description

+

A wrapper for the arguments of the pipeline of RWKV.

+ +

Definition at line 16 of file RWKV.py.

+

Constructor & Destructor Documentation

+ +

◆ __init__()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
formatron.integrations.RWKV.PIPELINE_ARGS.__init__ ( self,
temperature = 1.0,
top_p = 0.2,
top_k = 0,
alpha_frequency = 0.2,
alpha_presence = 0.2,
alpha_decay = 0.996,
token_ban = [],
token_stop = [],
chunk_len = 256,
engine_gen_config = EngineGenerationConfig() )
+
+ +

Definition at line 18 of file RWKV.py.

+ +
+
+

Member Data Documentation

+ +

◆ engine_gen_config

+ +
+
+ + + + +
formatron.integrations.RWKV.PIPELINE_ARGS.engine_gen_config
+
+ +

Definition at line 31 of file RWKV.py.

+ +
+
+
The documentation for this class was generated from the following file:
    +
  • src/formatron/integrations/RWKV.py
  • +
+
+
+ + + + diff --git a/v0.4.6/classformatron_1_1integrations_1_1RWKV_1_1PIPELINE__ARGS.js b/v0.4.6/classformatron_1_1integrations_1_1RWKV_1_1PIPELINE__ARGS.js new file mode 100644 index 00000000..64a7a9af --- /dev/null +++ b/v0.4.6/classformatron_1_1integrations_1_1RWKV_1_1PIPELINE__ARGS.js @@ -0,0 +1,5 @@ +var classformatron_1_1integrations_1_1RWKV_1_1PIPELINE__ARGS = +[ + [ "__init__", "classformatron_1_1integrations_1_1RWKV_1_1PIPELINE__ARGS.html#a53a892118d9b168024aaa6062f92cd7c", null ], + [ "engine_gen_config", "classformatron_1_1integrations_1_1RWKV_1_1PIPELINE__ARGS.html#a8f7501ec93400a3fbeadfd87a8886860", null ] +]; \ No newline at end of file diff --git a/v0.4.6/classformatron_1_1integrations_1_1RWKV_1_1PIPELINE__ARGS.png b/v0.4.6/classformatron_1_1integrations_1_1RWKV_1_1PIPELINE__ARGS.png new file mode 100644 index 0000000000000000000000000000000000000000..6e46fb50b3c2c2e84734a5c69f9cb3634033606e GIT binary patch literal 991 zcmeAS@N?(olHy`uVBq!ia0y~yU=#wf12~w03f*F8(FfeDDeT9L6Im^?rdHdi+j8r_&pVpX@MZ^++Ls1c;Eff<$IT89yc86I{DX5=x5K3 z`*+RcS5C5s)qSEmNxj;WdyVZPWy!#8QGZyb7*E);Do$ah*||+t%f8+EerM`4nXm-D zl(cVq>{^z*o4N1sdZmlKpS30x3d!~@({~gS_by&FHTcYw9;i)A*cGOFFsys|Tzw|PM?aN@JK{QR>=Mp%b5-+53;y9_+wZ=9 zU1BzW2-e=JF1gHjzhYUX!P@BZ*+JFvog(vY9R3!iJaby6-s2C!b-oOxYTDI4nd>fu zX(szT-EfiT8JR!_~P dOAdWy-zDhv&i9|#C16%$@O1TaS?83{1OU%S!BzkO literal 0 HcmV?d00001 diff --git a/v0.4.6/classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter-members.html b/v0.4.6/classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter-members.html new file mode 100644 index 00000000..ac131313 --- /dev/null +++ b/v0.4.6/classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter-members.html @@ -0,0 +1,153 @@ + + + + + + + + +Formatron: Member List + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
formatron.integrations.exllamav2.FormatterFilter Member List
+
+ +
+ + + + diff --git a/v0.4.6/classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html b/v0.4.6/classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html new file mode 100644 index 00000000..861c549c --- /dev/null +++ b/v0.4.6/classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html @@ -0,0 +1,577 @@ + + + + + + + + +Formatron: formatron.integrations.exllamav2.FormatterFilter Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
formatron.integrations.exllamav2.FormatterFilter Class Reference
+
+
+ +

ExLlamaV2Filter that uses a formatter to mask logits. + More...

+
+Inheritance diagram for formatron.integrations.exllamav2.FormatterFilter:
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 __init__ (self, model, tokenizer, FormatterBase formatter, EngineGenerationConfig|None config=None)
 
bool is_completed (self)
 Check if the formatter is completed.
 
"FormatterFilter" clone (self, c=None)
 
None begin (self, str prefix_str)
 
None reset (self)
 
 feed (self, int token)
 
typing.Tuple[typing.Set[int], typing.Set[int]] next_set (self)
 
typing.Tuple[typing.Sequence[int], typing.Sequence[int]] next (self)
 
bool use_background_worker (self)
 
bool can_mask_logits (self)
 
 prepare_logit_mask (self)
 
torch.Tensor mask_logits (self, torch.Tensor logits)
 
+ + + +

+Public Attributes

 eos_logits
 
+ + + + + + + +

+Protected Attributes

 _formatter
 
 _config
 
 _pass_tokens
 
+ + + +

Properties

dict[str, typing.Any] formatter_captures (self)
 
+

Detailed Description

+

ExLlamaV2Filter that uses a formatter to mask logits.

+ +

Definition at line 46 of file exllamav2.py.

+

Constructor & Destructor Documentation

+ +

◆ __init__()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
formatron.integrations.exllamav2.FormatterFilter.__init__ ( self,
model,
tokenizer,
FormatterBase formatter,
EngineGenerationConfig|None config = None )
+
+ +

Definition at line 48 of file exllamav2.py.

+ +
+
+

Member Function Documentation

+ +

◆ begin()

+ +
+
+ + + + + + + + + + + +
None formatron.integrations.exllamav2.FormatterFilter.begin ( self,
str prefix_str )
+
+ +

Definition at line 76 of file exllamav2.py.

+ +
+
+ +

◆ can_mask_logits()

+ +
+
+ + + + + + + +
bool formatron.integrations.exllamav2.FormatterFilter.can_mask_logits ( self)
+
+ +

Definition at line 116 of file exllamav2.py.

+ +
+
+ +

◆ clone()

+ +
+
+ + + + + + + + + + + +
"FormatterFilter" formatron.integrations.exllamav2.FormatterFilter.clone ( self,
c = None )
+
+ +

Definition at line 64 of file exllamav2.py.

+ +
+
+ +

◆ feed()

+ +
+
+ + + + + + + + + + + +
formatron.integrations.exllamav2.FormatterFilter.feed ( self,
int token )
+
+ +

Definition at line 86 of file exllamav2.py.

+ +
+
+ +

◆ formatter_captures()

+ +
+
+ + + + + + + +
dict[str, typing.Any] formatron.integrations.exllamav2.FormatterFilter.formatter_captures ( self)
+
+ +

Definition at line 139 of file exllamav2.py.

+ +
+
+ +

◆ is_completed()

+ +
+
+ + + + + + + +
bool formatron.integrations.exllamav2.FormatterFilter.is_completed ( self)
+
+ +

Check if the formatter is completed.

+ +

Definition at line 61 of file exllamav2.py.

+ +
+
+ +

◆ mask_logits()

+ +
+
+ + + + + + + + + + + +
torch.Tensor formatron.integrations.exllamav2.FormatterFilter.mask_logits ( self,
torch.Tensor logits )
+
+ +

Definition at line 123 of file exllamav2.py.

+ +
+
+ +

◆ next()

+ +
+
+ + + + + + + +
typing.Tuple[typing.Sequence[int], typing.Sequence[int]] formatron.integrations.exllamav2.FormatterFilter.next ( self)
+
+ +

Definition at line 102 of file exllamav2.py.

+ +
+
+ +

◆ next_set()

+ +
+
+ + + + + + + +
typing.Tuple[typing.Set[int], typing.Set[int]] formatron.integrations.exllamav2.FormatterFilter.next_set ( self)
+
+ +

Definition at line 93 of file exllamav2.py.

+ +
+
+ +

◆ prepare_logit_mask()

+ +
+
+ + + + + + + +
formatron.integrations.exllamav2.FormatterFilter.prepare_logit_mask ( self)
+
+ +

Definition at line 119 of file exllamav2.py.

+ +
+
+ +

◆ reset()

+ +
+
+ + + + + + + +
None formatron.integrations.exllamav2.FormatterFilter.reset ( self)
+
+ +

Definition at line 83 of file exllamav2.py.

+ +
+
+ +

◆ use_background_worker()

+ +
+
+ + + + + + + +
bool formatron.integrations.exllamav2.FormatterFilter.use_background_worker ( self)
+
+ +

Definition at line 112 of file exllamav2.py.

+ +
+
+

Member Data Documentation

+ +

◆ _config

+ +
+
+ + + + + +
+ + + + +
formatron.integrations.exllamav2.FormatterFilter._config
+
+protected
+
+ +

Definition at line 54 of file exllamav2.py.

+ +
+
+ +

◆ _formatter

+ +
+
+ + + + + +
+ + + + +
formatron.integrations.exllamav2.FormatterFilter._formatter
+
+protected
+
+ +

Definition at line 51 of file exllamav2.py.

+ +
+
+ +

◆ _pass_tokens

+ +
+
+ + + + + +
+ + + + +
formatron.integrations.exllamav2.FormatterFilter._pass_tokens
+
+protected
+
+ +

Definition at line 55 of file exllamav2.py.

+ +
+
+ +

◆ eos_logits

+ +
+
+ + + + +
formatron.integrations.exllamav2.FormatterFilter.eos_logits
+
+ +

Definition at line 56 of file exllamav2.py.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/v0.4.6/classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.js b/v0.4.6/classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.js new file mode 100644 index 00000000..7a1f0335 --- /dev/null +++ b/v0.4.6/classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.js @@ -0,0 +1,20 @@ +var classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter = +[ + [ "__init__", "classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#adc94d2f2ddd06f966dca93079f17df8c", null ], + [ "begin", "classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#a31967e1c243ae325d5bf288c73e6635e", null ], + [ "can_mask_logits", "classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#ad1269fb97cabd3381473bbd15ee59324", null ], + [ "clone", "classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#a6ea0f3a9197afc9dd2b5b808fac2f157", null ], + [ "feed", "classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#a6896753ca9ce0cdb5cf998edd379123e", null ], + [ "formatter_captures", "classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#ac1b4fa75c9e9009bd9990686efe1c2f5", null ], + [ "is_completed", "classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#adadb3652b5250cf08dfe7cc8824e2ec0", null ], + [ "mask_logits", "classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#a7a0e2e459eccf822cf79457a121a3a74", null ], + [ "next", "classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#aaf7f64e93e611f4fc0ca9b7c2196c2f2", null ], + [ "next_set", "classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#ac6f22aff80d80035bdd2118feff9f965", null ], + [ "prepare_logit_mask", "classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#aeb7f169a9c36b793867682069f00e928", null ], + [ "reset", "classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#a984bc61ef20d16e88ffb40aa2f5afcc3", null ], + [ "use_background_worker", "classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#a9aa83a5922cefce88197d2cc3822a0c6", null ], + [ "_config", "classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#ae43a79de8cc0fb018df02e7edab028ee", null ], + [ "_formatter", "classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#a568277b00bef848b3fccbfa7030c435f", null ], + [ "_pass_tokens", "classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#a370eaf641dd803b2759b4e5fc7f74a1c", null ], + [ "eos_logits", "classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#a16819bffd3e4b1bb48e05ac7f696592a", null ] +]; \ No newline at end of file diff --git a/v0.4.6/classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.png b/v0.4.6/classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.png new file mode 100644 index 0000000000000000000000000000000000000000..82f37a48699011fa5f270dc089432318122d2e43 GIT binary patch literal 938 zcmeAS@N?(olHy`uVBq!ia0y~yV3Y!~12~w03f*F8(FfeDDeT9L6+0@g;F{Fa=?cCEvuPu03 zrDxCi{6F5NPq$NF<620sjrsO~z~jq)7+hgGs4FPw>T-lf(X&;hcZ!s!m!|2YDM48( znoF;E1fBYu6?gSt2Cw`ilaH@{{`)^`tG~UT=PwTV0Oggj*RR^_6_mlooY#%wYIY{DVn@A^bJ%AmQFO#vvnWQtV7lpy8_L0ObY{?jpq1b5=?*4+LnQn&pyO}EVr%F3}` zdgVr$SFo_XwblDvTl;k%UhMfLrpH?=qxd#D`$pNJT~F*@@5tf5zVKPBPPp9bxl*_H z9TGLY&#c#0x9Hj3_iwY}Zkhkw_;;_`o;&+k-rwK1Urs+ae{17;nLBNz-*5ZBxqSQd zz55UBmdoE_pJX9<-GaNmFk%+q}=k?wMT#ck|@~z zJX?Afn~}y#`+AQ3vv0e;FWB98uGsW%kKW^B`?ePM{(tj*cmLOo)8ze_B`2kxSU&l~ z^Y)C**Uoik^<|ZMp0(PgJ7I;i*UKeoGq1nhu;$l(&i$_CpRVmXmz_1qred<`wq(^< zT}|nm_vR?Qkbf|D)>6Z(1?{&@^~#%P?Ys78&#gB_8i&)fo-O$~J?q}vuQ9%>F9y54 zbH7mKx8`W6)xuw_zmk{V4>6}POAv}QNm_V<3#?L*uCGUf#t zhce&(S9)ivX>`%8Z~0G;@uuG1KQk!#w&v1f+k(A%bC-jnpmIfLhlY}p+CRqC;^Buo T?k|`G%vB7Yu6{1-oD!M + + + + + + + +Formatron: Member List + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ + + + + + diff --git a/v0.4.6/classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html b/v0.4.6/classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html new file mode 100644 index 00000000..bfecc442 --- /dev/null +++ b/v0.4.6/classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html @@ -0,0 +1,402 @@ + + + + + + + + +Formatron: formatron.integrations.transformers.FormattersLogitsProcessor Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
formatron.integrations.transformers.FormattersLogitsProcessor Class Reference
+
+
+ +

Logit processor that uses formatters to mask batch logits. + More...

+
+Inheritance diagram for formatron.integrations.transformers.FormattersLogitsProcessor:
+
+
+ +
+ + + + + + + + + + + +

+Public Member Functions

 __init__ (self, typing.Sequence[FormatterBase|None] formatters, int eos_token_id, typing.Sequence[EngineGenerationConfig]|None configs=None)
 
None reset (self)
 
list[bool|None] is_completed (self)
 Check if the formatters are completed.
 
 __call__ (self, input_ids, scores)
 
+ + + +

+Public Attributes

 configs
 
+ + + + + + + +

+Protected Attributes

 _formatters
 
 _eos_token_id
 
 _last_input_id_length
 
+ + + + +

Properties

list[dict[str, typing.Any]|None] formatters_captures (self)
 Get the captures of the formatters.
 
+

Detailed Description

+

Logit processor that uses formatters to mask batch logits.

+ +

Definition at line 54 of file transformers.py.

+

Constructor & Destructor Documentation

+ +

◆ __init__()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
formatron.integrations.transformers.FormattersLogitsProcessor.__init__ ( self,
typing.Sequence[FormatterBase | None] formatters,
int eos_token_id,
typing.Sequence[EngineGenerationConfig] | None configs = None )
+
+ +

Definition at line 56 of file transformers.py.

+ +
+
+

Member Function Documentation

+ +

◆ __call__()

+ +
+
+ + + + + + + + + + + + + + + + +
formatron.integrations.transformers.FormattersLogitsProcessor.__call__ ( self,
input_ids,
scores )
+
+ +

Definition at line 99 of file transformers.py.

+ +
+
+ +

◆ formatters_captures()

+ +
+
+ + + + + + + +
list[dict[str, typing.Any] | None] formatron.integrations.transformers.FormattersLogitsProcessor.formatters_captures ( self)
+
+ +

Get the captures of the formatters.

+

Each element in the list corresponds to the captures of the formatter at the same index. If the formatter is None, the element is None.

+ +

Definition at line 86 of file transformers.py.

+ +
+
+ +

◆ is_completed()

+ +
+
+ + + + + + + +
list[bool | None] formatron.integrations.transformers.FormattersLogitsProcessor.is_completed ( self)
+
+ +

Check if the formatters are completed.

+

Each boolean in the list corresponds to the completion status of the formatter at the same index. If the formatter is None, the element is None.

+ +

Definition at line 96 of file transformers.py.

+ +
+
+ +

◆ reset()

+ +
+
+ + + + + + + +
None formatron.integrations.transformers.FormattersLogitsProcessor.reset ( self)
+
+ +

Definition at line 67 of file transformers.py.

+ +
+
+

Member Data Documentation

+ +

◆ _eos_token_id

+ +
+
+ + + + + +
+ + + + +
formatron.integrations.transformers.FormattersLogitsProcessor._eos_token_id
+
+protected
+
+ +

Definition at line 59 of file transformers.py.

+ +
+
+ +

◆ _formatters

+ +
+
+ + + + + +
+ + + + +
formatron.integrations.transformers.FormattersLogitsProcessor._formatters
+
+protected
+
+ +

Definition at line 58 of file transformers.py.

+ +
+
+ +

◆ _last_input_id_length

+ +
+
+ + + + + +
+ + + + +
formatron.integrations.transformers.FormattersLogitsProcessor._last_input_id_length
+
+protected
+
+ +

Definition at line 60 of file transformers.py.

+ +
+
+ +

◆ configs

+ +
+
+ + + + +
formatron.integrations.transformers.FormattersLogitsProcessor.configs
+
+ +

Definition at line 65 of file transformers.py.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/v0.4.6/classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.js b/v0.4.6/classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.js new file mode 100644 index 00000000..a359561c --- /dev/null +++ b/v0.4.6/classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.js @@ -0,0 +1,12 @@ +var classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor = +[ + [ "__init__", "classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html#aa70d2276eeb09fdf53066e4019df79df", null ], + [ "__call__", "classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html#af5ec5643f3c51046cb3b5e73fbb04f2b", null ], + [ "formatters_captures", "classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html#a148e8818c8d198d37e167d7030fa5746", null ], + [ "is_completed", "classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html#a0bf8e8613df954fcad9fb5368d0f7025", null ], + [ "reset", "classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html#a966da36a950eaef6898bcd5ec5841df4", null ], + [ "_eos_token_id", "classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html#a7731ed1ab6807c0de6c29ebfefd6975f", null ], + [ "_formatters", "classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html#a50a0787df5f246965db8481f0700d0b4", null ], + [ "_last_input_id_length", "classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html#a24c02e28fdbae4450af7527f93400fa7", null ], + [ "configs", "classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html#a598fc8c32fb2670796d4ae2186f8a134", null ] +]; \ No newline at end of file diff --git a/v0.4.6/classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.png b/v0.4.6/classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.png new file mode 100644 index 0000000000000000000000000000000000000000..b165f6b4d2130694cc0b9db69d701779e82c38a9 GIT binary patch literal 1044 zcmeAS@N?(olHy`uVBq!ia0y~yV9W)w12~w0WxV;onKO(Mo@^?W)`_!K_Hx`-dFgsX z%~Su7nP-*Zh0{a_tyN= zTp!(@In83>+q18i-8k`ScWA!(-ubJ(-kYJKo{)9h1poOyZ?lz2~C>Q{QT+LzPH_bd?ytfOnp0r_ghJThkeSV zJ0MFmPfmWqawcWAN_N^jY0rOCDs%m(v3Pv4H~x6iQ z4ZI9-KxH44a+n*$fr|EU+-7*-3RD6N8)_-}7;-x;t#Rf|W&=+ym6v6Qwy9JKZc{zk zy+PL#Xt(DlrQ6$z-#)$-Q!Mo`v@)pv-dA_)q}t!!mu6f{acf=qr}xGr6NQ`mxIUf} z2;Zifc_8vFfB5%jKKHlBPSdZiTU)(-uieJCJ8yownN%;nZu-)k+?nQgq9)$TQJl8T zwg0`hT+;h}?2@hL1&;@N%krn43k&u&`+A;zZ^Y5>DXZANp6auIYRZ4%-PXtx=u4Yq71I1xcD7Fu$ZX-;rK?`vytnx3!@9KHo1^u=ZBwzn)NA%C z;OgupZCM-CTIbx__o6;+w_Wewy|MpZ%YKy3nO^zZ=GKRgbJThQkFL+@FFG4}@7;}k zCvMx`{waEE&fce6W46AOx%js>WY5{+{=d3c%kCdvedzhVr;hSIYtN}nopAZ;l*wn^ z?NghRL^D%!)lQy$HUHBrc8y%`OX)jxH>m9Vcro-&%I;filfHP^?d#h8?OR!k%FBZ_ zRifr;Lcqv;ntx-Oiatt&?#Y=wlQk{v`)7XB-2D@pv^hQl^Dl#^tDnm{r-UW|@K^wJ literal 0 HcmV?d00001 diff --git a/v0.4.6/classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor-members.html b/v0.4.6/classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor-members.html new file mode 100644 index 00000000..f396d168 --- /dev/null +++ b/v0.4.6/classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor-members.html @@ -0,0 +1,148 @@ + + + + + + + + +Formatron: Member List + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ + + + + + diff --git a/v0.4.6/classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html b/v0.4.6/classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html new file mode 100644 index 00000000..75dca303 --- /dev/null +++ b/v0.4.6/classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html @@ -0,0 +1,486 @@ + + + + + + + + +Formatron: formatron.integrations.vllm.FormattersLogitsProcessor Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
formatron.integrations.vllm.FormattersLogitsProcessor Class Reference
+
+
+ +

Logit processor that uses formatters to mask batch logits. + More...

+ + + + + + + + + + + +

+Public Member Functions

 __init__ (self, typing.Sequence[FormatterBase|None] formatters, int eos_token_id, typing.Sequence[EngineGenerationConfig]|None configs=None)
 
list[bool|None] is_completed (self)
 Check if the formatters are completed.
 
None reset (self)
 
 __call__ (self, prompt, generated_tokens, logits)
 
+ + + +

+Protected Member Functions

 _to_next_batch_step (self)
 
+ + + + + + + + + + + + + +

+Protected Attributes

 _formatters
 
 _eos_token_id
 
 _last_input_id_length
 
 _configs
 
 _iter
 
 _debug_counter
 
+ + + +

Properties

list[dict[str, typing.Any]|None] formatters_captures (self)
 
+

Detailed Description

+

Logit processor that uses formatters to mask batch logits.

+ +

Definition at line 19 of file vllm.py.

+

Constructor & Destructor Documentation

+ +

◆ __init__()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
formatron.integrations.vllm.FormattersLogitsProcessor.__init__ ( self,
typing.Sequence[FormatterBase | None] formatters,
int eos_token_id,
typing.Sequence[EngineGenerationConfig] | None configs = None )
+
+ +

Definition at line 21 of file vllm.py.

+ +
+
+

Member Function Documentation

+ +

◆ __call__()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
formatron.integrations.vllm.FormattersLogitsProcessor.__call__ ( self,
prompt,
generated_tokens,
logits )
+
+ +

Definition at line 65 of file vllm.py.

+ +
+
+ +

◆ _to_next_batch_step()

+ +
+
+ + + + + +
+ + + + + + + +
formatron.integrations.vllm.FormattersLogitsProcessor._to_next_batch_step ( self)
+
+protected
+
+ +

Definition at line 61 of file vllm.py.

+ +
+
+ +

◆ formatters_captures()

+ +
+
+ + + + + + + +
list[dict[str, typing.Any] | None] formatron.integrations.vllm.FormattersLogitsProcessor.formatters_captures ( self)
+
+ +

Definition at line 42 of file vllm.py.

+ +
+
+ +

◆ is_completed()

+ +
+
+ + + + + + + +
list[bool | None] formatron.integrations.vllm.FormattersLogitsProcessor.is_completed ( self)
+
+ +

Check if the formatters are completed.

+

Each boolean in the list corresponds to the completion status of the formatter at the same index.

+ +

Definition at line 51 of file vllm.py.

+ +
+
+ +

◆ reset()

+ +
+
+ + + + + + + +
None formatron.integrations.vllm.FormattersLogitsProcessor.reset ( self)
+
+ +

Definition at line 54 of file vllm.py.

+ +
+
+

Member Data Documentation

+ +

◆ _configs

+ +
+
+ + + + + +
+ + + + +
formatron.integrations.vllm.FormattersLogitsProcessor._configs
+
+protected
+
+ +

Definition at line 30 of file vllm.py.

+ +
+
+ +

◆ _debug_counter

+ +
+
+ + + + + +
+ + + + +
formatron.integrations.vllm.FormattersLogitsProcessor._debug_counter
+
+protected
+
+ +

Definition at line 32 of file vllm.py.

+ +
+
+ +

◆ _eos_token_id

+ +
+
+ + + + + +
+ + + + +
formatron.integrations.vllm.FormattersLogitsProcessor._eos_token_id
+
+protected
+
+ +

Definition at line 24 of file vllm.py.

+ +
+
+ +

◆ _formatters

+ +
+
+ + + + + +
+ + + + +
formatron.integrations.vllm.FormattersLogitsProcessor._formatters
+
+protected
+
+ +

Definition at line 23 of file vllm.py.

+ +
+
+ +

◆ _iter

+ +
+
+ + + + + +
+ + + + +
formatron.integrations.vllm.FormattersLogitsProcessor._iter
+
+protected
+
+ +

Definition at line 31 of file vllm.py.

+ +
+
+ +

◆ _last_input_id_length

+ +
+
+ + + + + +
+ + + + +
formatron.integrations.vllm.FormattersLogitsProcessor._last_input_id_length
+
+protected
+
+ +

Definition at line 25 of file vllm.py.

+ +
+
+
The documentation for this class was generated from the following file:
    +
  • src/formatron/integrations/vllm.py
  • +
+
+
+ + + + diff --git a/v0.4.6/classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.js b/v0.4.6/classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.js new file mode 100644 index 00000000..66f4dc66 --- /dev/null +++ b/v0.4.6/classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.js @@ -0,0 +1,15 @@ +var classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor = +[ + [ "__init__", "classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html#a0ee5e6edc8fc11dfd7406c140c13b7b9", null ], + [ "__call__", "classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html#ad4a81bb45d259bb5408433cdb6cbafdd", null ], + [ "_to_next_batch_step", "classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html#ab87fea11f930a33130cecadd8cdf0cc6", null ], + [ "formatters_captures", "classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html#ae1387d693b21b6c34f7912a3bf7d182d", null ], + [ "is_completed", "classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html#ad6930fba60b378039db9698d811cb82a", null ], + [ "reset", "classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html#a697bbd642308e22804f46729935e101b", null ], + [ "_configs", "classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html#aef140b4278cf9892faa3644bd4c2ca99", null ], + [ "_debug_counter", "classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html#a83ec1613155b800bd9d1b0f012dff371", null ], + [ "_eos_token_id", "classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html#a9c18332e5d1133b7524a8dde402f2677", null ], + [ "_formatters", "classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html#ab9ca25ee76354b711cb5dd892eb5ab0f", null ], + [ "_iter", "classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html#ad7cf01b455ab6847df5c96912a5d2ae9", null ], + [ "_last_input_id_length", "classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html#aa6549c4f4130d1778f69e3e99942a87b", null ] +]; \ No newline at end of file diff --git a/v0.4.6/classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo-members.html b/v0.4.6/classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo-members.html new file mode 100644 index 00000000..06dd6919 --- /dev/null +++ b/v0.4.6/classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo-members.html @@ -0,0 +1,140 @@ + + + + + + + + +Formatron: Member List + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
formatron.schemas.dict_inference.FieldInfo Member List
+
+ +
+ + + + diff --git a/v0.4.6/classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo.html b/v0.4.6/classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo.html new file mode 100644 index 00000000..dca9c90e --- /dev/null +++ b/v0.4.6/classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo.html @@ -0,0 +1,278 @@ + + + + + + + + +Formatron: formatron.schemas.dict_inference.FieldInfo Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
formatron.schemas.dict_inference.FieldInfo Class Reference
+
+
+
+Inheritance diagram for formatron.schemas.dict_inference.FieldInfo:
+
+
+ + +formatron.schemas.schema.FieldInfo + +
+ + + + + + +

+Public Member Functions

 __init__ (self, typing.Type annotation)
 Initialize the field information.
 
- Public Member Functions inherited from formatron.schemas.schema.FieldInfo
+ + + +

+Protected Attributes

 _annotation
 
+ + + + + + + +

Properties

typing.Type[typing.Any]|None annotation (self)
 Get the type annotation of the field.
 
bool required (self)
 Check if the field is required for the schema.
 
+

Detailed Description

+
+

Definition at line 14 of file dict_inference.py.

+

Constructor & Destructor Documentation

+ +

◆ __init__()

+ +
+
+ + + + + + + + + + + +
formatron.schemas.dict_inference.FieldInfo.__init__ ( self,
typing.Type annotation )
+
+ +

Initialize the field information.

+
Parameters
+ + +
annotationThe type annotation of the field.
+
+
+ +

Definition at line 23 of file dict_inference.py.

+ +
+
+

Member Function Documentation

+ +

◆ annotation()

+ +
+
+ + + + + + + +
typing.Type[typing.Any] | None formatron.schemas.dict_inference.FieldInfo.annotation ( self)
+
+ +

Get the type annotation of the field.

+ +

Reimplemented from formatron.schemas.schema.FieldInfo.

+ +

Definition at line 37 of file dict_inference.py.

+ +
+
+ +

◆ required()

+ +
+
+ + + + + + + +
bool formatron.schemas.dict_inference.FieldInfo.required ( self)
+
+ +

Check if the field is required for the schema.

+ +

Reimplemented from formatron.schemas.schema.FieldInfo.

+ +

Definition at line 53 of file dict_inference.py.

+ +
+
+

Member Data Documentation

+ +

◆ _annotation

+ +
+
+ + + + + +
+ + + + +
formatron.schemas.dict_inference.FieldInfo._annotation
+
+protected
+
+ +

Definition at line 24 of file dict_inference.py.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/v0.4.6/classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo.js b/v0.4.6/classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo.js new file mode 100644 index 00000000..7016c39e --- /dev/null +++ b/v0.4.6/classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo.js @@ -0,0 +1,7 @@ +var classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo = +[ + [ "__init__", "classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo.html#a0286ba9c9e6509ce23d530409209b5da", null ], + [ "annotation", "classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo.html#a163fde7bbaa2e613b5af3a4a12b9152d", null ], + [ "required", "classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo.html#acd5625095baa17d3cf8f2b9562be0e06", null ], + [ "_annotation", "classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo.html#af85ec1a61b7ef87729757cef077c4df4", null ] +]; \ No newline at end of file diff --git a/v0.4.6/classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo.png b/v0.4.6/classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo.png new file mode 100644 index 0000000000000000000000000000000000000000..0a6246c8caff243d752e14915c8bde8d92366999 GIT binary patch literal 1005 zcmeAS@N?(olHy`uVBq!ia0y~yU}OZcJ2;qu8Vsf*QyFr*l5}N2)^A0>Vv~GIIxrRZ_oq_2^ivj}^L3H0CA#z%3 z7ALpy=OavDbuW;_{?|ZV)2b@+HPt4Y%|rXChJM8yrXi$Mr+m0#*>XRcTQg{6)?~I zz3#MM{3CqR&ge8u@zIXG*6=(5hr<-h3ulzdTuv&U= zYr~fXhK(_Y^k$}|%=r;qaPGv_hHJZ84;RfwlJcS+@CGuNGen^wCuPe0Fc`gVSd$*Y_T{81-IpLw?0po9e%UjLSngbKabKziP65 zq-FBioYyZbbLMqToSE-`tMl0YzEjp8*B_c{DSEkpH+9wj@X)Q74y<0!n7a9<=Y*_% zHeA>DRaBIWV#f4jHSreis|eLi;2Mn^BPi??#Vj5=s}hP`v-f@p6|}W5^p-} z6&BrlId=u){;PMpYUN*aeV@zXmUZv&Rl9<3A~CO-kFzX!zl&*IZb*6M?IpV^OBH|t z{q{Xmt#^c$*0P6EUJpO$z1Wk*q`A~&X^mjx+DcE&B~vcRHc5eU4JhMGWe~i0=9B!! X+qv^{Rp*rhGbV$ltDnm{r-UW|_Sd*A literal 0 HcmV?d00001 diff --git a/v0.4.6/classformatron_1_1schemas_1_1json__schema_1_1FieldInfo-members.html b/v0.4.6/classformatron_1_1schemas_1_1json__schema_1_1FieldInfo-members.html new file mode 100644 index 00000000..764e7d92 --- /dev/null +++ b/v0.4.6/classformatron_1_1schemas_1_1json__schema_1_1FieldInfo-members.html @@ -0,0 +1,141 @@ + + + + + + + + +Formatron: Member List + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
formatron.schemas.json_schema.FieldInfo Member List
+
+ +
+ + + + diff --git a/v0.4.6/classformatron_1_1schemas_1_1json__schema_1_1FieldInfo.html b/v0.4.6/classformatron_1_1schemas_1_1json__schema_1_1FieldInfo.html new file mode 100644 index 00000000..44035727 --- /dev/null +++ b/v0.4.6/classformatron_1_1schemas_1_1json__schema_1_1FieldInfo.html @@ -0,0 +1,309 @@ + + + + + + + + +Formatron: formatron.schemas.json_schema.FieldInfo Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
formatron.schemas.json_schema.FieldInfo Class Reference
+
+
+
+Inheritance diagram for formatron.schemas.json_schema.FieldInfo:
+
+
+ + +formatron.schemas.schema.FieldInfo + +
+ + + + + + +

+Public Member Functions

 __init__ (self, typing.Type annotation, bool required)
 Initialize the field information.
 
- Public Member Functions inherited from formatron.schemas.schema.FieldInfo
+ + + + + +

+Protected Attributes

 _annotation
 
 _required
 
+ + + + + + + +

Properties

typing.Type[typing.Any]|None annotation (self)
 Get the type annotation of the field.
 
bool required (self)
 Check if the field is required for the schema.
 
+

Detailed Description

+
+

Definition at line 18 of file json_schema.py.

+

Constructor & Destructor Documentation

+ +

◆ __init__()

+ +
+
+ + + + + + + + + + + + + + + + +
formatron.schemas.json_schema.FieldInfo.__init__ ( self,
typing.Type annotation,
bool required )
+
+ +

Initialize the field information.

+
Parameters
+ + +
annotationThe type annotation of the field.
+
+
+ +

Definition at line 27 of file json_schema.py.

+ +
+
+

Member Function Documentation

+ +

◆ annotation()

+ +
+
+ + + + + + + +
typing.Type[typing.Any] | None formatron.schemas.json_schema.FieldInfo.annotation ( self)
+
+ +

Get the type annotation of the field.

+ +

Reimplemented from formatron.schemas.schema.FieldInfo.

+ +

Definition at line 42 of file json_schema.py.

+ +
+
+ +

◆ required()

+ +
+
+ + + + + + + +
bool formatron.schemas.json_schema.FieldInfo.required ( self)
+
+ +

Check if the field is required for the schema.

+ +

Reimplemented from formatron.schemas.schema.FieldInfo.

+ +

Definition at line 58 of file json_schema.py.

+ +
+
+

Member Data Documentation

+ +

◆ _annotation

+ +
+
+ + + + + +
+ + + + +
formatron.schemas.json_schema.FieldInfo._annotation
+
+protected
+
+ +

Definition at line 28 of file json_schema.py.

+ +
+
+ +

◆ _required

+ +
+
+ + + + + +
+ + + + +
formatron.schemas.json_schema.FieldInfo._required
+
+protected
+
+ +

Definition at line 29 of file json_schema.py.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/v0.4.6/classformatron_1_1schemas_1_1json__schema_1_1FieldInfo.js b/v0.4.6/classformatron_1_1schemas_1_1json__schema_1_1FieldInfo.js new file mode 100644 index 00000000..28abc237 --- /dev/null +++ b/v0.4.6/classformatron_1_1schemas_1_1json__schema_1_1FieldInfo.js @@ -0,0 +1,8 @@ +var classformatron_1_1schemas_1_1json__schema_1_1FieldInfo = +[ + [ "__init__", "classformatron_1_1schemas_1_1json__schema_1_1FieldInfo.html#abc61867418b7f30a3545e71c9b28e708", null ], + [ "annotation", "classformatron_1_1schemas_1_1json__schema_1_1FieldInfo.html#a28f43dedc0eaf02cd16423172440208a", null ], + [ "required", "classformatron_1_1schemas_1_1json__schema_1_1FieldInfo.html#af25ae318725070cd198febebe07e5efa", null ], + [ "_annotation", "classformatron_1_1schemas_1_1json__schema_1_1FieldInfo.html#a82c87a6773b72ee766add0dc893482b0", null ], + [ "_required", "classformatron_1_1schemas_1_1json__schema_1_1FieldInfo.html#a8ac1acf32bb578e121ef28a433857726", null ] +]; \ No newline at end of file diff --git a/v0.4.6/classformatron_1_1schemas_1_1json__schema_1_1FieldInfo.png b/v0.4.6/classformatron_1_1schemas_1_1json__schema_1_1FieldInfo.png new file mode 100644 index 0000000000000000000000000000000000000000..ffe16ee89f7c8c9d428e4312af880f54b53aa19a GIT binary patch literal 1037 zcmeAS@N?(olHy`uVBq!ia0vp^KY_S|gBeH)z2AEbNJ$6ygt-3y{~ySF@#br3|Doj; z2ATyD)6cwk@ZbSZ-1KbN5}+JsNswPK1CS2}=1jA%FfcIB@N{tusbG9N_vWNeRy-}Y zy+kklw*Q#;sG@iCUt^W!8N8PtNUVH&zI%r&hhhMiW9ZZXzjdolsj7#EKE1T|$>D`b z&tr0ny+glVu9{;9>G z4!wF|^s{L1{yv+c-V@o6^zGhi?^-%X_}*vHpW)ZO{S3YSZO_rqi)y~U-?{45e>b>o zlP0fTRn$4lrbR%4m7)J7E5npUs`Yy#E@qy*|6s|BJx}6pGdB48@iD{{6)`-RG?|%U z`WzXC9Z#Mx98gtfXV9~>WGFa!lCi-XUCF!aCceT;4LUmnPMvgh0cucEin*o2@92^e z{QG_!ukgfI|1C7n)R#WFl=bVIEE{k@fWr9%3?lV z`IY&saN3e(_V!oRzAlULST*C6N^&-5FB@-jhsWx@w(DimuiLbL3ACMd)UWya-={0h zch0*q(L79Zv*C>!zk{DVt}MI1b@M8@u*^nf{^P>y`iSZ}0AV*>Sy=<$L!t@6ycbf6#WTD<-Aln$w?iwiy!GW`h*h{X&K z4EHiL1Z{b;UR>Ks_owt6k-5|FWLqON^TU1Q{{#j-08(j`d@9- zN#C^o_vzsLOX_R?u8S;ta@GMDz$ZMNKYg^>{r*;A^z1UG$BV;1MeWa?_H!QpqOi5y zPnK5ooP3=4X4%ZiQj-s6%1?^l_~zT5zF(?874o;Zzvh*i!NYfI#-B;4^|!W{|L;HP zp1Ak$M_c(dPc%;(fB!RM&y{cQLY97tn0{lM!n$9pyTg5gUXHycKU%vjT3P zJ(G9EcyV9d`Lk!GtKX~&kDS8^yC ays}S{N^+Cov*QG2Tn0~9KbLh*2~7Yty9pft literal 0 HcmV?d00001 diff --git a/v0.4.6/classformatron_1_1schemas_1_1pydantic_1_1ClassSchema-members.html b/v0.4.6/classformatron_1_1schemas_1_1pydantic_1_1ClassSchema-members.html new file mode 100644 index 00000000..954d8fcc --- /dev/null +++ b/v0.4.6/classformatron_1_1schemas_1_1pydantic_1_1ClassSchema-members.html @@ -0,0 +1,138 @@ + + + + + + + + +Formatron: Member List + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
formatron.schemas.pydantic.ClassSchema Member List
+
+
+ +

This is the complete list of members for formatron.schemas.pydantic.ClassSchema, including all inherited members.

+ + + +
fields(cls)formatron.schemas.pydantic.ClassSchema
from_json(cls, str _json)formatron.schemas.pydantic.ClassSchema
+
+ + + + diff --git a/v0.4.6/classformatron_1_1schemas_1_1pydantic_1_1ClassSchema.html b/v0.4.6/classformatron_1_1schemas_1_1pydantic_1_1ClassSchema.html new file mode 100644 index 00000000..a272f9d3 --- /dev/null +++ b/v0.4.6/classformatron_1_1schemas_1_1pydantic_1_1ClassSchema.html @@ -0,0 +1,219 @@ + + + + + + + + +Formatron: formatron.schemas.pydantic.ClassSchema Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
formatron.schemas.pydantic.ClassSchema Class Reference
+
+
+ +

A wrapper for pydantic BaseModel that implements the Schema interface. + More...

+
+Inheritance diagram for formatron.schemas.pydantic.ClassSchema:
+
+
+ + +formatron.schemas.schema.Schema + +
+ + + + + + + + +

Class Methods

typing.Dict[str, typing.Any] fields (cls)
 Get the fields of the schema.
 
"ClassSchema" from_json (cls, str _json)
 Create a ClassSchema from a JSON string.
 
+ + +

+Additional Inherited Members

- Public Member Functions inherited from formatron.schemas.schema.Schema
+

Detailed Description

+

A wrapper for pydantic BaseModel that implements the Schema interface.

+ +

Definition at line 72 of file pydantic.py.

+

Member Function Documentation

+ +

◆ fields()

+ +
+
+ + + + + + + +
typing.Dict[str, typing.Any] formatron.schemas.pydantic.ClassSchema.fields ( cls)
+
+ +

Get the fields of the schema.

+ +

Reimplemented from formatron.schemas.schema.Schema.

+ +

Definition at line 83 of file pydantic.py.

+ +
+
+ +

◆ from_json()

+ +
+
+ + + + + + + + + + + +
"ClassSchema" formatron.schemas.pydantic.ClassSchema.from_json ( cls,
str _json )
+
+ +

Create a ClassSchema from a JSON string.

+ +

Reimplemented from formatron.schemas.schema.Schema.

+ +

Definition at line 102 of file pydantic.py.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/v0.4.6/classformatron_1_1schemas_1_1pydantic_1_1ClassSchema.js b/v0.4.6/classformatron_1_1schemas_1_1pydantic_1_1ClassSchema.js new file mode 100644 index 00000000..a1fcef58 --- /dev/null +++ b/v0.4.6/classformatron_1_1schemas_1_1pydantic_1_1ClassSchema.js @@ -0,0 +1,5 @@ +var classformatron_1_1schemas_1_1pydantic_1_1ClassSchema = +[ + [ "fields", "classformatron_1_1schemas_1_1pydantic_1_1ClassSchema.html#add30bb5902bbfd8ff4fa17f197994442", null ], + [ "from_json", "classformatron_1_1schemas_1_1pydantic_1_1ClassSchema.html#aec269b72011e216e8f5fefdfa338253a", null ] +]; \ No newline at end of file diff --git a/v0.4.6/classformatron_1_1schemas_1_1pydantic_1_1ClassSchema.png b/v0.4.6/classformatron_1_1schemas_1_1pydantic_1_1ClassSchema.png new file mode 100644 index 0000000000000000000000000000000000000000..6312323486b82ac9c18d4742f8007918b5dd0b5a GIT binary patch literal 1502 zcmbu9X;9Ng6u>usNE=BJPzea4Oo$aE2p!IV#-Kro9AcmltRU(rM+Fp!fJFFPtpu^4 zHYi9cR1%JW2n>g{fGHpp330S)K(2sXLPEL1VU+X__Jh+p(+}Mb``+7qv-{rL-`f-~ z&%K%&1{weWO`0o}4giFxfQ?Z@=KNQAK8P^%a`$mjsZ@wMDpN4i8wwn(%ueaw6pc!y zQe@q>-Is^#t%{+0dIQ8>8TL^2a{$nxG^(>t97_I^yrS529omqdAy@943ZbGEgP93? z+eHUc!Uw$@BBYiu&1~}l;C`8XwFzPXz$60L3I{0qSYRy5fMoUGirgE66ECwJjIfis z5bvwldW#}9+qxX+X;_txkvopDif!xHNOx_r5HcYSe@9cDdi+`W>`4@ukXEcej6eJ^ z3YWX#Jq}3sZF7PWwR2b3#sWC?msw1QdOV9eO$5S6hqem!`@@R+FlF1RRPJT;{W;8N z-m9dRg&R2s;iz@)1uoR4RtAhkv)K!FL>LXcS|ETqh5{GM0cb#?KJs_enH>5Wv=DSR zuN8ujqbLv)PYwq#5y|H!dC3k?bdjunXw)*kf(F{npFUza@&C6iYKM57>!xjl?HkjR zO?hk#EesVU_FsbyLgDd*a)1*eg~n>@oZc9^K&8s8hH8e~#$-Pm=@|35(M#9n`8mFA zBtOadJ&l7)J>Q7+q#lIS_2$m?`{2Ie*+5jF?TxTL3rZ&@Uzu5jDO+b*q(tlMG5k*y zvD#|2vR=zG>|d6gx$>;AHOHH|MPWDNoaZ>O*Km*<-F6(}z+%aQHM#PU$5#9RF>L}^ z-*b3aN{SX+wuXue8tjs2cbyh%51gYIMP7{-YmQ*8Sh)3%ZzY)s$F|@H2xMH)&O^l& zf-;X1wcaz+r}GY;-)}I;9Up&Y64X1Fs{5l_*Y8h;baaBJVxcc~i%3J4+Q$xke} zOa&QAvlU!g@V~&Fi3&KUZsVp5MhU8QbVerqpb~t&i7+t4*YG|4eY!!$+NBGhkw&_s zsz5@2psvb34L*$SD6XF9Pu@M`l~)Clkt?Iy79q~vq`1rhr!Ngq`@~+gym~5p1RJi$ z==4+ez0o&i8q7@>`25l8qiEdoVmPtTSxky_2!Ppa%ON%(jl6r<3^8EjaS)!$mfwU* zbv=suU>Nf`Hbv@j+c#=?fQi?ua?_>>3?Qe)k;CEH6>U`YK-25CI@WmSDl)2R%Wun_ z6aG=>{1YHo>?DhvGY#}%!%3Oir^x+p>`qyl@d+9*EkMG&j_?C=(>{VYOWpNP4~Nm# zobk%g&ft<6x@vK8Gk(HUx7ED=M2ea~{`--drX1 z2F4%P*;ahlCTx1dr-xS6&N*v+@0Q1=#%SAoN1np#W`gZ)HIs7SFG_-J2y!7b=QtN*{~=}eyz@&QWq{`G8C*B0xoDjd?cZ}Ge;>}a@s#t z``XfQ-gAi)=9nd@hx&+8e8YmkKZReg*rUMSSUvvi7!ry(>OtxFHXiB8uchM=LWp%9 v*f;kri&#W-n^7dpo}Pb|eC6Ma7~Z5+t-60Sp~VIHi2=>UlUlkf=)1oFWFdRL literal 0 HcmV?d00001 diff --git a/v0.4.6/classformatron_1_1schemas_1_1pydantic_1_1FieldInfo-members.html b/v0.4.6/classformatron_1_1schemas_1_1pydantic_1_1FieldInfo-members.html new file mode 100644 index 00000000..b5711763 --- /dev/null +++ b/v0.4.6/classformatron_1_1schemas_1_1pydantic_1_1FieldInfo-members.html @@ -0,0 +1,143 @@ + + + + + + + + +Formatron: Member List + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
formatron.schemas.pydantic.FieldInfo Member List
+
+ +
+ + + + diff --git a/v0.4.6/classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.html b/v0.4.6/classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.html new file mode 100644 index 00000000..aa3f9d12 --- /dev/null +++ b/v0.4.6/classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.html @@ -0,0 +1,324 @@ + + + + + + + + +Formatron: formatron.schemas.pydantic.FieldInfo Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
formatron.schemas.pydantic.FieldInfo Class Reference
+
+
+ +

A wrapper for pydantic FieldInfo. + More...

+ + + + + + + + + +

+Public Member Functions

 __init__ (self, pydantic.fields.FieldInfo field)
 Initialize the field information.
 
 __repr__ (self)
 
 __str__ (self)
 
+ + + + + +

+Protected Attributes

 _field
 
 _annotation
 
+ + + + + +

Properties

typing.Type[typing.Any]|None annotation (self)
 
bool required (self)
 
+

Detailed Description

+

A wrapper for pydantic FieldInfo.

+ +

Definition at line 18 of file pydantic.py.

+

Constructor & Destructor Documentation

+ +

◆ __init__()

+ +
+
+ + + + + + + + + + + +
formatron.schemas.pydantic.FieldInfo.__init__ ( self,
pydantic.fields.FieldInfo field )
+
+ +

Initialize the field information.

+ +

Definition at line 24 of file pydantic.py.

+ +
+
+

Member Function Documentation

+ +

◆ __repr__()

+ +
+
+ + + + + + + +
formatron.schemas.pydantic.FieldInfo.__repr__ ( self)
+
+ +

Definition at line 62 of file pydantic.py.

+ +
+
+ +

◆ __str__()

+ +
+
+ + + + + + + +
formatron.schemas.pydantic.FieldInfo.__str__ ( self)
+
+ +

Definition at line 65 of file pydantic.py.

+ +
+
+ +

◆ annotation()

+ +
+
+ + + + + + + +
typing.Type[typing.Any] | None formatron.schemas.pydantic.FieldInfo.annotation ( self)
+
+ +

Definition at line 44 of file pydantic.py.

+ +
+
+ +

◆ required()

+ +
+
+ + + + + + + +
bool formatron.schemas.pydantic.FieldInfo.required ( self)
+
+ +

Definition at line 57 of file pydantic.py.

+ +
+
+

Member Data Documentation

+ +

◆ _annotation

+ +
+
+ + + + + +
+ + + + +
formatron.schemas.pydantic.FieldInfo._annotation
+
+protected
+
+ +

Definition at line 26 of file pydantic.py.

+ +
+
+ +

◆ _field

+ +
+
+ + + + + +
+ + + + +
formatron.schemas.pydantic.FieldInfo._field
+
+protected
+
+ +

Definition at line 25 of file pydantic.py.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/v0.4.6/classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.js b/v0.4.6/classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.js new file mode 100644 index 00000000..3af78a1b --- /dev/null +++ b/v0.4.6/classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.js @@ -0,0 +1,10 @@ +var classformatron_1_1schemas_1_1pydantic_1_1FieldInfo = +[ + [ "__init__", "classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.html#a4a5a010c6acef15f8fe2d4318223696b", null ], + [ "__repr__", "classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.html#ad291e8df78d045d3364bc6a17582b416", null ], + [ "__str__", "classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.html#a49ac1734cddfadc1b7721f57775890a6", null ], + [ "annotation", "classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.html#ac9e5af7e4cb356a450e9e48f3af24cfe", null ], + [ "required", "classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.html#aeae1e2e12ad15628c69d896fae9aa477", null ], + [ "_annotation", "classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.html#aab00d20e817e3ea9fc15295a94e8242b", null ], + [ "_field", "classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.html#abb92e2d49fec513432cced795bd853e2", null ] +]; \ No newline at end of file diff --git a/v0.4.6/classformatron_1_1schemas_1_1schema_1_1FieldInfo-members.html b/v0.4.6/classformatron_1_1schemas_1_1schema_1_1FieldInfo-members.html new file mode 100644 index 00000000..dd137f2d --- /dev/null +++ b/v0.4.6/classformatron_1_1schemas_1_1schema_1_1FieldInfo-members.html @@ -0,0 +1,138 @@ + + + + + + + + +Formatron: Member List + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
formatron.schemas.schema.FieldInfo Member List
+
+
+ +

This is the complete list of members for formatron.schemas.schema.FieldInfo, including all inherited members.

+ + + +
annotation(self)formatron.schemas.schema.FieldInfo
required(self)formatron.schemas.schema.FieldInfo
+
+ + + + diff --git a/v0.4.6/classformatron_1_1schemas_1_1schema_1_1FieldInfo.html b/v0.4.6/classformatron_1_1schemas_1_1schema_1_1FieldInfo.html new file mode 100644 index 00000000..85b3d99a --- /dev/null +++ b/v0.4.6/classformatron_1_1schemas_1_1schema_1_1FieldInfo.html @@ -0,0 +1,208 @@ + + + + + + + + +Formatron: formatron.schemas.schema.FieldInfo Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
formatron.schemas.schema.FieldInfo Class Reference
+
+
+
+Inheritance diagram for formatron.schemas.schema.FieldInfo:
+
+
+ + +formatron.schemas.dict_inference.FieldInfo +formatron.schemas.json_schema.FieldInfo + +
+ + + + + + + + +

Properties

typing.Type[typing.Any]|None annotation (self)
 Get the type annotation of the field.
 
bool required (self)
 Check if the field is required for the schema.
 
+

Detailed Description

+
+

Definition at line 9 of file schema.py.

+

Member Function Documentation

+ +

◆ annotation()

+ +
+
+ + + + + + + +
typing.Type[typing.Any] | None formatron.schemas.schema.FieldInfo.annotation ( self)
+
+ +

Get the type annotation of the field.

+ +

Reimplemented in formatron.schemas.dict_inference.FieldInfo, and formatron.schemas.json_schema.FieldInfo.

+ +

Definition at line 22 of file schema.py.

+ +
+
+ +

◆ required()

+ +
+
+ + + + + + + +
bool formatron.schemas.schema.FieldInfo.required ( self)
+
+ +

Check if the field is required for the schema.

+ +

Reimplemented in formatron.schemas.dict_inference.FieldInfo, and formatron.schemas.json_schema.FieldInfo.

+ +

Definition at line 39 of file schema.py.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/v0.4.6/classformatron_1_1schemas_1_1schema_1_1FieldInfo.js b/v0.4.6/classformatron_1_1schemas_1_1schema_1_1FieldInfo.js new file mode 100644 index 00000000..4c32fdab --- /dev/null +++ b/v0.4.6/classformatron_1_1schemas_1_1schema_1_1FieldInfo.js @@ -0,0 +1,5 @@ +var classformatron_1_1schemas_1_1schema_1_1FieldInfo = +[ + [ "annotation", "classformatron_1_1schemas_1_1schema_1_1FieldInfo.html#a5c7b1d8b8d8d52426e95a3f326cf3e75", null ], + [ "required", "classformatron_1_1schemas_1_1schema_1_1FieldInfo.html#ac0d64035ccdc78e44a4cf6165d56081b", null ] +]; \ No newline at end of file diff --git a/v0.4.6/classformatron_1_1schemas_1_1schema_1_1FieldInfo.png b/v0.4.6/classformatron_1_1schemas_1_1schema_1_1FieldInfo.png new file mode 100644 index 0000000000000000000000000000000000000000..0816998529dd0722199b1b2e52cb53d9a078875b GIT binary patch literal 1555 zcmb`HX;70#7{@nI!NSWx1zKLk2wE@*6$k;8MidAjHzFb`0c{9KAqcG@DyKTcAc&la zat5lPq1>Gq4!Jd4a)^i}LO28jidZcs0n_var(gWmneOcD|G)d}?Ci7qn+X-p7tfao}ms0M6}wJLW1DBj2Jy25Mwa1s!uTNHYxd#S>{&mty=+ zxeeih*^p4rZg_jF6c*)_gjlCw{dDa_T;Yxw(XT@d2h%704rEWt!K=sro;)OLxn`y+ z=mrr6!43ycruDC8O#Zn)^0KEw!WA=Ck|td9MIQu?M}EMXMo)~*M!3SDVk!)-FU@CO zy$ww}4B?)X9-${Qlh)Lm;v0g;WIfowdLC63Zm;h(lz@P*ppMcyP z+&B14k8R{87jeK6pwy6LN|h}sNNON$aMLF}qPP)2me#wDRu&%}bTX$Ca*voEVCcY1gKiupYZmZ;BF$?1ja zSXiL_Dgjcq@d&)t)TNx<`a(Lup2t>OJ0c`mSnIZXJqSt6P7EGmZ-O81MQ})ICSP!E zoyi^bcrKE)dku;Ve60$Y;_A);>Kxmaj@Os@`3DHNOLE;+PIN9sAUoL2hPr`?Jq(cV zMjdwhOv^c(g;JDS!eSk2a{@vFp2!P9IFL_B*?abrT7iwgIwkT6pl+R#&uoijWW!ka z(^wFP&>4&!4(pU=>FzAvz;)dO zW)*RE?(~tYjXWHqH<3hl%V{GTU)h%x6ega0RP8jZ3HRL~@nf5oFJb7mblRLa1&UXF zS=#0$yQ`u9kV)q0q%s&PVQI)wr|qB<^ipT3FuM7TK;^a3qW3l~I=AviDSJvBYWz)? z#rT6&;p5f$3_fW-=j;A-`mD@ugo5+{I#*c znn{ffL^2eziOIvih(l&xO4@=9GEa_qG(!*t_`!tS?q`+OFb3@_s76s%G6T{G(3_+E_@@1om#P4YodaGo)< zmL?A9Lbg4B6LYSMWcqOz%&d1aH0t}U_VOAlDK>e=0IQu!BGR|(sq#%SCr!(G0|flm zH5%_7E_6;pxr8r2NlGsYwZurXf_m@kY&?urR%Up8V_j6`{uNc&J%vQ^^Vhdv; + + + + + + + +Formatron: Member List + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
formatron.schemas.schema.Schema Member List
+
+
+ +

This is the complete list of members for formatron.schemas.schema.Schema, including all inherited members.

+ + + +
fields(cls)formatron.schemas.schema.Schema
from_json(cls, str json)formatron.schemas.schema.Schema
+
+ + + + diff --git a/v0.4.6/classformatron_1_1schemas_1_1schema_1_1Schema.html b/v0.4.6/classformatron_1_1schemas_1_1schema_1_1Schema.html new file mode 100644 index 00000000..6a2034d3 --- /dev/null +++ b/v0.4.6/classformatron_1_1schemas_1_1schema_1_1Schema.html @@ -0,0 +1,215 @@ + + + + + + + + +Formatron: formatron.schemas.schema.Schema Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
formatron.schemas.schema.Schema Class Reference
+
+
+ +

An abstract schema that describes some data. + More...

+
+Inheritance diagram for formatron.schemas.schema.Schema:
+
+
+ + +formatron.schemas.pydantic.ClassSchema + +
+ + + + + + + + +

Class Methods

dict[str, FieldInfofields (cls)
 Get the fields of the schema.
 
"Schema" from_json (cls, str json)
 Create a schema from a JSON string.
 
+

Detailed Description

+

An abstract schema that describes some data.

+ +

Definition at line 78 of file schema.py.

+

Member Function Documentation

+ +

◆ fields()

+ +
+
+ + + + + + + +
dict[str, FieldInfo] formatron.schemas.schema.Schema.fields ( cls)
+
+ +

Get the fields of the schema.

+ +

Reimplemented in formatron.schemas.pydantic.ClassSchema.

+ +

Definition at line 91 of file schema.py.

+ +
+
+ +

◆ from_json()

+ +
+
+ + + + + + + + + + + +
"Schema" formatron.schemas.schema.Schema.from_json ( cls,
str json )
+
+ +

Create a schema from a JSON string.

+ +

Reimplemented in formatron.schemas.pydantic.ClassSchema.

+ +

Definition at line 108 of file schema.py.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/v0.4.6/classformatron_1_1schemas_1_1schema_1_1Schema.js b/v0.4.6/classformatron_1_1schemas_1_1schema_1_1Schema.js new file mode 100644 index 00000000..624d51a1 --- /dev/null +++ b/v0.4.6/classformatron_1_1schemas_1_1schema_1_1Schema.js @@ -0,0 +1,5 @@ +var classformatron_1_1schemas_1_1schema_1_1Schema = +[ + [ "fields", "classformatron_1_1schemas_1_1schema_1_1Schema.html#a98d77a5645545d440b91126926d1aeb8", null ], + [ "from_json", "classformatron_1_1schemas_1_1schema_1_1Schema.html#a8c45239aaa45574add14fa72fbdf16dc", null ] +]; \ No newline at end of file diff --git a/v0.4.6/classformatron_1_1schemas_1_1schema_1_1Schema.png b/v0.4.6/classformatron_1_1schemas_1_1schema_1_1Schema.png new file mode 100644 index 0000000000000000000000000000000000000000..d44c6c647777afca4a61ee6a6e4492392bc36664 GIT binary patch literal 1058 zcmeAS@N?(olHy`uVBq!ia0vp^zk#@egBeJQN#%k#(g8jpuK)l42Qpv0`C8h4Xt{-f zW`V@?GcO)IcmNbPJsY+JD92e6I*dOj?5GP(mCg6Ut<6B_o?9t zyzzHY7|ocZ71G86}9+*!8BcTiI zHy4)}tsAZ`K%H5~gnIEjz29kpXaDK`wp&|S6#Vb0 z;{3V4b6?-qy=r&TZ`uAWB?5bQ=2>Lk2xJ!&Ty6e3Zi`}G_)DF?J1cq0_iXvQ^(x!W z_e=br>}c-jxTsNWfBD(ms!VC!)x1TwJulxc6cDWa+fl1;y#D6yNKtj+C3in3`)M7m z=2Hq7VGYg4toS)neMNtI-jYbGK%rQ zN}0{;SI1Wzf5Tt0{lmPQi_bAPxU*U_{0QE_++a@vU1FZk=+6W^mQf6bYZ-~V^t?S@}(Bh+Ti?Re3g^;%5u;&Rj3wMxHo tzRi4b85me;+VEg|d2pZ3=|{o!3>^&Vil4ONWP!Pv!PC{xWt~$(69ArJ8qWX# literal 0 HcmV?d00001 diff --git a/v0.4.6/classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata-members.html b/v0.4.6/classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata-members.html new file mode 100644 index 00000000..8df20f75 --- /dev/null +++ b/v0.4.6/classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata-members.html @@ -0,0 +1,141 @@ + + + + + + + + +Formatron: Member List + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
formatron.schemas.schema.TypeWithMetadata Member List
+
+
+ +

This is the complete list of members for formatron.schemas.schema.TypeWithMetadata, including all inherited members.

+ + + + + + +
__init__(self, typing.Type[typing.Any] type, dict[str, typing.Any]|None metadata)formatron.schemas.schema.TypeWithMetadata
_metadataformatron.schemas.schema.TypeWithMetadataprotected
_typeformatron.schemas.schema.TypeWithMetadataprotected
metadata(self)formatron.schemas.schema.TypeWithMetadata
type(self)formatron.schemas.schema.TypeWithMetadata
+
+ + + + diff --git a/v0.4.6/classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata.html b/v0.4.6/classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata.html new file mode 100644 index 00000000..a0b98f00 --- /dev/null +++ b/v0.4.6/classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata.html @@ -0,0 +1,280 @@ + + + + + + + + +Formatron: formatron.schemas.schema.TypeWithMetadata Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
formatron.schemas.schema.TypeWithMetadata Class Reference
+
+
+ + + + +

+Public Member Functions

 __init__ (self, typing.Type[typing.Any] type, dict[str, typing.Any]|None metadata)
 
+ + + + + +

+Protected Attributes

 _type
 
 _metadata
 
+ + + + + +

Properties

typing.Type[typing.Any] type (self)
 
dict[str, typing.Any]|None metadata (self)
 
+

Detailed Description

+
+

Definition at line 44 of file schema.py.

+

Constructor & Destructor Documentation

+ +

◆ __init__()

+ +
+
+ + + + + + + + + + + + + + + + +
formatron.schemas.schema.TypeWithMetadata.__init__ ( self,
typing.Type[typing.Any] type,
dict[str, typing.Any]|None metadata )
+
+ +

Definition at line 45 of file schema.py.

+ +
+
+

Member Function Documentation

+ +

◆ metadata()

+ +
+
+ + + + + + + +
dict[str, typing.Any]|None formatron.schemas.schema.TypeWithMetadata.metadata ( self)
+
+ +

Definition at line 70 of file schema.py.

+ +
+
+ +

◆ type()

+ +
+
+ + + + + + + +
typing.Type[typing.Any] formatron.schemas.schema.TypeWithMetadata.type ( self)
+
+ +

Definition at line 57 of file schema.py.

+ +
+
+

Member Data Documentation

+ +

◆ _metadata

+ +
+
+ + + + + +
+ + + + +
formatron.schemas.schema.TypeWithMetadata._metadata
+
+protected
+
+ +

Definition at line 47 of file schema.py.

+ +
+
+ +

◆ _type

+ +
+
+ + + + + +
+ + + + +
formatron.schemas.schema.TypeWithMetadata._type
+
+protected
+
+ +

Definition at line 46 of file schema.py.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + diff --git a/v0.4.6/classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata.js b/v0.4.6/classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata.js new file mode 100644 index 00000000..856d521e --- /dev/null +++ b/v0.4.6/classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata.js @@ -0,0 +1,8 @@ +var classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata = +[ + [ "__init__", "classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata.html#a0c3cf51ceb503d4d195f5623d57e160b", null ], + [ "metadata", "classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata.html#af8604b758b8af6878a130a4f0f28389b", null ], + [ "type", "classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata.html#ada7a24496aad9979411523441c53a6cf", null ], + [ "_metadata", "classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata.html#a34312895f9d497d5c35cf372f9c498f3", null ], + [ "_type", "classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata.html#a4d1ea7d59f700634eb2545ce3d6cf324", null ] +]; \ No newline at end of file diff --git a/v0.4.6/clipboard.js b/v0.4.6/clipboard.js new file mode 100644 index 00000000..42c1fb0e --- /dev/null +++ b/v0.4.6/clipboard.js @@ -0,0 +1,61 @@ +/** + +The code below is based on the Doxygen Awesome project, see +https://github.com/jothepro/doxygen-awesome-css + +MIT License + +Copyright (c) 2021 - 2022 jothepro + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +*/ + +let clipboard_title = "Copy to clipboard" +let clipboard_icon = `` +let clipboard_successIcon = `` +let clipboard_successDuration = 1000 + +$(function() { + if(navigator.clipboard) { + const fragments = document.getElementsByClassName("fragment") + for(const fragment of fragments) { + const clipboard_div = document.createElement("div") + clipboard_div.classList.add("clipboard") + clipboard_div.innerHTML = clipboard_icon + clipboard_div.title = clipboard_title + $(clipboard_div).click(function() { + const content = this.parentNode.cloneNode(true) + // filter out line number and folded fragments from file listings + content.querySelectorAll(".lineno, .ttc, .foldclosed").forEach((node) => { node.remove() }) + let text = content.textContent + // remove trailing newlines and trailing spaces from empty lines + text = text.replace(/^\s*\n/gm,'\n').replace(/\n*$/,'') + navigator.clipboard.writeText(text); + this.classList.add("success") + this.innerHTML = clipboard_successIcon + window.setTimeout(() => { // switch back to normal icon after timeout + this.classList.remove("success") + this.innerHTML = clipboard_icon + }, clipboard_successDuration); + }) + fragment.insertBefore(clipboard_div, fragment.firstChild) + } + } +}) diff --git a/v0.4.6/closed.png b/v0.4.6/closed.png new file mode 100644 index 0000000000000000000000000000000000000000..98cc2c909da37a6df914fbf67780eebd99c597f5 GIT binary patch literal 132 zcmeAS@N?(olHy`uVBq!ia0vp^oFL4>1|%O$WD@{V-kvUwAr*{o@8{^CZMh(5KoB^r_<4^zF@3)Cp&&t3hdujKf f*?bjBoY!V+E))@{xMcbjXe@)LtDnm{r-UW|*e5JT literal 0 HcmV?d00001 diff --git a/v0.4.6/config_8py.html b/v0.4.6/config_8py.html new file mode 100644 index 00000000..9854480b --- /dev/null +++ b/v0.4.6/config_8py.html @@ -0,0 +1,154 @@ + + + + + + + + +Formatron: src/formatron/config.py File Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
config.py File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Classes

class  formatron.config.EngineGenerationConfig
 Configuration for how an KBNF engine should be used in text generation. More...
 
+ + + + + + +

+Namespaces

namespace  formatron
 
namespace  formatron.config
 Configuration classes for Formatron.
 
+
+
+ + + + diff --git a/v0.4.6/config_8py.js b/v0.4.6/config_8py.js new file mode 100644 index 00000000..c2c2e491 --- /dev/null +++ b/v0.4.6/config_8py.js @@ -0,0 +1,4 @@ +var config_8py = +[ + [ "formatron.config.EngineGenerationConfig", "classformatron_1_1config_1_1EngineGenerationConfig.html", "classformatron_1_1config_1_1EngineGenerationConfig" ] +]; \ No newline at end of file diff --git a/v0.4.6/config_8py_source.html b/v0.4.6/config_8py_source.html new file mode 100644 index 00000000..d402cb3f --- /dev/null +++ b/v0.4.6/config_8py_source.html @@ -0,0 +1,154 @@ + + + + + + + + +Formatron: src/formatron/config.py Source File + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
config.py
+
+
+Go to the documentation of this file.
1"""
+
2Configuration classes for Formatron.
+
3"""
+
4from dataclasses import dataclass
+
5
+
6
+
7@dataclass
+ +
9 """
+
10 Configuration for how an KBNF engine should be used in text generation.
+
11
+
12 Attributes:
+
13 read_prompt: Whether to accept the prompt tokens when a generation begins.
+
+
14 reset_at_beginning: Whether to reset the engine when a new generation begins.
+
15 """
+
16 read_prompt: bool = False
+
17 reset_at_beginning: bool = True
+
+
Configuration for how an KBNF engine should be used in text generation.
Definition config.py:14
+
+
+ + + + diff --git a/v0.4.6/cookie.js b/v0.4.6/cookie.js new file mode 100644 index 00000000..53ad21d9 --- /dev/null +++ b/v0.4.6/cookie.js @@ -0,0 +1,58 @@ +/*! + Cookie helper functions + Copyright (c) 2023 Dimitri van Heesch + Released under MIT license. +*/ +let Cookie = { + cookie_namespace: 'doxygen_', + + readSetting(cookie,defVal) { + if (window.chrome) { + const val = localStorage.getItem(this.cookie_namespace+cookie) || + sessionStorage.getItem(this.cookie_namespace+cookie); + if (val) return val; + } else { + let myCookie = this.cookie_namespace+cookie+"="; + if (document.cookie) { + const index = document.cookie.indexOf(myCookie); + if (index != -1) { + const valStart = index + myCookie.length; + let valEnd = document.cookie.indexOf(";", valStart); + if (valEnd == -1) { + valEnd = document.cookie.length; + } + return document.cookie.substring(valStart, valEnd); + } + } + } + return defVal; + }, + + writeSetting(cookie,val,days=10*365) { // default days='forever', 0=session cookie, -1=delete + if (window.chrome) { + if (days==0) { + sessionStorage.setItem(this.cookie_namespace+cookie,val); + } else { + localStorage.setItem(this.cookie_namespace+cookie,val); + } + } else { + let date = new Date(); + date.setTime(date.getTime()+(days*24*60*60*1000)); + const expiration = days!=0 ? "expires="+date.toGMTString()+";" : ""; + document.cookie = this.cookie_namespace + cookie + "=" + + val + "; SameSite=Lax;" + expiration + "path=/"; + } + }, + + eraseSetting(cookie) { + if (window.chrome) { + if (localStorage.getItem(this.cookie_namespace+cookie)) { + localStorage.removeItem(this.cookie_namespace+cookie); + } else if (sessionStorage.getItem(this.cookie_namespace+cookie)) { + sessionStorage.removeItem(this.cookie_namespace+cookie); + } + } else { + this.writeSetting(cookie,'',-1); + } + }, +} diff --git a/v0.4.6/dict__inference_8py.html b/v0.4.6/dict__inference_8py.html new file mode 100644 index 00000000..4ab93cd6 --- /dev/null +++ b/v0.4.6/dict__inference_8py.html @@ -0,0 +1,165 @@ + + + + + + + + +Formatron: src/formatron/schemas/dict_inference.py File Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
dict_inference.py File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Classes

class  formatron.schemas.dict_inference.FieldInfo
 
+ + + + + + + + + +

+Namespaces

namespace  formatron
 
namespace  formatron.schemas
 This subpackage contains modules that define schemas creation from various sources.
 
namespace  formatron.schemas.dict_inference
 This module contains utilities for inferring schemas from dictionaries.
 
+ + + + + + +

+Functions

Type[Any] formatron.schemas.dict_inference._infer_type (Any value)
 
typing.Type[schemas.schema.Schemaformatron.schemas.dict_inference.infer_mapping (collections.abc.Mapping[str, Any] mapping)
 Recursively infer a schema from a mapping.
 
+
+
+ + + + diff --git a/v0.4.6/dict__inference_8py.js b/v0.4.6/dict__inference_8py.js new file mode 100644 index 00000000..2b5ac44f --- /dev/null +++ b/v0.4.6/dict__inference_8py.js @@ -0,0 +1,6 @@ +var dict__inference_8py = +[ + [ "formatron.schemas.dict_inference.FieldInfo", "classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo.html", "classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo" ], + [ "_infer_type", "dict__inference_8py.html#ad5cac24e76dc097a995f31d3d0ff9efc", null ], + [ "infer_mapping", "dict__inference_8py.html#a850490b4a317260a236333130d36a5d8", null ] +]; \ No newline at end of file diff --git a/v0.4.6/dict__inference_8py_source.html b/v0.4.6/dict__inference_8py_source.html new file mode 100644 index 00000000..fae8ef59 --- /dev/null +++ b/v0.4.6/dict__inference_8py_source.html @@ -0,0 +1,238 @@ + + + + + + + + +Formatron: src/formatron/schemas/dict_inference.py Source File + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
dict_inference.py
+
+
+Go to the documentation of this file.
1"""
+
2This module contains utilities for inferring schemas from dictionaries.
+
3"""
+
4import collections.abc
+
5import json
+
6from typing import Any, Type
+
7
+
8from pydantic import typing
+
9
+
10from formatron import schemas
+
11
+
12
+ +
+
14 __slots__ = ("_annotation",)
+
15
+
16 def __init__(self, annotation: typing.Type):
+
17 """
+
18 Initialize the field information.
+
19
+
20 Args:
+
21 annotation: The type annotation of the field.
+
22 """
+
+
23 self._annotation = annotation
+ +
25 @property
+
+
26 def annotation(self) -> typing.Type[typing.Any] | None:
+
27 """
+
28 Get the type annotation of the field.
+
29 """
+
30 return self._annotation
+
31
+
32 @property
+
33 def required(self) -> bool:
+
34 """
+
35 Check if the field is required for the schema.
+
36 """
+
+
37 return True
+
38
+
39
+
+
40def _infer_type(value: Any) -> Type[Any]:
+
41 if isinstance(value, collections.abc.Mapping):
+
42 return infer_mapping(value)
+
43 elif isinstance(value, collections.abc.Sequence) and not isinstance(value, str):
+
44 # Handle sequences with possibly heterogeneous elements
+
45 if not value:
+
46 return collections.Sequence[Any]
+
47 element_types = set()
+
48 for element in value:
+
49 element_type = type(element)
+
50 # Check for dictionary
+
51 original = typing.get_origin(element_type)
+
52 if original is None:
+
+
53 original = element_type
+
54 if original is typing.Mapping or isinstance(original, type) and issubclass(original,
+
55 collections.abc.Mapping):
+
+
56 element_types.add(infer_mapping(element))
+
57 else:
+
58 element_types.add(element_type)
+
+
+
59 if len(element_types) == 1:
+
60 return collections.abc.Sequence[next(iter(element_types))]
+
61 union_type = typing.Union[tuple(element_types)]
+
62 return collections.abc.Sequence[union_type]
+
63 else:
+
64 return type(value)
+
65
+
66
+
67def infer_mapping(mapping: collections.abc.Mapping[str, Any]) -> typing.Type[schemas.schema.Schema]:
+
68 """
+
69 Recursively infer a schema from a mapping.
+
70
+
71 Types that are specially handled:
+
72 - collections.abc.Mapping: converted to a schema. Keys are converted to field names and corresponding value types are converted to field types.
+
73 - collections.abc.Sequence with heterogeneous elements: all different element types are included in a union type.
+
74
+
75 Other types are directly inferred from the type of the value with no special handling.
+
76 """
+
77 field_infos = {}
+
78 for key, value in mapping.items():
+
79 assert isinstance(key, str), f"Key must be a string, got {key} of type {type(key)}"
+
80 assert key.isidentifier(), f"Key must be a valid identifier, got {key}"
+
81 inferred_type = _infer_type(value)
+
82 field_infos[key] = FieldInfo(inferred_type)
+
83 _class = type(f"Mapping_{id(mapping)}", (schemas.schema.Schema,), {"fields": lambda: field_infos})
+
84 _class.from_json = classmethod(lambda cls, json_str: json.loads(json_str))
+
85 return _class
+
+ +
__init__(self, typing.Type annotation)
Initialize the field information.
+
typing.Type[typing.Any]|None annotation(self)
Get the type annotation of the field.
+
bool required(self)
Check if the field is required for the schema.
+ + +
An abstract schema that describes some data.
Definition schema.py:78
+
typing.Type[schemas.schema.Schema] infer_mapping(collections.abc.Mapping[str, Any] mapping)
Recursively infer a schema from a mapping.
+
Type[Any] _infer_type(Any value)
+
+
+ + + + diff --git a/v0.4.6/dir_07d5411bfb9a2f8bc3eb64bb16ab190f.html b/v0.4.6/dir_07d5411bfb9a2f8bc3eb64bb16ab190f.html new file mode 100644 index 00000000..54943def --- /dev/null +++ b/v0.4.6/dir_07d5411bfb9a2f8bc3eb64bb16ab190f.html @@ -0,0 +1,144 @@ + + + + + + + + +Formatron: src/formatron/formats Directory Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
formats Directory Reference
+
+
+ + + + + + + + +

+Files

 __init__.py
 
 json.py
 
 regex.py
 
+
+
+ + + + diff --git a/v0.4.6/dir_07d5411bfb9a2f8bc3eb64bb16ab190f.js b/v0.4.6/dir_07d5411bfb9a2f8bc3eb64bb16ab190f.js new file mode 100644 index 00000000..a142a1e3 --- /dev/null +++ b/v0.4.6/dir_07d5411bfb9a2f8bc3eb64bb16ab190f.js @@ -0,0 +1,6 @@ +var dir_07d5411bfb9a2f8bc3eb64bb16ab190f = +[ + [ "__init__.py", "formats_2____init_____8py.html", null ], + [ "json.py", "json_8py.html", "json_8py" ], + [ "regex.py", "regex_8py.html", "regex_8py" ] +]; \ No newline at end of file diff --git a/v0.4.6/dir_2f7731174e12724dc50b600c6c8c5f5c.html b/v0.4.6/dir_2f7731174e12724dc50b600c6c8c5f5c.html new file mode 100644 index 00000000..c4843709 --- /dev/null +++ b/v0.4.6/dir_2f7731174e12724dc50b600c6c8c5f5c.html @@ -0,0 +1,148 @@ + + + + + + + + +Formatron: src/formatron/schemas Directory Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
schemas Directory Reference
+
+
+ + + + + + + + + + + + +

+Files

 __init__.py
 
 dict_inference.py
 
 json_schema.py
 
 pydantic.py
 
 schema.py
 
+
+
+ + + + diff --git a/v0.4.6/dir_2f7731174e12724dc50b600c6c8c5f5c.js b/v0.4.6/dir_2f7731174e12724dc50b600c6c8c5f5c.js new file mode 100644 index 00000000..40051d37 --- /dev/null +++ b/v0.4.6/dir_2f7731174e12724dc50b600c6c8c5f5c.js @@ -0,0 +1,8 @@ +var dir_2f7731174e12724dc50b600c6c8c5f5c = +[ + [ "__init__.py", "schemas_2____init_____8py.html", null ], + [ "dict_inference.py", "dict__inference_8py.html", "dict__inference_8py" ], + [ "json_schema.py", "json__schema_8py.html", "json__schema_8py" ], + [ "pydantic.py", "pydantic_8py.html", "pydantic_8py" ], + [ "schema.py", "schema_8py.html", "schema_8py" ] +]; \ No newline at end of file diff --git a/v0.4.6/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/v0.4.6/dir_68267d1309a1af8e8297ef4c3efbcdba.html new file mode 100644 index 00000000..43c324ff --- /dev/null +++ b/v0.4.6/dir_68267d1309a1af8e8297ef4c3efbcdba.html @@ -0,0 +1,140 @@ + + + + + + + + +Formatron: src Directory Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
src Directory Reference
+
+
+ + + + +

+Directories

 formatron
 
+
+
+ + + + diff --git a/v0.4.6/dir_68267d1309a1af8e8297ef4c3efbcdba.js b/v0.4.6/dir_68267d1309a1af8e8297ef4c3efbcdba.js new file mode 100644 index 00000000..5c348a76 --- /dev/null +++ b/v0.4.6/dir_68267d1309a1af8e8297ef4c3efbcdba.js @@ -0,0 +1,4 @@ +var dir_68267d1309a1af8e8297ef4c3efbcdba = +[ + [ "formatron", "dir_fcf8421df2b1fac2914241030b544a7c.html", "dir_fcf8421df2b1fac2914241030b544a7c" ] +]; \ No newline at end of file diff --git a/v0.4.6/dir_86ec2f274a7c7757cb321bd1b4c1dbf4.html b/v0.4.6/dir_86ec2f274a7c7757cb321bd1b4c1dbf4.html new file mode 100644 index 00000000..4808c166 --- /dev/null +++ b/v0.4.6/dir_86ec2f274a7c7757cb321bd1b4c1dbf4.html @@ -0,0 +1,150 @@ + + + + + + + + +Formatron: src/formatron/integrations Directory Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
integrations Directory Reference
+
+
+ + + + + + + + + + + + + + +

+Files

 __init__.py
 
 _utils.py
 
 exllamav2.py
 
 RWKV.py
 
 transformers.py
 
 vllm.py
 
+
+
+ + + + diff --git a/v0.4.6/dir_86ec2f274a7c7757cb321bd1b4c1dbf4.js b/v0.4.6/dir_86ec2f274a7c7757cb321bd1b4c1dbf4.js new file mode 100644 index 00000000..82a67fc9 --- /dev/null +++ b/v0.4.6/dir_86ec2f274a7c7757cb321bd1b4c1dbf4.js @@ -0,0 +1,9 @@ +var dir_86ec2f274a7c7757cb321bd1b4c1dbf4 = +[ + [ "__init__.py", "integrations_2____init_____8py.html", null ], + [ "_utils.py", "__utils_8py.html", "__utils_8py" ], + [ "exllamav2.py", "exllamav2_8py.html", "exllamav2_8py" ], + [ "RWKV.py", "RWKV_8py.html", "RWKV_8py" ], + [ "transformers.py", "transformers_8py.html", "transformers_8py" ], + [ "vllm.py", "vllm_8py.html", "vllm_8py" ] +]; \ No newline at end of file diff --git a/v0.4.6/dir_fcf8421df2b1fac2914241030b544a7c.html b/v0.4.6/dir_fcf8421df2b1fac2914241030b544a7c.html new file mode 100644 index 00000000..a001c894 --- /dev/null +++ b/v0.4.6/dir_fcf8421df2b1fac2914241030b544a7c.html @@ -0,0 +1,155 @@ + + + + + + + + +Formatron: src/formatron Directory Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
formatron Directory Reference
+
+
+ + + + + + + + +

+Directories

 formats
 
 integrations
 
 schemas
 
+ + + + + + + + + +

+Files

 __init__.py
 
 config.py
 
 extractor.py
 
 formatter.py
 
+
+
+ + + + diff --git a/v0.4.6/dir_fcf8421df2b1fac2914241030b544a7c.js b/v0.4.6/dir_fcf8421df2b1fac2914241030b544a7c.js new file mode 100644 index 00000000..455730fc --- /dev/null +++ b/v0.4.6/dir_fcf8421df2b1fac2914241030b544a7c.js @@ -0,0 +1,10 @@ +var dir_fcf8421df2b1fac2914241030b544a7c = +[ + [ "formats", "dir_07d5411bfb9a2f8bc3eb64bb16ab190f.html", "dir_07d5411bfb9a2f8bc3eb64bb16ab190f" ], + [ "integrations", "dir_86ec2f274a7c7757cb321bd1b4c1dbf4.html", "dir_86ec2f274a7c7757cb321bd1b4c1dbf4" ], + [ "schemas", "dir_2f7731174e12724dc50b600c6c8c5f5c.html", "dir_2f7731174e12724dc50b600c6c8c5f5c" ], + [ "__init__.py", "____init_____8py.html", null ], + [ "config.py", "config_8py.html", "config_8py" ], + [ "extractor.py", "extractor_8py.html", "extractor_8py" ], + [ "formatter.py", "formatter_8py.html", "formatter_8py" ] +]; \ No newline at end of file diff --git a/v0.4.6/doc.svg b/v0.4.6/doc.svg new file mode 100644 index 00000000..0b928a53 --- /dev/null +++ b/v0.4.6/doc.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/v0.4.6/docd.svg b/v0.4.6/docd.svg new file mode 100644 index 00000000..ac18b275 --- /dev/null +++ b/v0.4.6/docd.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/v0.4.6/doxygen-awesome.css b/v0.4.6/doxygen-awesome.css new file mode 100644 index 00000000..a2715e26 --- /dev/null +++ b/v0.4.6/doxygen-awesome.css @@ -0,0 +1,2677 @@ +/** + +Doxygen Awesome +https://github.com/jothepro/doxygen-awesome-css + +MIT License + +Copyright (c) 2021 - 2023 jothepro + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +*/ + +html { + /* primary theme color. This will affect the entire websites color scheme: links, arrows, labels, ... */ + --primary-color: #1779c4; + --primary-dark-color: #335c80; + --primary-light-color: #70b1e9; + + /* page base colors */ + --page-background-color: #ffffff; + --page-foreground-color: #2f4153; + --page-secondary-foreground-color: #6f7e8e; + + /* color for all separators on the website: hr, borders, ... */ + --separator-color: #dedede; + + /* border radius for all rounded components. Will affect many components, like dropdowns, memitems, codeblocks, ... */ + --border-radius-large: 8px; + --border-radius-small: 4px; + --border-radius-medium: 6px; + + /* default spacings. Most components reference these values for spacing, to provide uniform spacing on the page. */ + --spacing-small: 5px; + --spacing-medium: 10px; + --spacing-large: 16px; + + /* default box shadow used for raising an element above the normal content. Used in dropdowns, search result, ... */ + --box-shadow: 0 2px 8px 0 rgba(0,0,0,.075); + + --odd-color: rgba(0,0,0,.028); + + /* font-families. will affect all text on the website + * font-family: the normal font for text, headlines, menus + * font-family-monospace: used for preformatted text in memtitle, code, fragments + */ + --font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif; + --font-family-monospace: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace; + + /* font sizes */ + --page-font-size: 15.6px; + --navigation-font-size: 14.4px; + --toc-font-size: 13.4px; + --code-font-size: 14px; /* affects code, fragment */ + --title-font-size: 22px; + + /* content text properties. These only affect the page content, not the navigation or any other ui elements */ + --content-line-height: 27px; + /* The content is centered and constraint in it's width. To make the content fill the whole page, set the variable to auto.*/ + --content-maxwidth: 1050px; + --table-line-height: 24px; + --toc-sticky-top: var(--spacing-medium); + --toc-width: 200px; + --toc-max-height: calc(100vh - 2 * var(--spacing-medium) - 85px); + + /* colors for various content boxes: @warning, @note, @deprecated @bug */ + --warning-color: #faf3d8; + --warning-color-dark: #f3a600; + --warning-color-darker: #5f4204; + --note-color: #e4f3ff; + --note-color-dark: #1879C4; + --note-color-darker: #274a5c; + --todo-color: #e4dafd; + --todo-color-dark: #5b2bdd; + --todo-color-darker: #2a0d72; + --deprecated-color: #ecf0f3; + --deprecated-color-dark: #5b6269; + --deprecated-color-darker: #43454a; + --bug-color: #f8d1cc; + --bug-color-dark: #b61825; + --bug-color-darker: #75070f; + --invariant-color: #d8f1e3; + --invariant-color-dark: #44b86f; + --invariant-color-darker: #265532; + + /* blockquote colors */ + --blockquote-background: #f8f9fa; + --blockquote-foreground: #636568; + + /* table colors */ + --tablehead-background: #f1f1f1; + --tablehead-foreground: var(--page-foreground-color); + + /* menu-display: block | none + * Visibility of the top navigation on screens >= 768px. On smaller screen the menu is always visible. + * `GENERATE_TREEVIEW` MUST be enabled! + */ + --menu-display: block; + + --menu-focus-foreground: var(--page-background-color); + --menu-focus-background: var(--primary-color); + --menu-selected-background: rgba(0,0,0,.05); + + + --header-background: var(--page-background-color); + --header-foreground: var(--page-foreground-color); + + /* searchbar colors */ + --searchbar-background: var(--side-nav-background); + --searchbar-foreground: var(--page-foreground-color); + + /* searchbar size + * (`searchbar-width` is only applied on screens >= 768px. + * on smaller screens the searchbar will always fill the entire screen width) */ + --searchbar-height: 33px; + --searchbar-width: 210px; + --searchbar-border-radius: var(--searchbar-height); + + /* code block colors */ + --code-background: #f5f5f5; + --code-foreground: var(--page-foreground-color); + + /* fragment colors */ + --fragment-background: #F8F9FA; + --fragment-foreground: #37474F; + --fragment-keyword: #bb6bb2; + --fragment-keywordtype: #8258b3; + --fragment-keywordflow: #d67c3b; + --fragment-token: #438a59; + --fragment-comment: #969696; + --fragment-link: #5383d6; + --fragment-preprocessor: #46aaa5; + --fragment-linenumber-color: #797979; + --fragment-linenumber-background: #f4f4f5; + --fragment-linenumber-border: #e3e5e7; + --fragment-lineheight: 20px; + + /* sidebar navigation (treeview) colors */ + --side-nav-background: #fbfbfb; + --side-nav-foreground: var(--page-foreground-color); + --side-nav-arrow-opacity: 0; + --side-nav-arrow-hover-opacity: 0.9; + + --toc-background: var(--side-nav-background); + --toc-foreground: var(--side-nav-foreground); + + /* height of an item in any tree / collapsible table */ + --tree-item-height: 30px; + + --memname-font-size: var(--code-font-size); + --memtitle-font-size: 18px; + + --webkit-scrollbar-size: 7px; + --webkit-scrollbar-padding: 4px; + --webkit-scrollbar-color: var(--separator-color); + + --animation-duration: .12s +} + +@media screen and (max-width: 767px) { + html { + --page-font-size: 16px; + --navigation-font-size: 16px; + --toc-font-size: 15px; + --code-font-size: 15px; /* affects code, fragment */ + --title-font-size: 22px; + } +} + +@media (prefers-color-scheme: dark) { + html:not(.light-mode) { + color-scheme: dark; + + --primary-color: #1982d2; + --primary-dark-color: #86a9c4; + --primary-light-color: #4779ac; + + --box-shadow: 0 2px 8px 0 rgba(0,0,0,.35); + + --odd-color: rgba(100,100,100,.06); + + --menu-selected-background: rgba(0,0,0,.4); + + --page-background-color: #1C1D1F; + --page-foreground-color: #d2dbde; + --page-secondary-foreground-color: #859399; + --separator-color: #38393b; + --side-nav-background: #252628; + + --code-background: #2a2c2f; + + --tablehead-background: #2a2c2f; + + --blockquote-background: #222325; + --blockquote-foreground: #7e8c92; + + --warning-color: #3b2e04; + --warning-color-dark: #f1b602; + --warning-color-darker: #ceb670; + --note-color: #163750; + --note-color-dark: #1982D2; + --note-color-darker: #dcf0fa; + --todo-color: #2a2536; + --todo-color-dark: #7661b3; + --todo-color-darker: #ae9ed6; + --deprecated-color: #2e323b; + --deprecated-color-dark: #738396; + --deprecated-color-darker: #abb0bd; + --bug-color: #2e1917; + --bug-color-dark: #ad2617; + --bug-color-darker: #f5b1aa; + --invariant-color: #303a35; + --invariant-color-dark: #76ce96; + --invariant-color-darker: #cceed5; + + --fragment-background: #282c34; + --fragment-foreground: #dbe4eb; + --fragment-keyword: #cc99cd; + --fragment-keywordtype: #ab99cd; + --fragment-keywordflow: #e08000; + --fragment-token: #7ec699; + --fragment-comment: #999999; + --fragment-link: #98c0e3; + --fragment-preprocessor: #65cabe; + --fragment-linenumber-color: #cccccc; + --fragment-linenumber-background: #35393c; + --fragment-linenumber-border: #1f1f1f; + } +} + +/* dark mode variables are defined twice, to support both the dark-mode without and with doxygen-awesome-darkmode-toggle.js */ +html.dark-mode { + color-scheme: dark; + + --primary-color: #1982d2; + --primary-dark-color: #86a9c4; + --primary-light-color: #4779ac; + + --box-shadow: 0 2px 8px 0 rgba(0,0,0,.30); + + --odd-color: rgba(100,100,100,.06); + + --menu-selected-background: rgba(0,0,0,.4); + + --page-background-color: #1C1D1F; + --page-foreground-color: #d2dbde; + --page-secondary-foreground-color: #859399; + --separator-color: #38393b; + --side-nav-background: #252628; + + --code-background: #2a2c2f; + + --tablehead-background: #2a2c2f; + + --blockquote-background: #222325; + --blockquote-foreground: #7e8c92; + + --warning-color: #3b2e04; + --warning-color-dark: #f1b602; + --warning-color-darker: #ceb670; + --note-color: #163750; + --note-color-dark: #1982D2; + --note-color-darker: #dcf0fa; + --todo-color: #2a2536; + --todo-color-dark: #7661b3; + --todo-color-darker: #ae9ed6; + --deprecated-color: #2e323b; + --deprecated-color-dark: #738396; + --deprecated-color-darker: #abb0bd; + --bug-color: #2e1917; + --bug-color-dark: #ad2617; + --bug-color-darker: #f5b1aa; + --invariant-color: #303a35; + --invariant-color-dark: #76ce96; + --invariant-color-darker: #cceed5; + + --fragment-background: #282c34; + --fragment-foreground: #dbe4eb; + --fragment-keyword: #cc99cd; + --fragment-keywordtype: #ab99cd; + --fragment-keywordflow: #e08000; + --fragment-token: #7ec699; + --fragment-comment: #999999; + --fragment-link: #98c0e3; + --fragment-preprocessor: #65cabe; + --fragment-linenumber-color: #cccccc; + --fragment-linenumber-background: #35393c; + --fragment-linenumber-border: #1f1f1f; +} + +body { + color: var(--page-foreground-color); + background-color: var(--page-background-color); + font-size: var(--page-font-size); +} + +body, table, div, p, dl, #nav-tree .label, .title, +.sm-dox a, .sm-dox a:hover, .sm-dox a:focus, #projectname, +.SelectItem, #MSearchField, .navpath li.navelem a, +.navpath li.navelem a:hover, p.reference, p.definition, div.toc li, div.toc h3 { + font-family: var(--font-family); +} + +h1, h2, h3, h4, h5 { + margin-top: 1em; + font-weight: 600; + line-height: initial; +} + +p, div, table, dl, p.reference, p.definition { + font-size: var(--page-font-size); +} + +p.reference, p.definition { + color: var(--page-secondary-foreground-color); +} + +a:link, a:visited, a:hover, a:focus, a:active { + color: var(--primary-color) !important; + font-weight: 500; + background: none; +} + +a.anchor { + scroll-margin-top: var(--spacing-large); + display: block; +} + +/* + Title and top navigation + */ + +#top { + background: var(--header-background); + border-bottom: 1px solid var(--separator-color); +} + +@media screen and (min-width: 768px) { + #top { + display: flex; + flex-wrap: wrap; + justify-content: space-between; + align-items: center; + } +} + +#main-nav { + flex-grow: 5; + padding: var(--spacing-small) var(--spacing-medium); +} + +#titlearea { + width: auto; + padding: var(--spacing-medium) var(--spacing-large); + background: none; + color: var(--header-foreground); + border-bottom: none; +} + +@media screen and (max-width: 767px) { + #titlearea { + padding-bottom: var(--spacing-small); + } +} + +#titlearea table tbody tr { + height: auto !important; +} + +#projectname { + font-size: var(--title-font-size); + font-weight: 600; +} + +#projectnumber { + font-family: inherit; + font-size: 60%; +} + +#projectbrief { + font-family: inherit; + font-size: 80%; +} + +#projectlogo { + vertical-align: middle; +} + +#projectlogo img { + max-height: calc(var(--title-font-size) * 2); + margin-right: var(--spacing-small); +} + +.sm-dox, .tabs, .tabs2, .tabs3 { + background: none; + padding: 0; +} + +.tabs, .tabs2, .tabs3 { + border-bottom: 1px solid var(--separator-color); + margin-bottom: -1px; +} + +.main-menu-btn-icon, .main-menu-btn-icon:before, .main-menu-btn-icon:after { + background: var(--page-secondary-foreground-color); +} + +@media screen and (max-width: 767px) { + .sm-dox a span.sub-arrow { + background: var(--code-background); + } + + #main-menu a.has-submenu span.sub-arrow { + color: var(--page-secondary-foreground-color); + border-radius: var(--border-radius-medium); + } + + #main-menu a.has-submenu:hover span.sub-arrow { + color: var(--page-foreground-color); + } +} + +@media screen and (min-width: 768px) { + .sm-dox li, .tablist li { + display: var(--menu-display); + } + + .sm-dox a span.sub-arrow { + border-color: var(--header-foreground) transparent transparent transparent; + } + + .sm-dox a:hover span.sub-arrow { + border-color: var(--menu-focus-foreground) transparent transparent transparent; + } + + .sm-dox ul a span.sub-arrow { + border-color: transparent transparent transparent var(--page-foreground-color); + } + + .sm-dox ul a:hover span.sub-arrow { + border-color: transparent transparent transparent var(--menu-focus-foreground); + } +} + +.sm-dox ul { + background: var(--page-background-color); + box-shadow: var(--box-shadow); + border: 1px solid var(--separator-color); + border-radius: var(--border-radius-medium) !important; + padding: var(--spacing-small); + animation: ease-out 150ms slideInMenu; +} + +@keyframes slideInMenu { + from { + opacity: 0; + transform: translate(0px, -2px); + } + + to { + opacity: 1; + transform: translate(0px, 0px); + } +} + +.sm-dox ul a { + color: var(--page-foreground-color) !important; + background: var(--page-background-color); + font-size: var(--navigation-font-size); +} + +.sm-dox>li>ul:after { + border-bottom-color: var(--page-background-color) !important; +} + +.sm-dox>li>ul:before { + border-bottom-color: var(--separator-color) !important; +} + +.sm-dox ul a:hover, .sm-dox ul a:active, .sm-dox ul a:focus { + font-size: var(--navigation-font-size) !important; + color: var(--menu-focus-foreground) !important; + text-shadow: none; + background-color: var(--menu-focus-background); + border-radius: var(--border-radius-small) !important; +} + +.sm-dox a, .sm-dox a:focus, .tablist li, .tablist li a, .tablist li.current a { + text-shadow: none; + background: transparent; + background-image: none !important; + color: var(--header-foreground) !important; + font-weight: normal; + font-size: var(--navigation-font-size); + border-radius: var(--border-radius-small) !important; +} + +.sm-dox a:focus { + outline: auto; +} + +.sm-dox a:hover, .sm-dox a:active, .tablist li a:hover { + text-shadow: none; + font-weight: normal; + background: var(--menu-focus-background); + color: var(--menu-focus-foreground) !important; + border-radius: var(--border-radius-small) !important; + font-size: var(--navigation-font-size); +} + +.tablist li.current { + border-radius: var(--border-radius-small); + background: var(--menu-selected-background); +} + +.tablist li { + margin: var(--spacing-small) 0 var(--spacing-small) var(--spacing-small); +} + +.tablist a { + padding: 0 var(--spacing-large); +} + + +/* + Search box + */ + +#MSearchBox { + height: var(--searchbar-height); + background: var(--searchbar-background); + border-radius: var(--searchbar-border-radius); + border: 1px solid var(--separator-color); + overflow: hidden; + width: var(--searchbar-width); + position: relative; + box-shadow: none; + display: block; + margin-top: 0; +} + +/* until Doxygen 1.9.4 */ +.left img#MSearchSelect { + left: 0; + user-select: none; + padding-left: 8px; +} + +/* Doxygen 1.9.5 */ +.left span#MSearchSelect { + left: 0; + user-select: none; + margin-left: 8px; + padding: 0; +} + +.left #MSearchSelect[src$=".png"] { + padding-left: 0 +} + +.SelectionMark { + user-select: none; +} + +.tabs .left #MSearchSelect { + padding-left: 0; +} + +.tabs #MSearchBox { + position: absolute; + right: var(--spacing-medium); +} + +@media screen and (max-width: 767px) { + .tabs #MSearchBox { + position: relative; + right: 0; + margin-left: var(--spacing-medium); + margin-top: 0; + } +} + +#MSearchSelectWindow, #MSearchResultsWindow { + z-index: 9999; +} + +#MSearchBox.MSearchBoxActive { + border-color: var(--primary-color); + box-shadow: inset 0 0 0 1px var(--primary-color); +} + +#main-menu > li:last-child { + margin-right: 0; +} + +@media screen and (max-width: 767px) { + #main-menu > li:last-child { + height: 50px; + } +} + +#MSearchField { + font-size: var(--navigation-font-size); + height: calc(var(--searchbar-height) - 2px); + background: transparent; + width: calc(var(--searchbar-width) - 64px); +} + +.MSearchBoxActive #MSearchField { + color: var(--searchbar-foreground); +} + +#MSearchSelect { + top: calc(calc(var(--searchbar-height) / 2) - 11px); +} + +#MSearchBox span.left, #MSearchBox span.right { + background: none; + background-image: none; +} + +#MSearchBox span.right { + padding-top: calc(calc(var(--searchbar-height) / 2) - 12px); + position: absolute; + right: var(--spacing-small); +} + +.tabs #MSearchBox span.right { + top: calc(calc(var(--searchbar-height) / 2) - 12px); +} + +@keyframes slideInSearchResults { + from { + opacity: 0; + transform: translate(0, 15px); + } + + to { + opacity: 1; + transform: translate(0, 20px); + } +} + +#MSearchResultsWindow { + left: auto !important; + right: var(--spacing-medium); + border-radius: var(--border-radius-large); + border: 1px solid var(--separator-color); + transform: translate(0, 20px); + box-shadow: var(--box-shadow); + animation: ease-out 280ms slideInSearchResults; + background: var(--page-background-color); +} + +iframe#MSearchResults { + margin: 4px; +} + +iframe { + color-scheme: normal; +} + +@media (prefers-color-scheme: dark) { + html:not(.light-mode) iframe#MSearchResults { + filter: invert() hue-rotate(180deg); + } +} + +html.dark-mode iframe#MSearchResults { + filter: invert() hue-rotate(180deg); +} + +#MSearchResults .SRPage { + background-color: transparent; +} + +#MSearchResults .SRPage .SREntry { + font-size: 10pt; + padding: var(--spacing-small) var(--spacing-medium); +} + +#MSearchSelectWindow { + border: 1px solid var(--separator-color); + border-radius: var(--border-radius-medium); + box-shadow: var(--box-shadow); + background: var(--page-background-color); + padding-top: var(--spacing-small); + padding-bottom: var(--spacing-small); +} + +#MSearchSelectWindow a.SelectItem { + font-size: var(--navigation-font-size); + line-height: var(--content-line-height); + margin: 0 var(--spacing-small); + border-radius: var(--border-radius-small); + color: var(--page-foreground-color) !important; + font-weight: normal; +} + +#MSearchSelectWindow a.SelectItem:hover { + background: var(--menu-focus-background); + color: var(--menu-focus-foreground) !important; +} + +@media screen and (max-width: 767px) { + #MSearchBox { + margin-top: var(--spacing-medium); + margin-bottom: var(--spacing-medium); + width: calc(100vw - 30px); + } + + #main-menu > li:last-child { + float: none !important; + } + + #MSearchField { + width: calc(100vw - 110px); + } + + @keyframes slideInSearchResultsMobile { + from { + opacity: 0; + transform: translate(0, 15px); + } + + to { + opacity: 1; + transform: translate(0, 20px); + } + } + + #MSearchResultsWindow { + left: var(--spacing-medium) !important; + right: var(--spacing-medium); + overflow: auto; + transform: translate(0, 20px); + animation: ease-out 280ms slideInSearchResultsMobile; + width: auto !important; + } + + /* + * Overwrites for fixing the searchbox on mobile in doxygen 1.9.2 + */ + label.main-menu-btn ~ #searchBoxPos1 { + top: 3px !important; + right: 6px !important; + left: 45px; + display: flex; + } + + label.main-menu-btn ~ #searchBoxPos1 > #MSearchBox { + margin-top: 0; + margin-bottom: 0; + flex-grow: 2; + float: left; + } +} + +/* + Tree view + */ + +#side-nav { + padding: 0 !important; + background: var(--side-nav-background); + min-width: 8px; + max-width: 50vw; +} + +@media screen and (max-width: 767px) { + #side-nav { + display: none; + } + + #doc-content { + margin-left: 0 !important; + } +} + +#nav-tree { + background: transparent; + margin-right: 1px; +} + +#nav-tree .label { + font-size: var(--navigation-font-size); +} + +#nav-tree .item { + height: var(--tree-item-height); + line-height: var(--tree-item-height); +} + +#nav-tree .item > a:focus { + outline: none; +} + +#nav-sync { + bottom: 12px; + right: 12px; + top: auto !important; + user-select: none; +} + +#nav-tree .selected { + text-shadow: none; + background-image: none; + background-color: transparent; + position: relative; +} + +#nav-tree .selected::after { + content: ""; + position: absolute; + top: 1px; + bottom: 1px; + left: 0; + width: 4px; + border-radius: 0 var(--border-radius-small) var(--border-radius-small) 0; + background: var(--primary-color); +} + + +#nav-tree a { + color: var(--side-nav-foreground) !important; + font-weight: normal; +} + +#nav-tree a:focus { + outline-style: auto; +} + +#nav-tree .arrow { + opacity: var(--side-nav-arrow-opacity); + background: none; +} + +.arrow { + color: inherit; + cursor: pointer; + font-size: 45%; + vertical-align: middle; + margin-right: 2px; + font-family: serif; + height: auto; + text-align: right; +} + +#nav-tree div.item:hover .arrow, #nav-tree a:focus .arrow { + opacity: var(--side-nav-arrow-hover-opacity); +} + +#nav-tree .selected a { + color: var(--primary-color) !important; + font-weight: bolder; + font-weight: 600; +} + +.ui-resizable-e { + width: 4px; + background: transparent; + box-shadow: inset -1px 0 0 0 var(--separator-color); +} + +/* + Contents + */ + +div.header { + border-bottom: 1px solid var(--separator-color); + background-color: var(--page-background-color); + background-image: none; +} + +@media screen and (min-width: 1000px) { + #doc-content > div > div.contents, + .PageDoc > div.contents { + display: flex; + flex-direction: row-reverse; + flex-wrap: nowrap; + align-items: flex-start; + } + + div.contents .textblock { + min-width: 200px; + flex-grow: 1; + } +} + +div.contents, div.header .title, div.header .summary { + max-width: var(--content-maxwidth); +} + +div.contents, div.header .title { + line-height: initial; + margin: calc(var(--spacing-medium) + .2em) auto var(--spacing-medium) auto; +} + +div.header .summary { + margin: var(--spacing-medium) auto 0 auto; +} + +div.headertitle { + padding: 0; +} + +div.header .title { + font-weight: 600; + font-size: 225%; + padding: var(--spacing-medium) var(--spacing-large); + word-break: break-word; +} + +div.header .summary { + width: auto; + display: block; + float: none; + padding: 0 var(--spacing-large); +} + +td.memSeparator { + border-color: var(--separator-color); +} + +span.mlabel { + background: var(--primary-color); + border: none; + padding: 4px 9px; + border-radius: 12px; + margin-right: var(--spacing-medium); +} + +span.mlabel:last-of-type { + margin-right: 2px; +} + +div.contents { + padding: 0 var(--spacing-large); +} + +div.contents p, div.contents li { + line-height: var(--content-line-height); +} + +div.contents div.dyncontent { + margin: var(--spacing-medium) 0; +} + +@media (prefers-color-scheme: dark) { + html:not(.light-mode) div.contents div.dyncontent img, + html:not(.light-mode) div.contents center img, + html:not(.light-mode) div.contents > table img, + html:not(.light-mode) div.contents div.dyncontent iframe, + html:not(.light-mode) div.contents center iframe, + html:not(.light-mode) div.contents table iframe, + html:not(.light-mode) div.contents .dotgraph iframe { + filter: brightness(89%) hue-rotate(180deg) invert(); + } +} + +html.dark-mode div.contents div.dyncontent img, +html.dark-mode div.contents center img, +html.dark-mode div.contents > table img, +html.dark-mode div.contents div.dyncontent iframe, +html.dark-mode div.contents center iframe, +html.dark-mode div.contents table iframe, +html.dark-mode div.contents .dotgraph iframe + { + filter: brightness(89%) hue-rotate(180deg) invert(); +} + +h2.groupheader { + border-bottom: 0px; + color: var(--page-foreground-color); + box-shadow: + 100px 0 var(--page-background-color), + -100px 0 var(--page-background-color), + 100px 0.75px var(--separator-color), + -100px 0.75px var(--separator-color), + 500px 0 var(--page-background-color), + -500px 0 var(--page-background-color), + 500px 0.75px var(--separator-color), + -500px 0.75px var(--separator-color), + 900px 0 var(--page-background-color), + -900px 0 var(--page-background-color), + 900px 0.75px var(--separator-color), + -900px 0.75px var(--separator-color), + 1400px 0 var(--page-background-color), + -1400px 0 var(--page-background-color), + 1400px 0.75px var(--separator-color), + -1400px 0.75px var(--separator-color), + 1900px 0 var(--page-background-color), + -1900px 0 var(--page-background-color), + 1900px 0.75px var(--separator-color), + -1900px 0.75px var(--separator-color); +} + +blockquote { + margin: 0 var(--spacing-medium) 0 var(--spacing-medium); + padding: var(--spacing-small) var(--spacing-large); + background: var(--blockquote-background); + color: var(--blockquote-foreground); + border-left: 0; + overflow: visible; + border-radius: var(--border-radius-medium); + overflow: visible; + position: relative; +} + +blockquote::before, blockquote::after { + font-weight: bold; + font-family: serif; + font-size: 360%; + opacity: .15; + position: absolute; +} + +blockquote::before { + content: "“"; + left: -10px; + top: 4px; +} + +blockquote::after { + content: "”"; + right: -8px; + bottom: -25px; +} + +blockquote p { + margin: var(--spacing-small) 0 var(--spacing-medium) 0; +} +.paramname, .paramname em { + font-weight: 600; + color: var(--primary-dark-color); +} + +.paramname > code { + border: 0; +} + +table.params .paramname { + font-weight: 600; + font-family: var(--font-family-monospace); + font-size: var(--code-font-size); + padding-right: var(--spacing-small); + line-height: var(--table-line-height); +} + +h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { + text-shadow: 0 0 15px var(--primary-light-color); +} + +.alphachar a { + color: var(--page-foreground-color); +} + +.dotgraph { + max-width: 100%; + overflow-x: scroll; +} + +.dotgraph .caption { + position: sticky; + left: 0; +} + +/* Wrap Graphviz graphs with the `interactive_dotgraph` class if `INTERACTIVE_SVG = YES` */ +.interactive_dotgraph .dotgraph iframe { + max-width: 100%; +} + +/* + Table of Contents + */ + +div.contents .toc { + max-height: var(--toc-max-height); + min-width: var(--toc-width); + border: 0; + border-left: 1px solid var(--separator-color); + border-radius: 0; + background-color: var(--page-background-color); + box-shadow: none; + position: sticky; + top: var(--toc-sticky-top); + padding: 0 var(--spacing-large); + margin: var(--spacing-small) 0 var(--spacing-large) var(--spacing-large); +} + +div.toc h3 { + color: var(--toc-foreground); + font-size: var(--navigation-font-size); + margin: var(--spacing-large) 0 var(--spacing-medium) 0; +} + +div.toc li { + padding: 0; + background: none; + line-height: var(--toc-font-size); + margin: var(--toc-font-size) 0 0 0; +} + +div.toc li::before { + display: none; +} + +div.toc ul { + margin-top: 0 +} + +div.toc li a { + font-size: var(--toc-font-size); + color: var(--page-foreground-color) !important; + text-decoration: none; +} + +div.toc li a:hover, div.toc li a.active { + color: var(--primary-color) !important; +} + +div.toc li a.aboveActive { + color: var(--page-secondary-foreground-color) !important; +} + + +@media screen and (max-width: 999px) { + div.contents .toc { + max-height: 45vh; + float: none; + width: auto; + margin: 0 0 var(--spacing-medium) 0; + position: relative; + top: 0; + position: relative; + border: 1px solid var(--separator-color); + border-radius: var(--border-radius-medium); + background-color: var(--toc-background); + box-shadow: var(--box-shadow); + } + + div.contents .toc.interactive { + max-height: calc(var(--navigation-font-size) + 2 * var(--spacing-large)); + overflow: hidden; + } + + div.contents .toc > h3 { + -webkit-tap-highlight-color: transparent; + cursor: pointer; + position: sticky; + top: 0; + background-color: var(--toc-background); + margin: 0; + padding: var(--spacing-large) 0; + display: block; + } + + div.contents .toc.interactive > h3::before { + content: ""; + width: 0; + height: 0; + border-left: 4px solid transparent; + border-right: 4px solid transparent; + border-top: 5px solid var(--primary-color); + display: inline-block; + margin-right: var(--spacing-small); + margin-bottom: calc(var(--navigation-font-size) / 4); + transform: rotate(-90deg); + transition: transform var(--animation-duration) ease-out; + } + + div.contents .toc.interactive.open > h3::before { + transform: rotate(0deg); + } + + div.contents .toc.interactive.open { + max-height: 45vh; + overflow: auto; + transition: max-height 0.2s ease-in-out; + } + + div.contents .toc a, div.contents .toc a.active { + color: var(--primary-color) !important; + } + + div.contents .toc a:hover { + text-decoration: underline; + } +} + +/* + Code & Fragments + */ + +code, div.fragment, pre.fragment { + border-radius: var(--border-radius-small); + border: 1px solid var(--separator-color); + overflow: hidden; +} + +code { + display: inline; + background: var(--code-background); + color: var(--code-foreground); + padding: 2px 6px; +} + +div.fragment, pre.fragment { + margin: var(--spacing-medium) 0; + padding: calc(var(--spacing-large) - (var(--spacing-large) / 6)) var(--spacing-large); + background: var(--fragment-background); + color: var(--fragment-foreground); + overflow-x: auto; +} + +@media screen and (max-width: 767px) { + div.fragment, pre.fragment { + border-top-right-radius: 0; + border-bottom-right-radius: 0; + border-right: 0; + } + + .contents > div.fragment, + .textblock > div.fragment, + .textblock > pre.fragment, + .textblock > .tabbed > ul > li > div.fragment, + .textblock > .tabbed > ul > li > pre.fragment, + .contents > .doxygen-awesome-fragment-wrapper > div.fragment, + .textblock > .doxygen-awesome-fragment-wrapper > div.fragment, + .textblock > .doxygen-awesome-fragment-wrapper > pre.fragment, + .textblock > .tabbed > ul > li > .doxygen-awesome-fragment-wrapper > div.fragment, + .textblock > .tabbed > ul > li > .doxygen-awesome-fragment-wrapper > pre.fragment { + margin: var(--spacing-medium) calc(0px - var(--spacing-large)); + border-radius: 0; + border-left: 0; + } + + .textblock li > .fragment, + .textblock li > .doxygen-awesome-fragment-wrapper > .fragment { + margin: var(--spacing-medium) calc(0px - var(--spacing-large)); + } + + .memdoc li > .fragment, + .memdoc li > .doxygen-awesome-fragment-wrapper > .fragment { + margin: var(--spacing-medium) calc(0px - var(--spacing-medium)); + } + + .textblock ul, .memdoc ul { + overflow: initial; + } + + .memdoc > div.fragment, + .memdoc > pre.fragment, + dl dd > div.fragment, + dl dd pre.fragment, + .memdoc > .doxygen-awesome-fragment-wrapper > div.fragment, + .memdoc > .doxygen-awesome-fragment-wrapper > pre.fragment, + dl dd > .doxygen-awesome-fragment-wrapper > div.fragment, + dl dd .doxygen-awesome-fragment-wrapper > pre.fragment { + margin: var(--spacing-medium) calc(0px - var(--spacing-medium)); + border-radius: 0; + border-left: 0; + } +} + +code, code a, pre.fragment, div.fragment, div.fragment .line, div.fragment span, div.fragment .line a, div.fragment .line span { + font-family: var(--font-family-monospace); + font-size: var(--code-font-size) !important; +} + +div.line:after { + margin-right: var(--spacing-medium); +} + +div.fragment .line, pre.fragment { + white-space: pre; + word-wrap: initial; + line-height: var(--fragment-lineheight); +} + +div.fragment span.keyword { + color: var(--fragment-keyword); +} + +div.fragment span.keywordtype { + color: var(--fragment-keywordtype); +} + +div.fragment span.keywordflow { + color: var(--fragment-keywordflow); +} + +div.fragment span.stringliteral { + color: var(--fragment-token) +} + +div.fragment span.comment { + color: var(--fragment-comment); +} + +div.fragment a.code { + color: var(--fragment-link) !important; +} + +div.fragment span.preprocessor { + color: var(--fragment-preprocessor); +} + +div.fragment span.lineno { + display: inline-block; + width: 27px; + border-right: none; + background: var(--fragment-linenumber-background); + color: var(--fragment-linenumber-color); +} + +div.fragment span.lineno a { + background: none; + color: var(--fragment-link) !important; +} + +div.fragment > .line:first-child .lineno { + box-shadow: -999999px 0px 0 999999px var(--fragment-linenumber-background), -999998px 0px 0 999999px var(--fragment-linenumber-border); + background-color: var(--fragment-linenumber-background) !important; +} + +div.line { + border-radius: var(--border-radius-small); +} + +div.line.glow { + background-color: var(--primary-light-color); + box-shadow: none; +} + +/* + dl warning, attention, note, deprecated, bug, ... + */ + +dl.bug dt a, dl.deprecated dt a, dl.todo dt a { + font-weight: bold !important; +} + +dl.warning, dl.attention, dl.note, dl.deprecated, dl.bug, dl.invariant, dl.pre, dl.post, dl.todo, dl.remark { + padding: var(--spacing-medium); + margin: var(--spacing-medium) 0; + color: var(--page-background-color); + overflow: hidden; + margin-left: 0; + border-radius: var(--border-radius-small); +} + +dl.section dd { + margin-bottom: 2px; +} + +dl.warning, dl.attention { + background: var(--warning-color); + border-left: 8px solid var(--warning-color-dark); + color: var(--warning-color-darker); +} + +dl.warning dt, dl.attention dt { + color: var(--warning-color-dark); +} + +dl.note, dl.remark { + background: var(--note-color); + border-left: 8px solid var(--note-color-dark); + color: var(--note-color-darker); +} + +dl.note dt, dl.remark dt { + color: var(--note-color-dark); +} + +dl.todo { + background: var(--todo-color); + border-left: 8px solid var(--todo-color-dark); + color: var(--todo-color-darker); +} + +dl.todo dt a { + color: var(--todo-color-dark) !important; +} + +dl.bug dt a { + color: var(--todo-color-dark) !important; +} + +dl.bug { + background: var(--bug-color); + border-left: 8px solid var(--bug-color-dark); + color: var(--bug-color-darker); +} + +dl.bug dt a { + color: var(--bug-color-dark) !important; +} + +dl.deprecated { + background: var(--deprecated-color); + border-left: 8px solid var(--deprecated-color-dark); + color: var(--deprecated-color-darker); +} + +dl.deprecated dt a { + color: var(--deprecated-color-dark) !important; +} + +dl.section dd, dl.bug dd, dl.deprecated dd, dl.todo dd { + margin-inline-start: 0px; +} + +dl.invariant, dl.pre, dl.post { + background: var(--invariant-color); + border-left: 8px solid var(--invariant-color-dark); + color: var(--invariant-color-darker); +} + +dl.invariant dt, dl.pre dt, dl.post dt { + color: var(--invariant-color-dark); +} + +/* + memitem + */ + +div.memdoc, div.memproto, h2.memtitle { + box-shadow: none; + background-image: none; + border: none; +} + +div.memdoc { + padding: 0 var(--spacing-medium); + background: var(--page-background-color); +} + +h2.memtitle, div.memitem { + border: 1px solid var(--separator-color); + box-shadow: var(--box-shadow); +} + +h2.memtitle { + box-shadow: 0px var(--spacing-medium) 0 -1px var(--fragment-background), var(--box-shadow); +} + +div.memitem { + transition: none; +} + +div.memproto, h2.memtitle { + background: var(--fragment-background); +} + +h2.memtitle { + font-weight: 500; + font-size: var(--memtitle-font-size); + font-family: var(--font-family-monospace); + border-bottom: none; + border-top-left-radius: var(--border-radius-medium); + border-top-right-radius: var(--border-radius-medium); + word-break: break-all; + position: relative; +} + +h2.memtitle:after { + content: ""; + display: block; + background: var(--fragment-background); + height: var(--spacing-medium); + bottom: calc(0px - var(--spacing-medium)); + left: 0; + right: -14px; + position: absolute; + border-top-right-radius: var(--border-radius-medium); +} + +h2.memtitle > span.permalink { + font-size: inherit; +} + +h2.memtitle > span.permalink > a { + text-decoration: none; + padding-left: 3px; + margin-right: -4px; + user-select: none; + display: inline-block; + margin-top: -6px; +} + +h2.memtitle > span.permalink > a:hover { + color: var(--primary-dark-color) !important; +} + +a:target + h2.memtitle, a:target + h2.memtitle + div.memitem { + border-color: var(--primary-light-color); +} + +div.memitem { + border-top-right-radius: var(--border-radius-medium); + border-bottom-right-radius: var(--border-radius-medium); + border-bottom-left-radius: var(--border-radius-medium); + overflow: hidden; + display: block !important; +} + +div.memdoc { + border-radius: 0; +} + +div.memproto { + border-radius: 0 var(--border-radius-small) 0 0; + overflow: auto; + border-bottom: 1px solid var(--separator-color); + padding: var(--spacing-medium); + margin-bottom: -1px; +} + +div.memtitle { + border-top-right-radius: var(--border-radius-medium); + border-top-left-radius: var(--border-radius-medium); +} + +div.memproto table.memname { + font-family: var(--font-family-monospace); + color: var(--page-foreground-color); + font-size: var(--memname-font-size); + text-shadow: none; +} + +div.memproto div.memtemplate { + font-family: var(--font-family-monospace); + color: var(--primary-dark-color); + font-size: var(--memname-font-size); + margin-left: 2px; + text-shadow: none; +} + +table.mlabels, table.mlabels > tbody { + display: block; +} + +td.mlabels-left { + width: auto; +} + +td.mlabels-right { + margin-top: 3px; + position: sticky; + left: 0; +} + +table.mlabels > tbody > tr:first-child { + display: flex; + justify-content: space-between; + flex-wrap: wrap; +} + +.memname, .memitem span.mlabels { + margin: 0 +} + +/* + reflist + */ + +dl.reflist { + box-shadow: var(--box-shadow); + border-radius: var(--border-radius-medium); + border: 1px solid var(--separator-color); + overflow: hidden; + padding: 0; +} + + +dl.reflist dt, dl.reflist dd { + box-shadow: none; + text-shadow: none; + background-image: none; + border: none; + padding: 12px; +} + + +dl.reflist dt { + font-weight: 500; + border-radius: 0; + background: var(--code-background); + border-bottom: 1px solid var(--separator-color); + color: var(--page-foreground-color) +} + + +dl.reflist dd { + background: none; +} + +/* + Table + */ + +.contents table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname), +.contents table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname) tbody { + display: inline-block; + max-width: 100%; +} + +.contents > table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname):not(.classindex) { + margin-left: calc(0px - var(--spacing-large)); + margin-right: calc(0px - var(--spacing-large)); + max-width: calc(100% + 2 * var(--spacing-large)); +} + +table.fieldtable, +table.markdownTable tbody, +table.doxtable tbody { + border: none; + margin: var(--spacing-medium) 0; + box-shadow: 0 0 0 1px var(--separator-color); + border-radius: var(--border-radius-small); +} + +table.markdownTable, table.doxtable, table.fieldtable { + padding: 1px; +} + +table.doxtable caption { + display: block; +} + +table.fieldtable { + border-collapse: collapse; + width: 100%; +} + +th.markdownTableHeadLeft, +th.markdownTableHeadRight, +th.markdownTableHeadCenter, +th.markdownTableHeadNone, +table.doxtable th { + background: var(--tablehead-background); + color: var(--tablehead-foreground); + font-weight: 600; + font-size: var(--page-font-size); +} + +th.markdownTableHeadLeft:first-child, +th.markdownTableHeadRight:first-child, +th.markdownTableHeadCenter:first-child, +th.markdownTableHeadNone:first-child, +table.doxtable tr th:first-child { + border-top-left-radius: var(--border-radius-small); +} + +th.markdownTableHeadLeft:last-child, +th.markdownTableHeadRight:last-child, +th.markdownTableHeadCenter:last-child, +th.markdownTableHeadNone:last-child, +table.doxtable tr th:last-child { + border-top-right-radius: var(--border-radius-small); +} + +table.markdownTable td, +table.markdownTable th, +table.fieldtable td, +table.fieldtable th, +table.doxtable td, +table.doxtable th { + border: 1px solid var(--separator-color); + padding: var(--spacing-small) var(--spacing-medium); +} + +table.markdownTable td:last-child, +table.markdownTable th:last-child, +table.fieldtable td:last-child, +table.fieldtable th:last-child, +table.doxtable td:last-child, +table.doxtable th:last-child { + border-right: none; +} + +table.markdownTable td:first-child, +table.markdownTable th:first-child, +table.fieldtable td:first-child, +table.fieldtable th:first-child, +table.doxtable td:first-child, +table.doxtable th:first-child { + border-left: none; +} + +table.markdownTable tr:first-child td, +table.markdownTable tr:first-child th, +table.fieldtable tr:first-child td, +table.fieldtable tr:first-child th, +table.doxtable tr:first-child td, +table.doxtable tr:first-child th { + border-top: none; +} + +table.markdownTable tr:last-child td, +table.markdownTable tr:last-child th, +table.fieldtable tr:last-child td, +table.fieldtable tr:last-child th, +table.doxtable tr:last-child td, +table.doxtable tr:last-child th { + border-bottom: none; +} + +table.markdownTable tr, table.doxtable tr { + border-bottom: 1px solid var(--separator-color); +} + +table.markdownTable tr:last-child, table.doxtable tr:last-child { + border-bottom: none; +} + +.full_width_table table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname) { + display: block; +} + +.full_width_table table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname) tbody { + display: table; + width: 100%; +} + +table.fieldtable th { + font-size: var(--page-font-size); + font-weight: 600; + background-image: none; + background-color: var(--tablehead-background); + color: var(--tablehead-foreground); +} + +table.fieldtable td.fieldtype, .fieldtable td.fieldname, .fieldtable td.fielddoc, .fieldtable th { + border-bottom: 1px solid var(--separator-color); + border-right: 1px solid var(--separator-color); +} + +table.fieldtable tr:last-child td:first-child { + border-bottom-left-radius: var(--border-radius-small); +} + +table.fieldtable tr:last-child td:last-child { + border-bottom-right-radius: var(--border-radius-small); +} + +.memberdecls td.glow, .fieldtable tr.glow { + background-color: var(--primary-light-color); + box-shadow: none; +} + +table.memberdecls { + display: block; + -webkit-tap-highlight-color: transparent; +} + +table.memberdecls tr[class^='memitem'] { + font-family: var(--font-family-monospace); + font-size: var(--code-font-size); +} + +table.memberdecls tr[class^='memitem'] .memTemplParams { + font-family: var(--font-family-monospace); + font-size: var(--code-font-size); + color: var(--primary-dark-color); + white-space: normal; +} + +table.memberdecls .memItemLeft, +table.memberdecls .memItemRight, +table.memberdecls .memTemplItemLeft, +table.memberdecls .memTemplItemRight, +table.memberdecls .memTemplParams { + transition: none; + padding-top: var(--spacing-small); + padding-bottom: var(--spacing-small); + border-top: 1px solid var(--separator-color); + border-bottom: 1px solid var(--separator-color); + background-color: var(--fragment-background); +} + +table.memberdecls .memTemplItemLeft, +table.memberdecls .memTemplItemRight { + padding-top: 2px; +} + +table.memberdecls .memTemplParams { + border-bottom: 0; + border-left: 1px solid var(--separator-color); + border-right: 1px solid var(--separator-color); + border-radius: var(--border-radius-small) var(--border-radius-small) 0 0; + padding-bottom: var(--spacing-small); +} + +table.memberdecls .memTemplItemLeft { + border-radius: 0 0 0 var(--border-radius-small); + border-left: 1px solid var(--separator-color); + border-top: 0; +} + +table.memberdecls .memTemplItemRight { + border-radius: 0 0 var(--border-radius-small) 0; + border-right: 1px solid var(--separator-color); + padding-left: 0; + border-top: 0; +} + +table.memberdecls .memItemLeft { + border-radius: var(--border-radius-small) 0 0 var(--border-radius-small); + border-left: 1px solid var(--separator-color); + padding-left: var(--spacing-medium); + padding-right: 0; +} + +table.memberdecls .memItemRight { + border-radius: 0 var(--border-radius-small) var(--border-radius-small) 0; + border-right: 1px solid var(--separator-color); + padding-right: var(--spacing-medium); + padding-left: 0; + +} + +table.memberdecls .mdescLeft, table.memberdecls .mdescRight { + background: none; + color: var(--page-foreground-color); + padding: var(--spacing-small) 0; +} + +table.memberdecls .memItemLeft, +table.memberdecls .memTemplItemLeft { + padding-right: var(--spacing-medium); +} + +table.memberdecls .memSeparator { + background: var(--page-background-color); + height: var(--spacing-large); + border: 0; + transition: none; +} + +table.memberdecls .groupheader { + margin-bottom: var(--spacing-large); +} + +table.memberdecls .inherit_header td { + padding: 0 0 var(--spacing-medium) 0; + text-indent: -12px; + color: var(--page-secondary-foreground-color); +} + +table.memberdecls img[src="closed.png"], +table.memberdecls img[src="open.png"], +div.dynheader img[src="open.png"], +div.dynheader img[src="closed.png"] { + width: 0; + height: 0; + border-left: 4px solid transparent; + border-right: 4px solid transparent; + border-top: 5px solid var(--primary-color); + margin-top: 8px; + display: block; + float: left; + margin-left: -10px; + transition: transform var(--animation-duration) ease-out; +} + +table.memberdecls img { + margin-right: 10px; +} + +table.memberdecls img[src="closed.png"], +div.dynheader img[src="closed.png"] { + transform: rotate(-90deg); + +} + +.compoundTemplParams { + font-family: var(--font-family-monospace); + color: var(--primary-dark-color); + font-size: var(--code-font-size); +} + +@media screen and (max-width: 767px) { + + table.memberdecls .memItemLeft, + table.memberdecls .memItemRight, + table.memberdecls .mdescLeft, + table.memberdecls .mdescRight, + table.memberdecls .memTemplItemLeft, + table.memberdecls .memTemplItemRight, + table.memberdecls .memTemplParams { + display: block; + text-align: left; + padding-left: var(--spacing-large); + margin: 0 calc(0px - var(--spacing-large)) 0 calc(0px - var(--spacing-large)); + border-right: none; + border-left: none; + border-radius: 0; + white-space: normal; + } + + table.memberdecls .memItemLeft, + table.memberdecls .mdescLeft, + table.memberdecls .memTemplItemLeft { + border-bottom: 0; + padding-bottom: 0; + } + + table.memberdecls .memTemplItemLeft { + padding-top: 0; + } + + table.memberdecls .mdescLeft { + margin-bottom: calc(0px - var(--page-font-size)); + } + + table.memberdecls .memItemRight, + table.memberdecls .mdescRight, + table.memberdecls .memTemplItemRight { + border-top: 0; + padding-top: 0; + padding-right: var(--spacing-large); + overflow-x: auto; + } + + table.memberdecls tr[class^='memitem']:not(.inherit) { + display: block; + width: calc(100vw - 2 * var(--spacing-large)); + } + + table.memberdecls .mdescRight { + color: var(--page-foreground-color); + } + + table.memberdecls tr.inherit { + visibility: hidden; + } + + table.memberdecls tr[style="display: table-row;"] { + display: block !important; + visibility: visible; + width: calc(100vw - 2 * var(--spacing-large)); + animation: fade .5s; + } + + @keyframes fade { + 0% { + opacity: 0; + max-height: 0; + } + + 100% { + opacity: 1; + max-height: 200px; + } + } +} + + +/* + Horizontal Rule + */ + +hr { + margin-top: var(--spacing-large); + margin-bottom: var(--spacing-large); + height: 1px; + background-color: var(--separator-color); + border: 0; +} + +.contents hr { + box-shadow: 100px 0 var(--separator-color), + -100px 0 var(--separator-color), + 500px 0 var(--separator-color), + -500px 0 var(--separator-color), + 900px 0 var(--separator-color), + -900px 0 var(--separator-color), + 1400px 0 var(--separator-color), + -1400px 0 var(--separator-color), + 1900px 0 var(--separator-color), + -1900px 0 var(--separator-color); +} + +.contents img, .contents .center, .contents center, .contents div.image object { + max-width: 100%; + overflow: auto; +} + +@media screen and (max-width: 767px) { + .contents .dyncontent > .center, .contents > center { + margin-left: calc(0px - var(--spacing-large)); + margin-right: calc(0px - var(--spacing-large)); + max-width: calc(100% + 2 * var(--spacing-large)); + } +} + +/* + Directories + */ +div.directory { + border-top: 1px solid var(--separator-color); + border-bottom: 1px solid var(--separator-color); + width: auto; +} + +table.directory { + font-family: var(--font-family); + font-size: var(--page-font-size); + font-weight: normal; + width: 100%; +} + +table.directory td.entry, table.directory td.desc { + padding: calc(var(--spacing-small) / 2) var(--spacing-small); + line-height: var(--table-line-height); +} + +table.directory tr.even td:last-child { + border-radius: 0 var(--border-radius-small) var(--border-radius-small) 0; +} + +table.directory tr.even td:first-child { + border-radius: var(--border-radius-small) 0 0 var(--border-radius-small); +} + +table.directory tr.even:last-child td:last-child { + border-radius: 0 var(--border-radius-small) 0 0; +} + +table.directory tr.even:last-child td:first-child { + border-radius: var(--border-radius-small) 0 0 0; +} + +table.directory td.desc { + min-width: 250px; +} + +table.directory tr.even { + background-color: var(--odd-color); +} + +table.directory tr.odd { + background-color: transparent; +} + +.icona { + width: auto; + height: auto; + margin: 0 var(--spacing-small); +} + +.icon { + background: var(--primary-color); + border-radius: var(--border-radius-small); + font-size: var(--page-font-size); + padding: calc(var(--page-font-size) / 5); + line-height: var(--page-font-size); + transform: scale(0.8); + height: auto; + width: var(--page-font-size); + user-select: none; +} + +.iconfopen, .icondoc, .iconfclosed { + background-position: center; + margin-bottom: 0; + height: var(--table-line-height); +} + +.icondoc { + filter: saturate(0.2); +} + +@media screen and (max-width: 767px) { + div.directory { + margin-left: calc(0px - var(--spacing-large)); + margin-right: calc(0px - var(--spacing-large)); + } +} + +@media (prefers-color-scheme: dark) { + html:not(.light-mode) .iconfopen, html:not(.light-mode) .iconfclosed { + filter: hue-rotate(180deg) invert(); + } +} + +html.dark-mode .iconfopen, html.dark-mode .iconfclosed { + filter: hue-rotate(180deg) invert(); +} + +/* + Class list + */ + +.classindex dl.odd { + background: var(--odd-color); + border-radius: var(--border-radius-small); +} + +.classindex dl.even { + background-color: transparent; +} + +/* + Class Index Doxygen 1.8 +*/ + +table.classindex { + margin-left: 0; + margin-right: 0; + width: 100%; +} + +table.classindex table div.ah { + background-image: none; + background-color: initial; + border-color: var(--separator-color); + color: var(--page-foreground-color); + box-shadow: var(--box-shadow); + border-radius: var(--border-radius-large); + padding: var(--spacing-small); +} + +div.qindex { + background-color: var(--odd-color); + border-radius: var(--border-radius-small); + border: 1px solid var(--separator-color); + padding: var(--spacing-small) 0; +} + +/* + Footer and nav-path + */ + +#nav-path { + width: 100%; +} + +#nav-path ul { + background-image: none; + background: var(--page-background-color); + border: none; + border-top: 1px solid var(--separator-color); + border-bottom: 1px solid var(--separator-color); + border-bottom: 0; + box-shadow: 0 0.75px 0 var(--separator-color); + font-size: var(--navigation-font-size); +} + +img.footer { + width: 60px; +} + +.navpath li.footer { + color: var(--page-secondary-foreground-color); +} + +address.footer { + color: var(--page-secondary-foreground-color); + margin-bottom: var(--spacing-large); +} + +#nav-path li.navelem { + background-image: none; + display: flex; + align-items: center; +} + +.navpath li.navelem a { + text-shadow: none; + display: inline-block; + color: var(--primary-color) !important; +} + +.navpath li.navelem b { + color: var(--primary-dark-color); + font-weight: 500; +} + +li.navelem { + padding: 0; + margin-left: -8px; +} + +li.navelem:first-child { + margin-left: var(--spacing-large); +} + +li.navelem:first-child:before { + display: none; +} + +#nav-path li.navelem:after { + content: ''; + border: 5px solid var(--page-background-color); + border-bottom-color: transparent; + border-right-color: transparent; + border-top-color: transparent; + transform: translateY(-1px) scaleY(4.2); + z-index: 10; + margin-left: 6px; +} + +#nav-path li.navelem:before { + content: ''; + border: 5px solid var(--separator-color); + border-bottom-color: transparent; + border-right-color: transparent; + border-top-color: transparent; + transform: translateY(-1px) scaleY(3.2); + margin-right: var(--spacing-small); +} + +.navpath li.navelem a:hover { + color: var(--primary-color); +} + +/* + Scrollbars for Webkit +*/ + +#nav-tree::-webkit-scrollbar, +div.fragment::-webkit-scrollbar, +pre.fragment::-webkit-scrollbar, +div.memproto::-webkit-scrollbar, +.contents center::-webkit-scrollbar, +.contents .center::-webkit-scrollbar, +.contents table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname) tbody::-webkit-scrollbar, +div.contents .toc::-webkit-scrollbar, +.contents .dotgraph::-webkit-scrollbar, +.contents .tabs-overview-container::-webkit-scrollbar { + background: transparent; + width: calc(var(--webkit-scrollbar-size) + var(--webkit-scrollbar-padding) + var(--webkit-scrollbar-padding)); + height: calc(var(--webkit-scrollbar-size) + var(--webkit-scrollbar-padding) + var(--webkit-scrollbar-padding)); +} + +#nav-tree::-webkit-scrollbar-thumb, +div.fragment::-webkit-scrollbar-thumb, +pre.fragment::-webkit-scrollbar-thumb, +div.memproto::-webkit-scrollbar-thumb, +.contents center::-webkit-scrollbar-thumb, +.contents .center::-webkit-scrollbar-thumb, +.contents table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname) tbody::-webkit-scrollbar-thumb, +div.contents .toc::-webkit-scrollbar-thumb, +.contents .dotgraph::-webkit-scrollbar-thumb, +.contents .tabs-overview-container::-webkit-scrollbar-thumb { + background-color: transparent; + border: var(--webkit-scrollbar-padding) solid transparent; + border-radius: calc(var(--webkit-scrollbar-padding) + var(--webkit-scrollbar-padding)); + background-clip: padding-box; +} + +#nav-tree:hover::-webkit-scrollbar-thumb, +div.fragment:hover::-webkit-scrollbar-thumb, +pre.fragment:hover::-webkit-scrollbar-thumb, +div.memproto:hover::-webkit-scrollbar-thumb, +.contents center:hover::-webkit-scrollbar-thumb, +.contents .center:hover::-webkit-scrollbar-thumb, +.contents table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname) tbody:hover::-webkit-scrollbar-thumb, +div.contents .toc:hover::-webkit-scrollbar-thumb, +.contents .dotgraph:hover::-webkit-scrollbar-thumb, +.contents .tabs-overview-container:hover::-webkit-scrollbar-thumb { + background-color: var(--webkit-scrollbar-color); +} + +#nav-tree::-webkit-scrollbar-track, +div.fragment::-webkit-scrollbar-track, +pre.fragment::-webkit-scrollbar-track, +div.memproto::-webkit-scrollbar-track, +.contents center::-webkit-scrollbar-track, +.contents .center::-webkit-scrollbar-track, +.contents table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname) tbody::-webkit-scrollbar-track, +div.contents .toc::-webkit-scrollbar-track, +.contents .dotgraph::-webkit-scrollbar-track, +.contents .tabs-overview-container::-webkit-scrollbar-track { + background: transparent; +} + +#nav-tree::-webkit-scrollbar-corner { + background-color: var(--side-nav-background); +} + +#nav-tree, +div.fragment, +pre.fragment, +div.memproto, +.contents center, +.contents .center, +.contents table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname) tbody, +div.contents .toc { + overflow-x: auto; + overflow-x: overlay; +} + +#nav-tree { + overflow-x: auto; + overflow-y: auto; + overflow-y: overlay; +} + +/* + Scrollbars for Firefox +*/ + +#nav-tree, +div.fragment, +pre.fragment, +div.memproto, +.contents center, +.contents .center, +.contents table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname) tbody, +div.contents .toc, +.contents .dotgraph, +.contents .tabs-overview-container { + scrollbar-width: thin; +} + +/* + Optional Dark mode toggle button +*/ + +doxygen-awesome-dark-mode-toggle { + display: inline-block; + margin: 0 0 0 var(--spacing-small); + padding: 0; + width: var(--searchbar-height); + height: var(--searchbar-height); + background: none; + border: none; + border-radius: var(--searchbar-height); + vertical-align: middle; + text-align: center; + line-height: var(--searchbar-height); + font-size: 22px; + display: flex; + align-items: center; + justify-content: center; + user-select: none; + cursor: pointer; +} + +doxygen-awesome-dark-mode-toggle > svg { + transition: transform var(--animation-duration) ease-in-out; +} + +doxygen-awesome-dark-mode-toggle:active > svg { + transform: scale(.5); +} + +doxygen-awesome-dark-mode-toggle:hover { + background-color: rgba(0,0,0,.03); +} + +html.dark-mode doxygen-awesome-dark-mode-toggle:hover { + background-color: rgba(0,0,0,.18); +} + +/* + Optional fragment copy button +*/ +.doxygen-awesome-fragment-wrapper { + position: relative; +} + +doxygen-awesome-fragment-copy-button { + opacity: 0; + background: var(--fragment-background); + width: 28px; + height: 28px; + position: absolute; + right: calc(var(--spacing-large) - (var(--spacing-large) / 2.5)); + top: calc(var(--spacing-large) - (var(--spacing-large) / 2.5)); + border: 1px solid var(--fragment-foreground); + cursor: pointer; + border-radius: var(--border-radius-small); + display: flex; + justify-content: center; + align-items: center; +} + +.doxygen-awesome-fragment-wrapper:hover doxygen-awesome-fragment-copy-button, doxygen-awesome-fragment-copy-button.success { + opacity: .28; +} + +doxygen-awesome-fragment-copy-button:hover, doxygen-awesome-fragment-copy-button.success { + opacity: 1 !important; +} + +doxygen-awesome-fragment-copy-button:active:not([class~=success]) svg { + transform: scale(.91); +} + +doxygen-awesome-fragment-copy-button svg { + fill: var(--fragment-foreground); + width: 18px; + height: 18px; +} + +doxygen-awesome-fragment-copy-button.success svg { + fill: rgb(14, 168, 14); +} + +doxygen-awesome-fragment-copy-button.success { + border-color: rgb(14, 168, 14); +} + +@media screen and (max-width: 767px) { + .textblock > .doxygen-awesome-fragment-wrapper > doxygen-awesome-fragment-copy-button, + .textblock li > .doxygen-awesome-fragment-wrapper > doxygen-awesome-fragment-copy-button, + .memdoc li > .doxygen-awesome-fragment-wrapper > doxygen-awesome-fragment-copy-button, + .memdoc > .doxygen-awesome-fragment-wrapper > doxygen-awesome-fragment-copy-button, + dl dd > .doxygen-awesome-fragment-wrapper > doxygen-awesome-fragment-copy-button { + right: 0; + } +} + +/* + Optional paragraph link button +*/ + +a.anchorlink { + font-size: 90%; + margin-left: var(--spacing-small); + color: var(--page-foreground-color) !important; + text-decoration: none; + opacity: .15; + display: none; + transition: opacity var(--animation-duration) ease-in-out, color var(--animation-duration) ease-in-out; +} + +a.anchorlink svg { + fill: var(--page-foreground-color); +} + +h3 a.anchorlink svg, h4 a.anchorlink svg { + margin-bottom: -3px; + margin-top: -4px; +} + +a.anchorlink:hover { + opacity: .45; +} + +h2:hover a.anchorlink, h1:hover a.anchorlink, h3:hover a.anchorlink, h4:hover a.anchorlink { + display: inline-block; +} + +/* + Optional tab feature +*/ + +.tabbed > ul { + padding-inline-start: 0px; + margin: 0; + padding: var(--spacing-small) 0; +} + +.tabbed > ul > li { + display: none; +} + +.tabbed > ul > li.selected { + display: block; +} + +.tabs-overview-container { + overflow-x: auto; + display: block; + overflow-y: visible; +} + +.tabs-overview { + border-bottom: 1px solid var(--separator-color); + display: flex; + flex-direction: row; +} + +@media screen and (max-width: 767px) { + .tabs-overview-container { + margin: 0 calc(0px - var(--spacing-large)); + } + .tabs-overview { + padding: 0 var(--spacing-large) + } +} + +.tabs-overview button.tab-button { + color: var(--page-foreground-color); + margin: 0; + border: none; + background: transparent; + padding: calc(var(--spacing-large) / 2) 0; + display: inline-block; + font-size: var(--page-font-size); + cursor: pointer; + box-shadow: 0 1px 0 0 var(--separator-color); + position: relative; + + -webkit-tap-highlight-color: transparent; +} + +.tabs-overview button.tab-button .tab-title::before { + display: block; + content: attr(title); + font-weight: 600; + height: 0; + overflow: hidden; + visibility: hidden; +} + +.tabs-overview button.tab-button .tab-title { + float: left; + white-space: nowrap; + font-weight: normal; + padding: calc(var(--spacing-large) / 2) var(--spacing-large); + border-radius: var(--border-radius-medium); + transition: background-color var(--animation-duration) ease-in-out, font-weight var(--animation-duration) ease-in-out; +} + +.tabs-overview button.tab-button:not(:last-child) .tab-title { + box-shadow: 8px 0 0 -7px var(--separator-color); +} + +.tabs-overview button.tab-button:hover .tab-title { + background: var(--separator-color); + box-shadow: none; +} + +.tabs-overview button.tab-button.active .tab-title { + font-weight: 600; +} + +.tabs-overview button.tab-button::after { + content: ''; + display: block; + position: absolute; + left: 0; + bottom: 0; + right: 0; + height: 0; + width: 0%; + margin: 0 auto; + border-radius: var(--border-radius-small) var(--border-radius-small) 0 0; + background-color: var(--primary-color); + transition: width var(--animation-duration) ease-in-out, height var(--animation-duration) ease-in-out; +} + +.tabs-overview button.tab-button.active::after { + width: 100%; + box-sizing: border-box; + height: 3px; +} + + +/* + Navigation Buttons +*/ + +.section_buttons:not(:empty) { + margin-top: calc(var(--spacing-large) * 3); +} + +.section_buttons table.markdownTable { + display: block; + width: 100%; +} + +.section_buttons table.markdownTable tbody { + display: table !important; + width: 100%; + box-shadow: none; + border-spacing: 10px; +} + +.section_buttons table.markdownTable td { + padding: 0; +} + +.section_buttons table.markdownTable th { + display: none; +} + +.section_buttons table.markdownTable tr.markdownTableHead { + border: none; +} + +.section_buttons tr th, .section_buttons tr td { + background: none; + border: none; + padding: var(--spacing-large) 0 var(--spacing-small); +} + +.section_buttons a { + display: inline-block; + border: 1px solid var(--separator-color); + border-radius: var(--border-radius-medium); + color: var(--page-secondary-foreground-color) !important; + text-decoration: none; + transition: color var(--animation-duration) ease-in-out, background-color var(--animation-duration) ease-in-out; +} + +.section_buttons a:hover { + color: var(--page-foreground-color) !important; + background-color: var(--odd-color); +} + +.section_buttons tr td.markdownTableBodyLeft a { + padding: var(--spacing-medium) var(--spacing-large) var(--spacing-medium) calc(var(--spacing-large) / 2); +} + +.section_buttons tr td.markdownTableBodyRight a { + padding: var(--spacing-medium) calc(var(--spacing-large) / 2) var(--spacing-medium) var(--spacing-large); +} + +.section_buttons tr td.markdownTableBodyLeft a::before, +.section_buttons tr td.markdownTableBodyRight a::after { + color: var(--page-secondary-foreground-color) !important; + display: inline-block; + transition: color .08s ease-in-out, transform .09s ease-in-out; +} + +.section_buttons tr td.markdownTableBodyLeft a::before { + content: '〈'; + padding-right: var(--spacing-large); +} + + +.section_buttons tr td.markdownTableBodyRight a::after { + content: '〉'; + padding-left: var(--spacing-large); +} + + +.section_buttons tr td.markdownTableBodyLeft a:hover::before { + color: var(--page-foreground-color) !important; + transform: translateX(-3px); +} + +.section_buttons tr td.markdownTableBodyRight a:hover::after { + color: var(--page-foreground-color) !important; + transform: translateX(3px); +} + +@media screen and (max-width: 450px) { + .section_buttons a { + width: 100%; + box-sizing: border-box; + } + + .section_buttons tr td:nth-of-type(1).markdownTableBodyLeft a { + border-radius: var(--border-radius-medium) 0 0 var(--border-radius-medium); + border-right: none; + } + + .section_buttons tr td:nth-of-type(2).markdownTableBodyRight a { + border-radius: 0 var(--border-radius-medium) var(--border-radius-medium) 0; + } +} diff --git a/v0.4.6/doxygen.css b/v0.4.6/doxygen.css new file mode 100644 index 00000000..7cd7520d --- /dev/null +++ b/v0.4.6/doxygen.css @@ -0,0 +1,1838 @@ +/* The standard CSS for doxygen 1.11.0*/ + +body { + background-color: white; + color: black; +} + +body, table, div, p, dl { + font-weight: 400; + font-size: 14px; + font-family: Roboto,sans-serif; + line-height: 22px; +} + +/* @group Heading Levels */ + +.title { + font-family: Roboto,sans-serif; + line-height: 28px; + font-size: 150%; + font-weight: bold; + margin: 10px 2px; +} + +h1.groupheader { + font-size: 150%; +} + +h2.groupheader { + border-bottom: 1px solid #879ECB; + color: #354C7B; + font-size: 150%; + font-weight: normal; + margin-top: 1.75em; + padding-top: 8px; + padding-bottom: 4px; + width: 100%; +} + +h3.groupheader { + font-size: 100%; +} + +h1, h2, h3, h4, h5, h6 { + -webkit-transition: text-shadow 0.5s linear; + -moz-transition: text-shadow 0.5s linear; + -ms-transition: text-shadow 0.5s linear; + -o-transition: text-shadow 0.5s linear; + transition: text-shadow 0.5s linear; + margin-right: 15px; +} + +h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { + text-shadow: 0 0 15px cyan; +} + +dt { + font-weight: bold; +} + +p.startli, p.startdd { + margin-top: 2px; +} + +th p.starttd, th p.intertd, th p.endtd { + font-size: 100%; + font-weight: 700; +} + +p.starttd { + margin-top: 0px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + +p.interli { +} + +p.interdd { +} + +p.intertd { +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +h3.version { + font-size: 90%; + text-align: center; +} + +div.navtab { + padding-right: 15px; + text-align: right; + line-height: 110%; +} + +div.navtab table { + border-spacing: 0; +} + +td.navtab { + padding-right: 6px; + padding-left: 6px; +} + +td.navtabHL { + background-image: url('tab_a.png'); + background-repeat:repeat-x; + padding-right: 6px; + padding-left: 6px; +} + +td.navtabHL a, td.navtabHL a:visited { + color: white; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +} + +a.navtab { + font-weight: bold; +} + +div.qindex{ + text-align: center; + width: 100%; + line-height: 140%; + font-size: 130%; + color: #A0A0A0; +} + +#main-menu a:focus { + outline: auto; + z-index: 10; + position: relative; +} + +dt.alphachar{ + font-size: 180%; + font-weight: bold; +} + +.alphachar a{ + color: black; +} + +.alphachar a:hover, .alphachar a:visited{ + text-decoration: none; +} + +.classindex dl { + padding: 25px; + column-count:1 +} + +.classindex dd { + display:inline-block; + margin-left: 50px; + width: 90%; + line-height: 1.15em; +} + +.classindex dl.even { + background-color: white; +} + +.classindex dl.odd { + background-color: #F8F9FC; +} + +@media(min-width: 1120px) { + .classindex dl { + column-count:2 + } +} + +@media(min-width: 1320px) { + .classindex dl { + column-count:3 + } +} + + +/* @group Link Styling */ + +a { + color: #3D578C; + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: #4665A2; +} + +a:hover { + text-decoration: none; + background: linear-gradient(to bottom, transparent 0,transparent calc(100% - 1px), currentColor 100%); +} + +a:hover > span.arrow { + text-decoration: none; + background : #F9FAFC; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code, a.code:visited, a.line, a.line:visited { + color: #4665A2; +} + +a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { + color: #4665A2; +} + +a.code.hl_class { /* style for links to class names in code snippets */ } +a.code.hl_struct { /* style for links to struct names in code snippets */ } +a.code.hl_union { /* style for links to union names in code snippets */ } +a.code.hl_interface { /* style for links to interface names in code snippets */ } +a.code.hl_protocol { /* style for links to protocol names in code snippets */ } +a.code.hl_category { /* style for links to category names in code snippets */ } +a.code.hl_exception { /* style for links to exception names in code snippets */ } +a.code.hl_service { /* style for links to service names in code snippets */ } +a.code.hl_singleton { /* style for links to singleton names in code snippets */ } +a.code.hl_concept { /* style for links to concept names in code snippets */ } +a.code.hl_namespace { /* style for links to namespace names in code snippets */ } +a.code.hl_package { /* style for links to package names in code snippets */ } +a.code.hl_define { /* style for links to macro names in code snippets */ } +a.code.hl_function { /* style for links to function names in code snippets */ } +a.code.hl_variable { /* style for links to variable names in code snippets */ } +a.code.hl_typedef { /* style for links to typedef names in code snippets */ } +a.code.hl_enumvalue { /* style for links to enum value names in code snippets */ } +a.code.hl_enumeration { /* style for links to enumeration names in code snippets */ } +a.code.hl_signal { /* style for links to Qt signal names in code snippets */ } +a.code.hl_slot { /* style for links to Qt slot names in code snippets */ } +a.code.hl_friend { /* style for links to friend names in code snippets */ } +a.code.hl_dcop { /* style for links to KDE3 DCOP names in code snippets */ } +a.code.hl_property { /* style for links to property names in code snippets */ } +a.code.hl_event { /* style for links to event names in code snippets */ } +a.code.hl_sequence { /* style for links to sequence names in code snippets */ } +a.code.hl_dictionary { /* style for links to dictionary names in code snippets */ } + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +ul.check { + list-style:none; + text-indent: -16px; + padding-left: 38px; +} +li.unchecked:before { + content: "\2610\A0"; +} +li.checked:before { + content: "\2611\A0"; +} + +ol { + text-indent: 0px; +} + +ul { + text-indent: 0px; + overflow: visible; +} + +ul.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; + column-count: 3; + list-style-type: none; +} + +#side-nav ul { + overflow: visible; /* reset ul rule for scroll bar in GENERATE_TREEVIEW window */ +} + +#main-nav ul { + overflow: visible; /* reset ul rule for the navigation bar drop down lists */ +} + +.fragment { + text-align: left; + direction: ltr; + overflow-x: auto; + overflow-y: hidden; + position: relative; + min-height: 12px; + margin: 10px 0px; + padding: 10px 10px; + border: 1px solid #C4CFE5; + border-radius: 4px; + background-color: #FBFCFD; + color: black; +} + +pre.fragment { + word-wrap: break-word; + font-size: 10pt; + line-height: 125%; + font-family: 'JetBrains Mono',Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace,fixed; +} + +.clipboard { + width: 24px; + height: 24px; + right: 5px; + top: 5px; + opacity: 0; + position: absolute; + display: inline; + overflow: auto; + fill: black; + justify-content: center; + align-items: center; + cursor: pointer; +} + +.clipboard.success { + border: 1px solid black; + border-radius: 4px; +} + +.fragment:hover .clipboard, .clipboard.success { + opacity: .28; +} + +.clipboard:hover, .clipboard.success { + opacity: 1 !important; +} + +.clipboard:active:not([class~=success]) svg { + transform: scale(.91); +} + +.clipboard.success svg { + fill: #2EC82E; +} + +.clipboard.success { + border-color: #2EC82E; +} + +div.line { + font-family: 'JetBrains Mono',Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace,fixed; + font-size: 13px; + min-height: 13px; + line-height: 1.2; + text-wrap: unrestricted; + white-space: -moz-pre-wrap; /* Moz */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + white-space: pre-wrap; /* CSS3 */ + word-wrap: break-word; /* IE 5.5+ */ + text-indent: -53px; + padding-left: 53px; + padding-bottom: 0px; + margin: 0px; + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +div.line:after { + content:"\000A"; + white-space: pre; +} + +div.line.glow { + background-color: cyan; + box-shadow: 0 0 10px cyan; +} + +span.fold { + margin-left: 5px; + margin-right: 1px; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; + display: inline-block; + width: 12px; + height: 12px; + background-repeat:no-repeat; + background-position:center; +} + +span.lineno { + padding-right: 4px; + margin-right: 9px; + text-align: right; + border-right: 2px solid #00FF00; + color: black; + background-color: #E8E8E8; + white-space: pre; +} +span.lineno a, span.lineno a:visited { + color: #4665A2; + background-color: #D8D8D8; +} + +span.lineno a:hover { + color: #4665A2; + background-color: #C8C8C8; +} + +.lineno { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +div.classindex ul { + list-style: none; + padding-left: 0; +} + +div.classindex span.ai { + display: inline-block; +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + color: black; + margin: 0; +} + +div.contents { + margin-top: 10px; + margin-left: 12px; + margin-right: 8px; +} + +p.formulaDsp { + text-align: center; +} + +img.dark-mode-visible { + display: none; +} +img.light-mode-visible { + display: none; +} + +img.formulaInl, img.inline { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +address.footer { + text-align: right; + padding-right: 12px; +} + +img.footer { + border: 0px; + vertical-align: middle; + width: 104px; +} + +.compoundTemplParams { + color: #4665A2; + font-size: 80%; + line-height: 120%; +} + +/* @group Code Colorization */ + +span.keyword { + color: #008000; +} + +span.keywordtype { + color: #604020; +} + +span.keywordflow { + color: #E08000; +} + +span.comment { + color: #800000; +} + +span.preprocessor { + color: #806020; +} + +span.stringliteral { + color: #002080; +} + +span.charliteral { + color: #008080; +} + +span.xmlcdata { + color: black; +} + +span.vhdldigit { + color: #FF00FF; +} + +span.vhdlchar { + color: #000000; +} + +span.vhdlkeyword { + color: #700070; +} + +span.vhdllogic { + color: #FF0000; +} + +blockquote { + background-color: #F7F8FB; + border-left: 2px solid #9CAFD4; + margin: 0 24px 0 4px; + padding: 0 12px 0 16px; +} + +/* @end */ + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #2D4068; +} + +th.dirtab { + background-color: #374F7F; + color: #FFFFFF; + font-weight: bold; +} + +hr { + height: 0px; + border: none; + border-top: 1px solid #4A6AAA; +} + +hr.footer { + height: 1px; +} + +/* @group Member Descriptions */ + +table.memberdecls { + border-spacing: 0px; + padding: 0px; +} + +.memberdecls td, .fieldtable tr { + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +.memberdecls td.glow, .fieldtable tr.glow { + background-color: cyan; + box-shadow: 0 0 15px cyan; +} + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: #F9FAFC; + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: #555; +} + +.memSeparator { + border-bottom: 1px solid #DEE4F0; + line-height: 1px; + margin: 0px; + padding: 0px; +} + +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + +.memItemRight, .memTemplItemRight { + width: 100%; +} + +.memTemplParams { + color: #4665A2; + white-space: nowrap; + font-size: 80%; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtitle { + padding: 8px; + border-top: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + border-top-right-radius: 4px; + border-top-left-radius: 4px; + margin-bottom: -1px; + background-image: url('nav_f.png'); + background-repeat: repeat-x; + background-color: #E2E8F2; + line-height: 1.25; + font-weight: 300; + float:left; +} + +.permalink +{ + font-size: 65%; + display: inline-block; + vertical-align: middle; +} + +.memtemplate { + font-size: 80%; + color: #4665A2; + font-weight: normal; + margin-left: 9px; +} + +.mempage { + width: 100%; +} + +.memitem { + padding: 0; + margin-bottom: 10px; + margin-right: 5px; + -webkit-transition: box-shadow 0.5s linear; + -moz-transition: box-shadow 0.5s linear; + -ms-transition: box-shadow 0.5s linear; + -o-transition: box-shadow 0.5s linear; + transition: box-shadow 0.5s linear; + display: table !important; + width: 100%; +} + +.memitem.glow { + box-shadow: 0 0 15px cyan; +} + +.memname { + font-weight: 400; + margin-left: 6px; +} + +.memname td { + vertical-align: bottom; +} + +.memproto, dl.reflist dt { + border-top: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 0px 6px 0px; + color: #253555; + font-weight: bold; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + background-color: #DFE5F1; + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + border-top-right-radius: 4px; +} + +.overload { + font-family: 'JetBrains Mono',Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace,fixed; + font-size: 65%; +} + +.memdoc, dl.reflist dd { + border-bottom: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 10px 2px 10px; + border-top-width: 0; + background-image:url('nav_g.png'); + background-repeat:repeat-x; + background-color: white; + /* opera specific markup */ + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + /* firefox specific markup */ + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-bottomright: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + /* webkit specific markup */ + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +dl.reflist dt { + padding: 5px; +} + +dl.reflist dd { + margin: 0px 0px 10px 0px; + padding: 5px; +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; + padding: 0px; + padding-bottom: 1px; +} + +.paramname { + white-space: nowrap; + padding: 0px; + padding-bottom: 1px; + margin-left: 2px; +} + +.paramname em { + color: #602020; + font-style: normal; + margin-right: 1px; +} + +.paramname .paramdefval { + font-family: 'JetBrains Mono',Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace,fixed; +} + +.params, .retval, .exception, .tparams { + margin-left: 0px; + padding-left: 0px; +} + +.params .paramname, .retval .paramname, .tparams .paramname, .exception .paramname { + font-weight: bold; + vertical-align: top; +} + +.params .paramtype, .tparams .paramtype { + font-style: italic; + vertical-align: top; +} + +.params .paramdir, .tparams .paramdir { + font-family: 'JetBrains Mono',Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace,fixed; + vertical-align: top; +} + +table.mlabels { + border-spacing: 0px; +} + +td.mlabels-left { + width: 100%; + padding: 0px; +} + +td.mlabels-right { + vertical-align: bottom; + padding: 0px; + white-space: nowrap; +} + +span.mlabels { + margin-left: 8px; +} + +span.mlabel { + background-color: #728DC1; + border-top:1px solid #5373B4; + border-left:1px solid #5373B4; + border-right:1px solid #C4CFE5; + border-bottom:1px solid #C4CFE5; + text-shadow: none; + color: white; + margin-right: 4px; + padding: 2px 3px; + border-radius: 3px; + font-size: 7pt; + white-space: nowrap; + vertical-align: middle; +} + + + +/* @end */ + +/* these are for tree view inside a (index) page */ + +div.directory { + margin: 10px 0px; + border-top: 1px solid #9CAFD4; + border-bottom: 1px solid #9CAFD4; + width: 100%; +} + +.directory table { + border-collapse:collapse; +} + +.directory td { + margin: 0px; + padding: 0px; + vertical-align: top; +} + +.directory td.entry { + white-space: nowrap; + padding-right: 6px; + padding-top: 3px; +} + +.directory td.entry a { + outline:none; +} + +.directory td.entry a img { + border: none; +} + +.directory td.desc { + width: 100%; + padding-left: 6px; + padding-right: 6px; + padding-top: 3px; + border-left: 1px solid rgba(0,0,0,0.05); +} + +.directory tr.odd { + padding-left: 6px; + background-color: #F8F9FC; +} + +.directory tr.even { + padding-left: 6px; + background-color: white; +} + +.directory img { + vertical-align: -30%; +} + +.directory .levels { + white-space: nowrap; + width: 100%; + text-align: right; + font-size: 9pt; +} + +.directory .levels span { + cursor: pointer; + padding-left: 2px; + padding-right: 2px; + color: #3D578C; +} + +.arrow { + color: #9CAFD4; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: pointer; + font-size: 80%; + display: inline-block; + width: 16px; + height: 22px; +} + +.icon { + font-family: Arial,Helvetica; + line-height: normal; + font-weight: bold; + font-size: 12px; + height: 14px; + width: 16px; + display: inline-block; + background-color: #728DC1; + color: white; + text-align: center; + border-radius: 4px; + margin-left: 2px; + margin-right: 2px; +} + +.icona { + width: 24px; + height: 22px; + display: inline-block; +} + +.iconfopen { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('folderopen.svg'); + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.iconfclosed { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('folderclosed.svg'); + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.icondoc { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('doc.svg'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +/* @end */ + +div.dynheader { + margin-top: 8px; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +address { + font-style: normal; + color: #2A3D61; +} + +table.doxtable caption { + caption-side: top; +} + +table.doxtable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.doxtable td, table.doxtable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +table.fieldtable { + margin-bottom: 10px; + border: 1px solid #A8B8D9; + border-spacing: 0px; + border-radius: 4px; + box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); +} + +.fieldtable td, .fieldtable th { + padding: 3px 7px 2px; +} + +.fieldtable td.fieldtype, .fieldtable td.fieldname { + white-space: nowrap; + border-right: 1px solid #A8B8D9; + border-bottom: 1px solid #A8B8D9; + vertical-align: top; +} + +.fieldtable td.fieldname { + padding-top: 3px; +} + +.fieldtable td.fielddoc { + border-bottom: 1px solid #A8B8D9; +} + +.fieldtable td.fielddoc p:first-child { + margin-top: 0px; +} + +.fieldtable td.fielddoc p:last-child { + margin-bottom: 2px; +} + +.fieldtable tr:last-child td { + border-bottom: none; +} + +.fieldtable th { + background-image: url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; + font-size: 90%; + color: #253555; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; + font-weight: 400; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom: 1px solid #A8B8D9; +} + + +.tabsearch { + top: 0px; + left: 10px; + height: 36px; + background-image: url('tab_b.png'); + z-index: 101; + overflow: hidden; + font-size: 13px; +} + +.navpath ul +{ + font-size: 11px; + background-image: url('tab_b.png'); + background-repeat:repeat-x; + background-position: 0 -5px; + height:30px; + line-height:30px; + color:#283A5D; + border:solid 1px #C2CDE4; + overflow:hidden; + margin:0px; + padding:0px; +} + +.navpath li +{ + list-style-type:none; + float:left; + padding-left:10px; + padding-right:15px; + background-image:url('bc_s.png'); + background-repeat:no-repeat; + background-position:right; + color: #364D7C; +} + +.navpath li.navelem a +{ + height:32px; + display:block; + outline: none; + color: #283A5D; + font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + text-decoration: none; +} + +.navpath li.navelem a:hover +{ + color: white; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +} + +.navpath li.footer +{ + list-style-type:none; + float:right; + padding-left:10px; + padding-right:15px; + background-image:none; + background-repeat:no-repeat; + background-position:right; + color: #2A3D61; + font-size: 8pt; +} + + +div.summary +{ + float: right; + font-size: 8pt; + padding-right: 5px; + width: 50%; + text-align: right; +} + +div.summary a +{ + white-space: nowrap; +} + +table.classindex +{ + margin: 10px; + white-space: nowrap; + margin-left: 3%; + margin-right: 3%; + width: 94%; + border: 0; + border-spacing: 0; + padding: 0; +} + +div.ingroups +{ + font-size: 8pt; + width: 50%; + text-align: left; +} + +div.ingroups a +{ + white-space: nowrap; +} + +div.header +{ + background-image: url('nav_h.png'); + background-repeat:repeat-x; + background-color: #F9FAFC; + margin: 0px; + border-bottom: 1px solid #C4CFE5; +} + +div.headertitle +{ + padding: 5px 5px 5px 10px; +} + +.PageDocRTL-title div.headertitle { + text-align: right; + direction: rtl; +} + +dl { + padding: 0 0 0 0; +} + +/* + +dl.section { + margin-left: 0px; + padding-left: 0px; +} + +dl.note { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #D0C000; +} + +dl.warning, dl.attention, dl.important { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #FF0000; +} + +dl.pre, dl.post, dl.invariant { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #00D000; +} + +dl.deprecated { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #505050; +} + +dl.todo { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #00C0E0; +} + +dl.test { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #3030E0; +} + +dl.bug { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #C08050; +} + +*/ + +dl.bug dt a, dl.deprecated dt a, dl.todo dt a, dl.test a { + font-weight: bold !important; +} + +dl.warning, dl.attention, dl.important, dl.note, dl.deprecated, dl.bug, +dl.invariant, dl.pre, dl.post, dl.todo, dl.test, dl.remark { + padding: 10px; + margin: 10px 0px; + overflow: hidden; + margin-left: 0; + border-radius: 4px; +} + +dl.section dd { + margin-bottom: 2px; +} + +dl.warning, dl.attention, dl.important { + background: #f8d1cc; + border-left: 8px solid #b61825; + color: #75070f; +} + +dl.warning dt, dl.attention dt, dl.important dt { + color: #b61825; +} + +dl.note, dl.remark { + background: #faf3d8; + border-left: 8px solid #f3a600; + color: #5f4204; +} + +dl.note dt, dl.remark dt { + color: #f3a600; +} + +dl.todo { + background: #e4f3ff; + border-left: 8px solid #1879C4; + color: #274a5c; +} + +dl.todo dt { + color: #1879C4; +} + +dl.test { + background: #e8e8ff; + border-left: 8px solid #3939C4; + color: #1a1a5c; +} + +dl.test dt { + color: #3939C4; +} + +dl.bug dt a { + color: #5b2bdd !important; +} + +dl.bug { + background: #e4dafd; + border-left: 8px solid #5b2bdd; + color: #2a0d72; +} + +dl.bug dt a { + color: #5b2bdd !important; +} + +dl.deprecated { + background: #ecf0f3; + border-left: 8px solid #5b6269; + color: #43454a; +} + +dl.deprecated dt a { + color: #5b6269 !important; +} + +dl.note dd, dl.warning dd, dl.pre dd, dl.post dd, +dl.remark dd, dl.attention dd, dl.important dd, dl.invariant dd, +dl.bug dd, dl.deprecated dd, dl.todo dd, dl.test dd { + margin-inline-start: 0px; +} + +dl.invariant, dl.pre, dl.post { + background: #d8f1e3; + border-left: 8px solid #44b86f; + color: #265532; +} + +dl.invariant dt, dl.pre dt, dl.post dt { + color: #44b86f; +} + + +#projectrow +{ + height: 56px; +} + +#projectlogo +{ + text-align: center; + vertical-align: bottom; + border-collapse: separate; +} + +#projectlogo img +{ + border: 0px none; +} + +#projectalign +{ + vertical-align: middle; + padding-left: 0.5em; +} + +#projectname +{ + font-size: 200%; + font-family: Tahoma,Arial,sans-serif; + margin: 0px; + padding: 2px 0px; +} + +#projectbrief +{ + font-size: 90%; + font-family: Tahoma,Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#projectnumber +{ + font-size: 50%; + font-family: 50% Tahoma,Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#titlearea +{ + padding: 0px; + margin: 0px; + width: 100%; + border-bottom: 1px solid #5373B4; + background-color: white; +} + +.image +{ + text-align: center; +} + +.dotgraph +{ + text-align: center; +} + +.mscgraph +{ + text-align: center; +} + +.plantumlgraph +{ + text-align: center; +} + +.diagraph +{ + text-align: center; +} + +.caption +{ + font-weight: bold; +} + +dl.citelist { + margin-bottom:50px; +} + +dl.citelist dt { + color:#334975; + float:left; + font-weight:bold; + margin-right:10px; + padding:5px; + text-align:right; + width:52px; +} + +dl.citelist dd { + margin:2px 0 2px 72px; + padding:5px 0; +} + +div.toc { + padding: 14px 25px; + background-color: #F4F6FA; + border: 1px solid #D8DFEE; + border-radius: 7px 7px 7px 7px; + float: right; + height: auto; + margin: 0 8px 10px 10px; + width: 200px; +} + +div.toc li { + background: url("data:image/svg+xml;utf8,&%238595;") no-repeat scroll 0 5px transparent; + font: 10px/1.2 Verdana,'DejaVu Sans',Geneva,sans-serif; + margin-top: 5px; + padding-left: 10px; + padding-top: 2px; +} + +div.toc h3 { + font: bold 12px/1.2 Verdana,'DejaVu Sans',Geneva,sans-serif; + color: #4665A2; + border-bottom: 0 none; + margin: 0; +} + +div.toc ul { + list-style: none outside none; + border: medium none; + padding: 0px; +} + +div.toc li.level1 { + margin-left: 0px; +} + +div.toc li.level2 { + margin-left: 15px; +} + +div.toc li.level3 { + margin-left: 15px; +} + +div.toc li.level4 { + margin-left: 15px; +} + +span.emoji { + /* font family used at the site: https://unicode.org/emoji/charts/full-emoji-list.html + * font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", Times, Symbola, Aegyptus, Code2000, Code2001, Code2002, Musica, serif, LastResort; + */ +} + +span.obfuscator { + display: none; +} + +.inherit_header { + font-weight: bold; + color: gray; + cursor: pointer; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.inherit_header td { + padding: 6px 0px 2px 5px; +} + +.inherit { + display: none; +} + +tr.heading h2 { + margin-top: 12px; + margin-bottom: 4px; +} + +/* tooltip related style info */ + +.ttc { + position: absolute; + display: none; +} + +#powerTip { + cursor: default; + /*white-space: nowrap;*/ + color: black; + background-color: white; + border: 1px solid gray; + border-radius: 4px 4px 4px 4px; + box-shadow: 1px 1px 7px gray; + display: none; + font-size: smaller; + max-width: 80%; + opacity: 0.9; + padding: 1ex 1em 1em; + position: absolute; + z-index: 2147483647; +} + +#powerTip div.ttdoc { + color: grey; + font-style: italic; +} + +#powerTip div.ttname a { + font-weight: bold; +} + +#powerTip a { + color: #4665A2; +} + +#powerTip div.ttname { + font-weight: bold; +} + +#powerTip div.ttdeci { + color: #006318; +} + +#powerTip div { + margin: 0px; + padding: 0px; + font-size: 12px; + font-family: Roboto,sans-serif; + line-height: 16px; +} + +#powerTip:before, #powerTip:after { + content: ""; + position: absolute; + margin: 0px; +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.s:after, #powerTip.s:before, +#powerTip.w:after, #powerTip.w:before, +#powerTip.e:after, #powerTip.e:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.nw:after, #powerTip.nw:before, +#powerTip.sw:after, #powerTip.sw:before { + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; +} + +#powerTip.n:after, #powerTip.s:after, +#powerTip.w:after, #powerTip.e:after, +#powerTip.nw:after, #powerTip.ne:after, +#powerTip.sw:after, #powerTip.se:after { + border-color: rgba(255, 255, 255, 0); +} + +#powerTip.n:before, #powerTip.s:before, +#powerTip.w:before, #powerTip.e:before, +#powerTip.nw:before, #powerTip.ne:before, +#powerTip.sw:before, #powerTip.se:before { + border-color: rgba(128, 128, 128, 0); +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.nw:after, #powerTip.nw:before { + top: 100%; +} + +#powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after { + border-top-color: white; + border-width: 10px; + margin: 0px -10px; +} +#powerTip.n:before, #powerTip.ne:before, #powerTip.nw:before { + border-top-color: gray; + border-width: 11px; + margin: 0px -11px; +} +#powerTip.n:after, #powerTip.n:before { + left: 50%; +} + +#powerTip.nw:after, #powerTip.nw:before { + right: 14px; +} + +#powerTip.ne:after, #powerTip.ne:before { + left: 14px; +} + +#powerTip.s:after, #powerTip.s:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.sw:after, #powerTip.sw:before { + bottom: 100%; +} + +#powerTip.s:after, #powerTip.se:after, #powerTip.sw:after { + border-bottom-color: white; + border-width: 10px; + margin: 0px -10px; +} + +#powerTip.s:before, #powerTip.se:before, #powerTip.sw:before { + border-bottom-color: gray; + border-width: 11px; + margin: 0px -11px; +} + +#powerTip.s:after, #powerTip.s:before { + left: 50%; +} + +#powerTip.sw:after, #powerTip.sw:before { + right: 14px; +} + +#powerTip.se:after, #powerTip.se:before { + left: 14px; +} + +#powerTip.e:after, #powerTip.e:before { + left: 100%; +} +#powerTip.e:after { + border-left-color: gray; + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.e:before { + border-left-color: gray; + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +#powerTip.w:after, #powerTip.w:before { + right: 100%; +} +#powerTip.w:after { + border-right-color: gray; + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.w:before { + border-right-color: gray; + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +@media print +{ + #top { display: none; } + #side-nav { display: none; } + #nav-path { display: none; } + body { overflow:visible; } + h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } + .summary { display: none; } + .memitem { page-break-inside: avoid; } + #doc-content + { + margin-left:0 !important; + height:auto !important; + width:auto !important; + overflow:inherit; + display:inline; + } +} + +/* @group Markdown */ + +table.markdownTable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.markdownTable td, table.markdownTable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.markdownTable tr { +} + +th.markdownTableHeadLeft, th.markdownTableHeadRight, th.markdownTableHeadCenter, th.markdownTableHeadNone { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +th.markdownTableHeadLeft, td.markdownTableBodyLeft { + text-align: left +} + +th.markdownTableHeadRight, td.markdownTableBodyRight { + text-align: right +} + +th.markdownTableHeadCenter, td.markdownTableBodyCenter { + text-align: center +} + +tt, code, kbd, samp +{ + display: inline-block; +} +/* @end */ + +u { + text-decoration: underline; +} + +details>summary { + list-style-type: none; +} + +details > summary::-webkit-details-marker { + display: none; +} + +details>summary::before { + content: "\25ba"; + padding-right:4px; + font-size: 80%; +} + +details[open]>summary::before { + content: "\25bc"; + padding-right:4px; + font-size: 80%; +} + diff --git a/v0.4.6/doxygen.svg b/v0.4.6/doxygen.svg new file mode 100644 index 00000000..79a76354 --- /dev/null +++ b/v0.4.6/doxygen.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/v0.4.6/doxygen_crawl.html b/v0.4.6/doxygen_crawl.html new file mode 100644 index 00000000..3c3be0b4 --- /dev/null +++ b/v0.4.6/doxygen_crawl.html @@ -0,0 +1,499 @@ + + + +Validator / crawler helper + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/v0.4.6/dynsections.js b/v0.4.6/dynsections.js new file mode 100644 index 00000000..0c356052 --- /dev/null +++ b/v0.4.6/dynsections.js @@ -0,0 +1,205 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ + +function toggleVisibility(linkObj) { + return dynsection.toggleVisibility(linkObj); +} + +let dynsection = { + + // helper function + updateStripes : function() { + $('table.directory tr'). + removeClass('even').filter(':visible:even').addClass('even'); + $('table.directory tr'). + removeClass('odd').filter(':visible:odd').addClass('odd'); + }, + + toggleVisibility : function(linkObj) { + const base = $(linkObj).attr('id'); + const summary = $('#'+base+'-summary'); + const content = $('#'+base+'-content'); + const trigger = $('#'+base+'-trigger'); + const src=$(trigger).attr('src'); + if (content.is(':visible')===true) { + content.hide(); + summary.show(); + $(linkObj).addClass('closed').removeClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); + } else { + content.show(); + summary.hide(); + $(linkObj).removeClass('closed').addClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); + } + return false; + }, + + toggleLevel : function(level) { + $('table.directory tr').each(function() { + const l = this.id.split('_').length-1; + const i = $('#img'+this.id.substring(3)); + const a = $('#arr'+this.id.substring(3)); + if (l'); + // add vertical lines to other rows + $('span[class=lineno]').not(':eq(0)').append(''); + // add toggle controls to lines with fold divs + $('div[class=foldopen]').each(function() { + // extract specific id to use + const id = $(this).attr('id').replace('foldopen',''); + // extract start and end foldable fragment attributes + const start = $(this).attr('data-start'); + const end = $(this).attr('data-end'); + // replace normal fold span with controls for the first line of a foldable fragment + $(this).find('span[class=fold]:first').replaceWith(''); + // append div for folded (closed) representation + $(this).after(''); + // extract the first line from the "open" section to represent closed content + const line = $(this).children().first().clone(); + // remove any glow that might still be active on the original line + $(line).removeClass('glow'); + if (start) { + // if line already ends with a start marker (e.g. trailing {), remove it + $(line).html($(line).html().replace(new RegExp('\\s*'+start+'\\s*$','g'),'')); + } + // replace minus with plus symbol + $(line).find('span[class=fold]').css('background-image',codefold.plusImg[relPath]); + // append ellipsis + $(line).append(' '+start+''+end); + // insert constructed line into closed div + $('#foldclosed'+id).html(line); + }); + }, +}; +/* @license-end */ +$(function() { + $('.code,.codeRef').each(function() { + $(this).data('powertip',$('#a'+$(this).attr('href').replace(/.*\//,'').replace(/[^a-z_A-Z0-9]/g,'_')).html()); + $.fn.powerTip.smartPlacementLists.s = [ 's', 'n', 'ne', 'se' ]; + $(this).powerTip({ placement: 's', smartPlacement: true, mouseOnToPopup: true }); + }); +}); diff --git a/v0.4.6/exllamav2_8py.html b/v0.4.6/exllamav2_8py.html new file mode 100644 index 00000000..7fc24877 --- /dev/null +++ b/v0.4.6/exllamav2_8py.html @@ -0,0 +1,167 @@ + + + + + + + + +Formatron: src/formatron/integrations/exllamav2.py File Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
exllamav2.py File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Classes

class  formatron.integrations.exllamav2.FormatterFilter
 ExLlamaV2Filter that uses a formatter to mask logits. More...
 
+ + + + + + + + + +

+Namespaces

namespace  formatron
 
namespace  formatron.integrations
 This subpackage contains integrations with other frameworks and libraries.
 
namespace  formatron.integrations.exllamav2
 This module integrates the ExLlamaV2 library by providing convenience utilities.
 
+ + + + + + + +

+Functions

kbnf.Vocabulary formatron.integrations.exllamav2.create_engine_vocabulary (ExLlamaV2Tokenizer tokenizer)
 Create a vocabulary for the KBNF engine.
 
ExLlamaV2Filter formatron.integrations.exllamav2.create_formatter_filter (ExLlamaV2 model, ExLlamaV2Tokenizer tokenizer, FormatterBuilder formatter_builder, EngineGenerationConfig engine_config=None)
 Create a formatter filter for the ExLlamaV2 engine.
 
+
+
+ + + + diff --git a/v0.4.6/exllamav2_8py.js b/v0.4.6/exllamav2_8py.js new file mode 100644 index 00000000..17657695 --- /dev/null +++ b/v0.4.6/exllamav2_8py.js @@ -0,0 +1,6 @@ +var exllamav2_8py = +[ + [ "formatron.integrations.exllamav2.FormatterFilter", "classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html", "classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter" ], + [ "create_engine_vocabulary", "exllamav2_8py.html#ab73e373da3d117082bfcb5e4020e0358", null ], + [ "create_formatter_filter", "exllamav2_8py.html#a8fb6a829f6fb28c956693fb2e4b39b63", null ] +]; \ No newline at end of file diff --git a/v0.4.6/exllamav2_8py_source.html b/v0.4.6/exllamav2_8py_source.html new file mode 100644 index 00000000..1da2f5cd --- /dev/null +++ b/v0.4.6/exllamav2_8py_source.html @@ -0,0 +1,320 @@ + + + + + + + + +Formatron: src/formatron/integrations/exllamav2.py Source File + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
exllamav2.py
+
+
+Go to the documentation of this file.
1"""
+
2This module integrates the ExLlamaV2 library by providing convenience utilities.
+
3"""
+
4import typing
+
5from copy import copy, deepcopy
+
6import kbnf
+
7import torch
+
8from exllamav2 import ExLlamaV2Tokenizer, ExLlamaV2
+
9from exllamav2.generator.base import ExLlamaV2Filter
+
10from formatron.config import EngineGenerationConfig
+
11from formatron.formatter import FormatterBase, FormatterBuilder
+
12from formatron.integrations._utils import get_original_characters
+
13from functools import lru_cache
+
14
+
15
+
16def create_engine_vocabulary(tokenizer: ExLlamaV2Tokenizer) -> kbnf.Vocabulary:
+
17 """
+
18 Create a vocabulary for the KBNF engine.
+
19 """
+
+
20 assert hasattr(tokenizer.tokenizer_model, "vocab"), (f"tokenizer({tokenizer})"
+
21 f" with tokenizer_model({tokenizer.tokenizer_model})"
+
22 f" does not have vocab attribute!")
+
23 vocab = {tokenizer.tokenizer_model.id_to_piece(
+
24 i): i for i in range(tokenizer.tokenizer_model.vocab_size())}
+
25 new_vocab = get_original_characters(vocab)
+
26 return kbnf.Vocabulary({k: kbnf.Token(v) for k, v in new_vocab.items()},
+
27 {v: k for k, v in vocab.items()})
+
28
+
29
+
30def create_formatter_filter(model: ExLlamaV2, tokenizer: ExLlamaV2Tokenizer,
+
+
31 formatter_builder: FormatterBuilder,
+
32 engine_config: EngineGenerationConfig = None) -> ExLlamaV2Filter:
+
33 """
+
+
34 Create a formatter filter for the ExLlamaV2 engine.
+
35 """
+
36 vocab = create_engine_vocabulary(tokenizer)
+
37 f = formatter_builder.build(
+
38 vocab, lambda tokens: tokenizer.decode(torch.tensor(tokens)))
+
39 return FormatterFilter(model, tokenizer, f, engine_config)
+
40
+
41
+
42class FormatterFilter(ExLlamaV2Filter):
+
+
43 """
+
44 ExLlamaV2Filter that uses a formatter to mask logits.
+
45 """
+
+ +
47 def __init__(self, model, tokenizer, formatter: FormatterBase,
+
+
48 config: EngineGenerationConfig|None = None):
+
49 super().__init__(model, tokenizer)
+
50 self._formatter = formatter
+
51 if config is None:
+
52 config = EngineGenerationConfig()
+
53 self._config = config
+
54 self._pass_tokens = set()
+
55 self.eos_logits = None
+ +
57 def is_completed(self) -> bool:
+
+
58 """
+
59 Check if the formatter is completed.
+
60 """
+
+ +
62
+
63 def clone(self, c=None) -> "FormatterFilter":
+
+
+
64 if c is None:
+
65 c = FormatterFilter.__new__(FormatterFilter)
+
66 c.model = self.model
+
67 c.tokenizer = self.tokenizer
+
68 c.sequence_str = self.sequence_str
+
69 # formatter does not have mutable public state anyway
+
70 c._formatter = copy(self._formatter)
+
71 c._config = deepcopy(self._config)
+
72 c._pass_tokens = self._pass_tokens
+
73 return c
+
74
+
75 def begin(self, prefix_str: str) -> None:
+
+
+
76 if self._config.reset_at_beginning:
+
77 self._formatter.reset()
+
78 if self._config.read_prompt:
+
79 prompt = prefix_str.encode("utf-8")
+
80 self._formatter.accept_bytes(prompt)
+
81
+
82 def reset(self) -> None:
+
+
+ +
84
+
85 def feed(self, token: int):
+
+
+ +
87 return None
+
88 self._formatter.accept_token(token)
+
89
+
90 # adapted from https://github.com/Dan-wanna-M/formatron/issues/14
+
+
91 # Old version for compatibility
+
92 def next_set(self) -> typing.Tuple[typing.Set[int], typing.Set[int]]:
+
+ +
94 return {self.tokenizer.eos_token_id}, {self.tokenizer.eos_token_id}
+
95 self._formatter.compute_allowed_tokens()
+
96 self._pass_tokens.clear()
+
97 self._pass_tokens.update(self._formatter.get_allowed_tokens_since_last_computation())
+
98 return self._pass_tokens, set()
+
99
+
100 # adapted from https://github.com/Dan-wanna-M/formatron/issues/14
+
+
101 def next(self) -> typing.Tuple[typing.Sequence[int], typing.Sequence[int]]:
+
+
102 # Kludge to maintain compatibility with exllamav2 <= 0.2.0
+
103 if not hasattr(self, "allow_return_type_list"):
+
104 return self.next_set()
+
105 if self._formatter.is_completed():
+
106 return [self.tokenizer.eos_token_id], [self.tokenizer.eos_token_id]
+
107 self._formatter.compute_allowed_tokens()
+
108 return self._formatter.get_allowed_tokens_since_last_computation(), []
+
109
+
110 # adapted from https://github.com/Dan-wanna-M/formatron/issues/14
+
+
111 def use_background_worker(self) -> bool:
+
+
112 return True
+
113
+
114 # Used by ExLlamaV2 > 0.2.3
+
+
115 def can_mask_logits(self) -> bool:
+
+
116 return True
+
117
+
118 def prepare_logit_mask(self):
+
+
+
119 self._formatter.compute_allowed_tokens()
+
120 return True
+
121
+
122 def mask_logits(self, logits: torch.Tensor) -> torch.Tensor:
+
+
+ +
124 if self.eos_logits is None:
+
125 self.eos_logits = torch.full_like(logits, float("-inf"))
+
126 self.eos_logits[self.tokenizer.eos_token_id] = 0
+
127 return self.eos_logits
+
128 return self._formatter.mask_logits(logits)
+
129
+
130 @property
+
+
131 def formatter_captures(self) -> dict[str, typing.Any]:
+
132 return self._formatter.captures
+
+
Configuration for how an KBNF engine should be used in text generation.
Definition config.py:14
+
ExLlamaV2Filter that uses a formatter to mask logits.
Definition exllamav2.py:46
+ + + + + +
"FormatterFilter" clone(self, c=None)
Definition exllamav2.py:64
+
torch.Tensor mask_logits(self, torch.Tensor logits)
Definition exllamav2.py:123
+ + +
typing.Tuple[typing.Sequence[int], typing.Sequence[int]] next(self)
Definition exllamav2.py:102
+
dict[str, typing.Any] formatter_captures(self)
Definition exllamav2.py:139
+
typing.Tuple[typing.Set[int], typing.Set[int]] next_set(self)
Definition exllamav2.py:93
+ +
bool is_completed(self)
Check if the formatter is completed.
Definition exllamav2.py:61
+
__init__(self, model, tokenizer, FormatterBase formatter, EngineGenerationConfig|None config=None)
Definition exllamav2.py:49
+ + +
Configuration classes for Formatron.
Definition config.py:1
+
This module contains the Formatter class and its related classes.
Definition formatter.py:1
+ +
ExLlamaV2Filter create_formatter_filter(ExLlamaV2 model, ExLlamaV2Tokenizer tokenizer, FormatterBuilder formatter_builder, EngineGenerationConfig engine_config=None)
Create a formatter filter for the ExLlamaV2 engine.
Definition exllamav2.py:36
+
kbnf.Vocabulary create_engine_vocabulary(ExLlamaV2Tokenizer tokenizer)
Create a vocabulary for the KBNF engine.
Definition exllamav2.py:20
+
+
+ + + + diff --git a/v0.4.6/extractor_8py.html b/v0.4.6/extractor_8py.html new file mode 100644 index 00000000..1401e98b --- /dev/null +++ b/v0.4.6/extractor_8py.html @@ -0,0 +1,166 @@ + + + + + + + + +Formatron: src/formatron/extractor.py File Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
extractor.py File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + + + + + + + + + + + + +

+Classes

class  formatron.extractor.Extractor
 An abstract extractor that extracts data from a string and offers its KBNF rules definition. More...
 
class  formatron.extractor.NonterminalExtractor
 An extractor that extracts data corresponding to a nonterminal. More...
 
class  formatron.extractor.LiteralExtractor
 An extractor that extracts a literal string. More...
 
class  formatron.extractor.ChoiceExtractor
 An extractor that uses multiple extractors to extract data. More...
 
class  formatron.extractor.SubstringExtractor
 An extractor that extracts a substring of a given string from the input string. More...
 
+ + + + + + +

+Namespaces

namespace  formatron
 
namespace  formatron.extractor
 Extractors for extracting data from generated strings.
 
+
+
+ + + + diff --git a/v0.4.6/extractor_8py.js b/v0.4.6/extractor_8py.js new file mode 100644 index 00000000..24193897 --- /dev/null +++ b/v0.4.6/extractor_8py.js @@ -0,0 +1,8 @@ +var extractor_8py = +[ + [ "formatron.extractor.Extractor", "classformatron_1_1extractor_1_1Extractor.html", "classformatron_1_1extractor_1_1Extractor" ], + [ "formatron.extractor.NonterminalExtractor", "classformatron_1_1extractor_1_1NonterminalExtractor.html", "classformatron_1_1extractor_1_1NonterminalExtractor" ], + [ "formatron.extractor.LiteralExtractor", "classformatron_1_1extractor_1_1LiteralExtractor.html", "classformatron_1_1extractor_1_1LiteralExtractor" ], + [ "formatron.extractor.ChoiceExtractor", "classformatron_1_1extractor_1_1ChoiceExtractor.html", "classformatron_1_1extractor_1_1ChoiceExtractor" ], + [ "formatron.extractor.SubstringExtractor", "classformatron_1_1extractor_1_1SubstringExtractor.html", "classformatron_1_1extractor_1_1SubstringExtractor" ] +]; \ No newline at end of file diff --git a/v0.4.6/extractor_8py_source.html b/v0.4.6/extractor_8py_source.html new file mode 100644 index 00000000..dd1cfc6a --- /dev/null +++ b/v0.4.6/extractor_8py_source.html @@ -0,0 +1,387 @@ + + + + + + + + +Formatron: src/formatron/extractor.py Source File + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
extractor.py
+
+
+Go to the documentation of this file.
1"""
+
2Extractors for extracting data from generated strings.
+
3"""
+
4import abc
+
5import typing
+
6
+
7from general_sam import GeneralSam
+
8__all__ = ["Extractor", "ChoiceExtractor", "NonterminalExtractor"]
+
9
+
10class Extractor(abc.ABC):
+
11 """
+
12 An abstract extractor that extracts data from a string and offers its KBNF rules definition.
+
13 """
+
+ +
15 def __init__(self, capture_name: typing.Optional[str] = None):
+
16 """
+
17 Initialize an extractor.
+
18 Args:
+
19 capture_name: The name of the capture, or `None` if the extractor does not capture.
+
20 """
+
+
21 self._capture_name = capture_name
+ +
23 @property
+
+
24 def capture_name(self) -> typing.Optional[str]:
+
25 """
+
26 Get the name of the capture, or `None` if the extractor does not capture.
+
27 """
+
28 return self._capture_name
+
29
+
30 @abc.abstractmethod
+
31 def extract(self, input_str: str) -> typing.Optional[tuple[str, typing.Any]]:
+
32 """
+
33 Extract data from the input string, or `None` if the extraction failed.
+
34 Args:
+
+
35 input_str: The input string.
+
36 Returns:
+
37 The remaining string and the extracted data, or `None` if the extraction failed.
+
+
38 """
+
39
+
40 @property
+
41 @abc.abstractmethod
+
42 def kbnf_reference(self) -> str:
+
43 """
+
44 Get the KBNF reference of the extractor in the generated grammar of a Formatter.
+
45 Check Formatter.kbnf_definition for the difference between kbnf_reference and kbnf_definition.
+
46 """
+
47
+
+
48 def __str__(self):
+
49 return f"${{{self.kbnf_reference}}}"
+
+
50
+
51 @property
+
52 @abc.abstractmethod
+
53 def kbnf_definition(self) -> str:
+
54 """
+
55 Get the KBNF definition of the extractor in the generated grammar of a Formatter.
+
56
+
57 The difference between kbnf_reference and kbnf_definition is that kbnf_reference is how the extractor is referenced in other rules,
+
58 while kbnf_definition is the definition of the extractor itself, similar to a C header file. If kbnf_reference does not need extra definition,
+
59 you can just return an empty string.
+
60 """
+
61
+
62
+
63class NonterminalExtractor(Extractor):
+
64 """
+
65 An extractor that extracts data corresponding to a nonterminal.
+
66 """
+
+ +
68 def __init__(self, nonterminal: str, capture_name: typing.Optional[str] = None):
+
+
+
69 """
+
70 Initialize the nonterminal extractor.
+
71 """
+
+
72 super().__init__(capture_name)
+
73 if capture_name is None:
+
74 self._nonterminal = nonterminal
+
75 else:
+
76 self._nonterminal = f"{nonterminal}_{capture_name}"
+
77
+
78 @property
+
79 def nonterminal(self) -> str:
+
80 """
+
81 Get the nonterminal of the extractor.
+
82 """
+
83 return self._nonterminal
+
84
+
85 @property
+
86 def kbnf_reference(self) -> str:
+
87 return self._nonterminal
+
88
+
89
+ +
91 """
+
+
92 An extractor that extracts a literal string.
+
93 """
+
94
+
+
+
95 def __init__(self, literal: str):
+
96 """
+
97 Initialize the literal extractor. It never captures since capturing a literal is redundant.
+
+ +
99 Args:
+
100 literal: The literal string to extract.
+
101 """
+
102 super().__init__(None)
+
+
103 self._literal = literal
+
104
+
105 def extract(self, input_str: str) -> typing.Optional[tuple[str, str]]:
+
106 """
+
107 Extract the literal from the input string, or `None` if the literal is not found.
+
108 """
+
109 pos = input_str.find(self._literal)
+
+
110 if pos == -1:
+
111 return None
+
112 return input_str[pos + len(self._literal):], self._literal
+
113
+
114 @property
+
115 def kbnf_reference(self) -> str:
+
116 return repr(self._literal)
+
117
+
118 @property
+
119 def kbnf_definition(self) -> str:
+
120 return ""
+ +
124 """
+
125 An extractor that uses multiple extractors to extract data. It stops at the first succeeding extractor.
+
126 """
+
127
+
128 def __init__(self, choices: typing.Iterable[Extractor], capture_name: str, nonterminal: str):
+
129 """
+
130 Initialize the choice extractor.
+
131
+
132 Args:
+
133 choices: The extractors to choose from. The order determines the extractors' priority.
+
+
134 capture_name: The name of the capture, or `None` if the extractor does not capture.
+
135 nonterminal: The nonterminal representing the extractor.
+
136 """
+
+
137 super().__init__(nonterminal, capture_name)
+
138 self._choices = choices
+
139
+
+
140 def extract(self, input_str: str) -> typing.Optional[tuple[str, typing.Any]]:
+
141 """
+
142 Extract data from the input string using the first succeeding extractor.
+
+ +
144 Args:
+
145 input_str: The input string.
+
146 Returns:
+
147 The remaining string and the extracted data, or `None` if all extractors failed.
+
148 """
+
149 for choice in self._choices:
+
150 matched = choice.extract(input_str)
+
+
151 if matched:
+
152 return matched
+
153 return None
+
154
+
+
155 @property
+
156 def kbnf_definition(self) -> str:
+
157 return f"{self.nonterminal} ::= {' | '.join([i.kbnf_reference for i in self._choices])};"
+
+ +
159
+ +
161 """
+
162 An extractor that extracts a substring of a given string from the input string.
+
163 """
+
+
164
+
165 def __init__(self, string: str, capture_name: str, nonterminal: str, *, extract_empty_substring: bool = False):
+
166 """
+
167 Initialize the substring extractor.
+
168 Args:
+
169 string: The string to extract.
+
170 capture_name: The name of the capture, or `None` if the extractor does not capture.
+
171 extract_empty_substring: Whether to extract empty substring as a valid substring.
+
+
172 """
+
173 super().__init__(nonterminal, capture_name)
+
174 self._suffix_automaton = GeneralSam.from_bytes(string.encode("UTF-8"))
+
+
175 self._string = string
+
176 self.extract_empty_substring = extract_empty_substring
+
177
+
178 def extract(self, input_str: str) -> typing.Optional[tuple[str, str]]:
+
179 """
+
180 Extract the longest substring of a given string from the input string.
+
181 If extract_empty_substring is True, empty string is always a valid substring, so the returned string could be empty and `None` will never be returned.
+
182 Otherwise, empty string is not a valid substring,
+
183 so the returned string could not be empty and `None` will be returned if the input string does not contain the given string.
+
184 """
+
+
185 current_state = self._suffix_automaton.get_root_state()
+
186 longest_match = 0
+
187 for char in input_str:
+
+
188 current_state.feed_bytes(char.encode('utf-8'))
+
189 if current_state.is_nil():
+
190 break
+
+
191 longest_match += 1
+
192
+
193 if longest_match > 0 or self.extract_empty_substring:
+
+
194 extracted = input_str[:longest_match]
+
195 remaining = input_str[longest_match:]
+
196 return remaining, extracted
+
197 return None
+
198
+
199 @property
+
200 def kbnf_definition(self) -> str:
+
201 return f"{self.nonterminal} ::= #substrs{repr(self._string)};"
+
+
An extractor that uses multiple extractors to extract data.
Definition extractor.py:194
+ +
An abstract extractor that extracts data from a string and offers its KBNF rules definition.
Definition extractor.py:14
+ +
__init__(self, typing.Optional[str] capture_name=None)
Initialize an extractor.
Definition extractor.py:21
+
typing.Optional[tuple[str, typing.Any]] extract(self, str input_str)
Extract data from the input string, or None if the extraction failed.
Definition extractor.py:48
+
typing.Optional[str] capture_name(self)
Get the name of the capture, or None if the extractor does not capture.
Definition extractor.py:35
+ + + +
An extractor that extracts a literal string.
Definition extractor.py:143
+
__init__(self, str literal)
Initialize the literal extractor.
Definition extractor.py:151
+ +
typing.Optional[tuple[str, str]] extract(self, str input_str)
Extract the literal from the input string, or None if the literal is not found.
Definition extractor.py:158
+
An extractor that extracts data corresponding to a nonterminal.
Definition extractor.py:98
+
__init__(self, str nonterminal, typing.Optional[str] capture_name=None)
Initialize the nonterminal extractor.
Definition extractor.py:103
+ +
An extractor that extracts a substring of a given string from the input string.
Definition extractor.py:240
+
+
+ + + + diff --git a/v0.4.6/files.html b/v0.4.6/files.html new file mode 100644 index 00000000..c9dfb279 --- /dev/null +++ b/v0.4.6/files.html @@ -0,0 +1,160 @@ + + + + + + + + +Formatron: File List + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
File List
+
+
+
Here is a list of all files with brief descriptions:
+
+
+ + + + diff --git a/v0.4.6/files_dup.js b/v0.4.6/files_dup.js new file mode 100644 index 00000000..c3b39c49 --- /dev/null +++ b/v0.4.6/files_dup.js @@ -0,0 +1,4 @@ +var files_dup = +[ + [ "src", "dir_68267d1309a1af8e8297ef4c3efbcdba.html", "dir_68267d1309a1af8e8297ef4c3efbcdba" ] +]; \ No newline at end of file diff --git a/v0.4.6/folderclosed.svg b/v0.4.6/folderclosed.svg new file mode 100644 index 00000000..b04bed2e --- /dev/null +++ b/v0.4.6/folderclosed.svg @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/v0.4.6/folderclosedd.svg b/v0.4.6/folderclosedd.svg new file mode 100644 index 00000000..52f0166a --- /dev/null +++ b/v0.4.6/folderclosedd.svg @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/v0.4.6/folderopen.svg b/v0.4.6/folderopen.svg new file mode 100644 index 00000000..f6896dd2 --- /dev/null +++ b/v0.4.6/folderopen.svg @@ -0,0 +1,17 @@ + + + + + + + + + + diff --git a/v0.4.6/folderopend.svg b/v0.4.6/folderopend.svg new file mode 100644 index 00000000..2d1f06e7 --- /dev/null +++ b/v0.4.6/folderopend.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/v0.4.6/formats_2____init_____8py.html b/v0.4.6/formats_2____init_____8py.html new file mode 100644 index 00000000..bff53923 --- /dev/null +++ b/v0.4.6/formats_2____init_____8py.html @@ -0,0 +1,147 @@ + + + + + + + + +Formatron: src/formatron/formats/__init__.py File Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
__init__.py File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + + +

+Namespaces

namespace  formatron
 
namespace  formatron.formats
 This subpackage contains modules that operate with concrete formats, like json.
 
+
+
+ + + + diff --git a/v0.4.6/formats_2____init_____8py_source.html b/v0.4.6/formats_2____init_____8py_source.html new file mode 100644 index 00000000..95b9f1a5 --- /dev/null +++ b/v0.4.6/formats_2____init_____8py_source.html @@ -0,0 +1,137 @@ + + + + + + + + +Formatron: src/formatron/formats/__init__.py Source File + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
__init__.py
+
+
+Go to the documentation of this file.
1"""
+
2This subpackage contains modules that operate with concrete formats, like json.
+
3"""
+
+
+ + + + diff --git a/v0.4.6/formatter_8py.html b/v0.4.6/formatter_8py.html new file mode 100644 index 00000000..fc908169 --- /dev/null +++ b/v0.4.6/formatter_8py.html @@ -0,0 +1,159 @@ + + + + + + + + +Formatron: src/formatron/formatter.py File Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
formatter.py File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + + + + + +

+Classes

class  formatron.formatter.FormatterBase
 An abstract Formatter that enforces a format on the string generated by a language model. More...
 
class  formatron.formatter.Formatter
 
class  formatron.formatter.FormatterBuilder
 A builder for creating a Formatter. More...
 
+ + + + + + +

+Namespaces

namespace  formatron
 
namespace  formatron.formatter
 This module contains the Formatter class and its related classes.
 
+
+
+ + + + diff --git a/v0.4.6/formatter_8py.js b/v0.4.6/formatter_8py.js new file mode 100644 index 00000000..1f40ddc2 --- /dev/null +++ b/v0.4.6/formatter_8py.js @@ -0,0 +1,6 @@ +var formatter_8py = +[ + [ "formatron.formatter.FormatterBase", "classformatron_1_1formatter_1_1FormatterBase.html", "classformatron_1_1formatter_1_1FormatterBase" ], + [ "formatron.formatter.Formatter", "classformatron_1_1formatter_1_1Formatter.html", "classformatron_1_1formatter_1_1Formatter" ], + [ "formatron.formatter.FormatterBuilder", "classformatron_1_1formatter_1_1FormatterBuilder.html", "classformatron_1_1formatter_1_1FormatterBuilder" ] +]; \ No newline at end of file diff --git a/v0.4.6/formatter_8py_source.html b/v0.4.6/formatter_8py_source.html new file mode 100644 index 00000000..893e7235 --- /dev/null +++ b/v0.4.6/formatter_8py_source.html @@ -0,0 +1,743 @@ + + + + + + + + +Formatron: src/formatron/formatter.py Source File + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
formatter.py
+
+
+Go to the documentation of this file.
1"""
+
2This module contains the Formatter class and its related classes.
+
3"""
+
4import abc
+
5import collections
+
6from json import JSONDecodeError
+
7import json
+
8import re
+
9import textwrap
+
10import typing
+
11from copy import copy
+
12import kbnf
+
13from formatron.formats.json import JsonExtractor
+
14from formatron.schemas.schema import Schema
+
15from formatron.extractor import Extractor, LiteralExtractor, NonterminalExtractor, ChoiceExtractor, SubstringExtractor
+
16from formatron.formats.regex import RegexExtractor
+
17
+
18
+
19
+
20class FormatterBase(abc.ABC):
+
21 """
+
22 An abstract Formatter that enforces a format on the string generated by a language model.
+
23 """
+
+ +
25 @abc.abstractmethod
+
26 def accept_token(self, token_id: int):
+
27 """
+
28 Accept a token from the language model.
+
29 Args:
+
30 token_id: The token ID.
+
31 Returns:
+
32 The result of accepting the token.
+
33 """
+
+ +
35 @abc.abstractmethod
+
+
36 def accept_bytes(self, _bytes: bytes)->None:
+
37 """
+
38 Accept a bytes object from the language model.
+
39 Args:
+
40 _bytes: The bytes object.
+
41 """
+
+ +
43 @abc.abstractmethod
+
+
44 def compute_allowed_tokens(self) -> None:
+
45 """
+
46 Compute the allowed tokens based on the current state.
+
47 """
+
+ +
49 @abc.abstractmethod
+
+
50 def mask_logits(self, logits) -> typing.Any:
+
51 """
+
52 Mask the logits based on the current state.
+
53 Args:
+
54 logits: The logits to mask.
+
55 Returns:
+
56 The masked logits.
+
57 """
+
+ +
59 @abc.abstractmethod
+
+
60 def get_allowed_tokens_since_last_computation(self) -> typing.Sequence[int]:
+
61 """
+
62 Get the allowed tokens since the last computation(in other words, the last call to `compute_allowed_tokens`).
+
63 Returns:
+
64 The allowed tokens.
+
65 """
+
+ +
67 @abc.abstractmethod
+
+
68 def is_completed(self) -> bool:
+
69 """
+
70 Check if the generated string satisfies the format and hence the generation is completed.
+
71 """
+
+ +
73 @abc.abstractmethod
+
+
74 def _on_completion(self, generated_output: str) -> None:
+
75 """
+
76 Perform actions when the generation is completed.
+
77 """
+
78
+
79 @property
+
+
80 @abc.abstractmethod
+
81 def captures(self) -> dict[str, typing.Any|None]:
+
+
82 """
+
83 Get the captures from the generated string.
+
84 """
+
85
+
86 @abc.abstractmethod
+
87 def reset(self) -> None:
+
88 """
+
89 Reset the formatter to the initial state.
+
90 """
+
91
+
92
+
93class Formatter(FormatterBase):
+
94 """
+
95 A Formatter that enforces a format on the string generated by a language model. It is designed to compose
+
96 multiple extractors in a sequential, unambiguous, greedy manner. Check out the Formatter.captures property docs for more details.
+
97 If you need more complex extraction logic, you need to implement your own Extractor.
+
+
98 """
+
99
+
+
100 def __init__(self, extractors: list[Extractor], engine: kbnf.Engine,
+
101 decode_callback: typing.Callable[[list[int]], str], grammar_str: str):
+
102 """
+
103 Initialize the formatter.
+
+
104 Args:
+
105 extractors: The matchers to extract data from the generated string.
+
106 engine: The KBNF engine to enforce the format.
+
+
107 decode_callback: The callback to decode the token IDs to a string.
+
108 grammar_str: The KBNF grammar string.
+
109 """
+
110 self._extractors = extractors
+
111 self._engine = engine
+
+
+ +
113 self._decode_callback = decode_callback
+
114 self._grammar_str = grammar_str
+
115 self._captures = {}
+
116
+
117 @property
+
118 def grammar_str(self):
+
119 """
+
120 Get the KBNF grammar string.
+
121 """
+
+
122 return self._grammar_str
+
123
+
124 def accept_token(self, token_id: int)->kbnf.AcceptTokenResult:
+
125 result = self._engine.try_accept_new_token(token_id)
+
126 self._token_id_or_bytes.append(token_id)
+
127 if result == kbnf.AcceptTokenResult.Finished:
+ + +
130 return result
+
+
131
+
132 def _obtain_accepted_output(self)->str:
+
133 buffer = []
+
134 output = ""
+
135 last_type = None
+
136 def decode_buffer(buffer_type: type, buffer_content: list):
+
137 if buffer_type not in (int, bytes):
+
138 try:
+
139 buffer_content = [int(item) for item in buffer_content]
+
140 buffer_type = int
+
141 except ValueError:
+
+
142 assert False, f"Invalid type: {buffer_type}. Unable to convert to int."
+
143 if buffer_type is int:
+
144 return self._decode_callback(buffer_content)
+
+
145 elif buffer_type is bytes:
+
146 return b"".join(buffer_content).decode()
+
+ +
148 for element in self._token_id_or_bytes:
+
149 if last_type is None:
+
150 last_type = type(element)
+
151 elif last_type != type(element):
+
152 output += decode_buffer(last_type, buffer)
+
153 buffer.clear()
+
154 last_type = type(element)
+
+
+
155 buffer.append(element)
+
156
+
157 if buffer:
+
158 output += decode_buffer(last_type, buffer)
+
159 return output
+
160
+
161 def accept_bytes(self, _bytes: bytes)->kbnf.AcceptTokenResult:
+
162 result = self._engine.try_accept_new_bytes(_bytes)
+
163 self._token_id_or_bytes.append(_bytes)
+
164 if result == kbnf.AcceptTokenResult.Finished:
+
165 output = self._obtain_accepted_output()
+ +
167 return result
+
168
+
169 def compute_allowed_tokens(self) -> None:
+
170 self._engine.compute_allowed_token_ids()
+
171
+
172 def mask_logits(self, logits) -> typing.Any:
+
173 return self._engine.mask_logits(logits)
+
174
+
175 def get_allowed_tokens_since_last_computation(self) -> typing.Sequence[int]:
+
176 return self._engine.get_allowed_token_ids_from_last_computation()
+
177
+
178 def is_completed(self) -> bool:
+
179 """
+
180 Check if the generation is completed. This means the generation is ended by the engine.
+
181 If the generation is ended by integration-specific stop conditions like `max_new_tokens`,
+
182 the generation is not considered completed by this method.
+
183 """
+
+
+
184 return self._engine.is_finished()
+
185
+
186 def _on_completion(self, generated_output: str) -> None:
+
187 for matcher in self._extractors:
+
188 result = matcher.extract(generated_output)
+
189 if result is None:
+
190 captured = None
+
191 else:
+
+
+
192 generated_output, captured = matcher.extract(generated_output)
+
193 if matcher.capture_name:
+
194 if matcher.capture_name in self._captures:
+
+
+
195 self._captures[matcher.capture_name] = [
+
196 self._captures[matcher.capture_name]]
+
197 self._captures[matcher.capture_name].append(captured)
+
+
+
198 else:
+
199 self._captures[matcher.capture_name] = captured
+
200
+
+
201 @property
+
202 def captures(self) -> dict[str, typing.Any] | None:
+
203 """
+
204 Get the captures from the generated string. Note that the captures are only available for one extractor if:
+
205 - The extractor has a capture name.
+
+
206 - Formatter.is_completed() returns True.
+
207 - The extractor successfully extracts the data.
+
208 - This means the extractor identifies the correct string span to extract and whatever post-processing the extractor does on the extracted string is successful.
+
+
+ +
210 Captures are obtained by calling `Extractor.extract` method on the generated string in the sequence of extractors appended to the formatter.
+
211 Note that the previous extractors does not 'see' the semantics of the later extractors. For example,
+
212 consider the following formatter:
+
213 ```python
+
214 f = FormatterBuilder()
+
215 f.append_line(f"{f.regex('.*?', capture_name='a')}{f.regex('.*', capture_name='b')}")
+
216 f = f.build()
+
217 ```
+
218 The `b` extractor will always corresponding to `None` because the `a` extractor will always extract the whole string.
+
219 This behavior is different from what a typical regular expression engine would do!
+
220 """
+
221 return self._captures
+
222
+
223 def reset(self) -> None:
+
+
224 self._captures.clear()
+
225 self._engine.reset()
+
226 self._token_id_or_bytes.clear()
+
227
+
228 def __str__(self):
+
229 return (f"Formatter(engine={self._engine}, "
+
230 f"captures={self._captures}, "
+
231 f"extractors={len(self._extractors)}, "
+
232 f"completed={self.is_completed()}, "
+
233 f"token_ids={len(self._token_id_or_bytes)})"
+
234 f"grammar={self._grammar_str})")
+
235
+
236
+
237class FormatterBuilder:
+
238 """
+
239 A builder for creating a Formatter.
+
240 """
+
241 _formatter_builder_counter = 0
+
242
+
243 def __init__(self):
+
244 """
+
245 Initialize the formatter builder.
+
246 """
+
247 self._counter = 0
+
248 self._main_rule = []
+
249 self._rules = []
+
250 self._capture_names = set()
+
251 self._nonterminal_to_extractor = {}
+
+
252 self._extractors = []
+
253 self._instance_id = self.__class__._formatter_builder_counter
+
254 self.__class__._formatter_builder_counter += 1
+
+
255
+
256
+
+
257 def _assert_capture_name_valid(self, capture_name: str):
+
258 assert capture_name.isidentifier(), (f"capture_name {capture_name}"
+
259 f" should only contains alphanumeric characters, "
+
260 f"underscores, and does not start with digits!")
+
261 assert capture_name not in self._capture_names, f"capture_name {capture_name} is duplicated!"
+
+
+ +
263 def append_line(self, line: str) -> None:
+
264 """
+
265 Append a line to the format. Specifically, a newline character is appended to the input.
+
266
+
267 Note that if you need a literal `$`, you need to escape it by adding a backslash: `\\$`.
+
268 """
+
269 self.append_str(line + '\n')
+
270
+
+
+
271 def append_multiline_str(self, lines: str) -> None:
+
272 """
+
273 Appends a multiline string to the format, preserving the first line's leading whitespaces
+
+
274 and remove any common leading whitespaces from subsequent lines.
+
275
+
276 Note that tabs and spaces are both treated as whitespace, but they are not equal:
+
277 the lines " hello" and "\\thello" are considered to have no common leading whitespace.
+ +
279 Entirely blank lines are normalized to a newline character.
+
280
+
281 Note that if you need a literal `$`, you need to escape it by adding a backslash: `\\$`.
+
282 """
+
+
283 first = lines.find('\n')
+
284 self.append_str(lines[:first + 1] + textwrap.dedent(lines[first + 1:]))
+ +
286 def append_str(self, string: str) -> None:
+
287 """
+
288 Append a string to the format without any post-processing.
+ +
290 Note that if you need a literal `$`, you need to escape it by adding a backslash: `\\$`.
+
291 """
+
292 state = "normal"
+
293 last = 0
+
+
+ +
295 def append_literal(end):
+
296 if last < end:
+
297 literal = string[last:end]
+
298 self._main_rule.append(repr(literal))
+
299 self._extractors.append(LiteralExtractor(literal))
+
+
300
+
301 for i, char in enumerate(string):
+
302 if char == "$":
+
303 if state != "escaped":
+
304 state = "dollar"
+
+
305 else:
+
306 state = "normal"
+
307 elif state == "dollar":
+
+
308 if char == "{":
+
309 append_literal(i - 1)
+
310 last = i + 1
+
311 state = "left_bracket"
+
312 else:
+
313 state = "normal"
+
314 elif state == "left_bracket":
+
315 if char == "}":
+
316 state = "normal"
+
317 self._main_rule.append(string[last:i])
+
318 self._extractors.append(
+
+
319 self._nonterminal_to_extractor[string[last:i]])
+
320 last = i + 1
+
321 elif char == "\\":
+
322 state = "escaped"
+
+
323 else:
+
324 state = "normal"
+
325 append_literal(len(string))
+
326
+
327 def _create_nonterminal(self, name: str) -> str:
+
+
328 nonterminal = f"__{name}_{self._counter}_{self._instance_id}"
+
329 self._counter += 1
+
330 return nonterminal
+
331
+
332 def _add_capture_name(self, extractor: NonterminalExtractor) -> None:
+
333 if extractor.capture_name is None:
+
334 return None
+
335 self._assert_capture_name_valid(extractor.capture_name)
+
336 self._capture_names.add(extractor.capture_name)
+
337
+
338 def choose(self, *extractors: Extractor | str, capture_name: str = None) -> ChoiceExtractor:
+
339 """
+
340 Create a choice extractor.
+
341
+
342 Check out the ChoiceExtractor docs for more details.
+
343 Args:
+
344 extractors: The extractors to choose from.
+
345 capture_name: The capture name of the extractor, or `None` if the extractor does not capture.
+
346 Returns:
+
347 The choice extractor.
+
348 """
+
349 new_extractors = []
+
350 for extractor in extractors:
+
351 if isinstance(extractor, str):
+
352 new_extractors.append(LiteralExtractor(extractor))
+
353 else:
+
354 new_extractors.append(extractor)
+
355 return self._add_extractor("choice",
+
356 lambda nonterminal: ChoiceExtractor(new_extractors, capture_name, nonterminal))
+
357
+
358 def _add_extractor(self, extractor_type: str, create_extractor: typing.Callable[[str], Extractor]):
+
359 nonterminal = self._create_nonterminal(extractor_type)
+
360 extractor = create_extractor(nonterminal)
+
361 if isinstance(extractor, NonterminalExtractor):
+
362 self._add_capture_name(extractor)
+
363 nonterminal = extractor.nonterminal
+
+
+
364 self._nonterminal_to_extractor[nonterminal] = extractor
+
365 self._rules.append(extractor.kbnf_definition)
+
366 return extractor
+
367
+
368 def extractor(self, create_extractor: typing.Callable[[str], Extractor]) -> Extractor:
+
+
+
369 """
+
370 Create a custom extractor.
+
371
+
372 Args:
+
373 create_extractor: callable with signature (extractor_nonterminal: str)->Extractor that create the extractor. extractor_nonterminal is the auto-generated nonterminal reference for the extractor.
+
374 capture_name: The capture name of the extractor, or `None` if the extractor does not capture.
+
+
375 """
+
376 return self._add_extractor("extractor", create_extractor)
+
377
+
378 def json(self, schema: typing.Type[Schema]|collections.abc.Sequence, *, capture_name: str = None) -> JsonExtractor:
+
379 """
+
380 Create a JSON extractor. Check out the JsonExtractor docs for more details.
+
381
+
382 Args:
+
383 schema: The schema for extraction.
+
384 capture_name: The capture name of the extractor, or `None` if the extractor does not capture.
+
+
385 Returns:
+
386 The JSON extractor.
+
387 """
+
388 def to_json(_json: str):
+
389 if isinstance(schema, type) and issubclass(schema, Schema):
+
390 try:
+
391 return schema.from_json(_json)
+
392 except JSONDecodeError: # make ChoiceExtractor work appropriately
+
393 return None
+
394 else:
+
+
+
395 try:
+
396 return json.loads(_json)
+
397 except JSONDecodeError:
+
398 return None
+
399 return self._add_extractor("json",
+
400 lambda nonterminal: JsonExtractor(nonterminal, capture_name,schema, to_json))
+
401
+
402 def regex(self, regex: str, *, capture_name: str = None) -> RegexExtractor:
+
403 """
+
404 Create a regex extractor.
+
+
405
+
406 Check out the RegexExtractor docs for more details.
+
407
+
408 Args:
+
409 regex: The regular expression for extraction.
+
410 capture_name: The capture name of the extractor, or `None` if the extractor does not capture.
+
411 Returns:
+
+
412 The regex extractor.
+
413 """
+
414 return self._add_extractor("regex",
+
+
415 lambda nonterminal: RegexExtractor(regex, capture_name, nonterminal))
+
416
+
417 def str(self, *, stop: typing.Union[str, list[str]] = None,
+
418 capture_name: typing.Optional[str] = None) -> Extractor:
+
419 """
+
420 Create a string extractor.
+
421
+
422 The extractor will extract all text until(inclusive) one of the stop strings is encountered.
+
423
+
+
424 Args:
+
425 stop: The strings for the extractors to stop at. They will be included in text generation and extraction.
+
426 capture_name: The capture name of the extractor, or `None` if the extractor does not capture.
+
427 Returns:
+
428 The string extractor.
+
429 """
+
430 stop = [stop] if isinstance(stop, str) else stop or []
+
431 if not stop:
+
432 capture_regex = ".*"
+
433 else:
+
434 backslash = '\\'
+
435 capture_regex = f".*?(?:{'|'.join([re.escape(i.replace(backslash, backslash * 2)) for i in stop])})"
+
436 return self._add_extractor("str",
+
437 lambda nonterminal: RegexExtractor(capture_regex, capture_name, nonterminal))
+
438
+
+
439 def substr(self, string: str, *, capture_name: str = None, extract_empty_substring: bool = False) -> Extractor:
+
440 """
+
441 Create a substring extractor.
+
442
+
443 The extractor will extract a substring of the input string.
+
444
+
445 Args:
+
446 string: The string to extract.
+
447 capture_name: The capture name of the extractor, or `None` if the extractor does not capture.
+
448 extract_empty_substring: Whether to extract an empty substring as a valid substring.
+
449 Returns:
+
+
450 The substring extractor.
+
451 """
+
452 return self._add_extractor("substr",
+
453 lambda nonterminal: SubstringExtractor(string, capture_name, nonterminal,
+
+
454 extract_empty_substring=extract_empty_substring))
+
455
+
456 def build(self, vocabulary: kbnf.Vocabulary,
+
457 decode: typing.Callable[[list[int]], str],
+
458 engine_config: kbnf.Config = None) -> Formatter:
+
459 """
+
460 Build a formatter from the builder. The builder will not be consumed and can be used again.
+
461
+
462 Args:
+
463 vocabulary: The KBNF engine vocabulary for the formatter.
+
464 decode: The callback to decode the token IDs to a string.
+
+
465 engine_config: The KBNF engine configuration.
+
466 Returns:
+
467 The formatter.
+
468 """
+
469 assert len(
+
470 self._main_rule) != 0, "An empty formatter builder cannot build!"
+
471 rules = copy(self._rules)
+
472 rules.append(f"start ::= {' '.join(self._main_rule)};")
+
473 grammar_str = "\n".join(rules)
+
474 engine = kbnf.Engine(grammar_str, vocabulary, engine_config)
+
475 extractors = copy(self._extractors)
+
+
476 f = Formatter(extractors, engine, decode, grammar_str)
+
477 return f
+
+
An extractor that uses multiple extractors to extract data.
Definition extractor.py:194
+
An extractor that extracts a literal string.
Definition extractor.py:143
+
An extractor that extracts a substring of a given string from the input string.
Definition extractor.py:240
+
An extractor that loads json data to an object from a string.
Definition json.py:420
+
An extractor that extracts a string using a regular expression.
Definition regex.py:13
+
An abstract Formatter that enforces a format on the string generated by a language model.
Definition formatter.py:24
+
None _on_completion(self, str generated_output)
Perform actions when the generation is completed.
Definition formatter.py:80
+
None reset(self)
Reset the formatter to the initial state.
Definition formatter.py:104
+
accept_token(self, int token_id)
Accept a token from the language model.
Definition formatter.py:34
+
None compute_allowed_tokens(self)
Compute the allowed tokens based on the current state.
Definition formatter.py:48
+
dict[str, typing.Any|None] captures(self)
Definition formatter.py:98
+
typing.Sequence[int] get_allowed_tokens_since_last_computation(self)
Get the allowed tokens since the last computation(in other words, the last call to compute_allowed_to...
Definition formatter.py:66
+
None accept_bytes(self, bytes _bytes)
Accept a bytes object from the language model.
Definition formatter.py:42
+
bool is_completed(self)
Check if the generated string satisfies the format and hence the generation is completed.
Definition formatter.py:72
+
typing.Any mask_logits(self, logits)
Mask the logits based on the current state.
Definition formatter.py:58
+
A builder for creating a Formatter.
Definition formatter.py:274
+
None append_str(self, str string)
Append a string to the format without any post-processing.
Definition formatter.py:328
+
None _add_capture_name(self, NonterminalExtractor extractor)
Definition formatter.py:369
+ + +
ChoiceExtractor choose(self, *Extractor|str extractors, str capture_name=None)
Create a choice extractor.
Definition formatter.py:385
+ + +
_add_extractor(self, str extractor_type, typing.Callable[[str], Extractor] create_extractor)
Definition formatter.py:395
+ + +
Formatter build(self, kbnf.Vocabulary vocabulary, typing.Callable[[list[int]], str] decode, kbnf.Config engine_config=None)
Build a formatter from the builder.
Definition formatter.py:505
+
_assert_capture_name_valid(self, str capture_name)
Definition formatter.py:294
+
Extractor substr(self, str string, *, str capture_name=None, bool extract_empty_substring=False)
Create a substring extractor.
Definition formatter.py:488
+
JsonExtractor json(self, typing.Type[Schema]|collections.abc.Sequence schema, *, str capture_name=None)
Create a JSON extractor.
Definition formatter.py:424
+
Extractor str(self, *, typing.Union[str, list[str]] stop=None, typing.Optional[str] capture_name=None)
Create a string extractor.
Definition formatter.py:466
+
str _create_nonterminal(self, str name)
Definition formatter.py:364
+
RegexExtractor regex(self, str regex, *, str capture_name=None)
Create a regex extractor.
Definition formatter.py:450
+ +
typing.Any mask_logits(self, logits)
Mask the logits based on the current state.
Definition formatter.py:195
+
None reset(self)
Reset the formatter to the initial state.
Definition formatter.py:257
+
kbnf.AcceptTokenResult accept_bytes(self, bytes _bytes)
Accept a bytes object from the language model.
Definition formatter.py:184
+
grammar_str(self)
Get the KBNF grammar string.
Definition formatter.py:142
+
__init__(self, list[Extractor] extractors, kbnf.Engine engine, typing.Callable[[list[int]], str] decode_callback, str grammar_str)
Initialize the formatter.
Definition formatter.py:123
+ +
None compute_allowed_tokens(self)
Compute the allowed tokens based on the current state.
Definition formatter.py:192
+
typing.Sequence[int] get_allowed_tokens_since_last_computation(self)
Get the allowed tokens since the last computation(in other words, the last call to compute_allowed_to...
Definition formatter.py:198
+ + + +
kbnf.AcceptTokenResult accept_token(self, int token_id)
Accept a token from the language model.
Definition formatter.py:147
+ + +
bool is_completed(self)
Check if the generation is completed.
Definition formatter.py:206
+
None _on_completion(self, str generated_output)
Perform actions when the generation is completed.
Definition formatter.py:209
+ + +
dict[str, typing.Any]|None captures(self)
Get the captures from the generated string.
Definition formatter.py:252
+
Extractors for extracting data from generated strings.
Definition extractor.py:1
+
The module defines the JsonExtractor class, which is used to extract data from a string in JSON forma...
Definition json.py:1
+
This module contains the RegexExtractor class, which is used to extract data using a regular expressi...
Definition regex.py:1
+
+
+ + + + diff --git a/v0.4.6/functions.html b/v0.4.6/functions.html new file mode 100644 index 00000000..48939b50 --- /dev/null +++ b/v0.4.6/functions.html @@ -0,0 +1,293 @@ + + + + + + + + +Formatron: Class Members + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all class members with links to the classes they belong to:
+ +

- _ -

+ + +

- a -

+ + +

- b -

+ + +

- c -

+ + +

- e -

+ + +

- f -

+ + +

- g -

+ + +

- i -

+ + +

- j -

+ + +

- k -

+ + +

- m -

+ + +

- n -

+ + +

- p -

+ + +

- r -

+ + +

- s -

+ + +

- t -

+ + +

- u -

+
+
+ + + + diff --git a/v0.4.6/functions_func.html b/v0.4.6/functions_func.html new file mode 100644 index 00000000..7223b2ac --- /dev/null +++ b/v0.4.6/functions_func.html @@ -0,0 +1,250 @@ + + + + + + + + +Formatron: Class Members - Functions + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all functions with links to the classes they belong to:
+ +

- _ -

+ + +

- a -

+ + +

- b -

+ + +

- c -

+ + +

- e -

+ + +

- f -

+ + +

- g -

+ + +

- i -

+ + +

- j -

+ + +

- k -

+ + +

- m -

+ + +

- n -

+ + +

- p -

+ + +

- r -

+ + +

- s -

+ + +

- t -

+ + +

- u -

+
+
+ + + + diff --git a/v0.4.6/functions_vars.html b/v0.4.6/functions_vars.html new file mode 100644 index 00000000..24424868 --- /dev/null +++ b/v0.4.6/functions_vars.html @@ -0,0 +1,193 @@ + + + + + + + + +Formatron: Class Members - Variables + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all variables with links to the classes they belong to:
+ +

- _ -

+ + +

- c -

+ + +

- e -

+ + +

- f -

+ + +

- r -

+
+
+ + + + diff --git a/v0.4.6/hierarchy.html b/v0.4.6/hierarchy.html new file mode 100644 index 00000000..770f3741 --- /dev/null +++ b/v0.4.6/hierarchy.html @@ -0,0 +1,167 @@ + + + + + + + + +Formatron: Class Hierarchy + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Class Hierarchy
+
+
+
This inheritance list is sorted roughly, but not completely, alphabetically:
+
[detail level 1234]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 Cabc.ABC
 Cformatron.extractor.ExtractorAn abstract extractor that extracts data from a string and offers its KBNF rules definition
 Cformatron.extractor.LiteralExtractorAn extractor that extracts a literal string
 Cformatron.extractor.NonterminalExtractorAn extractor that extracts data corresponding to a nonterminal
 Cformatron.extractor.ChoiceExtractorAn extractor that uses multiple extractors to extract data
 Cformatron.extractor.SubstringExtractorAn extractor that extracts a substring of a given string from the input string
 Cformatron.formats.json.JsonExtractorAn extractor that loads json data to an object from a string
 Cformatron.formats.regex.RegexExtractorAn extractor that extracts a string using a regular expression
 Cformatron.formatter.FormatterBaseAn abstract Formatter that enforces a format on the string generated by a language model
 Cformatron.formatter.Formatter
 Cformatron.schemas.schema.FieldInfo
 Cformatron.schemas.dict_inference.FieldInfo
 Cformatron.schemas.json_schema.FieldInfo
 Cformatron.schemas.schema.SchemaAn abstract schema that describes some data
 Cformatron.schemas.pydantic.ClassSchemaA wrapper for pydantic BaseModel that implements the Schema interface
 Cformatron.config.EngineGenerationConfigConfiguration for how an KBNF engine should be used in text generation
 Cformatron.schemas.pydantic.FieldInfoA wrapper for pydantic FieldInfo
 Cformatron.formatter.FormatterBuilderA builder for creating a Formatter
 Cformatron.integrations.vllm.FormattersLogitsProcessorLogit processor that uses formatters to mask batch logits
 Crwkv.utils.PIPELINE
 Cformatron.integrations.RWKV.PIPELINEA wrapper for the pipeline of RWKV
 Crwkv.utils.PIPELINE_ARGS
 Cformatron.integrations.RWKV.PIPELINE_ARGSA wrapper for the arguments of the pipeline of RWKV
 Cformatron.schemas.schema.TypeWithMetadata
 CBaseModel
 Cformatron.schemas.pydantic.ClassSchemaA wrapper for pydantic BaseModel that implements the Schema interface
 CExLlamaV2Filter
 Cformatron.integrations.exllamav2.FormatterFilterExLlamaV2Filter that uses a formatter to mask logits
 CLogitsProcessor
 Cformatron.integrations.transformers.FormattersLogitsProcessorLogit processor that uses formatters to mask batch logits
+
+
+
+ + + + diff --git a/v0.4.6/hierarchy.js b/v0.4.6/hierarchy.js new file mode 100644 index 00000000..2303f2de --- /dev/null +++ b/v0.4.6/hierarchy.js @@ -0,0 +1,44 @@ +var hierarchy = +[ + [ "abc.ABC", null, [ + [ "formatron.extractor.Extractor", "classformatron_1_1extractor_1_1Extractor.html", [ + [ "formatron.extractor.LiteralExtractor", "classformatron_1_1extractor_1_1LiteralExtractor.html", null ], + [ "formatron.extractor.NonterminalExtractor", "classformatron_1_1extractor_1_1NonterminalExtractor.html", [ + [ "formatron.extractor.ChoiceExtractor", "classformatron_1_1extractor_1_1ChoiceExtractor.html", null ], + [ "formatron.extractor.SubstringExtractor", "classformatron_1_1extractor_1_1SubstringExtractor.html", null ], + [ "formatron.formats.json.JsonExtractor", "classformatron_1_1formats_1_1json_1_1JsonExtractor.html", null ], + [ "formatron.formats.regex.RegexExtractor", "classformatron_1_1formats_1_1regex_1_1RegexExtractor.html", null ] + ] ] + ] ], + [ "formatron.formatter.FormatterBase", "classformatron_1_1formatter_1_1FormatterBase.html", [ + [ "formatron.formatter.Formatter", "classformatron_1_1formatter_1_1Formatter.html", null ] + ] ], + [ "formatron.schemas.schema.FieldInfo", "classformatron_1_1schemas_1_1schema_1_1FieldInfo.html", [ + [ "formatron.schemas.dict_inference.FieldInfo", "classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo.html", null ], + [ "formatron.schemas.json_schema.FieldInfo", "classformatron_1_1schemas_1_1json__schema_1_1FieldInfo.html", null ] + ] ], + [ "formatron.schemas.schema.Schema", "classformatron_1_1schemas_1_1schema_1_1Schema.html", [ + [ "formatron.schemas.pydantic.ClassSchema", "classformatron_1_1schemas_1_1pydantic_1_1ClassSchema.html", null ] + ] ] + ] ], + [ "formatron.config.EngineGenerationConfig", "classformatron_1_1config_1_1EngineGenerationConfig.html", null ], + [ "formatron.schemas.pydantic.FieldInfo", "classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.html", null ], + [ "formatron.formatter.FormatterBuilder", "classformatron_1_1formatter_1_1FormatterBuilder.html", null ], + [ "formatron.integrations.vllm.FormattersLogitsProcessor", "classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html", null ], + [ "rwkv.utils.PIPELINE", null, [ + [ "formatron.integrations.RWKV.PIPELINE", "classformatron_1_1integrations_1_1RWKV_1_1PIPELINE.html", null ] + ] ], + [ "rwkv.utils.PIPELINE_ARGS", null, [ + [ "formatron.integrations.RWKV.PIPELINE_ARGS", "classformatron_1_1integrations_1_1RWKV_1_1PIPELINE__ARGS.html", null ] + ] ], + [ "formatron.schemas.schema.TypeWithMetadata", "classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata.html", null ], + [ "BaseModel", null, [ + [ "formatron.schemas.pydantic.ClassSchema", "classformatron_1_1schemas_1_1pydantic_1_1ClassSchema.html", null ] + ] ], + [ "ExLlamaV2Filter", null, [ + [ "formatron.integrations.exllamav2.FormatterFilter", "classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html", null ] + ] ], + [ "LogitsProcessor", null, [ + [ "formatron.integrations.transformers.FormattersLogitsProcessor", "classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html", null ] + ] ] +]; \ No newline at end of file diff --git a/v0.4.6/index.html b/v0.4.6/index.html new file mode 100644 index 00000000..c2c865e2 --- /dev/null +++ b/v0.4.6/index.html @@ -0,0 +1,134 @@ + + + + + + + + +Formatron: Main Page + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Formatron Documentation
+
+
+ +
+
+ + + + diff --git a/v0.4.6/integrations_2____init_____8py.html b/v0.4.6/integrations_2____init_____8py.html new file mode 100644 index 00000000..2c19ad2c --- /dev/null +++ b/v0.4.6/integrations_2____init_____8py.html @@ -0,0 +1,147 @@ + + + + + + + + +Formatron: src/formatron/integrations/__init__.py File Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
__init__.py File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + + +

+Namespaces

namespace  formatron
 
namespace  formatron.integrations
 This subpackage contains integrations with other frameworks and libraries.
 
+
+
+ + + + diff --git a/v0.4.6/integrations_2____init_____8py_source.html b/v0.4.6/integrations_2____init_____8py_source.html new file mode 100644 index 00000000..4ff380b5 --- /dev/null +++ b/v0.4.6/integrations_2____init_____8py_source.html @@ -0,0 +1,137 @@ + + + + + + + + +Formatron: src/formatron/integrations/__init__.py Source File + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
__init__.py
+
+
+Go to the documentation of this file.
1"""
+
2This subpackage contains integrations with other frameworks and libraries.
+
3"""
+
+
+ + + + diff --git a/v0.4.6/jquery.js b/v0.4.6/jquery.js new file mode 100644 index 00000000..1dffb65b --- /dev/null +++ b/v0.4.6/jquery.js @@ -0,0 +1,34 @@ +/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="
",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=y(e||this.defaultElement||this)[0],this.element=y(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=y(),this.hoverable=y(),this.focusable=y(),this.classesElementLookup={},e!==this&&(y.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=y(e.style?e.ownerDocument:e.document||e),this.window=y(this.document[0].defaultView||this.document[0].parentWindow)),this.options=y.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:y.noop,_create:y.noop,_init:y.noop,destroy:function(){var i=this;this._destroy(),y.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:y.noop,widget:function(){return this.element},option:function(t,e){var i,s,n,o=t;if(0===arguments.length)return y.widget.extend({},this.options);if("string"==typeof t)if(o={},t=(i=t.split(".")).shift(),i.length){for(s=o[t]=y.widget.extend({},this.options[t]),n=0;n
"),i=e.children()[0];return y("body").append(e),t=i.offsetWidth,e.css("overflow","scroll"),t===(i=i.offsetWidth)&&(i=e[0].clientWidth),e.remove(),s=t-i},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),e="scroll"===e||"auto"===e&&t.widthx(D(s),D(n))?o.important="horizontal":o.important="vertical",p.using.call(this,t,o)}),h.offset(y.extend(l,{using:t}))})},y.ui.position={fit:{left:function(t,e){var i=e.within,s=i.isWindow?i.scrollLeft:i.offset.left,n=i.width,o=t.left-e.collisionPosition.marginLeft,h=s-o,a=o+e.collisionWidth-n-s;e.collisionWidth>n?0n?0=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),y.ui.plugin={add:function(t,e,i){var s,n=y.ui[t].prototype;for(s in i)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([e,i[s]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;n").css({overflow:"hidden",position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(t),this._proportionallyResize()),this._setupHandles(),e.autoHide&&y(this.element).on("mouseenter",function(){e.disabled||(i._removeClass("ui-resizable-autohide"),i._handles.show())}).on("mouseleave",function(){e.disabled||i.resizing||(i._addClass("ui-resizable-autohide"),i._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy(),this._addedHandles.remove();function t(t){y(t).removeData("resizable").removeData("ui-resizable").off(".resizable")}var e;return this.elementIsWrapper&&(t(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;case"aspectRatio":this._aspectRatio=!!e}},_setupHandles:function(){var t,e,i,s,n,o=this.options,h=this;if(this.handles=o.handles||(y(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=y(),this._addedHandles=y(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),i=this.handles.split(","),this.handles={},e=0;e"),this._addClass(n,"ui-resizable-handle "+s),n.css({zIndex:o.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.children(this.handles[t]).length||(this.element.append(n),this._addedHandles=this._addedHandles.add(n));this._renderAxis=function(t){var e,i,s;for(e in t=t||this.element,this.handles)this.handles[e].constructor===String?this.handles[e]=this.element.children(this.handles[e]).first().show():(this.handles[e].jquery||this.handles[e].nodeType)&&(this.handles[e]=y(this.handles[e]),this._on(this.handles[e],{mousedown:h._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(i=y(this.handles[e],this.element),s=/sw|ne|nw|se|n|s/.test(e)?i.outerHeight():i.outerWidth(),i=["padding",/ne|nw|n/.test(e)?"Top":/se|sw|s/.test(e)?"Bottom":/^e$/.test(e)?"Right":"Left"].join(""),t.css(i,s),this._proportionallyResize()),this._handles=this._handles.add(this.handles[e])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){h.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),h.axis=n&&n[1]?n[1]:"se")}),o.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._addedHandles.remove()},_mouseCapture:function(t){var e,i,s=!1;for(e in this.handles)(i=y(this.handles[e])[0])!==t.target&&!y.contains(i,t.target)||(s=!0);return!this.options.disabled&&s},_mouseStart:function(t){var e,i,s=this.options,n=this.element;return this.resizing=!0,this._renderProxy(),e=this._num(this.helper.css("left")),i=this._num(this.helper.css("top")),s.containment&&(e+=y(s.containment).scrollLeft()||0,i+=y(s.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:e,top:i},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:n.width(),height:n.height()},this.originalSize=this._helper?{width:n.outerWidth(),height:n.outerHeight()}:{width:n.width(),height:n.height()},this.sizeDiff={width:n.outerWidth()-n.width(),height:n.outerHeight()-n.height()},this.originalPosition={left:e,top:i},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof s.aspectRatio?s.aspectRatio:this.originalSize.width/this.originalSize.height||1,s=y(".ui-resizable-"+this.axis).css("cursor"),y("body").css("cursor","auto"===s?this.axis+"-resize":s),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var e=this.originalMousePosition,i=this.axis,s=t.pageX-e.left||0,e=t.pageY-e.top||0,i=this._change[i];return this._updatePrevProperties(),i&&(e=i.apply(this,[t,s,e]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(e=this._updateRatio(e,t)),e=this._respectSize(e,t),this._updateCache(e),this._propagate("resize",t),e=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),y.isEmptyObject(e)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges())),!1},_mouseStop:function(t){this.resizing=!1;var e,i,s,n=this.options,o=this;return this._helper&&(s=(e=(i=this._proportionallyResizeElements).length&&/textarea/i.test(i[0].nodeName))&&this._hasScroll(i[0],"left")?0:o.sizeDiff.height,i=e?0:o.sizeDiff.width,e={width:o.helper.width()-i,height:o.helper.height()-s},i=parseFloat(o.element.css("left"))+(o.position.left-o.originalPosition.left)||null,s=parseFloat(o.element.css("top"))+(o.position.top-o.originalPosition.top)||null,n.animate||this.element.css(y.extend(e,{top:s,left:i})),o.helper.height(o.size.height),o.helper.width(o.size.width),this._helper&&!n.animate&&this._proportionallyResize()),y("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s=this.options,n={minWidth:this._isNumber(s.minWidth)?s.minWidth:0,maxWidth:this._isNumber(s.maxWidth)?s.maxWidth:1/0,minHeight:this._isNumber(s.minHeight)?s.minHeight:0,maxHeight:this._isNumber(s.maxHeight)?s.maxHeight:1/0};(this._aspectRatio||t)&&(e=n.minHeight*this.aspectRatio,i=n.minWidth/this.aspectRatio,s=n.maxHeight*this.aspectRatio,t=n.maxWidth/this.aspectRatio,e>n.minWidth&&(n.minWidth=e),i>n.minHeight&&(n.minHeight=i),st.width,h=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,a=this.originalPosition.left+this.originalSize.width,r=this.originalPosition.top+this.originalSize.height,l=/sw|nw|w/.test(i),i=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),h&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&l&&(t.left=a-e.minWidth),s&&l&&(t.left=a-e.maxWidth),h&&i&&(t.top=r-e.minHeight),n&&i&&(t.top=r-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;e").css({overflow:"hidden"}),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++e.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(t,e,i){return y.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},sw:function(t,e,i){return y.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,e,i]))},ne:function(t,e,i){return y.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},nw:function(t,e,i){return y.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,e,i]))}},_propagate:function(t,e){y.ui.plugin.call(this,t,[e,this.ui()]),"resize"!==t&&this._trigger(t,e,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),y.ui.plugin.add("resizable","animate",{stop:function(e){var i=y(this).resizable("instance"),t=i.options,s=i._proportionallyResizeElements,n=s.length&&/textarea/i.test(s[0].nodeName),o=n&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,h=n?0:i.sizeDiff.width,n={width:i.size.width-h,height:i.size.height-o},h=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,o=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(y.extend(n,o&&h?{top:o,left:h}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var t={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};s&&s.length&&y(s[0]).css({width:t.width,height:t.height}),i._updateCache(t),i._propagate("resize",e)}})}}),y.ui.plugin.add("resizable","containment",{start:function(){var i,s,n=y(this).resizable("instance"),t=n.options,e=n.element,o=t.containment,h=o instanceof y?o.get(0):/parent/.test(o)?e.parent().get(0):o;h&&(n.containerElement=y(h),/document/.test(o)||o===document?(n.containerOffset={left:0,top:0},n.containerPosition={left:0,top:0},n.parentData={element:y(document),left:0,top:0,width:y(document).width(),height:y(document).height()||document.body.parentNode.scrollHeight}):(i=y(h),s=[],y(["Top","Right","Left","Bottom"]).each(function(t,e){s[t]=n._num(i.css("padding"+e))}),n.containerOffset=i.offset(),n.containerPosition=i.position(),n.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},t=n.containerOffset,e=n.containerSize.height,o=n.containerSize.width,o=n._hasScroll(h,"left")?h.scrollWidth:o,e=n._hasScroll(h)?h.scrollHeight:e,n.parentData={element:h,left:t.left,top:t.top,width:o,height:e}))},resize:function(t){var e=y(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.position,o=e._aspectRatio||t.shiftKey,h={top:0,left:0},a=e.containerElement,t=!0;a[0]!==document&&/static/.test(a.css("position"))&&(h=s),n.left<(e._helper?s.left:0)&&(e.size.width=e.size.width+(e._helper?e.position.left-s.left:e.position.left-h.left),o&&(e.size.height=e.size.width/e.aspectRatio,t=!1),e.position.left=i.helper?s.left:0),n.top<(e._helper?s.top:0)&&(e.size.height=e.size.height+(e._helper?e.position.top-s.top:e.position.top),o&&(e.size.width=e.size.height*e.aspectRatio,t=!1),e.position.top=e._helper?s.top:0),i=e.containerElement.get(0)===e.element.parent().get(0),n=/relative|absolute/.test(e.containerElement.css("position")),i&&n?(e.offset.left=e.parentData.left+e.position.left,e.offset.top=e.parentData.top+e.position.top):(e.offset.left=e.element.offset().left,e.offset.top=e.element.offset().top),n=Math.abs(e.sizeDiff.width+(e._helper?e.offset.left-h.left:e.offset.left-s.left)),s=Math.abs(e.sizeDiff.height+(e._helper?e.offset.top-h.top:e.offset.top-s.top)),n+e.size.width>=e.parentData.width&&(e.size.width=e.parentData.width-n,o&&(e.size.height=e.size.width/e.aspectRatio,t=!1)),s+e.size.height>=e.parentData.height&&(e.size.height=e.parentData.height-s,o&&(e.size.width=e.size.height*e.aspectRatio,t=!1)),t||(e.position.left=e.prevPosition.left,e.position.top=e.prevPosition.top,e.size.width=e.prevSize.width,e.size.height=e.prevSize.height)},stop:function(){var t=y(this).resizable("instance"),e=t.options,i=t.containerOffset,s=t.containerPosition,n=t.containerElement,o=y(t.helper),h=o.offset(),a=o.outerWidth()-t.sizeDiff.width,o=o.outerHeight()-t.sizeDiff.height;t._helper&&!e.animate&&/relative/.test(n.css("position"))&&y(this).css({left:h.left-s.left-i.left,width:a,height:o}),t._helper&&!e.animate&&/static/.test(n.css("position"))&&y(this).css({left:h.left-s.left-i.left,width:a,height:o})}}),y.ui.plugin.add("resizable","alsoResize",{start:function(){var t=y(this).resizable("instance").options;y(t.alsoResize).each(function(){var t=y(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var e=y(this).resizable("instance"),s=e.options,n=e.originalSize,o=e.originalPosition,h={height:e.size.height-n.height||0,width:e.size.width-n.width||0,top:e.position.top-o.top||0,left:e.position.left-o.left||0};y(s.alsoResize).each(function(){var t=y(this),s=y(this).data("ui-resizable-alsoresize"),n={},e=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];y.each(e,function(t,e){var i=(s[e]||0)+(h[e]||0);i&&0<=i&&(n[e]=i||null)}),t.css(n)})},stop:function(){y(this).removeData("ui-resizable-alsoresize")}}),y.ui.plugin.add("resizable","ghost",{start:function(){var t=y(this).resizable("instance"),e=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),!1!==y.uiBackCompat&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=y(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=y(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),y.ui.plugin.add("resizable","grid",{resize:function(){var t,e=y(this).resizable("instance"),i=e.options,s=e.size,n=e.originalSize,o=e.originalPosition,h=e.axis,a="number"==typeof i.grid?[i.grid,i.grid]:i.grid,r=a[0]||1,l=a[1]||1,u=Math.round((s.width-n.width)/r)*r,p=Math.round((s.height-n.height)/l)*l,d=n.width+u,c=n.height+p,f=i.maxWidth&&i.maxWidthd,s=i.minHeight&&i.minHeight>c;i.grid=a,m&&(d+=r),s&&(c+=l),f&&(d-=r),g&&(c-=l),/^(se|s|e)$/.test(h)?(e.size.width=d,e.size.height=c):/^(ne)$/.test(h)?(e.size.width=d,e.size.height=c,e.position.top=o.top-p):/^(sw)$/.test(h)?(e.size.width=d,e.size.height=c,e.position.left=o.left-u):((c-l<=0||d-r<=0)&&(t=e._getPaddingPlusBorderDimensions(this)),0=f[g]?0:Math.min(f[g],n));!a&&1-1){targetElements.on(evt+EVENT_NAMESPACE,function elementToggle(event){$.powerTip.toggle(this,event)})}else{targetElements.on(evt+EVENT_NAMESPACE,function elementOpen(event){$.powerTip.show(this,event)})}});$.each(options.closeEvents,function(idx,evt){if($.inArray(evt,options.openEvents)<0){targetElements.on(evt+EVENT_NAMESPACE,function elementClose(event){$.powerTip.hide(this,!isMouseEvent(event))})}});targetElements.on("keydown"+EVENT_NAMESPACE,function elementKeyDown(event){if(event.keyCode===27){$.powerTip.hide(this,true)}})}return targetElements};$.fn.powerTip.defaults={fadeInTime:200,fadeOutTime:100,followMouse:false,popupId:"powerTip",popupClass:null,intentSensitivity:7,intentPollInterval:100,closeDelay:100,placement:"n",smartPlacement:false,offset:10,mouseOnToPopup:false,manual:false,openEvents:["mouseenter","focus"],closeEvents:["mouseleave","blur"]};$.fn.powerTip.smartPlacementLists={n:["n","ne","nw","s"],e:["e","ne","se","w","nw","sw","n","s","e"],s:["s","se","sw","n"],w:["w","nw","sw","e","ne","se","n","s","w"],nw:["nw","w","sw","n","s","se","nw"],ne:["ne","e","se","n","s","sw","ne"],sw:["sw","w","nw","s","n","ne","sw"],se:["se","e","ne","s","n","nw","se"],"nw-alt":["nw-alt","n","ne-alt","sw-alt","s","se-alt","w","e"],"ne-alt":["ne-alt","n","nw-alt","se-alt","s","sw-alt","e","w"],"sw-alt":["sw-alt","s","se-alt","nw-alt","n","ne-alt","w","e"],"se-alt":["se-alt","s","sw-alt","ne-alt","n","nw-alt","e","w"]};$.powerTip={show:function apiShowTip(element,event){if(isMouseEvent(event)){trackMouse(event);session.previousX=event.pageX;session.previousY=event.pageY;$(element).data(DATA_DISPLAYCONTROLLER).show()}else{$(element).first().data(DATA_DISPLAYCONTROLLER).show(true,true)}return element},reposition:function apiResetPosition(element){$(element).first().data(DATA_DISPLAYCONTROLLER).resetPosition();return element},hide:function apiCloseTip(element,immediate){var displayController;immediate=element?immediate:true;if(element){displayController=$(element).first().data(DATA_DISPLAYCONTROLLER)}else if(session.activeHover){displayController=session.activeHover.data(DATA_DISPLAYCONTROLLER)}if(displayController){displayController.hide(immediate)}return element},toggle:function apiToggle(element,event){if(session.activeHover&&session.activeHover.is(element)){$.powerTip.hide(element,!isMouseEvent(event))}else{$.powerTip.show(element,event)}return element}};$.powerTip.showTip=$.powerTip.show;$.powerTip.closeTip=$.powerTip.hide;function CSSCoordinates(){var me=this;me.top="auto";me.left="auto";me.right="auto";me.bottom="auto";me.set=function(property,value){if($.isNumeric(value)){me[property]=Math.round(value)}}}function DisplayController(element,options,tipController){var hoverTimer=null,myCloseDelay=null;function openTooltip(immediate,forceOpen){cancelTimer();if(!element.data(DATA_HASACTIVEHOVER)){if(!immediate){session.tipOpenImminent=true;hoverTimer=setTimeout(function intentDelay(){hoverTimer=null;checkForIntent()},options.intentPollInterval)}else{if(forceOpen){element.data(DATA_FORCEDOPEN,true)}closeAnyDelayed();tipController.showTip(element)}}else{cancelClose()}}function closeTooltip(disableDelay){if(myCloseDelay){myCloseDelay=session.closeDelayTimeout=clearTimeout(myCloseDelay);session.delayInProgress=false}cancelTimer();session.tipOpenImminent=false;if(element.data(DATA_HASACTIVEHOVER)){element.data(DATA_FORCEDOPEN,false);if(!disableDelay){session.delayInProgress=true;session.closeDelayTimeout=setTimeout(function closeDelay(){session.closeDelayTimeout=null;tipController.hideTip(element);session.delayInProgress=false;myCloseDelay=null},options.closeDelay);myCloseDelay=session.closeDelayTimeout}else{tipController.hideTip(element)}}}function checkForIntent(){var xDifference=Math.abs(session.previousX-session.currentX),yDifference=Math.abs(session.previousY-session.currentY),totalDifference=xDifference+yDifference;if(totalDifference",{id:options.popupId});if($body.length===0){$body=$("body")}$body.append(tipElement);session.tooltips=session.tooltips?session.tooltips.add(tipElement):tipElement}if(options.followMouse){if(!tipElement.data(DATA_HASMOUSEMOVE)){$document.on("mousemove"+EVENT_NAMESPACE,positionTipOnCursor);$window.on("scroll"+EVENT_NAMESPACE,positionTipOnCursor);tipElement.data(DATA_HASMOUSEMOVE,true)}}function beginShowTip(element){element.data(DATA_HASACTIVEHOVER,true);tipElement.queue(function queueTipInit(next){showTip(element);next()})}function showTip(element){var tipContent;if(!element.data(DATA_HASACTIVEHOVER)){return}if(session.isTipOpen){if(!session.isClosing){hideTip(session.activeHover)}tipElement.delay(100).queue(function queueTipAgain(next){showTip(element);next()});return}element.trigger("powerTipPreRender");tipContent=getTooltipContent(element);if(tipContent){tipElement.empty().append(tipContent)}else{return}element.trigger("powerTipRender");session.activeHover=element;session.isTipOpen=true;tipElement.data(DATA_MOUSEONTOTIP,options.mouseOnToPopup);tipElement.addClass(options.popupClass);if(!options.followMouse||element.data(DATA_FORCEDOPEN)){positionTipOnElement(element);session.isFixedTipOpen=true}else{positionTipOnCursor()}if(!element.data(DATA_FORCEDOPEN)&&!options.followMouse){$document.on("click"+EVENT_NAMESPACE,function documentClick(event){var target=event.target;if(target!==element[0]){if(options.mouseOnToPopup){if(target!==tipElement[0]&&!$.contains(tipElement[0],target)){$.powerTip.hide()}}else{$.powerTip.hide()}}})}if(options.mouseOnToPopup&&!options.manual){tipElement.on("mouseenter"+EVENT_NAMESPACE,function tipMouseEnter(){if(session.activeHover){session.activeHover.data(DATA_DISPLAYCONTROLLER).cancel()}});tipElement.on("mouseleave"+EVENT_NAMESPACE,function tipMouseLeave(){if(session.activeHover){session.activeHover.data(DATA_DISPLAYCONTROLLER).hide()}})}tipElement.fadeIn(options.fadeInTime,function fadeInCallback(){if(!session.desyncTimeout){session.desyncTimeout=setInterval(closeDesyncedTip,500)}element.trigger("powerTipOpen")})}function hideTip(element){session.isClosing=true;session.isTipOpen=false;session.desyncTimeout=clearInterval(session.desyncTimeout);element.data(DATA_HASACTIVEHOVER,false);element.data(DATA_FORCEDOPEN,false);$document.off("click"+EVENT_NAMESPACE);tipElement.off(EVENT_NAMESPACE);tipElement.fadeOut(options.fadeOutTime,function fadeOutCallback(){var coords=new CSSCoordinates;session.activeHover=null;session.isClosing=false;session.isFixedTipOpen=false;tipElement.removeClass();coords.set("top",session.currentY+options.offset);coords.set("left",session.currentX+options.offset);tipElement.css(coords);element.trigger("powerTipClose")})}function positionTipOnCursor(){var tipWidth,tipHeight,coords,collisions,collisionCount;if(!session.isFixedTipOpen&&(session.isTipOpen||session.tipOpenImminent&&tipElement.data(DATA_HASMOUSEMOVE))){tipWidth=tipElement.outerWidth();tipHeight=tipElement.outerHeight();coords=new CSSCoordinates;coords.set("top",session.currentY+options.offset);coords.set("left",session.currentX+options.offset);collisions=getViewportCollisions(coords,tipWidth,tipHeight);if(collisions!==Collision.none){collisionCount=countFlags(collisions);if(collisionCount===1){if(collisions===Collision.right){coords.set("left",session.scrollLeft+session.windowWidth-tipWidth)}else if(collisions===Collision.bottom){coords.set("top",session.scrollTop+session.windowHeight-tipHeight)}}else{coords.set("left",session.currentX-tipWidth-options.offset);coords.set("top",session.currentY-tipHeight-options.offset)}}tipElement.css(coords)}}function positionTipOnElement(element){var priorityList,finalPlacement;if(options.smartPlacement||options.followMouse&&element.data(DATA_FORCEDOPEN)){priorityList=$.fn.powerTip.smartPlacementLists[options.placement];$.each(priorityList,function(idx,pos){var collisions=getViewportCollisions(placeTooltip(element,pos),tipElement.outerWidth(),tipElement.outerHeight());finalPlacement=pos;return collisions!==Collision.none})}else{placeTooltip(element,options.placement);finalPlacement=options.placement}tipElement.removeClass("w nw sw e ne se n s w se-alt sw-alt ne-alt nw-alt");tipElement.addClass(finalPlacement)}function placeTooltip(element,placement){var iterationCount=0,tipWidth,tipHeight,coords=new CSSCoordinates;coords.set("top",0);coords.set("left",0);tipElement.css(coords);do{tipWidth=tipElement.outerWidth();tipHeight=tipElement.outerHeight();coords=placementCalculator.compute(element,placement,tipWidth,tipHeight,options.offset);tipElement.css(coords)}while(++iterationCount<=5&&(tipWidth!==tipElement.outerWidth()||tipHeight!==tipElement.outerHeight()));return coords}function closeDesyncedTip(){var isDesynced=false,hasDesyncableCloseEvent=$.grep(["mouseleave","mouseout","blur","focusout"],function(eventType){return $.inArray(eventType,options.closeEvents)!==-1}).length>0;if(session.isTipOpen&&!session.isClosing&&!session.delayInProgress&&hasDesyncableCloseEvent){if(session.activeHover.data(DATA_HASACTIVEHOVER)===false||session.activeHover.is(":disabled")){isDesynced=true}else if(!isMouseOver(session.activeHover)&&!session.activeHover.is(":focus")&&!session.activeHover.data(DATA_FORCEDOPEN)){if(tipElement.data(DATA_MOUSEONTOTIP)){if(!isMouseOver(tipElement)){isDesynced=true}}else{isDesynced=true}}if(isDesynced){hideTip(session.activeHover)}}}this.showTip=beginShowTip;this.hideTip=hideTip;this.resetPosition=positionTipOnElement}function isSvgElement(element){return Boolean(window.SVGElement&&element[0]instanceof SVGElement)}function isMouseEvent(event){return Boolean(event&&$.inArray(event.type,MOUSE_EVENTS)>-1&&typeof event.pageX==="number")}function initTracking(){if(!session.mouseTrackingActive){session.mouseTrackingActive=true;getViewportDimensions();$(getViewportDimensions);$document.on("mousemove"+EVENT_NAMESPACE,trackMouse);$window.on("resize"+EVENT_NAMESPACE,trackResize);$window.on("scroll"+EVENT_NAMESPACE,trackScroll)}}function getViewportDimensions(){session.scrollLeft=$window.scrollLeft();session.scrollTop=$window.scrollTop();session.windowWidth=$window.width();session.windowHeight=$window.height()}function trackResize(){session.windowWidth=$window.width();session.windowHeight=$window.height()}function trackScroll(){var x=$window.scrollLeft(),y=$window.scrollTop();if(x!==session.scrollLeft){session.currentX+=x-session.scrollLeft;session.scrollLeft=x}if(y!==session.scrollTop){session.currentY+=y-session.scrollTop;session.scrollTop=y}}function trackMouse(event){session.currentX=event.pageX;session.currentY=event.pageY}function isMouseOver(element){var elementPosition=element.offset(),elementBox=element[0].getBoundingClientRect(),elementWidth=elementBox.right-elementBox.left,elementHeight=elementBox.bottom-elementBox.top;return session.currentX>=elementPosition.left&&session.currentX<=elementPosition.left+elementWidth&&session.currentY>=elementPosition.top&&session.currentY<=elementPosition.top+elementHeight}function getTooltipContent(element){var tipText=element.data(DATA_POWERTIP),tipObject=element.data(DATA_POWERTIPJQ),tipTarget=element.data(DATA_POWERTIPTARGET),targetElement,content;if(tipText){if($.isFunction(tipText)){tipText=tipText.call(element[0])}content=tipText}else if(tipObject){if($.isFunction(tipObject)){tipObject=tipObject.call(element[0])}if(tipObject.length>0){content=tipObject.clone(true,true)}}else if(tipTarget){targetElement=$("#"+tipTarget);if(targetElement.length>0){content=targetElement.html()}}return content}function getViewportCollisions(coords,elementWidth,elementHeight){var viewportTop=session.scrollTop,viewportLeft=session.scrollLeft,viewportBottom=viewportTop+session.windowHeight,viewportRight=viewportLeft+session.windowWidth,collisions=Collision.none;if(coords.topviewportBottom||Math.abs(coords.bottom-session.windowHeight)>viewportBottom){collisions|=Collision.bottom}if(coords.leftviewportRight){collisions|=Collision.left}if(coords.left+elementWidth>viewportRight||coords.right1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);/*! SmartMenus jQuery Plugin - v1.1.0 - September 17, 2017 + * http://www.smartmenus.org/ + * Copyright Vasil Dinkov, Vadikom Web Ltd. http://vadikom.com; Licensed MIT */(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("jquery")):t(jQuery)})(function($){function initMouseDetection(t){var e=".smartmenus_mouse";if(mouseDetectionEnabled||t)mouseDetectionEnabled&&t&&($(document).off(e),mouseDetectionEnabled=!1);else{var i=!0,s=null,o={mousemove:function(t){var e={x:t.pageX,y:t.pageY,timeStamp:(new Date).getTime()};if(s){var o=Math.abs(s.x-e.x),a=Math.abs(s.y-e.y);if((o>0||a>0)&&2>=o&&2>=a&&300>=e.timeStamp-s.timeStamp&&(mouse=!0,i)){var n=$(t.target).closest("a");n.is("a")&&$.each(menuTrees,function(){return $.contains(this.$root[0],n[0])?(this.itemEnter({currentTarget:n[0]}),!1):void 0}),i=!1}}s=e}};o[touchEvents?"touchstart":"pointerover pointermove pointerout MSPointerOver MSPointerMove MSPointerOut"]=function(t){isTouchEvent(t.originalEvent)&&(mouse=!1)},$(document).on(getEventsNS(o,e)),mouseDetectionEnabled=!0}}function isTouchEvent(t){return!/^(4|mouse)$/.test(t.pointerType)}function getEventsNS(t,e){e||(e="");var i={};for(var s in t)i[s.split(" ").join(e+" ")+e]=t[s];return i}var menuTrees=[],mouse=!1,touchEvents="ontouchstart"in window,mouseDetectionEnabled=!1,requestAnimationFrame=window.requestAnimationFrame||function(t){return setTimeout(t,1e3/60)},cancelAnimationFrame=window.cancelAnimationFrame||function(t){clearTimeout(t)},canAnimate=!!$.fn.animate;return $.SmartMenus=function(t,e){this.$root=$(t),this.opts=e,this.rootId="",this.accessIdPrefix="",this.$subArrow=null,this.activatedItems=[],this.visibleSubMenus=[],this.showTimeout=0,this.hideTimeout=0,this.scrollTimeout=0,this.clickActivated=!1,this.focusActivated=!1,this.zIndexInc=0,this.idInc=0,this.$firstLink=null,this.$firstSub=null,this.disabled=!1,this.$disableOverlay=null,this.$touchScrollingSub=null,this.cssTransforms3d="perspective"in t.style||"webkitPerspective"in t.style,this.wasCollapsible=!1,this.init()},$.extend($.SmartMenus,{hideAll:function(){$.each(menuTrees,function(){this.menuHideAll()})},destroy:function(){for(;menuTrees.length;)menuTrees[0].destroy();initMouseDetection(!0)},prototype:{init:function(t){var e=this;if(!t){menuTrees.push(this),this.rootId=((new Date).getTime()+Math.random()+"").replace(/\D/g,""),this.accessIdPrefix="sm-"+this.rootId+"-",this.$root.hasClass("sm-rtl")&&(this.opts.rightToLeftSubMenus=!0);var i=".smartmenus";this.$root.data("smartmenus",this).attr("data-smartmenus-id",this.rootId).dataSM("level",1).on(getEventsNS({"mouseover focusin":$.proxy(this.rootOver,this),"mouseout focusout":$.proxy(this.rootOut,this),keydown:$.proxy(this.rootKeyDown,this)},i)).on(getEventsNS({mouseenter:$.proxy(this.itemEnter,this),mouseleave:$.proxy(this.itemLeave,this),mousedown:$.proxy(this.itemDown,this),focus:$.proxy(this.itemFocus,this),blur:$.proxy(this.itemBlur,this),click:$.proxy(this.itemClick,this)},i),"a"),i+=this.rootId,this.opts.hideOnClick&&$(document).on(getEventsNS({touchstart:$.proxy(this.docTouchStart,this),touchmove:$.proxy(this.docTouchMove,this),touchend:$.proxy(this.docTouchEnd,this),click:$.proxy(this.docClick,this)},i)),$(window).on(getEventsNS({"resize orientationchange":$.proxy(this.winResize,this)},i)),this.opts.subIndicators&&(this.$subArrow=$("").addClass("sub-arrow"),this.opts.subIndicatorsText&&this.$subArrow.html(this.opts.subIndicatorsText)),initMouseDetection()}if(this.$firstSub=this.$root.find("ul").each(function(){e.menuInit($(this))}).eq(0),this.$firstLink=this.$root.find("a").eq(0),this.opts.markCurrentItem){var s=/(index|default)\.[^#\?\/]*/i,o=/#.*/,a=window.location.href.replace(s,""),n=a.replace(o,"");this.$root.find("a").each(function(){var t=this.href.replace(s,""),i=$(this);(t==a||t==n)&&(i.addClass("current"),e.opts.markCurrentTree&&i.parentsUntil("[data-smartmenus-id]","ul").each(function(){$(this).dataSM("parent-a").addClass("current")}))})}this.wasCollapsible=this.isCollapsible()},destroy:function(t){if(!t){var e=".smartmenus";this.$root.removeData("smartmenus").removeAttr("data-smartmenus-id").removeDataSM("level").off(e),e+=this.rootId,$(document).off(e),$(window).off(e),this.opts.subIndicators&&(this.$subArrow=null)}this.menuHideAll();var i=this;this.$root.find("ul").each(function(){var t=$(this);t.dataSM("scroll-arrows")&&t.dataSM("scroll-arrows").remove(),t.dataSM("shown-before")&&((i.opts.subMenusMinWidth||i.opts.subMenusMaxWidth)&&t.css({width:"",minWidth:"",maxWidth:""}).removeClass("sm-nowrap"),t.dataSM("scroll-arrows")&&t.dataSM("scroll-arrows").remove(),t.css({zIndex:"",top:"",left:"",marginLeft:"",marginTop:"",display:""})),0==(t.attr("id")||"").indexOf(i.accessIdPrefix)&&t.removeAttr("id")}).removeDataSM("in-mega").removeDataSM("shown-before").removeDataSM("scroll-arrows").removeDataSM("parent-a").removeDataSM("level").removeDataSM("beforefirstshowfired").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeAttr("aria-expanded"),this.$root.find("a.has-submenu").each(function(){var t=$(this);0==t.attr("id").indexOf(i.accessIdPrefix)&&t.removeAttr("id")}).removeClass("has-submenu").removeDataSM("sub").removeAttr("aria-haspopup").removeAttr("aria-controls").removeAttr("aria-expanded").closest("li").removeDataSM("sub"),this.opts.subIndicators&&this.$root.find("span.sub-arrow").remove(),this.opts.markCurrentItem&&this.$root.find("a.current").removeClass("current"),t||(this.$root=null,this.$firstLink=null,this.$firstSub=null,this.$disableOverlay&&(this.$disableOverlay.remove(),this.$disableOverlay=null),menuTrees.splice($.inArray(this,menuTrees),1))},disable:function(t){if(!this.disabled){if(this.menuHideAll(),!t&&!this.opts.isPopup&&this.$root.is(":visible")){var e=this.$root.offset();this.$disableOverlay=$('
').css({position:"absolute",top:e.top,left:e.left,width:this.$root.outerWidth(),height:this.$root.outerHeight(),zIndex:this.getStartZIndex(!0),opacity:0}).appendTo(document.body)}this.disabled=!0}},docClick:function(t){return this.$touchScrollingSub?(this.$touchScrollingSub=null,void 0):((this.visibleSubMenus.length&&!$.contains(this.$root[0],t.target)||$(t.target).closest("a").length)&&this.menuHideAll(),void 0)},docTouchEnd:function(){if(this.lastTouch){if(!(!this.visibleSubMenus.length||void 0!==this.lastTouch.x2&&this.lastTouch.x1!=this.lastTouch.x2||void 0!==this.lastTouch.y2&&this.lastTouch.y1!=this.lastTouch.y2||this.lastTouch.target&&$.contains(this.$root[0],this.lastTouch.target))){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0);var t=this;this.hideTimeout=setTimeout(function(){t.menuHideAll()},350)}this.lastTouch=null}},docTouchMove:function(t){if(this.lastTouch){var e=t.originalEvent.touches[0];this.lastTouch.x2=e.pageX,this.lastTouch.y2=e.pageY}},docTouchStart:function(t){var e=t.originalEvent.touches[0];this.lastTouch={x1:e.pageX,y1:e.pageY,target:e.target}},enable:function(){this.disabled&&(this.$disableOverlay&&(this.$disableOverlay.remove(),this.$disableOverlay=null),this.disabled=!1)},getClosestMenu:function(t){for(var e=$(t).closest("ul");e.dataSM("in-mega");)e=e.parent().closest("ul");return e[0]||null},getHeight:function(t){return this.getOffset(t,!0)},getOffset:function(t,e){var i;"none"==t.css("display")&&(i={position:t[0].style.position,visibility:t[0].style.visibility},t.css({position:"absolute",visibility:"hidden"}).show());var s=t[0].getBoundingClientRect&&t[0].getBoundingClientRect(),o=s&&(e?s.height||s.bottom-s.top:s.width||s.right-s.left);return o||0===o||(o=e?t[0].offsetHeight:t[0].offsetWidth),i&&t.hide().css(i),o},getStartZIndex:function(t){var e=parseInt(this[t?"$root":"$firstSub"].css("z-index"));return!t&&isNaN(e)&&(e=parseInt(this.$root.css("z-index"))),isNaN(e)?1:e},getTouchPoint:function(t){return t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0]||t},getViewport:function(t){var e=t?"Height":"Width",i=document.documentElement["client"+e],s=window["inner"+e];return s&&(i=Math.min(i,s)),i},getViewportHeight:function(){return this.getViewport(!0)},getViewportWidth:function(){return this.getViewport()},getWidth:function(t){return this.getOffset(t)},handleEvents:function(){return!this.disabled&&this.isCSSOn()},handleItemEvents:function(t){return this.handleEvents()&&!this.isLinkInMegaMenu(t)},isCollapsible:function(){return"static"==this.$firstSub.css("position")},isCSSOn:function(){return"inline"!=this.$firstLink.css("display")},isFixed:function(){var t="fixed"==this.$root.css("position");return t||this.$root.parentsUntil("body").each(function(){return"fixed"==$(this).css("position")?(t=!0,!1):void 0}),t},isLinkInMegaMenu:function(t){return $(this.getClosestMenu(t[0])).hasClass("mega-menu")},isTouchMode:function(){return!mouse||this.opts.noMouseOver||this.isCollapsible()},itemActivate:function(t,e){var i=t.closest("ul"),s=i.dataSM("level");if(s>1&&(!this.activatedItems[s-2]||this.activatedItems[s-2][0]!=i.dataSM("parent-a")[0])){var o=this;$(i.parentsUntil("[data-smartmenus-id]","ul").get().reverse()).add(i).each(function(){o.itemActivate($(this).dataSM("parent-a"))})}if((!this.isCollapsible()||e)&&this.menuHideSubMenus(this.activatedItems[s-1]&&this.activatedItems[s-1][0]==t[0]?s:s-1),this.activatedItems[s-1]=t,this.$root.triggerHandler("activate.smapi",t[0])!==!1){var a=t.dataSM("sub");a&&(this.isTouchMode()||!this.opts.showOnClick||this.clickActivated)&&this.menuShow(a)}},itemBlur:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&this.$root.triggerHandler("blur.smapi",e[0])},itemClick:function(t){var e=$(t.currentTarget);if(this.handleItemEvents(e)){if(this.$touchScrollingSub&&this.$touchScrollingSub[0]==e.closest("ul")[0])return this.$touchScrollingSub=null,t.stopPropagation(),!1;if(this.$root.triggerHandler("click.smapi",e[0])===!1)return!1;var i=$(t.target).is(".sub-arrow"),s=e.dataSM("sub"),o=s?2==s.dataSM("level"):!1,a=this.isCollapsible(),n=/toggle$/.test(this.opts.collapsibleBehavior),r=/link$/.test(this.opts.collapsibleBehavior),h=/^accordion/.test(this.opts.collapsibleBehavior);if(s&&!s.is(":visible")){if((!r||!a||i)&&(this.opts.showOnClick&&o&&(this.clickActivated=!0),this.itemActivate(e,h),s.is(":visible")))return this.focusActivated=!0,!1}else if(a&&(n||i))return this.itemActivate(e,h),this.menuHide(s),n&&(this.focusActivated=!1),!1;return this.opts.showOnClick&&o||e.hasClass("disabled")||this.$root.triggerHandler("select.smapi",e[0])===!1?!1:void 0}},itemDown:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&e.dataSM("mousedown",!0)},itemEnter:function(t){var e=$(t.currentTarget);if(this.handleItemEvents(e)){if(!this.isTouchMode()){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0);var i=this;this.showTimeout=setTimeout(function(){i.itemActivate(e)},this.opts.showOnClick&&1==e.closest("ul").dataSM("level")?1:this.opts.showTimeout)}this.$root.triggerHandler("mouseenter.smapi",e[0])}},itemFocus:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&(!this.focusActivated||this.isTouchMode()&&e.dataSM("mousedown")||this.activatedItems.length&&this.activatedItems[this.activatedItems.length-1][0]==e[0]||this.itemActivate(e,!0),this.$root.triggerHandler("focus.smapi",e[0]))},itemLeave:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&(this.isTouchMode()||(e[0].blur(),this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0)),e.removeDataSM("mousedown"),this.$root.triggerHandler("mouseleave.smapi",e[0]))},menuHide:function(t){if(this.$root.triggerHandler("beforehide.smapi",t[0])!==!1&&(canAnimate&&t.stop(!0,!0),"none"!=t.css("display"))){var e=function(){t.css("z-index","")};this.isCollapsible()?canAnimate&&this.opts.collapsibleHideFunction?this.opts.collapsibleHideFunction.call(this,t,e):t.hide(this.opts.collapsibleHideDuration,e):canAnimate&&this.opts.hideFunction?this.opts.hideFunction.call(this,t,e):t.hide(this.opts.hideDuration,e),t.dataSM("scroll")&&(this.menuScrollStop(t),t.css({"touch-action":"","-ms-touch-action":"","-webkit-transform":"",transform:""}).off(".smartmenus_scroll").removeDataSM("scroll").dataSM("scroll-arrows").hide()),t.dataSM("parent-a").removeClass("highlighted").attr("aria-expanded","false"),t.attr({"aria-expanded":"false","aria-hidden":"true"});var i=t.dataSM("level");this.activatedItems.splice(i-1,1),this.visibleSubMenus.splice($.inArray(t,this.visibleSubMenus),1),this.$root.triggerHandler("hide.smapi",t[0])}},menuHideAll:function(){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0);for(var t=this.opts.isPopup?1:0,e=this.visibleSubMenus.length-1;e>=t;e--)this.menuHide(this.visibleSubMenus[e]);this.opts.isPopup&&(canAnimate&&this.$root.stop(!0,!0),this.$root.is(":visible")&&(canAnimate&&this.opts.hideFunction?this.opts.hideFunction.call(this,this.$root):this.$root.hide(this.opts.hideDuration))),this.activatedItems=[],this.visibleSubMenus=[],this.clickActivated=!1,this.focusActivated=!1,this.zIndexInc=0,this.$root.triggerHandler("hideAll.smapi")},menuHideSubMenus:function(t){for(var e=this.activatedItems.length-1;e>=t;e--){var i=this.activatedItems[e].dataSM("sub");i&&this.menuHide(i)}},menuInit:function(t){if(!t.dataSM("in-mega")){t.hasClass("mega-menu")&&t.find("ul").dataSM("in-mega",!0);for(var e=2,i=t[0];(i=i.parentNode.parentNode)!=this.$root[0];)e++;var s=t.prevAll("a").eq(-1);s.length||(s=t.prevAll().find("a").eq(-1)),s.addClass("has-submenu").dataSM("sub",t),t.dataSM("parent-a",s).dataSM("level",e).parent().dataSM("sub",t);var o=s.attr("id")||this.accessIdPrefix+ ++this.idInc,a=t.attr("id")||this.accessIdPrefix+ ++this.idInc;s.attr({id:o,"aria-haspopup":"true","aria-controls":a,"aria-expanded":"false"}),t.attr({id:a,role:"group","aria-hidden":"true","aria-labelledby":o,"aria-expanded":"false"}),this.opts.subIndicators&&s[this.opts.subIndicatorsPos](this.$subArrow.clone())}},menuPosition:function(t){var e,i,s=t.dataSM("parent-a"),o=s.closest("li"),a=o.parent(),n=t.dataSM("level"),r=this.getWidth(t),h=this.getHeight(t),u=s.offset(),l=u.left,c=u.top,d=this.getWidth(s),m=this.getHeight(s),p=$(window),f=p.scrollLeft(),v=p.scrollTop(),b=this.getViewportWidth(),S=this.getViewportHeight(),g=a.parent().is("[data-sm-horizontal-sub]")||2==n&&!a.hasClass("sm-vertical"),M=this.opts.rightToLeftSubMenus&&!o.is("[data-sm-reverse]")||!this.opts.rightToLeftSubMenus&&o.is("[data-sm-reverse]"),w=2==n?this.opts.mainMenuSubOffsetX:this.opts.subMenusSubOffsetX,T=2==n?this.opts.mainMenuSubOffsetY:this.opts.subMenusSubOffsetY;if(g?(e=M?d-r-w:w,i=this.opts.bottomToTopSubMenus?-h-T:m+T):(e=M?w-r:d-w,i=this.opts.bottomToTopSubMenus?m-T-h:T),this.opts.keepInViewport){var y=l+e,I=c+i;if(M&&f>y?e=g?f-y+e:d-w:!M&&y+r>f+b&&(e=g?f+b-r-y+e:w-r),g||(S>h&&I+h>v+S?i+=v+S-h-I:(h>=S||v>I)&&(i+=v-I)),g&&(I+h>v+S+.49||v>I)||!g&&h>S+.49){var x=this;t.dataSM("scroll-arrows")||t.dataSM("scroll-arrows",$([$('')[0],$('')[0]]).on({mouseenter:function(){t.dataSM("scroll").up=$(this).hasClass("scroll-up"),x.menuScroll(t)},mouseleave:function(e){x.menuScrollStop(t),x.menuScrollOut(t,e)},"mousewheel DOMMouseScroll":function(t){t.preventDefault()}}).insertAfter(t));var A=".smartmenus_scroll";if(t.dataSM("scroll",{y:this.cssTransforms3d?0:i-m,step:1,itemH:m,subH:h,arrowDownH:this.getHeight(t.dataSM("scroll-arrows").eq(1))}).on(getEventsNS({mouseover:function(e){x.menuScrollOver(t,e)},mouseout:function(e){x.menuScrollOut(t,e)},"mousewheel DOMMouseScroll":function(e){x.menuScrollMousewheel(t,e)}},A)).dataSM("scroll-arrows").css({top:"auto",left:"0",marginLeft:e+(parseInt(t.css("border-left-width"))||0),width:r-(parseInt(t.css("border-left-width"))||0)-(parseInt(t.css("border-right-width"))||0),zIndex:t.css("z-index")}).eq(g&&this.opts.bottomToTopSubMenus?0:1).show(),this.isFixed()){var C={};C[touchEvents?"touchstart touchmove touchend":"pointerdown pointermove pointerup MSPointerDown MSPointerMove MSPointerUp"]=function(e){x.menuScrollTouch(t,e)},t.css({"touch-action":"none","-ms-touch-action":"none"}).on(getEventsNS(C,A))}}}t.css({top:"auto",left:"0",marginLeft:e,marginTop:i-m})},menuScroll:function(t,e,i){var s,o=t.dataSM("scroll"),a=t.dataSM("scroll-arrows"),n=o.up?o.upEnd:o.downEnd;if(!e&&o.momentum){if(o.momentum*=.92,s=o.momentum,.5>s)return this.menuScrollStop(t),void 0}else s=i||(e||!this.opts.scrollAccelerate?this.opts.scrollStep:Math.floor(o.step));var r=t.dataSM("level");if(this.activatedItems[r-1]&&this.activatedItems[r-1].dataSM("sub")&&this.activatedItems[r-1].dataSM("sub").is(":visible")&&this.menuHideSubMenus(r-1),o.y=o.up&&o.y>=n||!o.up&&n>=o.y?o.y:Math.abs(n-o.y)>s?o.y+(o.up?s:-s):n,t.css(this.cssTransforms3d?{"-webkit-transform":"translate3d(0, "+o.y+"px, 0)",transform:"translate3d(0, "+o.y+"px, 0)"}:{marginTop:o.y}),mouse&&(o.up&&o.y>o.downEnd||!o.up&&o.y0;t.dataSM("scroll-arrows").eq(i?0:1).is(":visible")&&(t.dataSM("scroll").up=i,this.menuScroll(t,!0))}e.preventDefault()},menuScrollOut:function(t,e){mouse&&(/^scroll-(up|down)/.test((e.relatedTarget||"").className)||(t[0]==e.relatedTarget||$.contains(t[0],e.relatedTarget))&&this.getClosestMenu(e.relatedTarget)==t[0]||t.dataSM("scroll-arrows").css("visibility","hidden"))},menuScrollOver:function(t,e){if(mouse&&!/^scroll-(up|down)/.test(e.target.className)&&this.getClosestMenu(e.target)==t[0]){this.menuScrollRefreshData(t);var i=t.dataSM("scroll"),s=$(window).scrollTop()-t.dataSM("parent-a").offset().top-i.itemH;t.dataSM("scroll-arrows").eq(0).css("margin-top",s).end().eq(1).css("margin-top",s+this.getViewportHeight()-i.arrowDownH).end().css("visibility","visible")}},menuScrollRefreshData:function(t){var e=t.dataSM("scroll"),i=$(window).scrollTop()-t.dataSM("parent-a").offset().top-e.itemH;this.cssTransforms3d&&(i=-(parseFloat(t.css("margin-top"))-i)),$.extend(e,{upEnd:i,downEnd:i+this.getViewportHeight()-e.subH})},menuScrollStop:function(t){return this.scrollTimeout?(cancelAnimationFrame(this.scrollTimeout),this.scrollTimeout=0,t.dataSM("scroll").step=1,!0):void 0},menuScrollTouch:function(t,e){if(e=e.originalEvent,isTouchEvent(e)){var i=this.getTouchPoint(e);if(this.getClosestMenu(i.target)==t[0]){var s=t.dataSM("scroll");if(/(start|down)$/i.test(e.type))this.menuScrollStop(t)?(e.preventDefault(),this.$touchScrollingSub=t):this.$touchScrollingSub=null,this.menuScrollRefreshData(t),$.extend(s,{touchStartY:i.pageY,touchStartTime:e.timeStamp});else if(/move$/i.test(e.type)){var o=void 0!==s.touchY?s.touchY:s.touchStartY;if(void 0!==o&&o!=i.pageY){this.$touchScrollingSub=t;var a=i.pageY>o;void 0!==s.up&&s.up!=a&&$.extend(s,{touchStartY:i.pageY,touchStartTime:e.timeStamp}),$.extend(s,{up:a,touchY:i.pageY}),this.menuScroll(t,!0,Math.abs(i.pageY-o))}e.preventDefault()}else void 0!==s.touchY&&((s.momentum=15*Math.pow(Math.abs(i.pageY-s.touchStartY)/(e.timeStamp-s.touchStartTime),2))&&(this.menuScrollStop(t),this.menuScroll(t),e.preventDefault()),delete s.touchY)}}},menuShow:function(t){if((t.dataSM("beforefirstshowfired")||(t.dataSM("beforefirstshowfired",!0),this.$root.triggerHandler("beforefirstshow.smapi",t[0])!==!1))&&this.$root.triggerHandler("beforeshow.smapi",t[0])!==!1&&(t.dataSM("shown-before",!0),canAnimate&&t.stop(!0,!0),!t.is(":visible"))){var e=t.dataSM("parent-a"),i=this.isCollapsible();if((this.opts.keepHighlighted||i)&&e.addClass("highlighted"),i)t.removeClass("sm-nowrap").css({zIndex:"",width:"auto",minWidth:"",maxWidth:"",top:"",left:"",marginLeft:"",marginTop:""});else{if(t.css("z-index",this.zIndexInc=(this.zIndexInc||this.getStartZIndex())+1),(this.opts.subMenusMinWidth||this.opts.subMenusMaxWidth)&&(t.css({width:"auto",minWidth:"",maxWidth:""}).addClass("sm-nowrap"),this.opts.subMenusMinWidth&&t.css("min-width",this.opts.subMenusMinWidth),this.opts.subMenusMaxWidth)){var s=this.getWidth(t);t.css("max-width",this.opts.subMenusMaxWidth),s>this.getWidth(t)&&t.removeClass("sm-nowrap").css("width",this.opts.subMenusMaxWidth)}this.menuPosition(t)}var o=function(){t.css("overflow","")};i?canAnimate&&this.opts.collapsibleShowFunction?this.opts.collapsibleShowFunction.call(this,t,o):t.show(this.opts.collapsibleShowDuration,o):canAnimate&&this.opts.showFunction?this.opts.showFunction.call(this,t,o):t.show(this.opts.showDuration,o),e.attr("aria-expanded","true"),t.attr({"aria-expanded":"true","aria-hidden":"false"}),this.visibleSubMenus.push(t),this.$root.triggerHandler("show.smapi",t[0])}},popupHide:function(t){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0);var e=this;this.hideTimeout=setTimeout(function(){e.menuHideAll()},t?1:this.opts.hideTimeout)},popupShow:function(t,e){if(!this.opts.isPopup)return alert('SmartMenus jQuery Error:\n\nIf you want to show this menu via the "popupShow" method, set the isPopup:true option.'),void 0;if(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0),this.$root.dataSM("shown-before",!0),canAnimate&&this.$root.stop(!0,!0),!this.$root.is(":visible")){this.$root.css({left:t,top:e});var i=this,s=function(){i.$root.css("overflow","")};canAnimate&&this.opts.showFunction?this.opts.showFunction.call(this,this.$root,s):this.$root.show(this.opts.showDuration,s),this.visibleSubMenus[0]=this.$root}},refresh:function(){this.destroy(!0),this.init(!0)},rootKeyDown:function(t){if(this.handleEvents())switch(t.keyCode){case 27:var e=this.activatedItems[0];if(e){this.menuHideAll(),e[0].focus();var i=e.dataSM("sub");i&&this.menuHide(i)}break;case 32:var s=$(t.target);if(s.is("a")&&this.handleItemEvents(s)){var i=s.dataSM("sub");i&&!i.is(":visible")&&(this.itemClick({currentTarget:t.target}),t.preventDefault())}}},rootOut:function(t){if(this.handleEvents()&&!this.isTouchMode()&&t.target!=this.$root[0]&&(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0),!this.opts.showOnClick||!this.opts.hideOnClick)){var e=this;this.hideTimeout=setTimeout(function(){e.menuHideAll()},this.opts.hideTimeout)}},rootOver:function(t){this.handleEvents()&&!this.isTouchMode()&&t.target!=this.$root[0]&&this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0)},winResize:function(t){if(this.handleEvents()){if(!("onorientationchange"in window)||"orientationchange"==t.type){var e=this.isCollapsible();this.wasCollapsible&&e||(this.activatedItems.length&&this.activatedItems[this.activatedItems.length-1][0].blur(),this.menuHideAll()),this.wasCollapsible=e}}else if(this.$disableOverlay){var i=this.$root.offset();this.$disableOverlay.css({top:i.top,left:i.left,width:this.$root.outerWidth(),height:this.$root.outerHeight()})}}}}),$.fn.dataSM=function(t,e){return e?this.data(t+"_smartmenus",e):this.data(t+"_smartmenus")},$.fn.removeDataSM=function(t){return this.removeData(t+"_smartmenus")},$.fn.smartmenus=function(options){if("string"==typeof options){var args=arguments,method=options;return Array.prototype.shift.call(args),this.each(function(){var t=$(this).data("smartmenus");t&&t[method]&&t[method].apply(t,args)})}return this.each(function(){var dataOpts=$(this).data("sm-options")||null;if(dataOpts)try{dataOpts=eval("("+dataOpts+")")}catch(e){dataOpts=null,alert('ERROR\n\nSmartMenus jQuery init:\nInvalid "data-sm-options" attribute value syntax.')}new $.SmartMenus(this,$.extend({},$.fn.smartmenus.defaults,options,dataOpts))})},$.fn.smartmenus.defaults={isPopup:!1,mainMenuSubOffsetX:0,mainMenuSubOffsetY:0,subMenusSubOffsetX:0,subMenusSubOffsetY:0,subMenusMinWidth:"10em",subMenusMaxWidth:"20em",subIndicators:!0,subIndicatorsPos:"append",subIndicatorsText:"",scrollStep:30,scrollAccelerate:!0,showTimeout:250,hideTimeout:500,showDuration:0,showFunction:null,hideDuration:0,hideFunction:function(t,e){t.fadeOut(200,e)},collapsibleShowDuration:0,collapsibleShowFunction:function(t,e){t.slideDown(200,e)},collapsibleHideDuration:0,collapsibleHideFunction:function(t,e){t.slideUp(200,e)},showOnClick:!1,hideOnClick:!0,noMouseOver:!1,keepInViewport:!0,keepHighlighted:!0,markCurrentItem:!1,markCurrentTree:!0,rightToLeftSubMenus:!1,bottomToTopSubMenus:!1,collapsibleBehavior:"default"},$}); \ No newline at end of file diff --git a/v0.4.6/json_8py.html b/v0.4.6/json_8py.html new file mode 100644 index 00000000..dc6614e1 --- /dev/null +++ b/v0.4.6/json_8py.html @@ -0,0 +1,179 @@ + + + + + + + + +Formatron: src/formatron/formats/json.py File Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
json.py File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Classes

class  formatron.formats.json.JsonExtractor
 An extractor that loads json data to an object from a string. More...
 
+ + + + + + + + + +

+Namespaces

namespace  formatron
 
namespace  formatron.formats
 This subpackage contains modules that operate with concrete formats, like json.
 
namespace  formatron.formats.json
 The module defines the JsonExtractor class, which is used to extract data from a string in JSON format.
 
+ + + + + + + + + +

+Functions

None formatron.formats.json.register_generate_nonterminal_def (typing.Callable[[typing.Type, str], typing.Optional[typing.Tuple[str, typing.List[typing.Tuple[typing.Type, str]]]]] generate_nonterminal_def)
 Register a callable to generate nonterminal definition from a type.
 
 formatron.formats.json._register_all_predefined_types ()
 
str formatron.formats.json._generate_kbnf_grammar (schemas.schema.Schema|collections.abc.Sequence schema, str start_nonterminal)
 Generate a KBNF grammar string from a schema for JSON format.
 
+ + + + + + + +

+Variables

str formatron.formats.json.SPACE_NONTERMINAL = "[ \t\n\r]*"
 
str formatron.formats.json.GRAMMAR_HEADER
 
list formatron.formats.json._type_to_nonterminals
 
+
+
+ + + + diff --git a/v0.4.6/json_8py.js b/v0.4.6/json_8py.js new file mode 100644 index 00000000..4260416b --- /dev/null +++ b/v0.4.6/json_8py.js @@ -0,0 +1,10 @@ +var json_8py = +[ + [ "formatron.formats.json.JsonExtractor", "classformatron_1_1formats_1_1json_1_1JsonExtractor.html", "classformatron_1_1formats_1_1json_1_1JsonExtractor" ], + [ "_generate_kbnf_grammar", "json_8py.html#af4331f1a7679439503d898b2356d289e", null ], + [ "_register_all_predefined_types", "json_8py.html#a311b750cba3838aee622b9809888f051", null ], + [ "register_generate_nonterminal_def", "json_8py.html#a55ae1cd2ef251d160e872a0c49e7ba7a", null ], + [ "_type_to_nonterminals", "json_8py.html#a003a1dac95634ac70f86d51e768945a4", null ], + [ "GRAMMAR_HEADER", "json_8py.html#ac81c86f8a6384cf3b11c47ddf2049ca7", null ], + [ "SPACE_NONTERMINAL", "json_8py.html#af32c4b136b54f0356b017d6a319bb53d", null ] +]; \ No newline at end of file diff --git a/v0.4.6/json_8py_source.html b/v0.4.6/json_8py_source.html new file mode 100644 index 00000000..65eae91d --- /dev/null +++ b/v0.4.6/json_8py_source.html @@ -0,0 +1,679 @@ + + + + + + + + +Formatron: src/formatron/formats/json.py Source File + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
json.py
+
+
+Go to the documentation of this file.
1"""
+
2The module defines the `JsonExtractor` class, which is used to extract data from a string in JSON format.
+
3"""
+
4import collections
+
5import decimal
+
6import types
+
7import typing
+
8
+
9from frozendict import frozendict
+
10
+
11from formatron import extractor, schemas
+
12
+
13__all__ = ["JsonExtractor"]
+
14
+
15SPACE_NONTERMINAL = "[ \t\n\r]*"
+ +
17GRAMMAR_HEADER = rf"""integer ::= #"-?(0|[1-9][0-9]*)";
+
18number ::= #"-?(0|[1-9][0-9]*)(\\.[0-9]+)?([eE][+-]?[0-9]+)?";
+
19string ::= #'"([^\\\\"\u0000-\u001f]|\\\\["\\\\bfnrt/]|\\\\u[0-9A-Fa-f]{{4}})*"';
+
20boolean ::= "true"|"false";
+
21null ::= "null";
+
22array ::= array_begin (json_value (comma json_value)*)? array_end;
+
23object ::= object_begin (string colon json_value (comma string colon json_value)*)? object_end;
+
24json_value ::= number|string|boolean|null|array|object;
+
25comma ::= #"{SPACE_NONTERMINAL},{SPACE_NONTERMINAL}";
+
26colon ::= #"{SPACE_NONTERMINAL}:{SPACE_NONTERMINAL}";
+
27object_begin ::= #"\\{{{SPACE_NONTERMINAL}";
+
28object_end ::= #"{SPACE_NONTERMINAL}\\}}";
+
29array_begin ::= #"\\[{SPACE_NONTERMINAL}";
+
30array_end ::= #"{SPACE_NONTERMINAL}\\]";
+
31"""
+
32_type_to_nonterminals = []
+
33
+
34
+ +
36 generate_nonterminal_def: typing.Callable[
+
37 [typing.Type, str],
+
38 typing.Optional[typing.Tuple[str,
+
39 typing.List[typing.Tuple[typing.Type, str]]]]]) -> None:
+
40 """
+
41 Register a callable to generate nonterminal definition from a type.
+
42 The callable returns (nonterminal_definition, [(sub_type, sub_nonterminal), ...])
+
43 if the type is supported by this callable, otherwise None.
+
44 [(sub_type, sub_nonterminal), ...] are the types and nonterminals used in nonterminal_definition that may need
+
45 to be generated in the grammar too.
+
46
+
47 Args:
+
48 generate_nonterminal_def: A callable to generate nonterminal definition from a type.
+
+
49 """
+
50 _type_to_nonterminals.append(generate_nonterminal_def)
+
51
+
52
+ +
54 def schema(current: typing.Type, nonterminal: str):
+
55 if isinstance(current, type) and not isinstance(current, types.GenericAlias) \
+
56 and issubclass(current, schemas.schema.Schema):
+
+
+
57 line = [f"{nonterminal} ::= ", "object_begin "]
+
58 result = []
+
59 fields = []
+
60 for field, _field_info in current.fields().items():
+
61 field_name = f"{nonterminal}_{field}"
+
62 fields.append(f"'\"{field}\"' colon {field_name}")
+
63 result.append((_field_info, field_name))
+
64 line.append(" comma ".join(fields))
+
65 line.append(" object_end;\n")
+
66 return "".join(line), result
+
67 return None
+
68
+
69 def field_info(current: typing.Type, nonterminal: str):
+
70 if isinstance(current, schemas.schema.FieldInfo):
+
71 annotation = current.annotation
+
72 if current.required:
+
73 return "", [(annotation, nonterminal)]
+
74 new_nonterminal = f"{nonterminal}_required"
+
75 return f"{nonterminal} ::= {new_nonterminal}?;\n", [(annotation, new_nonterminal)]
+
76 return None
+
77
+
78 def string_metadata(current: typing.Type, nonterminal: str):
+
79 min_length = current.metadata.get("min_length")
+
80 max_length = current.metadata.get("max_length")
+
81 pattern = current.metadata.get("pattern")
+
82 if pattern:
+
83 assert not (min_length or max_length), "pattern is mutually exclusive with min_length and max_length"
+
84 repetition_map = {
+
85 (True, False): f"{{{min_length},}}",
+
86 (False, True): f"{{0,{max_length}}}",
+
87 (True, True): f"{{{min_length},{max_length}}}"
+
88 }
+
89 repetition = repetition_map.get((min_length is not None, max_length is not None))
+
90 if repetition is not None:
+
91 return fr"""{nonterminal} ::= #'"([^\\\\"\u0000-\u001f]|\\\\["\\\\bfnrt/]|\\\\u[0-9A-Fa-f]{{4}}){repetition}"';
+
92""", []
+
93 if pattern is not None:
+
94 pattern = pattern.replace("'", "\\'")
+
95 return f"""{nonterminal} ::= #'"{pattern}"';\n""", []
+
96
+
97 def number_metadata(current: typing.Type, nonterminal: str):
+
98 gt = current.metadata.get("gt")
+
99 ge = current.metadata.get("ge")
+
100 lt = current.metadata.get("lt")
+
101 le = current.metadata.get("le")
+
102
+
103 prefix_map = {
+
104 (gt, 0): "",
+
105 (ge, 0): "0|",
+
106 (lt, 0): "-",
+
107 (le, 0): "0|-",
+
108 }
+
109
+
110 for (condition, value), prefix in prefix_map.items():
+
111 if condition is not None and condition == value:
+
112 if issubclass(current.type, int):
+
113 return f"""{nonterminal} ::= #'{prefix}[1-9][0-9]*';\n""", []
+
114 elif issubclass(current.type, float):
+
115 return f"""{nonterminal} ::= #'{prefix}[1-9][0-9]*(\\.[0-9]+)?([eE][+-]?[0-9]+)?';\n""", []
+
116
+
117 raise ValueError(f"{current.type.__name__} metadata {current.metadata} is not supported in json_generators!")
+
118
+
119 def sequence_metadata(current: typing.Type, nonterminal: str):
+
120 min_items = current.metadata.get("min_length")
+
121 max_items = current.metadata.get("max_length")
+
122 prefix_items = current.metadata.get("prefix_items")
+
123 additional_items = current.metadata.get("additional_items")
+
124 if max_items is not None and prefix_items is not None and max_items <= len(prefix_items): # truncate prefix items
+
125 prefix_items = prefix_items[:max_items+1]
+
126 if prefix_items:
+
127 if not min_items: # json schema defaults to 0
+
128 min_items = 0
+
129 if not additional_items:
+
130 if min_items > len(prefix_items):
+
131 raise ValueError(f"min_items {min_items} is greater than the number of prefix_items {len(prefix_items)} and additional_items is not allowed")
+
132 max_items = len(prefix_items)
+
133 if min_items is not None or max_items is not None: # prefix items will set min
+
134 new_nonterminal = f"{nonterminal}_item"
+
135 ebnf_rules = []
+
136 if min_items is None:
+
137 min_items = 0
+
138 if min_items == 0 and max_items is None and prefix_items is None: # no special handling needed
+
139 return "", [(current.type, new_nonterminal)]
+
140 prefix_items_nonterminals = [f"{new_nonterminal}_{i}" for i in range(len(prefix_items))] if prefix_items else []
+
141 prefix_items_parts = [] # contains the sequence of nonterminals for prefix items from min_items to len(prefix_items)
+
142 if prefix_items is not None:
+
143 for i in range(max(min_items,1), len(prefix_items)+1):
+
144 prefix_items_parts.append(prefix_items_nonterminals[:i])
+
145 if min_items == 0:
+
146 ebnf_rules.append(f"{nonterminal} ::= array_begin array_end;")
+
147 if max_items is None: # unbounded
+
148 if not prefix_items:
+
149 min_items_part = ' comma '.join([new_nonterminal] * (min_items - 1))
+
150 ebnf_rules.append(f"{nonterminal} ::= array_begin {min_items_part} comma {new_nonterminal}+ array_end;")
+
151 elif len(prefix_items_parts) >= min_items:
+
152 for prefix_items_part in prefix_items_parts:
+
153 prefix_items_part = ' comma '.join(prefix_items_part)
+
154 ebnf_rules.append(f"{nonterminal} ::= array_begin {prefix_items_part} (comma {new_nonterminal})* array_end;")
+
155 else:
+
156 min_items_part = ' comma '.join([new_nonterminal] * (min_items - len(prefix_items_nonterminals)-1))
+
157 if min_items_part:
+
158 min_items_part = "comma " + min_items_part
+
159 prefix_items_part = ' comma '.join(prefix_items_nonterminals)
+
160 ebnf_rules.append(f"{nonterminal} ::= array_begin {prefix_items_part} {min_items_part} comma {new_nonterminal}+ array_end;")
+
161 elif min_items == 0 and not prefix_items:
+
162 for i in range(min_items, max_items + 1):
+
163 items = ' comma '.join([new_nonterminal] * i)
+
164 ebnf_rules.append(f"{nonterminal} ::= array_begin {items} array_end;")
+
165 else:
+
166 prefix_items_num = len(prefix_items_nonterminals)
+
167 if prefix_items:
+
168 for prefix_items_part in prefix_items_parts:
+
169 prefix_items_part = ' comma '.join(prefix_items_part)
+
170 ebnf_rules.append(f"{nonterminal} ::= array_begin {prefix_items_part} array_end;")
+
171 min_items_part = ' comma '.join([new_nonterminal] * (min_items - prefix_items_num))
+
172 prefix_items_part = ' comma '.join(prefix_items_nonterminals)
+
173 if min_items_part and prefix_items_part:
+
174 ebnf_rules.append(f"{nonterminal}_min ::= {prefix_items_part} comma {min_items_part};")
+
175 elif min_items_part:
+
176 ebnf_rules.append(f"{nonterminal}_min ::= {min_items_part};")
+
177 elif prefix_items_part:
+
178 ebnf_rules.append(f"{nonterminal}_min ::= {prefix_items_part};")
+
179 common = max(min_items, prefix_items_num)
+
180 for i in range(1, max_items + 1 - common):
+
181 items = ' comma '.join([new_nonterminal] * i)
+
182 ebnf_rules.append(f"{nonterminal} ::= array_begin {nonterminal}_min comma {items} array_end;")
+
183 # Handle the item type
+
184 args = typing.get_args(current.type)
+
185 if args:
+
186 item_type = args[0]
+
187 else:
+
188 # If args is empty, default to Any
+
189 item_type = typing.Any
+
190 if prefix_items:
+
191 return "\n".join(ebnf_rules) + "\n", list(zip(prefix_items, prefix_items_nonterminals)) + [(item_type, new_nonterminal)]
+
192 return "\n".join(ebnf_rules) + "\n", [(item_type, new_nonterminal)]
+
193 return None
+
194
+
195 def is_sequence_like(current: typing.Type) -> bool:
+
196 """
+
197 Check if the given type is sequence-like.
+
198
+
199 This function returns True for:
+
200 - typing.Sequence
+
201 - typing.List
+
202 - typing.Tuple
+
203 - Any subclass of collections.abc.Sequence
+
204 - list
+
205 - tuple
+
206
+
207 Args:
+
208 current: The type to check.
+
209
+
210 Returns:
+
211 bool: True if the type is sequence-like, False otherwise.
+
212 """
+
213 original = typing.get_origin(current)
+
214 if original is None:
+
215 original = current
+
216 return (
+
217 original is typing.Sequence or
+
218 original is typing.List or
+
219 original is typing.Tuple or
+
220 (isinstance(original, type) and (issubclass(original, collections.abc.Sequence) or
+
221 issubclass(original, list) or
+
222 issubclass(original, tuple)))
+
223 )
+
224
+
225 def metadata(current: typing.Type, nonterminal: str):
+
226 if isinstance(current, schemas.schema.TypeWithMetadata):
+
227 original = typing.get_origin(current.type)
+
228 if original is None:
+
229 original = current.type
+
230 if not current.metadata:
+
231 return "", [(current.type, nonterminal)]
+
232 if isinstance(current.type, type) and issubclass(current.type, str):
+
233 return string_metadata(current, nonterminal)
+
234 elif isinstance(current.type, type) and issubclass(current.type, (int, float)):
+
235 return number_metadata(current, nonterminal)
+
236 elif is_sequence_like(original):
+
237 return sequence_metadata(current, nonterminal)
+
238 return None
+
239
+
240 def builtin_sequence(current: typing.Type, nonterminal: str):
+
241 original = typing.get_origin(current)
+
242 if original is None:
+
243 original = current
+
244 if is_sequence_like(original):
+
245 new_nonterminal = f"{nonterminal}_value"
+
246 annotation = typing.get_args(current)
+
247 if not annotation:
+
248 annotation = typing.Any
+
249 else:
+
250 annotation = annotation[0]
+
251 return f"{nonterminal} ::= array_begin ({new_nonterminal} (comma {new_nonterminal})*)? array_end;\n", \
+
252 [(annotation, new_nonterminal)]
+
253 return None
+
254
+
255 def builtin_dict(current: typing.Type, nonterminal: str):
+
256 original = typing.get_origin(current)
+
257 if original is None:
+
258 original = current
+
259 if original is typing.Mapping or isinstance(original, type) and issubclass(original,
+
260 collections.abc.Mapping):
+
261 new_nonterminal = f"{nonterminal}_value"
+
262 args = typing.get_args(current)
+
263 if not args:
+
264 value = typing.Any
+
265 else:
+
266 assert issubclass(
+
267 args[0], str), f"{args[0]} is not string!"
+
268 value = args[1]
+
269 return f"{nonterminal} ::=" \
+
270 f" object_begin (string colon {new_nonterminal} (comma string colon {new_nonterminal})*)?" \
+
271 f" object_end;\n", \
+
272 [(value, new_nonterminal)]
+
273 return None
+
274
+
275 def builtin_tuple(current: typing.Type, nonterminal: str):
+
276 if typing.get_origin(current) is tuple or isinstance(current, type) and issubclass(current, tuple):
+
277 args = typing.get_args(current)
+
278 new_nonterminals = []
+
279 result = []
+
280 for i, arg in enumerate(args):
+
281 result.append(arg)
+
282 new_nonterminals.append(f"{nonterminal}_{i}")
+
283 return f"{nonterminal} ::=array_begin {' comma '.join(new_nonterminals)} array_end;\n", \
+
284 zip(result, new_nonterminals)
+
285
+
286 def builtin_union(current: typing.Type, nonterminal: str):
+
287 if typing.get_origin(current) is typing.Union:
+
288 args = typing.get_args(current)
+
289 assert args, f"{current} from {nonterminal} cannot be an empty union!"
+
290 new_nonterminals = []
+
291 result = []
+
292 for i, arg in enumerate(args):
+
293 result.append(arg)
+
294 new_nonterminals.append(f"{nonterminal}_{i}")
+
295 return f"{nonterminal} ::= {' | '.join(new_nonterminals)};\n", zip(result, new_nonterminals)
+
296
+
297 def builtin_literal(current: typing.Type, nonterminal: str):
+
298 if typing.get_origin(current) is typing.Literal:
+
299 args = typing.get_args(current)
+
300 assert args, f"{current} from {nonterminal} cannot be an empty literal!"
+
301 new_items = []
+
302 result = []
+
303 for i, arg in enumerate(args):
+
304 if isinstance(arg, str):
+
305 new_items.append(f'"\\"{repr(arg)[1:-1]}\\""')
+
306 elif isinstance(arg, bool):
+
307 new_items.append(f'"{str(arg).lower()}"')
+
308 elif isinstance(arg, int):
+
309 new_items.append(f'"{str(arg)}"')
+
310 elif isinstance(arg, float):
+
311 new_items.append(f'"{str(arg)}"')
+
312 elif arg is None:
+
313 new_items.append("null")
+
314 elif isinstance(arg, tuple):
+
315 for j,item in enumerate(arg):
+
316 new_nonterminal = f"{nonterminal}_{i}_{j}"
+
317 result.append((typing.Literal[item], new_nonterminal))
+
318 new_item = f"(array_begin {' comma '.join(map(lambda x:x[1], result))} array_end)"
+
319 new_items.append(new_item)
+
320 elif isinstance(arg, frozendict):
+
321 for key, value in arg.items():
+
322 new_nonterminal = f"{nonterminal}_{i}_{key}"
+
323 result.append((typing.Literal[value], new_nonterminal))
+
324 new_item = f"object_begin {' comma '.join(map(lambda x:x[1], result))} object_end"
+
325 new_items.append(new_item)
+
326 else:
+
327 new_nonterminal = f"{nonterminal}_{i}"
+
328 result.append((arg, new_nonterminal))
+
329 new_items.append(new_nonterminal)
+
330 return f"{nonterminal} ::= {' | '.join(new_items)};\n", result
+
331
+
332 def builtin_simple_types(current: typing.Type, nonterminal: str):
+
333 if isinstance(current, type) and issubclass(current, bool):
+
334 return f"{nonterminal} ::= boolean;\n", []
+
335 elif isinstance(current, type) and issubclass(current, int):
+
336 return f"{nonterminal} ::= integer;\n", []
+
337 elif isinstance(current, type) and issubclass(current, float):
+
338 return f"{nonterminal} ::= number;\n", []
+
339 elif isinstance(current, type) and issubclass(current, decimal.Decimal):
+
340 return f"{nonterminal} ::= number;\n", []
+
341 elif isinstance(current, type) and issubclass(current, str):
+
342 return f"{nonterminal} ::= string;\n", []
+
343 elif isinstance(current, type) and issubclass(current, type(None)):
+
344 return f"{nonterminal} ::= null;\n", []
+
345 elif current is typing.Any:
+
346 return f"{nonterminal} ::= json_value;\n", []
+
347 elif isinstance(current, typing.NewType):
+
348 current: typing.NewType
+
349 return "", [(current.__supertype__, nonterminal)]
+
350
+
351 register_generate_nonterminal_def(builtin_simple_types)
+ + + + +
356 register_generate_nonterminal_def(builtin_literal)
+ +
358 register_generate_nonterminal_def(builtin_sequence)
+ +
360
+
361def _generate_kbnf_grammar(schema: schemas.schema.Schema|collections.abc.Sequence, start_nonterminal: str) -> str:
+
362 """
+
363 Generate a KBNF grammar string from a schema for JSON format.
+
364
+
365 Args:
+
366 schema: The schema to generate a grammar for.
+
367 start_nonterminal: The start nonterminal of the grammar. Default is "start".
+
368
+
+
369 Returns:
+
370 The generated KBNF grammar string.
+
371 """
+
372 type_id_to_nonterminal = {
+
373 id(int): "integer",
+
374 id(float): "number",
+
375 id(str): "string",
+
376 id(bool): "boolean",
+
377 id(type(None)): "null",
+
378 id(list): "array",
+
379 id(dict): "object",
+
380 id(typing.Any): "json_value",
+
+ +
382 result = [GRAMMAR_HEADER]
+
383 nonterminals = set()
+
384 stack = [(schema, start_nonterminal)]
+
385 while stack:
+
386 (current, nonterminal) = stack.pop()
+
387 type_id = id(current)
+
388 if type_id in type_id_to_nonterminal:
+
389 line = f"{nonterminal} ::= {type_id_to_nonterminal[type_id]};\n"
+
390 result.append(line)
+
391 continue
+
392 type_id_to_nonterminal[type_id] = nonterminal
+
393 for i in _type_to_nonterminals:
+
394 value = i(current, nonterminal)
+
395 if value is not None:
+
396 line, to_stack = value
+
397 result.append(line)
+
398 stack.extend(to_stack)
+
399 nonterminals.add(nonterminal)
+
400 break
+
401 else:
+
402 raise TypeError(
+
403 f"{current} from {nonterminal} is not supported in json_generators!")
+
404 return "".join(result)
+
405
+
406
+ +
408 """
+
409 An extractor that loads json data to an object from a string.
+
410 """
+
411
+
412 def __init__(self, nonterminal: str, capture_name: typing.Optional[str], schema: schemas.schema.Schema|collections.abc.Sequence,
+
413 to_object: typing.Callable[[str], schemas.schema.Schema]):
+
414 """
+
415 Create a json extractor from a given schema or a list of supported types.
+
416
+
+
417 Currently, the following data types are supported:
+
418
+
419 - bool
+
+
420 - int
+
421 - positive int
+
422 - negative int
+
423 - nonnegative int
+
424 - nonpositive int
+
425 - float
+
426 - positive float
+
427 - negative float
+
428 - nonnegative float
+
429 - nonpositive float
+
430 - str
+
431 - optionally with min_length, max_length and pattern constraints
+
432 - length is measured in UTF-8 character number after json parsing
+
433 - *Warning*: too large difference between min_length and max_length can lead to enormous memory consumption!
+
434 - pattern is mutually exclusive with min_length and max_length
+
435 - pattern will be compiled to a regular expression so all caveats of regular expressions apply
+
436 - pattern currently is automatically anchored at both ends
+
437 - the generated json could be invalid if the pattern allows invalid content between the json string's quotes.
+
438 - for example, `pattern=".*"` will allow '\"' to appear in the json string which is forbidden by JSON standard.
+
439 - NoneType
+
440 - typing.Any
+
441 - Subclasses of collections.abc.Mapping[str,T] and typing.Mapping[str,T] where T is a supported type,
+
442 - Subclasses of collections.abc.Sequence[T] and typing.Sequence[T] where T is a supported type.
+
443 - optionally with `minItems`, `maxItems`, `prefixItems` constraints
+
444 - *Warning*: too large difference between minItems and maxItems can lead to very slow performance!
+
445 - *Warning*: By json schema definition, prefixItems by default allows additional items and missing items in the prefixItems, which may not be the desired behavior and can lead to very slow performance if prefixItems is long!
+
446 - tuple[T1,T2,...] where T1,T2,... are supported types. The order, type and number of elements will be preserved.
+
447 - typing.Literal[x1,x2,...] where x1, x2, ... are instances of int, string, bool or NoneType, or another typing.Literal[y1,y2,...]
+
448 - typing.Union[T1,T2,...] where T1,T2,... are supported types.
+
449 - schemas.Schema where all its fields' data types are supported. Recursive schema definitions are supported as well.
+
450 - *Warning*: while not required field is supported, they can lead to very slow performance and/or enormous memory consumption if there are too many of them!
+
451 Args:
+
452 nonterminal: The nonterminal representing the extractor.
+
453 capture_name: The capture name of the extractor, or `None` if the extractor does not capture.
+
454 to_object: A callable to convert the extracted string to a schema instance.
+
455 """
+
456 super().__init__(nonterminal, capture_name)
+
457 self._to_object = to_object
+
458 self._rule_str = _generate_kbnf_grammar(schema, self.nonterminal)
+
459 def extract(self, input_str: str) -> typing.Optional[tuple[str, schemas.schema.Schema]]:
+
460 """
+
461 Extract a schema instance from a string.
+
462
+
463 Args:
+
464 input_str: The input string to extract from.
+
465
+
466 Returns:
+
467 A tuple of the remaining string and the extracted schema instance, or `None` if extraction failed.
+
468 """
+
469
+
470 # Ensure the input string starts with '{' or '[' after stripping leading whitespace
+
471 input_str = input_str.lstrip()
+
+
472 if not input_str.startswith(('{', '[')):
+
473 return None
+
474
+
475 # Variables to track the balance of brackets and the position in the string
+
476 bracket_count = 0
+
+
477 position = 0
+
478 in_string = False
+
479 escape_next = False
+
480 start_char = input_str[0]
+
481 end_char = '}' if start_char == '{' else ']'
+
482
+
483 # Iterate over the string to find where the JSON object or array ends
+
484 for char in input_str:
+
485 if not in_string:
+
+
486 if char == start_char:
+
487 bracket_count += 1
+
488 elif char == end_char:
+
489 bracket_count -= 1
+
490 elif char == '"':
+
491 in_string = True
+
492 else:
+
493 if char == '"' and not escape_next:
+
494 in_string = False
+
495 elif char == '\\':
+
496 escape_next = not escape_next
+
497 else:
+
498 escape_next = False
+
499
+
500 # Move to the next character
+
501 position += 1
+
502
+
503 # If brackets are balanced and we're not in a string, stop processing
+
504 if bracket_count == 0 and not in_string:
+
505 break
+
506 else:
+
507 return None
+
508 # The position now points to the character after the last '}', so we slice to position
+
509 json_str = input_str[:position]
+
510 remaining_str = input_str[position:]
+
511 # Return the unparsed remainder of the string and the decoded JSON object
+
512 return remaining_str, self._to_object(json_str)
+
513
+
514 @property
+
515 def kbnf_definition(self):
+
516 return self._rule_str
+
517
+
518
+ +
+
+
An extractor that extracts data corresponding to a nonterminal.
Definition extractor.py:98
+
str nonterminal(self)
Get the nonterminal of the extractor.
Definition extractor.py:121
+
An extractor that loads json data to an object from a string.
Definition json.py:420
+ +
typing.Optional[tuple[str, schemas.schema.Schema]] extract(self, str input_str)
Extract a schema instance from a string.
Definition json.py:486
+
__init__(self, str nonterminal, typing.Optional[str] capture_name, schemas.schema.Schema|collections.abc.Sequence schema, typing.Callable[[str], schemas.schema.Schema] to_object)
Create a json extractor from a given schema or a list of supported types.
Definition json.py:473
+ + + +
An abstract schema that describes some data.
Definition schema.py:78
+ +
_register_all_predefined_types()
Definition json.py:57
+
None register_generate_nonterminal_def(typing.Callable[[typing.Type, str], typing.Optional[typing.Tuple[str, typing.List[typing.Tuple[typing.Type, str]]]]] generate_nonterminal_def)
Register a callable to generate nonterminal definition from a type.
Definition json.py:53
+
str _generate_kbnf_grammar(schemas.schema.Schema|collections.abc.Sequence schema, str start_nonterminal)
Generate a KBNF grammar string from a schema for JSON format.
Definition json.py:381
+
+
+ + + + diff --git a/v0.4.6/json__schema_8py.html b/v0.4.6/json__schema_8py.html new file mode 100644 index 00000000..20da19b4 --- /dev/null +++ b/v0.4.6/json__schema_8py.html @@ -0,0 +1,210 @@ + + + + + + + + +Formatron: src/formatron/schemas/json_schema.py File Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
json_schema.py File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Classes

class  formatron.schemas.json_schema.FieldInfo
 
+ + + + + + + + + +

+Namespaces

namespace  formatron
 
namespace  formatron.schemas
 This subpackage contains modules that define schemas creation from various sources.
 
namespace  formatron.schemas.json_schema
 This module contains utilities for creating schemas from JSON schemas.
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

schemas.schema.Schema formatron.schemas.json_schema.create_schema (dict[str, typing.Any] schema, registry=Registry())
 Create a Schema object from a JSON schema object.
 
str formatron.schemas.json_schema._resolve_new_url (str uri, str ref)
 Adapted from https://github.com/python-jsonschema/referencing/blob/main/referencing/_core.py#L667.
 
None formatron.schemas.json_schema._validate_json_schema (dict[str, typing.Any] schema)
 
typing.Type formatron.schemas.json_schema._convert_json_schema_to_our_schema (dict[str, typing.Any] schema, dict[int, typing.Type] json_schema_id_to_schema)
 Recursively handle all types needed to fully determine the type of a schema.
 
 formatron.schemas.json_schema._extract_fields_from_object_type (typing.Type object_type)
 
typing.Type formatron.schemas.json_schema._handle_anyOf (dict[str, typing.Any] schema, dict[int, typing.Type] json_schema_id_to_schema)
 
typing.Type[typing.Any|None] formatron.schemas.json_schema._infer_type (dict[str, typing.Any] schema, dict[int, typing.Type] json_schema_id_to_schema)
 Infer more specific types.
 
typing.Any formatron.schemas.json_schema._get_literal (dict[str, typing.Any] schema)
 
typing.Type formatron.schemas.json_schema._handle_literal (typing.Any literal, typing.Type obtained_type, dict[str, typing.Any] schema, dict[int, typing.Type] json_schema_id_to_schema)
 
typing.Type formatron.schemas.json_schema._handle_str_with_metadata (dict[str, typing.Any] schema)
 Handle string type with metadata such as maxLength, minLength, and pattern.
 
typing.Type formatron.schemas.json_schema._handle_numeric_with_metadata (dict[str, typing.Any] schema, typing.Type numeric_type)
 Handle numeric types (int or float) with metadata such as minimum, maximum, exclusiveMinimum, and exclusiveMaximum.
 
typing.Type formatron.schemas.json_schema._create_custom_type (dict[str, typing.Any] schema, dict[int, typing.Type] json_schema_id_to_schema)
 
typing.Type formatron.schemas.json_schema._handle_list_metadata (typing.Type obtained_type, dict[str, typing.Any] schema, dict[int, typing.Type] json_schema_id_to_schema)
 Handle cases where the obtained type is a list.
 
typing.Type[typing.Any|None] formatron.schemas.json_schema._obtain_type (dict[str, typing.Any] schema, dict[int, typing.Type] json_schema_id_to_schema)
 Directly obtain type information from this schema's type keyword.
 
 formatron.schemas.json_schema._merge_referenced_schema (dict[str, typing.Any] schema, set[int] memo)
 
 formatron.schemas.json_schema._merge_key (dict[str, typing.Any] schema, str ref_key, typing.Any reference_value)
 
 formatron.schemas.json_schema._recursive_resolve_reference (str base_uri, typing.Any schema, Registry registry, set[int] memo)
 
 formatron.schemas.json_schema._resolve_reference (dict[str, typing.Any] schema, str key, typing.Any resolver)
 
+ + + +

+Variables

int formatron.schemas.json_schema._counter
 
+
+
+ + + + diff --git a/v0.4.6/json__schema_8py.js b/v0.4.6/json__schema_8py.js new file mode 100644 index 00000000..03bfc1bc --- /dev/null +++ b/v0.4.6/json__schema_8py.js @@ -0,0 +1,23 @@ +var json__schema_8py = +[ + [ "formatron.schemas.json_schema.FieldInfo", "classformatron_1_1schemas_1_1json__schema_1_1FieldInfo.html", "classformatron_1_1schemas_1_1json__schema_1_1FieldInfo" ], + [ "_convert_json_schema_to_our_schema", "json__schema_8py.html#a5f4856cb7c30aa340432d386836f25be", null ], + [ "_create_custom_type", "json__schema_8py.html#a15dc86b65c90ac8423c8989054f8c9e5", null ], + [ "_extract_fields_from_object_type", "json__schema_8py.html#af20251afc012b955e29c92922fcc83ef", null ], + [ "_get_literal", "json__schema_8py.html#a096ea829025ebd26b9ae165c17cf8976", null ], + [ "_handle_anyOf", "json__schema_8py.html#a6f88bf4e3c48d96b060ccdcbd80b3328", null ], + [ "_handle_list_metadata", "json__schema_8py.html#aa80f28ccaf9ed4b404564f629139f9d1", null ], + [ "_handle_literal", "json__schema_8py.html#a969bd30894a578428528b94b0f82f1ba", null ], + [ "_handle_numeric_with_metadata", "json__schema_8py.html#ad187a02f7616ccbb83c00462996a7fe1", null ], + [ "_handle_str_with_metadata", "json__schema_8py.html#a32e51b70be50d55d3944e6c700bbd1a5", null ], + [ "_infer_type", "json__schema_8py.html#ac742e1e581efccb6cc9742e7a23c25c2", null ], + [ "_merge_key", "json__schema_8py.html#a5fcddd43a5f64374b5b75d4aafeb9135", null ], + [ "_merge_referenced_schema", "json__schema_8py.html#a45c9b97319a58c2013b8e3f10ad78c30", null ], + [ "_obtain_type", "json__schema_8py.html#a544d74edf1fdccbad9e216d9ff028a20", null ], + [ "_recursive_resolve_reference", "json__schema_8py.html#aaba012c79d101be93f4d96588c9f8cc2", null ], + [ "_resolve_new_url", "json__schema_8py.html#a9dc9dc267e5dd7b6581e2367e9238152", null ], + [ "_resolve_reference", "json__schema_8py.html#a24b516494672cc5dbbf7300ea65479b1", null ], + [ "_validate_json_schema", "json__schema_8py.html#a51aa68e29951e6b295844b13177b7d6a", null ], + [ "create_schema", "json__schema_8py.html#ab2aeae10eb93ef3a3ca1c50013c6b380", null ], + [ "_counter", "json__schema_8py.html#a63e9b97210ccf01282f81aa529a86e50", null ] +]; \ No newline at end of file diff --git a/v0.4.6/json__schema_8py_source.html b/v0.4.6/json__schema_8py_source.html new file mode 100644 index 00000000..35afb44a --- /dev/null +++ b/v0.4.6/json__schema_8py_source.html @@ -0,0 +1,579 @@ + + + + + + + + +Formatron: src/formatron/schemas/json_schema.py Source File + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Formatron v0.4.6 + + +
+
Formatron empowers everyone to control the output format of language models with minimal overhead.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
json_schema.py
+
+
+Go to the documentation of this file.
1"""
+
2This module contains utilities for creating schemas from JSON schemas.
+
3"""
+
4
+
5import collections
+
6import collections.abc
+
7import copy
+
8import json
+
9from urllib.parse import urldefrag, urljoin
+
10import frozendict
+
11import jsonschema.validators
+
12from pydantic import typing
+
13import jsonschema
+
14from formatron import schemas
+
15from referencing import Registry, Resource
+
16
+ +
+
18 __slots__ = ("_annotation",)
+
19
+
20 def __init__(self, annotation: typing.Type, required:bool):
+
21 """
+
22 Initialize the field information.
+
23
+
24 Args:
+
25 annotation: The type annotation of the field.
+
26 """
+
+
27 self._annotation = annotation
+
28 self._required = required
+ +
30 @property
+
+
31 def annotation(self) -> typing.Type[typing.Any] | None:
+
32 """
+
33 Get the type annotation of the field.
+
34 """
+
35 return self._annotation
+
36
+
37 @property
+
38 def required(self) -> bool:
+
39 """
+
40 Check if the field is required for the schema.
+
41 """
+
+
42 return self._required
+
43
+
44_counter = 0
+
+
45
+
46def create_schema(schema: dict[str, typing.Any], registry=Registry()) -> schemas.schema.Schema:
+
47 """
+
48 Create a Schema object from a JSON schema object.
+
49
+
50 This function takes a JSON schema and converts it into a Schema object that can be used
+
51 for data validation and serialization. Currently, only the following JSON Schema features are supported:
+
52
+
53 - `type` keyword
+
54 - `minLength, maxLength, pattern` keywords for string type
+
55 - `minimum, maximum, exclusiveMinimum, exclusiveMaximum` keywords for number type and integer type
+
56 - `items` keyword
+
57 - optionally with `minItems`, `maxItems`, `prefixItems` constraints
+
+
58 - `properties` keyword
+
59 - Due to implementation limitations, we always assume `additionalProperties` is false.
+
60 - `enum` and `const` keyword
+
+
61 - This includes advanced enum types such as array and object.
+
62 - Note that if both `enum`(or `const`) and `type` are present, `type` will be ignored.
+
+
63 - `required` keyword
+
64 - `anyOf` keyword
+
65 - This currently does not support factoring out common parts of the subschemas(like https://json-schema.org/understanding-json-schema/reference/combining#factoringschemas)
+
66 - Schema references ($ref and $dynamicRef)
+
67 - Hence, all types of schema identifications(`$defs`, `$id`, `$anchor`, `$dynamicAnchor`) are supported.
+
68 - This includes recursive schema references.
+
69 - Recursive array references(like \[\[\[\[...\]\]\]\]) are not supported yet.
+
70 - Due to implementation limitations, duplicate constraint keywords in both referrers and referents are not allowed.
+
71 - This bound is expected to be loosened in future versions of Formatron where "easily mergeable" constraint keywords will be merged.
+
72
+
73 Requirements:
+
74 - The input schema must be a valid JSON Schema according to the JSON Schema Draft 2020-12 standard
+
75 - The root schema's type must be exactly "object" or "array" or both
+
76 - The schema must have a valid '$id' and '$schema' fields
+
77 - All references must be resolvable within the given schema and registry
+
78
+
79 Args:
+
80 schema: A dictionary representing a valid JSON schema.
+
81 registry: A Registry object containing additional schema definitions.
+
82 Defaults to an empty Registry.
+
83
+
84 Returns:
+
85 schemas.schema.Schema: A Schema object representing the input JSON schema.
+
86
+
87 Raises:
+
88 jsonschema.exceptions.ValidationError: If the input schema is not a valid JSON Schema.
+
89 ValueError: If there are issues with schema references, constraints or requirements.
+
90 """
+
91 registry = copy.deepcopy(registry)
+
92 schema = copy.deepcopy(schema)
+ +
94 registry = Resource.from_contents(schema) @ registry
+
95 json_schema_id_to_schema = {}
+
96 memo = set()
+
97 _recursive_resolve_reference(schema["$id"], schema, registry, memo)
+
98 memo.clear()
+
99 _merge_referenced_schema(schema,memo)
+
100 result = _convert_json_schema_to_our_schema(schema,json_schema_id_to_schema)
+
101 return result
+
102
+
103def _resolve_new_url(uri: str, ref: str) -> str:
+
104 """
+
105 Adapted from https://github.com/python-jsonschema/referencing/blob/main/referencing/_core.py#L667.
+
106 """
+
107 if not ref.startswith("#"):
+
108 uri, _ = urldefrag(urljoin(uri, ref))
+
109 return uri
+
110
+
111def _validate_json_schema(schema: dict[str, typing.Any]) -> None:
+
+
112 if "type" in schema:
+
113 root_type = schema["type"]
+
114 if isinstance(root_type, str):
+
115 if root_type not in ["object", "array"]:
+
116 raise ValueError("Root schema type must be 'object' or 'array'")
+
117 elif isinstance(root_type, list):
+
118 if not set(root_type).issubset({"object", "array"}):
+
119 raise ValueError("Root schema type must be 'object', 'array', or both")
+
120 else:
+
121 raise ValueError("Invalid 'type' specification in root schema")
+
122 jsonschema.validate(instance=schema, schema=jsonschema.validators.Draft202012Validator.META_SCHEMA)
+
123
+
124def _convert_json_schema_to_our_schema(schema: dict[str, typing.Any], json_schema_id_to_schema: dict[int, typing.Type])->typing.Type:
+
+
125 """
+
126 Recursively handle all types needed to fully determine the type of a schema
+
127 """
+
128 schema_id = id(schema)
+
129 if schema_id in json_schema_id_to_schema: # Circular reference
+
+
130 return json_schema_id_to_schema[schema_id]
+
131 if isinstance(schema, dict):
+
132 _inferred_type = _infer_type(schema, json_schema_id_to_schema)
+
133 if "properties" in schema:
+
134 fields = _extract_fields_from_object_type(json_schema_id_to_schema[schema_id])
+
+
+
135 properties = schema["properties"]
+
136 required = schema.get("required", [])
+
137 for _property in properties:
+
138 fields[_property] = FieldInfo(_convert_json_schema_to_our_schema(properties[_property], json_schema_id_to_schema), required=_property in required)
+
139 return _inferred_type
+
140
+
141def _extract_fields_from_object_type(object_type:typing.Type):
+
142 args = typing.get_args(object_type)
+
143 for arg in args:
+
144 if isinstance(arg, type) and issubclass(arg, schemas.schema.Schema):
+
145 return arg.fields()
+
146 return object_type.fields()
+
147
+
+
148def _handle_anyOf(schema: dict[str, typing.Any], json_schema_id_to_schema: dict[int, typing.Type]) -> typing.Type:
+
149 allowed_keys = {"anyOf", "$id", "$schema"}
+
150 assert set(schema.keys()).issubset(allowed_keys), "Only 'anyOf', '$id', and '$schema' are allowed when 'anyOf' is present"
+
151 new_list = []
+
152 for item in schema["anyOf"]:
+
+
153 new_list.append(_convert_json_schema_to_our_schema(item, json_schema_id_to_schema))
+
154 return typing.Union[tuple(new_list)]
+
155
+
156def _infer_type(schema: dict[str, typing.Any], json_schema_id_to_schema: dict[int, typing.Type]) -> typing.Type[typing.Any | None]:
+
157 """
+
158 Infer more specific types.
+
159 """
+
160 if "anyOf" in schema:
+
161 return _handle_anyOf(schema, json_schema_id_to_schema)
+
162 obtained_type = _obtain_type(schema, json_schema_id_to_schema)
+
163 if obtained_type is None:
+
164 obtained_type = typing.Union[str, float, int, bool, None, list[typing.Any]]
+
165 args = typing.get_args(obtained_type)
+
166 if not args:
+
167 args = [obtained_type]
+
168 else:
+
169 args = list(args)
+
+
+
170 for i, arg in enumerate(args):
+
171 if arg is object:
+
172 args[i] = _create_custom_type(schema, json_schema_id_to_schema)
+
173 elif arg is list:
+
174 args[i] = _handle_list_metadata(obtained_type, schema, json_schema_id_to_schema)
+
175 elif arg is str:
+
176 args[i] = _handle_str_with_metadata(schema)
+
+
+
177 elif arg is int or arg is float:
+
178 args[i] = _handle_numeric_with_metadata(schema, arg)
+
179 if typing.get_origin(obtained_type) is typing.Union:
+
180 obtained_type = typing.Union[tuple(args)]
+
181 elif typing.get_origin(obtained_type) is typing.Literal:
+
182 obtained_type = typing.Literal[tuple(args)]
+
183 else:
+
184 obtained_type = args[0]
+
+
185 json_schema_id_to_schema[id(schema)] = obtained_type
+
186 return obtained_type
+
187
+
188def _get_literal(schema: dict[str, typing.Any]) -> typing.Any:
+
189 if "enum" in schema and "const" in schema:
+
+
190 raise ValueError("JSON schema cannot contain both 'enum' and 'const' keywords")
+
191 return tuple(schema["enum"]) if "enum" in schema else schema.get("const")
+
192
+
193def _handle_literal(literal: typing.Any, obtained_type: typing.Type, schema: dict[str, typing.Any], json_schema_id_to_schema: dict[int, typing.Type]) -> typing.Type:
+
194 # TODO: validate literal against obtained_type
+
195 if not isinstance(literal, tuple):
+
196 literal = (literal,)
+
197 literal = frozendict.deepfreeze(literal)
+
198 literal_type = typing.Literal[literal]
+
199 return literal_type
+
200
+
201def _handle_str_with_metadata(schema: dict[str, typing.Any]) -> typing.Type:
+
202 """
+
203 Handle string type with metadata such as maxLength, minLength, and pattern.
+
204 """
+
205 metadata = {}
+
206 if "maxLength" in schema:
+
207 metadata["max_length"] = schema["maxLength"]
+
208 if "minLength" in schema:
+
209 metadata["min_length"] = schema["minLength"]
+
210 if "pattern" in schema:
+
211 metadata["pattern"] = schema["pattern"]
+
212
+
213 if metadata:
+
214 return schemas.schema.TypeWithMetadata(str, metadata)
+
215 return str
+
216
+
217def _handle_numeric_with_metadata(schema: dict[str, typing.Any], numeric_type: typing.Type) -> typing.Type:
+
218 """
+
+
+
219 Handle numeric types (int or float) with metadata such as minimum, maximum, exclusiveMinimum, and exclusiveMaximum.
+
220 """
+
221 metadata = {}
+
222 if "minimum" in schema:
+
223 metadata["ge"] = schema["minimum"]
+
+
+
224 if "maximum" in schema:
+
225 metadata["le"] = schema["maximum"]
+
226 if "exclusiveMinimum" in schema:
+
227 metadata["gt"] = schema["exclusiveMinimum"]
+
228 if "exclusiveMaximum" in schema:
+
229 metadata["lt"] = schema["exclusiveMaximum"]
+
230
+
231 if metadata:
+
+
232 return schemas.schema.TypeWithMetadata(numeric_type, metadata)
+
233 return numeric_type
+
234
+
235
+
236
+
+
237def _create_custom_type(schema: dict[str, typing.Any], json_schema_id_to_schema: dict[int, typing.Type]) -> typing.Type:
+
238 global _counter
+
239 fields = {}
+
240 new_type = type(f"__json_schema_{_counter}", (schemas.schema.Schema,), {
+
241 "from_json": classmethod(lambda cls, x: json.loads(x)),
+
242 "fields": classmethod(lambda cls: fields)
+
243 })
+
244 _counter += 1
+
245 json_schema_id_to_schema[id(schema)] = new_type
+
246 return new_type
+
247
+
248def _handle_list_metadata(obtained_type: typing.Type, schema: dict[str, typing.Any], json_schema_id_to_schema: dict[int, typing.Type]) -> typing.Type:
+
249 """
+
+
250 Handle cases where the obtained type is a list
+
251 """
+
252 metadata = {}
+
253 if "minItems" in schema:
+
254 metadata["min_length"] = schema["minItems"]
+
+
255 if "maxItems" in schema:
+
256 metadata["max_length"] = schema["maxItems"]
+
257 if "prefixItems" in schema:
+
258 metadata["prefix_items"] = tuple(_convert_json_schema_to_our_schema(i, json_schema_id_to_schema) for i in schema["prefixItems"])
+
259 item_type = typing.Any
+
260 if "items" in schema:
+
261 if schema["items"] == False:
+
262 metadata["additional_items"] = False
+
263 else:
+
264 item_type = _convert_json_schema_to_our_schema(schema["items"], json_schema_id_to_schema)
+
265 if item_type is None:
+
266 item_type = typing.Any
+
267 if metadata:
+
268 if "additional_items" not in metadata:
+
269 metadata["additional_items"] = True
+
270 return schemas.schema.TypeWithMetadata(list, metadata)
+
271 return list[item_type]
+
+
+ +
273
+
274def _obtain_type(schema: dict[str, typing.Any], json_schema_id_to_schema:dict[int, typing.Type]) -> typing.Type[typing.Any|None]:
+
275 """
+
276 Directly obtain type information from this schema's type keyword.
+
277 """
+
278 if "type" not in schema:
+
279 obtained_type = None
+
280 else:
+
281 json_type = schema["type"]
+
282 if json_type == "string":
+
+
283 obtained_type = str
+
284 elif json_type == "number":
+
285 obtained_type = float
+
286 elif json_type == "integer":
+
287 obtained_type = int
+
+
288 elif json_type == "boolean":
+
289 obtained_type = bool
+
290 elif json_type == "null":
+
291 obtained_type = type(None)
+
292 elif json_type == "array":
+
293 obtained_type = list
+
294 elif json_type == "object":
+
295 obtained_type = object
+
296 elif isinstance(json_type, collections.abc.Sequence):
+
297 new_list = []
+
298 for item in json_type:
+
299 new_schema = schema.copy()
+
300 new_schema["type"] = item
+
301 new_list.append(_obtain_type(new_schema, json_schema_id_to_schema))
+
302 obtained_type = typing.Union[tuple(new_list)]
+
303 else:
+
304 raise TypeError(f"Unsupported type in json schema: {json_type}")
+
305 literal = _get_literal(schema)
+
306 if literal is not None:
+
307 return _handle_literal(literal, obtained_type, schema, json_schema_id_to_schema)
+
308 return obtained_type
+
309
+
310
+
+
311
+
312
+
313
+
314def _merge_referenced_schema(schema: dict[str, typing.Any], memo: set[int]):
+
315 keys = ["$ref", "$dynamicRef"]
+
+
316 if id(schema) in memo: # Circular reference
+
317 return None
+
318 if isinstance(schema, list):
+
319 memo.add(id(schema))
+
320 for item in schema:
+
321 _merge_referenced_schema(item, memo)
+
322 elif isinstance(schema, dict):
+
323 memo.add(id(schema))
+
324 for key in keys:
+
325 if key in schema:
+
326 _merge_referenced_schema(schema[key], memo) # ensure no unmerged references
+
327 for ref_key, ref_value in schema[key].items():
+
328 _merge_key(schema, ref_key, ref_value)
+
329 del schema[key]
+
330 for key, value in schema.items():
+
331 _merge_referenced_schema(value, memo)
+
332
+
333def _merge_key(schema:dict[str, typing.Any], ref_key:str, reference_value:typing.Any):
+
334 if ref_key not in schema:
+
335 schema[ref_key] = reference_value
+
336 return None
+
337 if schema[ref_key] is reference_value:
+
338 return None
+
339 if isinstance(schema[ref_key], dict) and isinstance(reference_value, dict):
+
340 for new_ref_key, new_ref_value in reference_value.items():
+
341 _merge_key(schema[ref_key], new_ref_key, new_ref_value)
+
342 return None
+
343 if ref_key in ("$id", "$schema"):
+
344 # For $id and $schema, keep the original value
+
345 return None
+
346 if isinstance(schema[ref_key], (str, int, float, bool)) and isinstance(reference_value, (str, int, float, bool)):
+
347 if schema[ref_key] == reference_value:
+
348 return None
+
349 raise ValueError(f"Duplicate keys in schema referenced by {ref_key} in JSON schema: {schema} is not supported")
+
350
+
351
+
352def _recursive_resolve_reference(base_uri: str, schema: typing.Any, registry: Registry, memo: set[int]):
+
+
+
353 if id(schema) in memo:
+
354 return schema
+
355 memo.add(id(schema))
+
356 if isinstance(schema, list):
+
357 new_list = []
+
358 for item in schema:
+
359 new_list.append(_recursive_resolve_reference(base_uri, item, registry, memo))
+
360 schema.clear()
+
361 schema.extend(new_list)
+
362 if isinstance(schema, dict):
+
363 if "$id" in schema:
+
364 base_uri = _resolve_new_url(base_uri, schema["$id"])
+
365 resolver = registry.resolver(base_uri)
+
366 keys = ["$ref", "$dynamicRef"]
+
367 for key in keys:
+
368 if key in schema:
+
369 _resolve_reference(schema, key, resolver)
+
370 for key, value in schema.items():
+
371 _recursive_resolve_reference(base_uri, value, registry, memo)
+
+
+
372 return schema
+
373
+
374def _resolve_reference(schema: dict[str, typing.Any], key: str, resolver: typing.Any):
+
375 resolved = resolver.lookup(schema[key])
+
376 if resolved.contents is schema:
+
377 raise ValueError(f"Circular self reference detected in JSON schema: {schema}")
+
378 schema[key] = resolved.contents
+
+ +
typing.Type[typing.Any]|None annotation(self)
Get the type annotation of the field.
+ + +
__init__(self, typing.Type annotation, bool required)
Initialize the field information.
+
bool required(self)
Check if the field is required for the schema.
+ +
An abstract schema that describes some data.
Definition schema.py:78
+ +
typing.Any _get_literal(dict[str, typing.Any] schema)
+
typing.Type _create_custom_type(dict[str, typing.Any] schema, dict[int, typing.Type] json_schema_id_to_schema)
+
_resolve_reference(dict[str, typing.Any] schema, str key, typing.Any resolver)
+
typing.Type _handle_str_with_metadata(dict[str, typing.Any] schema)
Handle string type with metadata such as maxLength, minLength, and pattern.
+
_merge_referenced_schema(dict[str, typing.Any] schema, set[int] memo)
+
None _validate_json_schema(dict[str, typing.Any] schema)
+
typing.Type[typing.Any|None] _obtain_type(dict[str, typing.Any] schema, dict[int, typing.Type] json_schema_id_to_schema)
Directly obtain type information from this schema's type keyword.
+
typing.Type _convert_json_schema_to_our_schema(dict[str, typing.Any] schema, dict[int, typing.Type] json_schema_id_to_schema)
Recursively handle all types needed to fully determine the type of a schema.
+
_merge_key(dict[str, typing.Any] schema, str ref_key, typing.Any reference_value)
+
typing.Type _handle_anyOf(dict[str, typing.Any] schema, dict[int, typing.Type] json_schema_id_to_schema)
+
typing.Type _handle_literal(typing.Any literal, typing.Type obtained_type, dict[str, typing.Any] schema, dict[int, typing.Type] json_schema_id_to_schema)
+
str _resolve_new_url(str uri, str ref)
Adapted from https://github.com/python-jsonschema/referencing/blob/main/referencing/_core....
+
typing.Type _handle_list_metadata(typing.Type obtained_type, dict[str, typing.Any] schema, dict[int, typing.Type] json_schema_id_to_schema)
Handle cases where the obtained type is a list.
+
_recursive_resolve_reference(str base_uri, typing.Any schema, Registry registry, set[int] memo)
+
schemas.schema.Schema create_schema(dict[str, typing.Any] schema, registry=Registry())
Create a Schema object from a JSON schema object.
+
typing.Type[typing.Any|None] _infer_type(dict[str, typing.Any] schema, dict[int, typing.Type] json_schema_id_to_schema)
Infer more specific types.
+
typing.Type _handle_numeric_with_metadata(dict[str, typing.Any] schema, typing.Type numeric_type)
Handle numeric types (int or float) with metadata such as minimum, maximum, exclusiveMinimum,...
+
_extract_fields_from_object_type(typing.Type object_type)
+
+
+ + + + diff --git a/v0.4.6/menu.js b/v0.4.6/menu.js new file mode 100644 index 00000000..0fd1e990 --- /dev/null +++ b/v0.4.6/menu.js @@ -0,0 +1,134 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ +function initMenu(relPath,searchEnabled,serverSide,searchPage,search,treeview) { + function makeTree(data,relPath) { + let result=''; + if ('children' in data) { + result+='
    '; + for (let i in data.children) { + let url; + const link = data.children[i].url; + if (link.substring(0,1)=='^') { + url = link.substring(1); + } else { + url = relPath+link; + } + result+='
  • '+ + data.children[i].text+''+ + makeTree(data.children[i],relPath)+'
  • '; + } + result+='
'; + } + return result; + } + let searchBoxHtml; + if (searchEnabled) { + if (serverSide) { + searchBoxHtml='
'+ + '
'+ + '
 '+ + ''+ + '
'+ + '
'+ + '
'+ + '
'; + } else { + searchBoxHtml='
'+ + ''+ + ' '+ + ''+ + ''+ + ''+ + ''+ + ''+ + '
'; + } + } + + $('#main-nav').before('
'+ + ''+ + ''+ + '
'); + $('#main-nav').append(makeTree(menudata,relPath)); + $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu'); + if (searchBoxHtml) { + $('#main-menu').append('
  • '); + } + const $mainMenuState = $('#main-menu-state'); + let prevWidth = 0; + if ($mainMenuState.length) { + const initResizableIfExists = function() { + if (typeof initResizable==='function') initResizable(treeview); + } + // animate mobile menu + $mainMenuState.change(function() { + const $menu = $('#main-menu'); + let options = { duration: 250, step: initResizableIfExists }; + if (this.checked) { + options['complete'] = () => $menu.css('display', 'block'); + $menu.hide().slideDown(options); + } else { + options['complete'] = () => $menu.css('display', 'none'); + $menu.show().slideUp(options); + } + }); + // set default menu visibility + const resetState = function() { + const $menu = $('#main-menu'); + const newWidth = $(window).outerWidth(); + if (newWidth!=prevWidth) { + if ($(window).outerWidth()<768) { + $mainMenuState.prop('checked',false); $menu.hide(); + $('#searchBoxPos1').html(searchBoxHtml); + $('#searchBoxPos2').hide(); + } else { + $menu.show(); + $('#searchBoxPos1').empty(); + $('#searchBoxPos2').html(searchBoxHtml); + $('#searchBoxPos2').show(); + } + if (typeof searchBox!=='undefined') { + searchBox.CloseResultsWindow(); + } + prevWidth = newWidth; + } + } + $(window).ready(function() { resetState(); initResizableIfExists(); }); + $(window).resize(resetState); + } + $('#main-menu').smartmenus(); +} +/* @license-end */ diff --git a/v0.4.6/menudata.js b/v0.4.6/menudata.js new file mode 100644 index 00000000..f8444aad --- /dev/null +++ b/v0.4.6/menudata.js @@ -0,0 +1,95 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file +*/ +var menudata={children:[ +{text:"Main Page",url:"index.html"}, +{text:"Packages",url:"namespaces.html",children:[ +{text:"Package List",url:"namespaces.html"}, +{text:"Package Members",url:"namespacemembers.html",children:[ +{text:"All",url:"namespacemembers.html",children:[ +{text:"_",url:"namespacemembers.html#index__5F"}, +{text:"c",url:"namespacemembers.html#index_c"}, +{text:"g",url:"namespacemembers.html#index_g"}, +{text:"h",url:"namespacemembers.html#index_h"}, +{text:"i",url:"namespacemembers.html#index_i"}, +{text:"p",url:"namespacemembers.html#index_p"}, +{text:"r",url:"namespacemembers.html#index_r"}, +{text:"s",url:"namespacemembers.html#index_s"}]}, +{text:"Functions",url:"namespacemembers_func.html",children:[ +{text:"_",url:"namespacemembers_func.html#index__5F"}, +{text:"c",url:"namespacemembers_func.html#index_c"}, +{text:"g",url:"namespacemembers_func.html#index_g"}, +{text:"h",url:"namespacemembers_func.html#index_h"}, +{text:"i",url:"namespacemembers_func.html#index_i"}, +{text:"r",url:"namespacemembers_func.html#index_r"}]}, +{text:"Variables",url:"namespacemembers_vars.html"}]}]}, +{text:"Classes",url:"annotated.html",children:[ +{text:"Class List",url:"annotated.html"}, +{text:"Class Index",url:"classes.html"}, +{text:"Class Hierarchy",url:"hierarchy.html"}, +{text:"Class Members",url:"functions.html",children:[ +{text:"All",url:"functions.html",children:[ +{text:"_",url:"functions.html#index__5F"}, +{text:"a",url:"functions.html#index_a"}, +{text:"b",url:"functions.html#index_b"}, +{text:"c",url:"functions.html#index_c"}, +{text:"e",url:"functions.html#index_e"}, +{text:"f",url:"functions.html#index_f"}, +{text:"g",url:"functions.html#index_g"}, +{text:"i",url:"functions.html#index_i"}, +{text:"j",url:"functions.html#index_j"}, +{text:"k",url:"functions.html#index_k"}, +{text:"m",url:"functions.html#index_m"}, +{text:"n",url:"functions.html#index_n"}, +{text:"p",url:"functions.html#index_p"}, +{text:"r",url:"functions.html#index_r"}, +{text:"s",url:"functions.html#index_s"}, +{text:"t",url:"functions.html#index_t"}, +{text:"u",url:"functions.html#index_u"}]}, +{text:"Functions",url:"functions_func.html",children:[ +{text:"_",url:"functions_func.html#index__5F"}, +{text:"a",url:"functions_func.html#index_a"}, +{text:"b",url:"functions_func.html#index_b"}, +{text:"c",url:"functions_func.html#index_c"}, +{text:"e",url:"functions_func.html#index_e"}, +{text:"f",url:"functions_func.html#index_f"}, +{text:"g",url:"functions_func.html#index_g"}, +{text:"i",url:"functions_func.html#index_i"}, +{text:"j",url:"functions_func.html#index_j"}, +{text:"k",url:"functions_func.html#index_k"}, +{text:"m",url:"functions_func.html#index_m"}, +{text:"n",url:"functions_func.html#index_n"}, +{text:"p",url:"functions_func.html#index_p"}, +{text:"r",url:"functions_func.html#index_r"}, +{text:"s",url:"functions_func.html#index_s"}, +{text:"t",url:"functions_func.html#index_t"}, +{text:"u",url:"functions_func.html#index_u"}]}, +{text:"Variables",url:"functions_vars.html",children:[ +{text:"_",url:"functions_vars.html#index__5F"}, +{text:"c",url:"functions_vars.html#index_c"}, +{text:"e",url:"functions_vars.html#index_e"}, +{text:"f",url:"functions_vars.html#index_f"}, +{text:"r",url:"functions_vars.html#index_r"}]}]}]}, +{text:"Files",url:"files.html",children:[ +{text:"File List",url:"files.html"}]}]} diff --git a/v0.4.6/minus.svg b/v0.4.6/minus.svg new file mode 100644 index 00000000..f70d0c1a --- /dev/null +++ b/v0.4.6/minus.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/v0.4.6/minusd.svg b/v0.4.6/minusd.svg new file mode 100644 index 00000000..5f8e8796 --- /dev/null +++ b/v0.4.6/minusd.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/v0.4.6/namespaceformatron.html b/v0.4.6/namespaceformatron.html new file mode 100644 index 00000000..5a89fe90 --- /dev/null +++ b/v0.4.6/namespaceformatron.html @@ -0,0 +1,158 @@ + + + + + + + + +Formatron: formatron Namespace Reference + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    formatron Namespace Reference
    +
    +
    + + + + + + + + + + + + + + + + + + + + +

    +Namespaces

    namespace  config
     Configuration classes for Formatron.
     
    namespace  extractor
     Extractors for extracting data from generated strings.
     
    namespace  formats
     This subpackage contains modules that operate with concrete formats, like json.
     
    namespace  formatter
     This module contains the Formatter class and its related classes.
     
    namespace  integrations
     This subpackage contains integrations with other frameworks and libraries.
     
    namespace  schemas
     This subpackage contains modules that define schemas creation from various sources.
     
    +
    +
    + + + + diff --git a/v0.4.6/namespaceformatron.js b/v0.4.6/namespaceformatron.js new file mode 100644 index 00000000..5bb652c5 --- /dev/null +++ b/v0.4.6/namespaceformatron.js @@ -0,0 +1,9 @@ +var namespaceformatron = +[ + [ "config", "namespaceformatron_1_1config.html", "namespaceformatron_1_1config" ], + [ "extractor", "namespaceformatron_1_1extractor.html", "namespaceformatron_1_1extractor" ], + [ "formats", "namespaceformatron_1_1formats.html", "namespaceformatron_1_1formats" ], + [ "formatter", "namespaceformatron_1_1formatter.html", "namespaceformatron_1_1formatter" ], + [ "integrations", "namespaceformatron_1_1integrations.html", "namespaceformatron_1_1integrations" ], + [ "schemas", "namespaceformatron_1_1schemas.html", "namespaceformatron_1_1schemas" ] +]; \ No newline at end of file diff --git a/v0.4.6/namespaceformatron_1_1config.html b/v0.4.6/namespaceformatron_1_1config.html new file mode 100644 index 00000000..e2ec8ef5 --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1config.html @@ -0,0 +1,148 @@ + + + + + + + + +Formatron: formatron.config Namespace Reference + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    formatron.config Namespace Reference
    +
    +
    + +

    Configuration classes for Formatron. +More...

    + + + + + +

    +Classes

    class  EngineGenerationConfig
     Configuration for how an KBNF engine should be used in text generation. More...
     
    +

    Detailed Description

    +

    Configuration classes for Formatron.

    +
    +
    + + + + diff --git a/v0.4.6/namespaceformatron_1_1config.js b/v0.4.6/namespaceformatron_1_1config.js new file mode 100644 index 00000000..a58e7a15 --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1config.js @@ -0,0 +1,4 @@ +var namespaceformatron_1_1config = +[ + [ "EngineGenerationConfig", "classformatron_1_1config_1_1EngineGenerationConfig.html", "classformatron_1_1config_1_1EngineGenerationConfig" ] +]; \ No newline at end of file diff --git a/v0.4.6/namespaceformatron_1_1extractor.html b/v0.4.6/namespaceformatron_1_1extractor.html new file mode 100644 index 00000000..6249eab8 --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1extractor.html @@ -0,0 +1,160 @@ + + + + + + + + +Formatron: formatron.extractor Namespace Reference + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    formatron.extractor Namespace Reference
    +
    +
    + +

    Extractors for extracting data from generated strings. +More...

    + + + + + + + + + + + + + + + + + +

    +Classes

    class  ChoiceExtractor
     An extractor that uses multiple extractors to extract data. More...
     
    class  Extractor
     An abstract extractor that extracts data from a string and offers its KBNF rules definition. More...
     
    class  LiteralExtractor
     An extractor that extracts a literal string. More...
     
    class  NonterminalExtractor
     An extractor that extracts data corresponding to a nonterminal. More...
     
    class  SubstringExtractor
     An extractor that extracts a substring of a given string from the input string. More...
     
    +

    Detailed Description

    +

    Extractors for extracting data from generated strings.

    +
    +
    + + + + diff --git a/v0.4.6/namespaceformatron_1_1extractor.js b/v0.4.6/namespaceformatron_1_1extractor.js new file mode 100644 index 00000000..e44dd459 --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1extractor.js @@ -0,0 +1,8 @@ +var namespaceformatron_1_1extractor = +[ + [ "ChoiceExtractor", "classformatron_1_1extractor_1_1ChoiceExtractor.html", "classformatron_1_1extractor_1_1ChoiceExtractor" ], + [ "Extractor", "classformatron_1_1extractor_1_1Extractor.html", "classformatron_1_1extractor_1_1Extractor" ], + [ "LiteralExtractor", "classformatron_1_1extractor_1_1LiteralExtractor.html", "classformatron_1_1extractor_1_1LiteralExtractor" ], + [ "NonterminalExtractor", "classformatron_1_1extractor_1_1NonterminalExtractor.html", "classformatron_1_1extractor_1_1NonterminalExtractor" ], + [ "SubstringExtractor", "classformatron_1_1extractor_1_1SubstringExtractor.html", "classformatron_1_1extractor_1_1SubstringExtractor" ] +]; \ No newline at end of file diff --git a/v0.4.6/namespaceformatron_1_1formats.html b/v0.4.6/namespaceformatron_1_1formats.html new file mode 100644 index 00000000..a264b5ed --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1formats.html @@ -0,0 +1,151 @@ + + + + + + + + +Formatron: formatron.formats Namespace Reference + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    formatron.formats Namespace Reference
    +
    +
    + +

    This subpackage contains modules that operate with concrete formats, like json. +More...

    + + + + + + + + +

    +Namespaces

    namespace  json
     The module defines the JsonExtractor class, which is used to extract data from a string in JSON format.
     
    namespace  regex
     This module contains the RegexExtractor class, which is used to extract data using a regular expression.
     
    +

    Detailed Description

    +

    This subpackage contains modules that operate with concrete formats, like json.

    +
    +
    + + + + diff --git a/v0.4.6/namespaceformatron_1_1formats.js b/v0.4.6/namespaceformatron_1_1formats.js new file mode 100644 index 00000000..97497b16 --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1formats.js @@ -0,0 +1,5 @@ +var namespaceformatron_1_1formats = +[ + [ "json", "namespaceformatron_1_1formats_1_1json.html", "namespaceformatron_1_1formats_1_1json" ], + [ "regex", "namespaceformatron_1_1formats_1_1regex.html", "namespaceformatron_1_1formats_1_1regex" ] +]; \ No newline at end of file diff --git a/v0.4.6/namespaceformatron_1_1formats_1_1json.html b/v0.4.6/namespaceformatron_1_1formats_1_1json.html new file mode 100644 index 00000000..3d09ef94 --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1formats_1_1json.html @@ -0,0 +1,342 @@ + + + + + + + + +Formatron: formatron.formats.json Namespace Reference + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    formatron.formats.json Namespace Reference
    +
    +
    + +

    The module defines the JsonExtractor class, which is used to extract data from a string in JSON format. +More...

    + + + + + +

    +Classes

    class  JsonExtractor
     An extractor that loads json data to an object from a string. More...
     
    + + + + + + + + + +

    +Functions

    None register_generate_nonterminal_def (typing.Callable[[typing.Type, str], typing.Optional[typing.Tuple[str, typing.List[typing.Tuple[typing.Type, str]]]]] generate_nonterminal_def)
     Register a callable to generate nonterminal definition from a type.
     
     _register_all_predefined_types ()
     
    str _generate_kbnf_grammar (schemas.schema.Schema|collections.abc.Sequence schema, str start_nonterminal)
     Generate a KBNF grammar string from a schema for JSON format.
     
    + + + + + + + +

    +Variables

    str SPACE_NONTERMINAL = "[ \t\n\r]*"
     
    str GRAMMAR_HEADER
     
    list _type_to_nonterminals
     
    +

    Detailed Description

    +

    The module defines the JsonExtractor class, which is used to extract data from a string in JSON format.

    +

    Function Documentation

    + +

    ◆ _generate_kbnf_grammar()

    + +
    +
    + + + + + +
    + + + + + + + + + + + +
    str formatron.formats.json._generate_kbnf_grammar (schemas.schema.Schema|collections.abc.Sequence schema,
    str start_nonterminal )
    +
    +protected
    +
    + +

    Generate a KBNF grammar string from a schema for JSON format.

    +
    Parameters
    + + + +
    schemaThe schema to generate a grammar for.
    start_nonterminalThe start nonterminal of the grammar. Default is "start".
    +
    +
    +
    Returns
    The generated KBNF grammar string.
    + +

    Definition at line 381 of file json.py.

    + +
    +
    + +

    ◆ _register_all_predefined_types()

    + +
    +
    + + + + + +
    + + + + + + + +
    formatron.formats.json._register_all_predefined_types ()
    +
    +protected
    +
    + +

    Definition at line 57 of file json.py.

    + +
    +
    + +

    ◆ register_generate_nonterminal_def()

    + +
    +
    + + + + + + + +
    None formatron.formats.json.register_generate_nonterminal_def (typing.Callable[ + [typing.Type, str], + typing.Optional[typing.Tuple[str, + typing.List[typing.Tuple[typing.Type, str]]]]] generate_nonterminal_def)
    +
    + +

    Register a callable to generate nonterminal definition from a type.

    +

    The callable returns (nonterminal_definition, [(sub_type, sub_nonterminal), ...]) if the type is supported by this callable, otherwise None. [(sub_type, sub_nonterminal), ...] are the types and nonterminals used in nonterminal_definition that may need to be generated in the grammar too.

    +
    Parameters
    + + +
    generate_nonterminal_defA callable to generate nonterminal definition from a type.
    +
    +
    + +

    Definition at line 49 of file json.py.

    + +
    +
    +

    Variable Documentation

    + +

    ◆ _type_to_nonterminals

    + +
    +
    + + + + + +
    + + + + +
    list formatron.formats.json._type_to_nonterminals
    +
    +protected
    +
    + +

    Definition at line 36 of file json.py.

    + +
    +
    + +

    ◆ GRAMMAR_HEADER

    + +
    +
    + + + + +
    str formatron.formats.json.GRAMMAR_HEADER
    +
    +Initial value:
    1= rf"""integer ::= #"-?(0|[1-9][0-9]*)";
    +
    2number ::= #"-?(0|[1-9][0-9]*)(\\.[0-9]+)?([eE][+-]?[0-9]+)?";
    +
    3string ::= #'"([^\\\\"\u0000-\u001f]|\\\\["\\\\bfnrt/]|\\\\u[0-9A-Fa-f]{{4}})*"';
    +
    4boolean ::= "true"|"false";
    +
    5null ::= "null";
    +
    6array ::= array_begin (json_value (comma json_value)*)? array_end;
    +
    7object ::= object_begin (string colon json_value (comma string colon json_value)*)? object_end;
    +
    8json_value ::= number|string|boolean|null|array|object;
    +
    9comma ::= #"{SPACE_NONTERMINAL},{SPACE_NONTERMINAL}";
    +
    10colon ::= #"{SPACE_NONTERMINAL}:{SPACE_NONTERMINAL}";
    +
    11object_begin ::= #"\\{{{SPACE_NONTERMINAL}";
    +
    12object_end ::= #"{SPACE_NONTERMINAL}\\}}";
    +
    13array_begin ::= #"\\[{SPACE_NONTERMINAL}";
    +
    14array_end ::= #"{SPACE_NONTERMINAL}\\]";
    +
    15"""
    +
    +

    Definition at line 18 of file json.py.

    + +
    +
    + +

    ◆ SPACE_NONTERMINAL

    + +
    +
    + + + + +
    str formatron.formats.json.SPACE_NONTERMINAL = "[ \t\n\r]*"
    +
    + +

    Definition at line 16 of file json.py.

    + +
    +
    +
    +
    + + + + diff --git a/v0.4.6/namespaceformatron_1_1formats_1_1json.js b/v0.4.6/namespaceformatron_1_1formats_1_1json.js new file mode 100644 index 00000000..6792c838 --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1formats_1_1json.js @@ -0,0 +1,10 @@ +var namespaceformatron_1_1formats_1_1json = +[ + [ "JsonExtractor", "classformatron_1_1formats_1_1json_1_1JsonExtractor.html", "classformatron_1_1formats_1_1json_1_1JsonExtractor" ], + [ "_generate_kbnf_grammar", "namespaceformatron_1_1formats_1_1json.html#af4331f1a7679439503d898b2356d289e", null ], + [ "_register_all_predefined_types", "namespaceformatron_1_1formats_1_1json.html#a311b750cba3838aee622b9809888f051", null ], + [ "register_generate_nonterminal_def", "namespaceformatron_1_1formats_1_1json.html#a55ae1cd2ef251d160e872a0c49e7ba7a", null ], + [ "_type_to_nonterminals", "namespaceformatron_1_1formats_1_1json.html#a003a1dac95634ac70f86d51e768945a4", null ], + [ "GRAMMAR_HEADER", "namespaceformatron_1_1formats_1_1json.html#ac81c86f8a6384cf3b11c47ddf2049ca7", null ], + [ "SPACE_NONTERMINAL", "namespaceformatron_1_1formats_1_1json.html#af32c4b136b54f0356b017d6a319bb53d", null ] +]; \ No newline at end of file diff --git a/v0.4.6/namespaceformatron_1_1formats_1_1regex.html b/v0.4.6/namespaceformatron_1_1formats_1_1regex.html new file mode 100644 index 00000000..a9c69a31 --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1formats_1_1regex.html @@ -0,0 +1,148 @@ + + + + + + + + +Formatron: formatron.formats.regex Namespace Reference + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    formatron.formats.regex Namespace Reference
    +
    +
    + +

    This module contains the RegexExtractor class, which is used to extract data using a regular expression. +More...

    + + + + + +

    +Classes

    class  RegexExtractor
     An extractor that extracts a string using a regular expression. More...
     
    +

    Detailed Description

    +

    This module contains the RegexExtractor class, which is used to extract data using a regular expression.

    +
    +
    + + + + diff --git a/v0.4.6/namespaceformatron_1_1formats_1_1regex.js b/v0.4.6/namespaceformatron_1_1formats_1_1regex.js new file mode 100644 index 00000000..eb0d97bf --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1formats_1_1regex.js @@ -0,0 +1,4 @@ +var namespaceformatron_1_1formats_1_1regex = +[ + [ "RegexExtractor", "classformatron_1_1formats_1_1regex_1_1RegexExtractor.html", "classformatron_1_1formats_1_1regex_1_1RegexExtractor" ] +]; \ No newline at end of file diff --git a/v0.4.6/namespaceformatron_1_1formatter.html b/v0.4.6/namespaceformatron_1_1formatter.html new file mode 100644 index 00000000..74bcf8a9 --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1formatter.html @@ -0,0 +1,153 @@ + + + + + + + + +Formatron: formatron.formatter Namespace Reference + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    formatron.formatter Namespace Reference
    +
    +
    + +

    This module contains the Formatter class and its related classes. +More...

    + + + + + + + + + + +

    +Classes

    class  Formatter
     
    class  FormatterBase
     An abstract Formatter that enforces a format on the string generated by a language model. More...
     
    class  FormatterBuilder
     A builder for creating a Formatter. More...
     
    +

    Detailed Description

    +

    This module contains the Formatter class and its related classes.

    +
    +
    + + + + diff --git a/v0.4.6/namespaceformatron_1_1formatter.js b/v0.4.6/namespaceformatron_1_1formatter.js new file mode 100644 index 00000000..44fcd78f --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1formatter.js @@ -0,0 +1,6 @@ +var namespaceformatron_1_1formatter = +[ + [ "Formatter", "classformatron_1_1formatter_1_1Formatter.html", "classformatron_1_1formatter_1_1Formatter" ], + [ "FormatterBase", "classformatron_1_1formatter_1_1FormatterBase.html", "classformatron_1_1formatter_1_1FormatterBase" ], + [ "FormatterBuilder", "classformatron_1_1formatter_1_1FormatterBuilder.html", "classformatron_1_1formatter_1_1FormatterBuilder" ] +]; \ No newline at end of file diff --git a/v0.4.6/namespaceformatron_1_1integrations.html b/v0.4.6/namespaceformatron_1_1integrations.html new file mode 100644 index 00000000..afd86618 --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1integrations.html @@ -0,0 +1,159 @@ + + + + + + + + +Formatron: formatron.integrations Namespace Reference + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    formatron.integrations Namespace Reference
    +
    +
    + +

    This subpackage contains integrations with other frameworks and libraries. +More...

    + + + + + + + + + + + + + + + + +

    +Namespaces

    namespace  _utils
     
    namespace  exllamav2
     This module integrates the ExLlamaV2 library by providing convenience utilities.
     
    namespace  RWKV
     This module integrates the RWKV library by providing convenience utilities.
     
    namespace  transformers
     This module integrates the transformers library by providing convenience utilities.
     
    namespace  vllm
     This module integrates the vllm library by providing convenience utilities.
     
    +

    Detailed Description

    +

    This subpackage contains integrations with other frameworks and libraries.

    +
    +
    + + + + diff --git a/v0.4.6/namespaceformatron_1_1integrations.js b/v0.4.6/namespaceformatron_1_1integrations.js new file mode 100644 index 00000000..9c4f4165 --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1integrations.js @@ -0,0 +1,14 @@ +var namespaceformatron_1_1integrations = +[ + [ "_utils", "namespaceformatron_1_1integrations_1_1__utils.html", [ + [ "_autodetect_processors", "namespaceformatron_1_1integrations_1_1__utils.html#a76ded8fc3ee5ad369ec55b595ae74153", null ], + [ "_multiple_replace", "namespaceformatron_1_1integrations_1_1__utils.html#abf64c53a323448aedc1361d01515226a", null ], + [ "get_original_characters", "namespaceformatron_1_1integrations_1_1__utils.html#ad30a176c08ead38cba6e7f425c7c6c08", null ], + [ "huggingface_bytelevel_decoder", "namespaceformatron_1_1integrations_1_1__utils.html#a91dd89b0d6aecbea162244c5592f374b", null ], + [ "Processors", "namespaceformatron_1_1integrations_1_1__utils.html#ad5e049a7fd2978958881877de9eb6c1a", null ] + ] ], + [ "exllamav2", "namespaceformatron_1_1integrations_1_1exllamav2.html", "namespaceformatron_1_1integrations_1_1exllamav2" ], + [ "RWKV", "namespaceformatron_1_1integrations_1_1RWKV.html", "namespaceformatron_1_1integrations_1_1RWKV" ], + [ "transformers", "namespaceformatron_1_1integrations_1_1transformers.html", "namespaceformatron_1_1integrations_1_1transformers" ], + [ "vllm", "namespaceformatron_1_1integrations_1_1vllm.html", "namespaceformatron_1_1integrations_1_1vllm" ] +]; \ No newline at end of file diff --git a/v0.4.6/namespaceformatron_1_1integrations_1_1RWKV.html b/v0.4.6/namespaceformatron_1_1integrations_1_1RWKV.html new file mode 100644 index 00000000..3c44b8f5 --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1integrations_1_1RWKV.html @@ -0,0 +1,184 @@ + + + + + + + + +Formatron: formatron.integrations.RWKV Namespace Reference + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    formatron.integrations.RWKV Namespace Reference
    +
    +
    + +

    This module integrates the RWKV library by providing convenience utilities. +More...

    + + + + + + + + +

    +Classes

    class  PIPELINE
     A wrapper for the pipeline of RWKV. More...
     
    class  PIPELINE_ARGS
     A wrapper for the arguments of the pipeline of RWKV. More...
     
    + + + + +

    +Functions

    kbnf.Vocabulary create_engine_vocabulary (str WORD_NAME, tokenizer)
     Create a vocabulary for the KBNF engine.
     
    +

    Detailed Description

    +

    This module integrates the RWKV library by providing convenience utilities.

    +

    Function Documentation

    + +

    ◆ create_engine_vocabulary()

    + +
    +
    + + + + + + + + + + + +
    kbnf.Vocabulary formatron.integrations.RWKV.create_engine_vocabulary (str WORD_NAME,
    tokenizer )
    +
    + +

    Create a vocabulary for the KBNF engine.

    + +

    Definition at line 37 of file RWKV.py.

    + +
    +
    +
    +
    + + + + diff --git a/v0.4.6/namespaceformatron_1_1integrations_1_1RWKV.js b/v0.4.6/namespaceformatron_1_1integrations_1_1RWKV.js new file mode 100644 index 00000000..57923dd5 --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1integrations_1_1RWKV.js @@ -0,0 +1,6 @@ +var namespaceformatron_1_1integrations_1_1RWKV = +[ + [ "PIPELINE", "classformatron_1_1integrations_1_1RWKV_1_1PIPELINE.html", "classformatron_1_1integrations_1_1RWKV_1_1PIPELINE" ], + [ "PIPELINE_ARGS", "classformatron_1_1integrations_1_1RWKV_1_1PIPELINE__ARGS.html", "classformatron_1_1integrations_1_1RWKV_1_1PIPELINE__ARGS" ], + [ "create_engine_vocabulary", "namespaceformatron_1_1integrations_1_1RWKV.html#a2fc99d20bbcc438cc823a728cbc999ea", null ] +]; \ No newline at end of file diff --git a/v0.4.6/namespaceformatron_1_1integrations_1_1__utils.html b/v0.4.6/namespaceformatron_1_1integrations_1_1__utils.html new file mode 100644 index 00000000..ed1418cb --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1integrations_1_1__utils.html @@ -0,0 +1,276 @@ + + + + + + + + +Formatron: formatron.integrations._utils Namespace Reference + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    formatron.integrations._utils Namespace Reference
    +
    +
    + + + + + + + + + + + +

    +Functions

    bytes _multiple_replace (typing.Dict[bytes, bytes] replacements, re.Pattern[bytes] regex, bytes text)
     
     _autodetect_processors (typing.Dict[str, int] vocab)
     
    typing.Dict[int, bytes] get_original_characters (typing.Dict[str, int] vocab)
     
     huggingface_bytelevel_decoder ()
     I hate legacy code.
     
    + + + +

    +Variables

     Processors = set[typing.Literal["sentencepiece", "<0xHH>", "dot_G"]]
     
    +

    Function Documentation

    + +

    ◆ _autodetect_processors()

    + +
    +
    + + + + + +
    + + + + + + + +
    formatron.integrations._utils._autodetect_processors (typing.Dict[str, int] vocab)
    +
    +protected
    +
    + +

    Definition at line 14 of file _utils.py.

    + +
    +
    + +

    ◆ _multiple_replace()

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + +
    bytes formatron.integrations._utils._multiple_replace (typing.Dict[bytes, bytes] replacements,
    re.Pattern[bytes] regex,
    bytes text )
    +
    +protected
    +
    + +

    Definition at line 6 of file _utils.py.

    + +
    +
    + +

    ◆ get_original_characters()

    + +
    +
    + + + + + + + +
    typing.Dict[int, bytes] formatron.integrations._utils.get_original_characters (typing.Dict[str, int] vocab)
    +
    + +

    Definition at line 28 of file _utils.py.

    + +
    +
    + +

    ◆ huggingface_bytelevel_decoder()

    + +
    +
    + + + + + + + +
    formatron.integrations._utils.huggingface_bytelevel_decoder ()
    +
    + +

    I hate legacy code.

    + +

    Definition at line 56 of file _utils.py.

    + +
    +
    +

    Variable Documentation

    + +

    ◆ Processors

    + +
    +
    + + + + +
    formatron.integrations._utils.Processors = set[typing.Literal["sentencepiece", "<0xHH>", "dot_G"]]
    +
    + +

    Definition at line 11 of file _utils.py.

    + +
    +
    +
    +
    + + + + diff --git a/v0.4.6/namespaceformatron_1_1integrations_1_1exllamav2.html b/v0.4.6/namespaceformatron_1_1integrations_1_1exllamav2.html new file mode 100644 index 00000000..907f46c5 --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1integrations_1_1exllamav2.html @@ -0,0 +1,215 @@ + + + + + + + + +Formatron: formatron.integrations.exllamav2 Namespace Reference + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    formatron.integrations.exllamav2 Namespace Reference
    +
    +
    + +

    This module integrates the ExLlamaV2 library by providing convenience utilities. +More...

    + + + + + +

    +Classes

    class  FormatterFilter
     ExLlamaV2Filter that uses a formatter to mask logits. More...
     
    + + + + + + + +

    +Functions

    kbnf.Vocabulary create_engine_vocabulary (ExLlamaV2Tokenizer tokenizer)
     Create a vocabulary for the KBNF engine.
     
    ExLlamaV2Filter create_formatter_filter (ExLlamaV2 model, ExLlamaV2Tokenizer tokenizer, FormatterBuilder formatter_builder, EngineGenerationConfig engine_config=None)
     Create a formatter filter for the ExLlamaV2 engine.
     
    +

    Detailed Description

    +

    This module integrates the ExLlamaV2 library by providing convenience utilities.

    +

    Function Documentation

    + +

    ◆ create_engine_vocabulary()

    + +
    +
    + + + + + + + +
    kbnf.Vocabulary formatron.integrations.exllamav2.create_engine_vocabulary (ExLlamaV2Tokenizer tokenizer)
    +
    + +

    Create a vocabulary for the KBNF engine.

    + +

    Definition at line 20 of file exllamav2.py.

    + +
    +
    + +

    ◆ create_formatter_filter()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + +
    ExLlamaV2Filter formatron.integrations.exllamav2.create_formatter_filter (ExLlamaV2 model,
    ExLlamaV2Tokenizer tokenizer,
    FormatterBuilder formatter_builder,
    EngineGenerationConfig engine_config = None )
    +
    + +

    Create a formatter filter for the ExLlamaV2 engine.

    + +

    Definition at line 34 of file exllamav2.py.

    + +
    +
    +
    +
    + + + + diff --git a/v0.4.6/namespaceformatron_1_1integrations_1_1exllamav2.js b/v0.4.6/namespaceformatron_1_1integrations_1_1exllamav2.js new file mode 100644 index 00000000..4408f051 --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1integrations_1_1exllamav2.js @@ -0,0 +1,6 @@ +var namespaceformatron_1_1integrations_1_1exllamav2 = +[ + [ "FormatterFilter", "classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html", "classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter" ], + [ "create_engine_vocabulary", "namespaceformatron_1_1integrations_1_1exllamav2.html#ab73e373da3d117082bfcb5e4020e0358", null ], + [ "create_formatter_filter", "namespaceformatron_1_1integrations_1_1exllamav2.html#a8fb6a829f6fb28c956693fb2e4b39b63", null ] +]; \ No newline at end of file diff --git a/v0.4.6/namespaceformatron_1_1integrations_1_1transformers.html b/v0.4.6/namespaceformatron_1_1integrations_1_1transformers.html new file mode 100644 index 00000000..6602a6bb --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1integrations_1_1transformers.html @@ -0,0 +1,243 @@ + + + + + + + + +Formatron: formatron.integrations.transformers Namespace Reference + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    formatron.integrations.transformers Namespace Reference
    +
    +
    + +

    This module integrates the transformers library by providing convenience utilities. +More...

    + + + + + +

    +Classes

    class  FormattersLogitsProcessor
     Logit processor that uses formatters to mask batch logits. More...
     
    + + + + + + + + + + +

    +Functions

    kbnf.Vocabulary create_engine_vocabulary (PreTrainedTokenizerBase tokenizer)
     Create a vocabulary for the KBNF engine.
     
    LogitsProcessor create_formatter_logits_processor (PreTrainedTokenizerBase tokenizer, typing.Sequence[FormatterBuilder|None]|FormatterBuilder formatter_builders, typing.Sequence[EngineGenerationConfig] configs=None)
     Create a formatter logits processor.
     
    LogitsProcessorList create_formatter_logits_processor_list (PreTrainedTokenizerBase tokenizer, typing.Sequence[FormatterBuilder|None]|FormatterBuilder formatter_builders, typing.Sequence[EngineGenerationConfig] configs=None)
     Create a formatter logits processor list.
     
    +

    Detailed Description

    +

    This module integrates the transformers library by providing convenience utilities.

    +

    Function Documentation

    + +

    ◆ create_engine_vocabulary()

    + +
    +
    + + + + + + + +
    kbnf.Vocabulary formatron.integrations.transformers.create_engine_vocabulary (PreTrainedTokenizerBase tokenizer)
    +
    + +

    Create a vocabulary for the KBNF engine.

    + +

    Definition at line 19 of file transformers.py.

    + +
    +
    + +

    ◆ create_formatter_logits_processor()

    + +
    +
    + + + + + + + + + + + + + + + + +
    LogitsProcessor formatron.integrations.transformers.create_formatter_logits_processor (PreTrainedTokenizerBase tokenizer,
    typing.Sequence[FormatterBuilder | None] | FormatterBuilder formatter_builders,
    typing.Sequence[EngineGenerationConfig] configs = None )
    +
    + +

    Create a formatter logits processor.

    + +

    Definition at line 29 of file transformers.py.

    + +
    +
    + +

    ◆ create_formatter_logits_processor_list()

    + +
    +
    + + + + + + + + + + + + + + + + +
    LogitsProcessorList formatron.integrations.transformers.create_formatter_logits_processor_list (PreTrainedTokenizerBase tokenizer,
    typing.Sequence[FormatterBuilder | None] | FormatterBuilder formatter_builders,
    typing.Sequence[EngineGenerationConfig] configs = None )
    +
    + +

    Create a formatter logits processor list.

    + +

    Definition at line 43 of file transformers.py.

    + +
    +
    +
    +
    + + + + diff --git a/v0.4.6/namespaceformatron_1_1integrations_1_1transformers.js b/v0.4.6/namespaceformatron_1_1integrations_1_1transformers.js new file mode 100644 index 00000000..f49ff502 --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1integrations_1_1transformers.js @@ -0,0 +1,7 @@ +var namespaceformatron_1_1integrations_1_1transformers = +[ + [ "FormattersLogitsProcessor", "classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html", "classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor" ], + [ "create_engine_vocabulary", "namespaceformatron_1_1integrations_1_1transformers.html#a1e2bb52e2c35fb3592fbc9fcff06f41a", null ], + [ "create_formatter_logits_processor", "namespaceformatron_1_1integrations_1_1transformers.html#af8d1673116b56d3651e2e79934356a01", null ], + [ "create_formatter_logits_processor_list", "namespaceformatron_1_1integrations_1_1transformers.html#a4036de8ad72188b3558f8e5a0fd289f4", null ] +]; \ No newline at end of file diff --git a/v0.4.6/namespaceformatron_1_1integrations_1_1vllm.html b/v0.4.6/namespaceformatron_1_1integrations_1_1vllm.html new file mode 100644 index 00000000..d52d7171 --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1integrations_1_1vllm.html @@ -0,0 +1,210 @@ + + + + + + + + +Formatron: formatron.integrations.vllm Namespace Reference + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    formatron.integrations.vllm Namespace Reference
    +
    +
    + +

    This module integrates the vllm library by providing convenience utilities. +More...

    + + + + + +

    +Classes

    class  FormattersLogitsProcessor
     Logit processor that uses formatters to mask batch logits. More...
     
    + + + + + + + +

    +Functions

    kbnf.Vocabulary create_engine_vocabulary (LLM llm)
     Create a vocabulary for the KBNF engine.
     
    FormattersLogitsProcessor create_formatters_logits_processor (LLM llm, typing.Sequence[FormatterBuilder|None]|FormatterBuilder formatter_builders, typing.Sequence[EngineGenerationConfig] configs=None)
     Create a formatter logits processor.
     
    +

    Detailed Description

    +

    This module integrates the vllm library by providing convenience utilities.

    +

    Function Documentation

    + +

    ◆ create_engine_vocabulary()

    + +
    +
    + + + + + + + +
    kbnf.Vocabulary formatron.integrations.vllm.create_engine_vocabulary (LLM llm)
    +
    + +

    Create a vocabulary for the KBNF engine.

    + +

    Definition at line 113 of file vllm.py.

    + +
    +
    + +

    ◆ create_formatters_logits_processor()

    + +
    +
    + + + + + + + + + + + + + + + + +
    FormattersLogitsProcessor formatron.integrations.vllm.create_formatters_logits_processor (LLM llm,
    typing.Sequence[FormatterBuilder | None] | FormatterBuilder formatter_builders,
    typing.Sequence[EngineGenerationConfig] configs = None )
    +
    + +

    Create a formatter logits processor.

    + +

    Definition at line 124 of file vllm.py.

    + +
    +
    +
    +
    + + + + diff --git a/v0.4.6/namespaceformatron_1_1integrations_1_1vllm.js b/v0.4.6/namespaceformatron_1_1integrations_1_1vllm.js new file mode 100644 index 00000000..468e8fcf --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1integrations_1_1vllm.js @@ -0,0 +1,6 @@ +var namespaceformatron_1_1integrations_1_1vllm = +[ + [ "FormattersLogitsProcessor", "classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html", "classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor" ], + [ "create_engine_vocabulary", "namespaceformatron_1_1integrations_1_1vllm.html#acec47a067c2396265f1d7a941b0a7ab3", null ], + [ "create_formatters_logits_processor", "namespaceformatron_1_1integrations_1_1vllm.html#a995ec0f6519cf5b67bcc52d411653a26", null ] +]; \ No newline at end of file diff --git a/v0.4.6/namespaceformatron_1_1schemas.html b/v0.4.6/namespaceformatron_1_1schemas.html new file mode 100644 index 00000000..dd5b0cbc --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1schemas.html @@ -0,0 +1,157 @@ + + + + + + + + +Formatron: formatron.schemas Namespace Reference + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    formatron.schemas Namespace Reference
    +
    +
    + +

    This subpackage contains modules that define schemas creation from various sources. +More...

    + + + + + + + + + + + + + + +

    +Namespaces

    namespace  dict_inference
     This module contains utilities for inferring schemas from dictionaries.
     
    namespace  json_schema
     This module contains utilities for creating schemas from JSON schemas.
     
    namespace  pydantic
     A module that implements the Schema interface using pydantic.
     
    namespace  schema
     This module contains the Schema abstract class and FieldInfo abstract class.
     
    +

    Detailed Description

    +

    This subpackage contains modules that define schemas creation from various sources.

    +
    +
    + + + + diff --git a/v0.4.6/namespaceformatron_1_1schemas.js b/v0.4.6/namespaceformatron_1_1schemas.js new file mode 100644 index 00000000..61a41c48 --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1schemas.js @@ -0,0 +1,7 @@ +var namespaceformatron_1_1schemas = +[ + [ "dict_inference", "namespaceformatron_1_1schemas_1_1dict__inference.html", "namespaceformatron_1_1schemas_1_1dict__inference" ], + [ "json_schema", "namespaceformatron_1_1schemas_1_1json__schema.html", "namespaceformatron_1_1schemas_1_1json__schema" ], + [ "pydantic", "namespaceformatron_1_1schemas_1_1pydantic.html", "namespaceformatron_1_1schemas_1_1pydantic" ], + [ "schema", "namespaceformatron_1_1schemas_1_1schema.html", "namespaceformatron_1_1schemas_1_1schema" ] +]; \ No newline at end of file diff --git a/v0.4.6/namespaceformatron_1_1schemas_1_1dict__inference.html b/v0.4.6/namespaceformatron_1_1schemas_1_1dict__inference.html new file mode 100644 index 00000000..068a83e1 --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1schemas_1_1dict__inference.html @@ -0,0 +1,210 @@ + + + + + + + + +Formatron: formatron.schemas.dict_inference Namespace Reference + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    formatron.schemas.dict_inference Namespace Reference
    +
    +
    + +

    This module contains utilities for inferring schemas from dictionaries. +More...

    + + + + +

    +Classes

    class  FieldInfo
     
    + + + + + + +

    +Functions

    Type[Any] _infer_type (Any value)
     
    typing.Type[schemas.schema.Schemainfer_mapping (collections.abc.Mapping[str, Any] mapping)
     Recursively infer a schema from a mapping.
     
    +

    Detailed Description

    +

    This module contains utilities for inferring schemas from dictionaries.

    +

    Function Documentation

    + +

    ◆ _infer_type()

    + +
    +
    + + + + + +
    + + + + + + + +
    Type[Any] formatron.schemas.dict_inference._infer_type (Any value)
    +
    +protected
    +
    + +

    Definition at line 59 of file dict_inference.py.

    + +
    +
    + +

    ◆ infer_mapping()

    + +
    +
    + + + + + + + +
    typing.Type[schemas.schema.Schema] formatron.schemas.dict_inference.infer_mapping (collections.abc.Mapping[str, Any] mapping)
    +
    + +

    Recursively infer a schema from a mapping.

    +

    Types that are specially handled:

      +
    • collections.abc.Mapping: converted to a schema. Keys are converted to field names and corresponding value types are converted to field types.
    • +
    • collections.abc.Sequence with heterogeneous elements: all different element types are included in a union type.
    • +
    +

    Other types are directly inferred from the type of the value with no special handling.

    + +

    Definition at line 95 of file dict_inference.py.

    + +
    +
    +
    +
    + + + + diff --git a/v0.4.6/namespaceformatron_1_1schemas_1_1dict__inference.js b/v0.4.6/namespaceformatron_1_1schemas_1_1dict__inference.js new file mode 100644 index 00000000..33715b08 --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1schemas_1_1dict__inference.js @@ -0,0 +1,6 @@ +var namespaceformatron_1_1schemas_1_1dict__inference = +[ + [ "FieldInfo", "classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo.html", "classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo" ], + [ "_infer_type", "namespaceformatron_1_1schemas_1_1dict__inference.html#ad5cac24e76dc097a995f31d3d0ff9efc", null ], + [ "infer_mapping", "namespaceformatron_1_1schemas_1_1dict__inference.html#a850490b4a317260a236333130d36a5d8", null ] +]; \ No newline at end of file diff --git a/v0.4.6/namespaceformatron_1_1schemas_1_1json__schema.html b/v0.4.6/namespaceformatron_1_1schemas_1_1json__schema.html new file mode 100644 index 00000000..951d69e7 --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1schemas_1_1json__schema.html @@ -0,0 +1,872 @@ + + + + + + + + +Formatron: formatron.schemas.json_schema Namespace Reference + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    formatron.schemas.json_schema Namespace Reference
    +
    +
    + +

    This module contains utilities for creating schemas from JSON schemas. +More...

    + + + + +

    +Classes

    class  FieldInfo
     
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Functions

    schemas.schema.Schema create_schema (dict[str, typing.Any] schema, registry=Registry())
     Create a Schema object from a JSON schema object.
     
    str _resolve_new_url (str uri, str ref)
     Adapted from https://github.com/python-jsonschema/referencing/blob/main/referencing/_core.py#L667.
     
    None _validate_json_schema (dict[str, typing.Any] schema)
     
    typing.Type _convert_json_schema_to_our_schema (dict[str, typing.Any] schema, dict[int, typing.Type] json_schema_id_to_schema)
     Recursively handle all types needed to fully determine the type of a schema.
     
     _extract_fields_from_object_type (typing.Type object_type)
     
    typing.Type _handle_anyOf (dict[str, typing.Any] schema, dict[int, typing.Type] json_schema_id_to_schema)
     
    typing.Type[typing.Any|None] _infer_type (dict[str, typing.Any] schema, dict[int, typing.Type] json_schema_id_to_schema)
     Infer more specific types.
     
    typing.Any _get_literal (dict[str, typing.Any] schema)
     
    typing.Type _handle_literal (typing.Any literal, typing.Type obtained_type, dict[str, typing.Any] schema, dict[int, typing.Type] json_schema_id_to_schema)
     
    typing.Type _handle_str_with_metadata (dict[str, typing.Any] schema)
     Handle string type with metadata such as maxLength, minLength, and pattern.
     
    typing.Type _handle_numeric_with_metadata (dict[str, typing.Any] schema, typing.Type numeric_type)
     Handle numeric types (int or float) with metadata such as minimum, maximum, exclusiveMinimum, and exclusiveMaximum.
     
    typing.Type _create_custom_type (dict[str, typing.Any] schema, dict[int, typing.Type] json_schema_id_to_schema)
     
    typing.Type _handle_list_metadata (typing.Type obtained_type, dict[str, typing.Any] schema, dict[int, typing.Type] json_schema_id_to_schema)
     Handle cases where the obtained type is a list.
     
    typing.Type[typing.Any|None] _obtain_type (dict[str, typing.Any] schema, dict[int, typing.Type] json_schema_id_to_schema)
     Directly obtain type information from this schema's type keyword.
     
     _merge_referenced_schema (dict[str, typing.Any] schema, set[int] memo)
     
     _merge_key (dict[str, typing.Any] schema, str ref_key, typing.Any reference_value)
     
     _recursive_resolve_reference (str base_uri, typing.Any schema, Registry registry, set[int] memo)
     
     _resolve_reference (dict[str, typing.Any] schema, str key, typing.Any resolver)
     
    + + + +

    +Variables

    int _counter
     
    +

    Detailed Description

    +

    This module contains utilities for creating schemas from JSON schemas.

    +

    Function Documentation

    + +

    ◆ _convert_json_schema_to_our_schema()

    + +
    +
    + + + + + +
    + + + + + + + + + + + +
    typing.Type formatron.schemas.json_schema._convert_json_schema_to_our_schema (dict[str, typing.Any] schema,
    dict[int, typing.Type] json_schema_id_to_schema )
    +
    +protected
    +
    + +

    Recursively handle all types needed to fully determine the type of a schema.

    + +

    Definition at line 153 of file json_schema.py.

    + +
    +
    + +

    ◆ _create_custom_type()

    + +
    +
    + + + + + +
    + + + + + + + + + + + +
    typing.Type formatron.schemas.json_schema._create_custom_type (dict[str, typing.Any] schema,
    dict[int, typing.Type] json_schema_id_to_schema )
    +
    +protected
    +
    + +

    Definition at line 272 of file json_schema.py.

    + +
    +
    + +

    ◆ _extract_fields_from_object_type()

    + +
    +
    + + + + + +
    + + + + + + + +
    formatron.schemas.json_schema._extract_fields_from_object_type (typing.Type object_type)
    +
    +protected
    +
    + +

    Definition at line 170 of file json_schema.py.

    + +
    +
    + +

    ◆ _get_literal()

    + +
    +
    + + + + + +
    + + + + + + + +
    typing.Any formatron.schemas.json_schema._get_literal (dict[str, typing.Any] schema)
    +
    +protected
    +
    + +

    Definition at line 219 of file json_schema.py.

    + +
    +
    + +

    ◆ _handle_anyOf()

    + +
    +
    + + + + + +
    + + + + + + + + + + + +
    typing.Type formatron.schemas.json_schema._handle_anyOf (dict[str, typing.Any] schema,
    dict[int, typing.Type] json_schema_id_to_schema )
    +
    +protected
    +
    + +

    Definition at line 177 of file json_schema.py.

    + +
    +
    + +

    ◆ _handle_list_metadata()

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + +
    typing.Type formatron.schemas.json_schema._handle_list_metadata (typing.Type obtained_type,
    dict[str, typing.Any] schema,
    dict[int, typing.Type] json_schema_id_to_schema )
    +
    +protected
    +
    + +

    Handle cases where the obtained type is a list.

    + +

    Definition at line 288 of file json_schema.py.

    + +
    +
    + +

    ◆ _handle_literal()

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    typing.Type formatron.schemas.json_schema._handle_literal (typing.Any literal,
    typing.Type obtained_type,
    dict[str, typing.Any] schema,
    dict[int, typing.Type] json_schema_id_to_schema )
    +
    +protected
    +
    + +

    Definition at line 224 of file json_schema.py.

    + +
    +
    + +

    ◆ _handle_numeric_with_metadata()

    + +
    +
    + + + + + +
    + + + + + + + + + + + +
    typing.Type formatron.schemas.json_schema._handle_numeric_with_metadata (dict[str, typing.Any] schema,
    typing.Type numeric_type )
    +
    +protected
    +
    + +

    Handle numeric types (int or float) with metadata such as minimum, maximum, exclusiveMinimum, and exclusiveMaximum.

    + +

    Definition at line 255 of file json_schema.py.

    + +
    +
    + +

    ◆ _handle_str_with_metadata()

    + +
    +
    + + + + + +
    + + + + + + + +
    typing.Type formatron.schemas.json_schema._handle_str_with_metadata (dict[str, typing.Any] schema)
    +
    +protected
    +
    + +

    Handle string type with metadata such as maxLength, minLength, and pattern.

    + +

    Definition at line 237 of file json_schema.py.

    + +
    +
    + +

    ◆ _infer_type()

    + +
    +
    + + + + + +
    + + + + + + + + + + + +
    typing.Type[typing.Any | None] formatron.schemas.json_schema._infer_type (dict[str, typing.Any] schema,
    dict[int, typing.Type] json_schema_id_to_schema )
    +
    +protected
    +
    + +

    Infer more specific types.

    + +

    Definition at line 190 of file json_schema.py.

    + +
    +
    + +

    ◆ _merge_key()

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + +
    formatron.schemas.json_schema._merge_key (dict[str, typing.Any] schema,
    str ref_key,
    typing.Any reference_value )
    +
    +protected
    +
    + +

    Definition at line 372 of file json_schema.py.

    + +
    +
    + +

    ◆ _merge_referenced_schema()

    + +
    +
    + + + + + +
    + + + + + + + + + + + +
    formatron.schemas.json_schema._merge_referenced_schema (dict[str, typing.Any] schema,
    set[int] memo )
    +
    +protected
    +
    + +

    Definition at line 353 of file json_schema.py.

    + +
    +
    + +

    ◆ _obtain_type()

    + +
    +
    + + + + + +
    + + + + + + + + + + + +
    typing.Type[typing.Any|None] formatron.schemas.json_schema._obtain_type (dict[str, typing.Any] schema,
    dict[int, typing.Type] json_schema_id_to_schema )
    +
    +protected
    +
    + +

    Directly obtain type information from this schema's type keyword.

    + +

    Definition at line 316 of file json_schema.py.

    + +
    +
    + +

    ◆ _recursive_resolve_reference()

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    formatron.schemas.json_schema._recursive_resolve_reference (str base_uri,
    typing.Any schema,
    Registry registry,
    set[int] memo )
    +
    +protected
    +
    + +

    Definition at line 391 of file json_schema.py.

    + +
    +
    + +

    ◆ _resolve_new_url()

    + +
    +
    + + + + + +
    + + + + + + + + + + + +
    str formatron.schemas.json_schema._resolve_new_url (str uri,
    str ref )
    +
    +protected
    +
    +
    + +

    ◆ _resolve_reference()

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + +
    formatron.schemas.json_schema._resolve_reference (dict[str, typing.Any] schema,
    str key,
    typing.Any resolver )
    +
    +protected
    +
    + +

    Definition at line 413 of file json_schema.py.

    + +
    +
    + +

    ◆ _validate_json_schema()

    + +
    +
    + + + + + +
    + + + + + + + +
    None formatron.schemas.json_schema._validate_json_schema (dict[str, typing.Any] schema)
    +
    +protected
    +
    + +

    Definition at line 135 of file json_schema.py.

    + +
    +
    + +

    ◆ create_schema()

    + +
    +
    + + + + + + + + + + + +
    schemas.schema.Schema formatron.schemas.json_schema.create_schema (dict[str, typing.Any] schema,
    registry = Registry() )
    +
    + +

    Create a Schema object from a JSON schema object.

    +

    This function takes a JSON schema and converts it into a Schema object that can be used for data validation and serialization. Currently, only the following JSON Schema features are supported:

    +
      +
    • type keyword
    • +
    • minLength, maxLength, pattern keywords for string type
    • +
    • minimum, maximum, exclusiveMinimum, exclusiveMaximum keywords for number type and integer type
    • +
    • items keyword
        +
      • optionally with minItems, maxItems, prefixItems constraints
      • +
      +
    • +
    • properties keyword
        +
      • Due to implementation limitations, we always assume additionalProperties is false.
      • +
      +
    • +
    • enum and const keyword
        +
      • This includes advanced enum types such as array and object.
      • +
      • Note that if both enum(or const) and type are present, type will be ignored.
      • +
      +
    • +
    • required keyword
    • +
    • anyOf keyword +
    • +
    • Schema references ($ref and $dynamicRef)
        +
      • Hence, all types of schema identifications($defs, $id, $anchor, $dynamicAnchor) are supported.
      • +
      • This includes recursive schema references.
          +
        • Recursive array references(like [[[[...]]]]) are not supported yet.
        • +
        +
      • +
      • Due to implementation limitations, duplicate constraint keywords in both referrers and referents are not allowed.
          +
        • This bound is expected to be loosened in future versions of Formatron where "easily mergeable" constraint keywords will be merged.
        • +
        +
      • +
      +
    • +
    +
    Requirements
      +
    • The input schema must be a valid JSON Schema according to the JSON Schema Draft 2020-12 standard
    • +
    • The root schema's type must be exactly "object" or "array" or both
    • +
    • The schema must have a valid '$id' and '$schema' fields
    • +
    • All references must be resolvable within the given schema and registry
    • +
    +
    +
    Parameters
    + + + +
    schemaA dictionary representing a valid JSON schema.
    registryA Registry object containing additional schema definitions. Defaults to an empty Registry.
    +
    +
    +
    Returns
    +
    +schemas A Schema object representing the input JSON schema.
    +
    Exceptions
    + + + +
    jsonschemaIf the input schema is not a valid JSON Schema.
    ValueErrorIf there are issues with schema references, constraints or requirements.
    +
    +
    + +

    Definition at line 112 of file json_schema.py.

    + +
    +
    +

    Variable Documentation

    + +

    ◆ _counter

    + +
    +
    + + + + + +
    + + + + +
    int formatron.schemas.json_schema._counter
    +
    +protected
    +
    + +

    Definition at line 66 of file json_schema.py.

    + +
    +
    +
    +
    + + + + diff --git a/v0.4.6/namespaceformatron_1_1schemas_1_1json__schema.js b/v0.4.6/namespaceformatron_1_1schemas_1_1json__schema.js new file mode 100644 index 00000000..40f196c4 --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1schemas_1_1json__schema.js @@ -0,0 +1,23 @@ +var namespaceformatron_1_1schemas_1_1json__schema = +[ + [ "FieldInfo", "classformatron_1_1schemas_1_1json__schema_1_1FieldInfo.html", "classformatron_1_1schemas_1_1json__schema_1_1FieldInfo" ], + [ "_convert_json_schema_to_our_schema", "namespaceformatron_1_1schemas_1_1json__schema.html#a5f4856cb7c30aa340432d386836f25be", null ], + [ "_create_custom_type", "namespaceformatron_1_1schemas_1_1json__schema.html#a15dc86b65c90ac8423c8989054f8c9e5", null ], + [ "_extract_fields_from_object_type", "namespaceformatron_1_1schemas_1_1json__schema.html#af20251afc012b955e29c92922fcc83ef", null ], + [ "_get_literal", "namespaceformatron_1_1schemas_1_1json__schema.html#a096ea829025ebd26b9ae165c17cf8976", null ], + [ "_handle_anyOf", "namespaceformatron_1_1schemas_1_1json__schema.html#a6f88bf4e3c48d96b060ccdcbd80b3328", null ], + [ "_handle_list_metadata", "namespaceformatron_1_1schemas_1_1json__schema.html#aa80f28ccaf9ed4b404564f629139f9d1", null ], + [ "_handle_literal", "namespaceformatron_1_1schemas_1_1json__schema.html#a969bd30894a578428528b94b0f82f1ba", null ], + [ "_handle_numeric_with_metadata", "namespaceformatron_1_1schemas_1_1json__schema.html#ad187a02f7616ccbb83c00462996a7fe1", null ], + [ "_handle_str_with_metadata", "namespaceformatron_1_1schemas_1_1json__schema.html#a32e51b70be50d55d3944e6c700bbd1a5", null ], + [ "_infer_type", "namespaceformatron_1_1schemas_1_1json__schema.html#ac742e1e581efccb6cc9742e7a23c25c2", null ], + [ "_merge_key", "namespaceformatron_1_1schemas_1_1json__schema.html#a5fcddd43a5f64374b5b75d4aafeb9135", null ], + [ "_merge_referenced_schema", "namespaceformatron_1_1schemas_1_1json__schema.html#a45c9b97319a58c2013b8e3f10ad78c30", null ], + [ "_obtain_type", "namespaceformatron_1_1schemas_1_1json__schema.html#a544d74edf1fdccbad9e216d9ff028a20", null ], + [ "_recursive_resolve_reference", "namespaceformatron_1_1schemas_1_1json__schema.html#aaba012c79d101be93f4d96588c9f8cc2", null ], + [ "_resolve_new_url", "namespaceformatron_1_1schemas_1_1json__schema.html#a9dc9dc267e5dd7b6581e2367e9238152", null ], + [ "_resolve_reference", "namespaceformatron_1_1schemas_1_1json__schema.html#a24b516494672cc5dbbf7300ea65479b1", null ], + [ "_validate_json_schema", "namespaceformatron_1_1schemas_1_1json__schema.html#a51aa68e29951e6b295844b13177b7d6a", null ], + [ "create_schema", "namespaceformatron_1_1schemas_1_1json__schema.html#ab2aeae10eb93ef3a3ca1c50013c6b380", null ], + [ "_counter", "namespaceformatron_1_1schemas_1_1json__schema.html#a63e9b97210ccf01282f81aa529a86e50", null ] +]; \ No newline at end of file diff --git a/v0.4.6/namespaceformatron_1_1schemas_1_1pydantic.html b/v0.4.6/namespaceformatron_1_1schemas_1_1pydantic.html new file mode 100644 index 00000000..292604ba --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1schemas_1_1pydantic.html @@ -0,0 +1,227 @@ + + + + + + + + +Formatron: formatron.schemas.pydantic Namespace Reference + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    formatron.schemas.pydantic Namespace Reference
    +
    +
    + +

    A module that implements the Schema interface using pydantic. +More...

    + + + + + + + + +

    +Classes

    class  ClassSchema
     A wrapper for pydantic BaseModel that implements the Schema interface. More...
     
    class  FieldInfo
     A wrapper for pydantic FieldInfo. More...
     
    + + + + +

    +Functions

    CallableT callable_schema (CallableT func, *, ConfigDict config=None, bool validate_return=False)
     A decorator that wraps pydantic's validate_call.
     
    + + + +

    +Variables

     CallableT = typing.TypeVar('CallableT', bound=typing.Callable)
     
    +

    Detailed Description

    +

    A module that implements the Schema interface using pydantic.

    +

    Function Documentation

    + +

    ◆ callable_schema()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + +
    CallableT formatron.schemas.pydantic.callable_schema (CallableT func,
    * ,
    ConfigDict config = None,
    bool validate_return = False )
    +
    + +

    A decorator that wraps pydantic's validate_call.

    +

    The decorated callable also implements the Schema interface.

    +
    Parameters
    + + + + +
    funcThe function to decorate.
    configThe pydantic configuration of validate_call.
    validate_returnWhether to validate the return value.
    +
    +
    +
    Returns
    The decorated callable.
    + +

    Definition at line 122 of file pydantic.py.

    + +
    +
    +

    Variable Documentation

    + +

    ◆ CallableT

    + +
    +
    + + + + +
    formatron.schemas.pydantic.CallableT = typing.TypeVar('CallableT', bound=typing.Callable)
    +
    + +

    Definition at line 108 of file pydantic.py.

    + +
    +
    +
    +
    + + + + diff --git a/v0.4.6/namespaceformatron_1_1schemas_1_1pydantic.js b/v0.4.6/namespaceformatron_1_1schemas_1_1pydantic.js new file mode 100644 index 00000000..35c928e9 --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1schemas_1_1pydantic.js @@ -0,0 +1,7 @@ +var namespaceformatron_1_1schemas_1_1pydantic = +[ + [ "ClassSchema", "classformatron_1_1schemas_1_1pydantic_1_1ClassSchema.html", "classformatron_1_1schemas_1_1pydantic_1_1ClassSchema" ], + [ "FieldInfo", "classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.html", "classformatron_1_1schemas_1_1pydantic_1_1FieldInfo" ], + [ "callable_schema", "namespaceformatron_1_1schemas_1_1pydantic.html#a0b1aeb9a63626b0e782bc4b9e1ce18cf", null ], + [ "CallableT", "namespaceformatron_1_1schemas_1_1pydantic.html#acf48165db355935623fdcd27fafe2b27", null ] +]; \ No newline at end of file diff --git a/v0.4.6/namespaceformatron_1_1schemas_1_1schema.html b/v0.4.6/namespaceformatron_1_1schemas_1_1schema.html new file mode 100644 index 00000000..5a486c7f --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1schemas_1_1schema.html @@ -0,0 +1,152 @@ + + + + + + + + +Formatron: formatron.schemas.schema Namespace Reference + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    formatron.schemas.schema Namespace Reference
    +
    +
    + +

    This module contains the Schema abstract class and FieldInfo abstract class. +More...

    + + + + + + + + + +

    +Classes

    class  FieldInfo
     
    class  Schema
     An abstract schema that describes some data. More...
     
    class  TypeWithMetadata
     
    +

    Detailed Description

    +

    This module contains the Schema abstract class and FieldInfo abstract class.

    +
    +
    + + + + diff --git a/v0.4.6/namespaceformatron_1_1schemas_1_1schema.js b/v0.4.6/namespaceformatron_1_1schemas_1_1schema.js new file mode 100644 index 00000000..d4863766 --- /dev/null +++ b/v0.4.6/namespaceformatron_1_1schemas_1_1schema.js @@ -0,0 +1,6 @@ +var namespaceformatron_1_1schemas_1_1schema = +[ + [ "FieldInfo", "classformatron_1_1schemas_1_1schema_1_1FieldInfo.html", "classformatron_1_1schemas_1_1schema_1_1FieldInfo" ], + [ "Schema", "classformatron_1_1schemas_1_1schema_1_1Schema.html", "classformatron_1_1schemas_1_1schema_1_1Schema" ], + [ "TypeWithMetadata", "classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata.html", "classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata" ] +]; \ No newline at end of file diff --git a/v0.4.6/namespacemembers.html b/v0.4.6/namespacemembers.html new file mode 100644 index 00000000..dc731250 --- /dev/null +++ b/v0.4.6/namespacemembers.html @@ -0,0 +1,200 @@ + + + + + + + + +Formatron: Package Members + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace members with links to the namespace documentation for each member:
    + +

    - _ -

    + + +

    - c -

    + + +

    - g -

    + + +

    - h -

    + + +

    - i -

    + + +

    - p -

    + + +

    - r -

    + + +

    - s -

    +
    +
    + + + + diff --git a/v0.4.6/namespacemembers_func.html b/v0.4.6/namespacemembers_func.html new file mode 100644 index 00000000..0a72b971 --- /dev/null +++ b/v0.4.6/namespacemembers_func.html @@ -0,0 +1,186 @@ + + + + + + + + +Formatron: Package Members + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace functions with links to the namespace documentation for each function:
    + +

    - _ -

    + + +

    - c -

    + + +

    - g -

    + + +

    - h -

    + + +

    - i -

    + + +

    - r -

    +
    +
    + + + + diff --git a/v0.4.6/namespacemembers_vars.html b/v0.4.6/namespacemembers_vars.html new file mode 100644 index 00000000..4465a311 --- /dev/null +++ b/v0.4.6/namespacemembers_vars.html @@ -0,0 +1,138 @@ + + + + + + + + +Formatron: Package Members + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace variables with links to the namespace documentation for each variable:
    +
    +
    + + + + diff --git a/v0.4.6/namespaces.html b/v0.4.6/namespaces.html new file mode 100644 index 00000000..5d07af8c --- /dev/null +++ b/v0.4.6/namespaces.html @@ -0,0 +1,178 @@ + + + + + + + + +Formatron: Package List + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Package List
    +
    +
    +
    Here are the packages with brief descriptions (if available):
    +
    [detail level 1234]
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
     Nformatron
     NconfigConfiguration classes for Formatron
     CEngineGenerationConfigConfiguration for how an KBNF engine should be used in text generation
     NextractorExtractors for extracting data from generated strings
     CChoiceExtractorAn extractor that uses multiple extractors to extract data
     CExtractorAn abstract extractor that extracts data from a string and offers its KBNF rules definition
     CLiteralExtractorAn extractor that extracts a literal string
     CNonterminalExtractorAn extractor that extracts data corresponding to a nonterminal
     CSubstringExtractorAn extractor that extracts a substring of a given string from the input string
     NformatsThis subpackage contains modules that operate with concrete formats, like json
     NjsonThe module defines the JsonExtractor class, which is used to extract data from a string in JSON format
     CJsonExtractorAn extractor that loads json data to an object from a string
     NregexThis module contains the RegexExtractor class, which is used to extract data using a regular expression
     CRegexExtractorAn extractor that extracts a string using a regular expression
     NformatterThis module contains the Formatter class and its related classes
     CFormatter
     CFormatterBaseAn abstract Formatter that enforces a format on the string generated by a language model
     CFormatterBuilderA builder for creating a Formatter
     NintegrationsThis subpackage contains integrations with other frameworks and libraries
     N_utils
     Nexllamav2This module integrates the ExLlamaV2 library by providing convenience utilities
     CFormatterFilterExLlamaV2Filter that uses a formatter to mask logits
     NRWKVThis module integrates the RWKV library by providing convenience utilities
     CPIPELINEA wrapper for the pipeline of RWKV
     CPIPELINE_ARGSA wrapper for the arguments of the pipeline of RWKV
     NtransformersThis module integrates the transformers library by providing convenience utilities
     CFormattersLogitsProcessorLogit processor that uses formatters to mask batch logits
     NvllmThis module integrates the vllm library by providing convenience utilities
     CFormattersLogitsProcessorLogit processor that uses formatters to mask batch logits
     NschemasThis subpackage contains modules that define schemas creation from various sources
     Ndict_inferenceThis module contains utilities for inferring schemas from dictionaries
     CFieldInfo
     Njson_schemaThis module contains utilities for creating schemas from JSON schemas
     CFieldInfo
     NpydanticA module that implements the Schema interface using pydantic
     CClassSchemaA wrapper for pydantic BaseModel that implements the Schema interface
     CFieldInfoA wrapper for pydantic FieldInfo
     NschemaThis module contains the Schema abstract class and FieldInfo abstract class
     CFieldInfo
     CSchemaAn abstract schema that describes some data
     CTypeWithMetadata
    +
    +
    +
    + + + + diff --git a/v0.4.6/namespaces_dup.js b/v0.4.6/namespaces_dup.js new file mode 100644 index 00000000..ed829f97 --- /dev/null +++ b/v0.4.6/namespaces_dup.js @@ -0,0 +1,4 @@ +var namespaces_dup = +[ + [ "formatron", "namespaceformatron.html", "namespaceformatron" ] +]; \ No newline at end of file diff --git a/v0.4.6/nav_f.png b/v0.4.6/nav_f.png new file mode 100644 index 0000000000000000000000000000000000000000..72a58a529ed3a9ed6aa0c51a79cf207e026deee2 GIT binary patch literal 153 zcmeAS@N?(olHy`uVBq!ia0vp^j6iI`!2~2XGqLUlQVE_ejv*C{Z|{2ZH7M}7UYxc) zn!W8uqtnIQ>_z8U literal 0 HcmV?d00001 diff --git a/v0.4.6/nav_fd.png b/v0.4.6/nav_fd.png new file mode 100644 index 0000000000000000000000000000000000000000..032fbdd4c54f54fa9a2e6423b94ef4b2ebdfaceb GIT binary patch literal 169 zcmeAS@N?(olHy`uVBq!ia0vp^j6iI`!2~2XGqLUlQU#tajv*C{Z|C~*H7f|XvG1G8 zt7aS*L7xwMeS}!z6R#{C5tIw-s~AJ==F^i}x3XyJseHR@yF& zerFf(Zf;Dd{+(0lDIROL@Sj-Ju2JQ8&-n%4%q?>|^bShc&lR?}7HeMo@BDl5N(aHY Uj$gdr1MOz;boFyt=akR{0D!zeaR2}S literal 0 HcmV?d00001 diff --git a/v0.4.6/nav_g.png b/v0.4.6/nav_g.png new file mode 100644 index 0000000000000000000000000000000000000000..2093a237a94f6c83e19ec6e5fd42f7ddabdafa81 GIT binary patch literal 95 zcmeAS@N?(olHy`uVBq!ia0vp^j6lrB!3HFm1ilyoDK$?Q$B+ufw|5PB85lU25BhtE tr?otc=hd~V+ws&_A@j8Fiv!KF$B+ufw|5=67#uj90@pIL wZ=Q8~_Ju`#59=RjDrmm`tMD@M=!-l18IR?&vFVdQ&MBb@0HFXL6W-eg#Jd_@e6*DPn)w;=|1H}Zvm9l6xXXB%>yL=NQU;mg M>FVdQ&MBb@0Bdt1Qvd(} literal 0 HcmV?d00001 diff --git a/v0.4.6/navtree.css b/v0.4.6/navtree.css new file mode 100644 index 00000000..6b1e5e46 --- /dev/null +++ b/v0.4.6/navtree.css @@ -0,0 +1,149 @@ +#nav-tree .children_ul { + margin:0; + padding:4px; +} + +#nav-tree ul { + list-style:none outside none; + margin:0px; + padding:0px; +} + +#nav-tree li { + white-space:nowrap; + margin:0px; + padding:0px; +} + +#nav-tree .plus { + margin:0px; +} + +#nav-tree .selected { + background-image: url('tab_a.png'); + background-repeat:repeat-x; + color: white; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +} + +#nav-tree .selected .arrow { + color: #9CAFD4; + text-shadow: none; +} + +#nav-tree img { + margin:0px; + padding:0px; + border:0px; + vertical-align: middle; +} + +#nav-tree a { + text-decoration:none; + padding:0px; + margin:0px; +} + +#nav-tree .label { + margin:0px; + padding:0px; + font: 12px 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; +} + +#nav-tree .label a { + padding:2px; +} + +#nav-tree .selected a { + text-decoration:none; + color:white; +} + +#nav-tree .children_ul { + margin:0px; + padding:0px; +} + +#nav-tree .item { + margin:0px; + padding:0px; +} + +#nav-tree { + padding: 0px 0px; + font-size:14px; + overflow:auto; +} + +#doc-content { + overflow:auto; + display:block; + padding:0px; + margin:0px; + -webkit-overflow-scrolling : touch; /* iOS 5+ */ +} + +#side-nav { + padding:0 6px 0 0; + margin: 0px; + display:block; + position: absolute; + left: 0px; + width: $width; + overflow : hidden; +} + +.ui-resizable .ui-resizable-handle { + display:block; +} + +.ui-resizable-e { + background-image:url('splitbar.png'); + background-size:100%; + background-repeat:repeat-y; + background-attachment: scroll; + cursor:ew-resize; + height:100%; + right:0; + top:0; + width:6px; +} + +.ui-resizable-handle { + display:none; + font-size:0.1px; + position:absolute; + z-index:1; +} + +#nav-tree-contents { + margin: 6px 0px 0px 0px; +} + +#nav-tree { + background-repeat:repeat-x; + background-color: #F9FAFC; + -webkit-overflow-scrolling : touch; /* iOS 5+ */ +} + +#nav-sync { + position:absolute; + top:5px; + right:24px; + z-index:0; +} + +#nav-sync img { + opacity:0.3; +} + +#nav-sync img:hover { + opacity:0.9; +} + +@media print +{ + #nav-tree { display: none; } + div.ui-resizable-handle { display: none; position: relative; } +} + diff --git a/v0.4.6/navtree.js b/v0.4.6/navtree.js new file mode 100644 index 00000000..9027ce6a --- /dev/null +++ b/v0.4.6/navtree.js @@ -0,0 +1,483 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ + +function initNavTree(toroot,relpath) { + let navTreeSubIndices = []; + const ARROW_DOWN = '▼'; + const ARROW_RIGHT = '►'; + const NAVPATH_COOKIE_NAME = ''+'navpath'; + + const getData = function(varName) { + const i = varName.lastIndexOf('/'); + const n = i>=0 ? varName.substring(i+1) : varName; + return eval(n.replace(/-/g,'_')); + } + + const stripPath = function(uri) { + return uri.substring(uri.lastIndexOf('/')+1); + } + + const stripPath2 = function(uri) { + const i = uri.lastIndexOf('/'); + const s = uri.substring(i+1); + const m = uri.substring(0,i+1).match(/\/d\w\/d\w\w\/$/); + return m ? uri.substring(i-6) : s; + } + + const hashValue = function() { + return $(location).attr('hash').substring(1).replace(/[^\w-]/g,''); + } + + const hashUrl = function() { + return '#'+hashValue(); + } + + const pathName = function() { + return $(location).attr('pathname').replace(/[^-A-Za-z0-9+&@#/%?=~_|!:,.;()]/g, ''); + } + + const storeLink = function(link) { + if (!$("#nav-sync").hasClass('sync')) { + Cookie.writeSetting(NAVPATH_COOKIE_NAME,link,0); + } + } + + const deleteLink = function() { + Cookie.eraseSetting(NAVPATH_COOKIE_NAME); + } + + const cachedLink = function() { + return Cookie.readSetting(NAVPATH_COOKIE_NAME,''); + } + + const getScript = function(scriptName,func) { + const head = document.getElementsByTagName("head")[0]; + const script = document.createElement('script'); + script.id = scriptName; + script.type = 'text/javascript'; + script.onload = func; + script.src = scriptName+'.js'; + head.appendChild(script); + } + + const createIndent = function(o,domNode,node) { + let level=-1; + let n = node; + while (n.parentNode) { level++; n=n.parentNode; } + if (node.childrenData) { + const imgNode = document.createElement("span"); + imgNode.className = 'arrow'; + imgNode.style.paddingLeft=(16*level).toString()+'px'; + imgNode.innerHTML=ARROW_RIGHT; + node.plus_img = imgNode; + node.expandToggle = document.createElement("a"); + node.expandToggle.href = "javascript:void(0)"; + node.expandToggle.onclick = function() { + if (node.expanded) { + $(node.getChildrenUL()).slideUp("fast"); + node.plus_img.innerHTML=ARROW_RIGHT; + node.expanded = false; + } else { + expandNode(o, node, false, true); + } + } + node.expandToggle.appendChild(imgNode); + domNode.appendChild(node.expandToggle); + } else { + let span = document.createElement("span"); + span.className = 'arrow'; + span.style.width = 16*(level+1)+'px'; + span.innerHTML = ' '; + domNode.appendChild(span); + } + } + + let animationInProgress = false; + + const gotoAnchor = function(anchor,aname) { + let pos, docContent = $('#doc-content'); + let ancParent = $(anchor.parent()); + if (ancParent.hasClass('memItemLeft') || ancParent.hasClass('memtitle') || + ancParent.hasClass('fieldname') || ancParent.hasClass('fieldtype') || + ancParent.is(':header')) { + pos = ancParent.position().top; + } else if (anchor.position()) { + pos = anchor.position().top; + } + if (pos) { + const dcOffset = docContent.offset().top; + const dcHeight = docContent.height(); + const dcScrHeight = docContent[0].scrollHeight + const dcScrTop = docContent.scrollTop(); + let dist = Math.abs(Math.min(pos-dcOffset,dcScrHeight-dcHeight-dcScrTop)); + animationInProgress = true; + docContent.animate({ + scrollTop: pos + dcScrTop - dcOffset + },Math.max(50,Math.min(500,dist)),function() { + animationInProgress=false; + if (anchor.parent().attr('class')=='memItemLeft') { + let rows = $('.memberdecls tr[class$="'+hashValue()+'"]'); + glowEffect(rows.children(),300); // member without details + } else if (anchor.parent().attr('class')=='fieldname') { + glowEffect(anchor.parent().parent(),1000); // enum value + } else if (anchor.parent().attr('class')=='fieldtype') { + glowEffect(anchor.parent().parent(),1000); // struct field + } else if (anchor.parent().is(":header")) { + glowEffect(anchor.parent(),1000); // section header + } else { + glowEffect(anchor.next(),1000); // normal member + } + }); + } + } + + const newNode = function(o, po, text, link, childrenData, lastNode) { + const node = { + children : [], + childrenData : childrenData, + depth : po.depth + 1, + relpath : po.relpath, + isLast : lastNode, + li : document.createElement("li"), + parentNode : po, + itemDiv : document.createElement("div"), + labelSpan : document.createElement("span"), + label : document.createTextNode(text), + expanded : false, + childrenUL : null, + getChildrenUL : function() { + if (!this.childrenUL) { + this.childrenUL = document.createElement("ul"); + this.childrenUL.className = "children_ul"; + this.childrenUL.style.display = "none"; + this.li.appendChild(node.childrenUL); + } + return node.childrenUL; + }, + }; + + node.itemDiv.className = "item"; + node.labelSpan.className = "label"; + createIndent(o,node.itemDiv,node); + node.itemDiv.appendChild(node.labelSpan); + node.li.appendChild(node.itemDiv); + + const a = document.createElement("a"); + node.labelSpan.appendChild(a); + po.getChildrenUL().appendChild(node.li); + a.appendChild(node.label); + if (link) { + let url; + if (link.substring(0,1)=='^') { + url = link.substring(1); + link = url; + } else { + url = node.relpath+link; + } + a.className = stripPath(link.replace('#',':')); + if (link.indexOf('#')!=-1) { + const aname = '#'+link.split('#')[1]; + const srcPage = stripPath(pathName()); + const targetPage = stripPath(link.split('#')[0]); + a.href = srcPage!=targetPage ? url : aname; + a.onclick = function() { + storeLink(link); + aPPar = $(a).parent().parent(); + if (!aPPar.hasClass('selected')) { + $('.item').removeClass('selected'); + $('.item').removeAttr('id'); + aPPar.addClass('selected'); + aPPar.attr('id','selected'); + } + const anchor = $(aname); + gotoAnchor(anchor,aname); + }; + } else { + a.href = url; + a.onclick = () => storeLink(link); + } + } else if (childrenData != null) { + a.className = "nolink"; + a.href = "javascript:void(0)"; + a.onclick = node.expandToggle.onclick; + } + return node; + } + + const showRoot = function() { + const headerHeight = $("#top").height(); + const footerHeight = $("#nav-path").height(); + const windowHeight = $(window).height() - headerHeight - footerHeight; + (function() { // retry until we can scroll to the selected item + try { + const navtree=$('#nav-tree'); + navtree.scrollTo('#selected',100,{offset:-windowHeight/2}); + } catch (err) { + setTimeout(arguments.callee, 0); + } + })(); + } + + const expandNode = function(o, node, imm, setFocus) { + if (node.childrenData && !node.expanded) { + if (typeof(node.childrenData)==='string') { + const varName = node.childrenData; + getScript(node.relpath+varName,function() { + node.childrenData = getData(varName); + expandNode(o, node, imm, setFocus); + }); + } else { + if (!node.childrenVisited) { + getNode(o, node); + } + $(node.getChildrenUL()).slideDown("fast"); + node.plus_img.innerHTML = ARROW_DOWN; + node.expanded = true; + if (setFocus) { + $(node.expandToggle).focus(); + } + } + } + } + + const glowEffect = function(n,duration) { + n.addClass('glow').delay(duration).queue(function(next) { + $(this).removeClass('glow');next(); + }); + } + + const highlightAnchor = function() { + const aname = hashUrl(); + const anchor = $(aname); + gotoAnchor(anchor,aname); + } + + const selectAndHighlight = function(hash,n) { + let a; + if (hash) { + const link=stripPath(pathName())+':'+hash.substring(1); + a=$('.item a[class$="'+link+'"]'); + } + if (a && a.length) { + a.parent().parent().addClass('selected'); + a.parent().parent().attr('id','selected'); + highlightAnchor(); + } else if (n) { + $(n.itemDiv).addClass('selected'); + $(n.itemDiv).attr('id','selected'); + } + let topOffset=5; + if ($('#nav-tree-contents .item:first').hasClass('selected')) { + topOffset+=25; + } + $('#nav-sync').css('top',topOffset+'px'); + showRoot(); + } + + const showNode = function(o, node, index, hash) { + if (node && node.childrenData) { + if (typeof(node.childrenData)==='string') { + const varName = node.childrenData; + getScript(node.relpath+varName,function() { + node.childrenData = getData(varName); + showNode(o,node,index,hash); + }); + } else { + if (!node.childrenVisited) { + getNode(o, node); + } + $(node.getChildrenUL()).css({'display':'block'}); + node.plus_img.innerHTML = ARROW_DOWN; + node.expanded = true; + const n = node.children[o.breadcrumbs[index]]; + if (index+11 ? '#'+parts[1].replace(/[^\w-]/g,'') : ''; + } + if (hash.match(/^#l\d+$/)) { + const anchor=$('a[name='+hash.substring(1)+']'); + glowEffect(anchor.parent(),1000); // line number + hash=''; // strip line number anchors + } + const url=root+hash; + let i=-1; + while (NAVTREEINDEX[i+1]<=url) i++; + if (i==-1) { i=0; root=NAVTREE[0][1]; } // fallback: show index + if (navTreeSubIndices[i]) { + gotoNode(o,i,root,hash,relpath) + } else { + getScript(relpath+'navtreeindex'+i,function() { + navTreeSubIndices[i] = eval('NAVTREEINDEX'+i); + if (navTreeSubIndices[i]) { + gotoNode(o,i,root,hash,relpath); + } + }); + } + } + + const showSyncOff = function(n,relpath) { + n.html(''); + } + + const showSyncOn = function(n,relpath) { + n.html(''); + } + + const o = { + toroot : toroot, + node : { + childrenData : NAVTREE, + children : [], + childrenUL : document.createElement("ul"), + getChildrenUL : function() { return this.childrenUL }, + li : document.getElementById("nav-tree-contents"), + depth : 0, + relpath : relpath, + expanded : false, + isLast : true, + plus_img : document.createElement("span"), + }, + }; + o.node.li.appendChild(o.node.childrenUL); + o.node.plus_img.className = 'arrow'; + o.node.plus_img.innerHTML = ARROW_RIGHT; + + const navSync = $('#nav-sync'); + if (cachedLink()) { + showSyncOff(navSync,relpath); + navSync.removeClass('sync'); + } else { + showSyncOn(navSync,relpath); + } + + navSync.click(() => { + const navSync = $('#nav-sync'); + if (navSync.hasClass('sync')) { + navSync.removeClass('sync'); + showSyncOff(navSync,relpath); + storeLink(stripPath2(pathName())+hashUrl()); + } else { + navSync.addClass('sync'); + showSyncOn(navSync,relpath); + deleteLink(); + } + }); + + navTo(o,toroot,hashUrl(),relpath); + showRoot(); + + $(window).bind('hashchange', () => { + if (!animationInProgress) { + if (window.location.hash && window.location.hash.length>1) { + let a; + if ($(location).attr('hash')) { + const clslink=stripPath(pathName())+':'+hashValue(); + a=$('.item a[class$="'+clslink.replace(/1|%O$WD@{VPM$7~Ar*{o?;hlAFyLXmaDC0y znK1_#cQqJWPES%4Uujug^TE?jMft$}Eq^WaR~)%f)vSNs&gek&x%A9X9sM + + + + + + + + diff --git a/v0.4.6/plusd.svg b/v0.4.6/plusd.svg new file mode 100644 index 00000000..0c65bfe9 --- /dev/null +++ b/v0.4.6/plusd.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/v0.4.6/pydantic_8py.html b/v0.4.6/pydantic_8py.html new file mode 100644 index 00000000..bec51fd5 --- /dev/null +++ b/v0.4.6/pydantic_8py.html @@ -0,0 +1,173 @@ + + + + + + + + +Formatron: src/formatron/schemas/pydantic.py File Reference + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    pydantic.py File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + + + + +

    +Classes

    class  formatron.schemas.pydantic.FieldInfo
     A wrapper for pydantic FieldInfo. More...
     
    class  formatron.schemas.pydantic.ClassSchema
     A wrapper for pydantic BaseModel that implements the Schema interface. More...
     
    + + + + + + + + + +

    +Namespaces

    namespace  formatron
     
    namespace  formatron.schemas
     This subpackage contains modules that define schemas creation from various sources.
     
    namespace  formatron.schemas.pydantic
     A module that implements the Schema interface using pydantic.
     
    + + + + +

    +Functions

    CallableT formatron.schemas.pydantic.callable_schema (CallableT func, *, ConfigDict config=None, bool validate_return=False)
     A decorator that wraps pydantic's validate_call.
     
    + + + +

    +Variables

     formatron.schemas.pydantic.CallableT = typing.TypeVar('CallableT', bound=typing.Callable)
     
    +
    +
    + + + + diff --git a/v0.4.6/pydantic_8py.js b/v0.4.6/pydantic_8py.js new file mode 100644 index 00000000..2191dc23 --- /dev/null +++ b/v0.4.6/pydantic_8py.js @@ -0,0 +1,7 @@ +var pydantic_8py = +[ + [ "formatron.schemas.pydantic.FieldInfo", "classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.html", "classformatron_1_1schemas_1_1pydantic_1_1FieldInfo" ], + [ "formatron.schemas.pydantic.ClassSchema", "classformatron_1_1schemas_1_1pydantic_1_1ClassSchema.html", "classformatron_1_1schemas_1_1pydantic_1_1ClassSchema" ], + [ "callable_schema", "pydantic_8py.html#a0b1aeb9a63626b0e782bc4b9e1ce18cf", null ], + [ "CallableT", "pydantic_8py.html#acf48165db355935623fdcd27fafe2b27", null ] +]; \ No newline at end of file diff --git a/v0.4.6/pydantic_8py_source.html b/v0.4.6/pydantic_8py_source.html new file mode 100644 index 00000000..465be9bc --- /dev/null +++ b/v0.4.6/pydantic_8py_source.html @@ -0,0 +1,309 @@ + + + + + + + + +Formatron: src/formatron/schemas/pydantic.py Source File + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    pydantic.py
    +
    +
    +Go to the documentation of this file.
    1"""
    +
    2A module that implements the Schema interface using pydantic.
    +
    3"""
    +
    4import inspect
    +
    5import json
    +
    6import typing
    +
    7
    +
    8import pydantic.fields
    +
    9from pydantic import BaseModel, validate_call, ConfigDict, Field
    +
    10
    +
    11from formatron.schemas.schema import FieldInfo, Schema, TypeWithMetadata
    +
    12
    +
    13
    +
    14class FieldInfo(FieldInfo):
    +
    15 """
    +
    16 A wrapper for pydantic FieldInfo.
    +
    17 """
    +
    +
    18 __slots__ = ("_field",)
    +
    19
    +
    20 def __init__(self, field: pydantic.fields.FieldInfo):
    +
    21 """
    +
    22 Initialize the field information.
    +
    23 """
    +
    +
    24 self._field = field
    +
    25 self._annotation = field.annotation
    +
    26 if field.metadata:
    +
    27 metadata = {}
    +
    28 for constraint in ["min_length", "max_length", "pattern", "gt", "ge", "lt", "le"]:
    +
    29 value = next((getattr(m, constraint) for m in self._field.metadata if hasattr(m, constraint)), None)
    +
    30 if value is not None:
    +
    31 metadata[constraint] = value
    +
    32 if metadata:
    +
    33 self._annotation = TypeWithMetadata(self._annotation, metadata)
    +
    34
    +
    35 @property
    +
    +
    36 def annotation(self) -> typing.Type[typing.Any] | None:
    +
    37 return self._annotation
    +
    38
    +
    39 @property
    +
    40 def required(self) -> bool:
    +
    41 return self._field.is_required()
    +
    42
    +
    43 def __repr__(self):
    +
    +
    44 return repr(self._field)
    +
    45
    +
    46 def __str__(self):
    +
    +
    47 return str(self._field)
    +
    48
    +
    49
    +
    50class ClassSchema(BaseModel, Schema):
    +
    51 """
    +
    52 A wrapper for pydantic BaseModel that implements the Schema interface.
    +
    53 """
    +
    54 __cached_fields__ = None
    +
    55
    +
    56 @classmethod
    +
    +
    57 def fields(cls) -> typing.Dict[str, typing.Any]:
    +
    58 if cls.__cached_fields__ is not None:
    +
    59 return cls.__cached_fields__
    +
    +
    60 cls.__cached_fields__ = {k: FieldInfo(v) for k, v in cls.model_fields.items()}
    +
    61 return cls.__cached_fields__
    +
    + +
    63 @classmethod
    +
    64 def from_json(cls, _json: str) -> "ClassSchema":
    +
    +
    +
    65 """
    +
    66 Create a ClassSchema from a JSON string.
    +
    67 """
    +
    68 return cls.model_validate_json(_json)
    +
    +
    +
    69
    +
    70
    +
    71CallableT = typing.TypeVar('CallableT', bound=typing.Callable)
    +
    + +
    73
    +
    74def callable_schema(func: CallableT, /, *, config: ConfigDict = None, validate_return: bool = False) -> CallableT:
    +
    75 """
    +
    76 A decorator that wraps pydantic's validate_call. The decorated callable also implements the Schema interface.
    +
    77
    +
    78 Args:
    +
    79 func: The function to decorate.
    +
    80 config: The pydantic configuration of validate_call.
    +
    81 validate_return: Whether to validate the return value.
    +
    82
    +
    +
    83 Returns:
    +
    84 The decorated callable.
    +
    85 """
    +
    86 pydantic_wrapper = validate_call(config=config, validate_return=validate_return)(func)
    +
    87 signature = inspect.signature(func, eval_str=True)
    +
    88 fields = {}
    +
    +
    89 for k, p in signature.parameters.items():
    +
    90 default = None
    +
    91 if p.default is not inspect.Signature.empty:
    +
    92 default = p.default
    +
    93 actual_type = p.annotation
    +
    94 metadata = []
    +
    95 if isinstance(p.default, pydantic.fields.FieldInfo):
    +
    96 fields[k] = p.default
    +
    97 if typing.get_origin(p.annotation) is typing.Annotated:
    +
    98 actual_type, *meta = typing.get_args(p.annotation)
    +
    99 fieldinfo = None
    +
    100 for i in meta:
    +
    101 if isinstance(i, pydantic.fields.FieldInfo):
    +
    +
    102 fieldinfo = i
    +
    103 else:
    +
    104 metadata.append(i)
    +
    +
    105 if fieldinfo is not None:
    +
    106 fields[k] = fieldinfo
    +
    107 if k in fields:
    +
    +
    108 fields[k].default = default
    +
    109 fields[k].annotation = actual_type
    +
    110 fields[k].metadata.extend(metadata)
    +
    111 continue
    +
    112 if default is not None:
    +
    113 fields[k] = Field(default)
    +
    114 else:
    +
    115 fields[k] = Field()
    +
    116 fields[k].annotation = actual_type
    +
    117 fields[k].metadata.extend(metadata)
    +
    118 for k in fields:
    +
    119 fields[k] = FieldInfo(fields[k])
    +
    120
    +
    121 def from_json(cls, json_str):
    +
    +
    122 json_data = json.loads(json_str)
    +
    123 positional_only = []
    +
    124 others = {}
    +
    125 for k, p in signature.parameters.items():
    +
    126 if p.kind == p.POSITIONAL_ONLY:
    +
    127 positional_only.append(json_data[k])
    +
    128 else:
    +
    129 others[k] = json_data[k]
    +
    130 return cls(*positional_only, **others)
    +
    131
    +
    132 _class = type(
    +
    133 f'{func.__qualname__}_PydanticSchema_{id(func)}',
    +
    134 (Schema,),
    +
    135 {
    +
    136 "_func": pydantic_wrapper,
    +
    137 '__new__': lambda cls, *args, **kwargs: pydantic_wrapper(*args, **kwargs),
    +
    138 '__call__': lambda *args, **kwargs: pydantic_wrapper(*args, **kwargs) # make duck typer happy
    +
    139 }
    +
    140 )
    +
    141 _class.from_json = classmethod(from_json)
    +
    142 _class.fields = classmethod(lambda cls: fields)
    +
    143 return _class
    +
    +
    A wrapper for pydantic BaseModel that implements the Schema interface.
    Definition pydantic.py:72
    +
    A wrapper for pydantic FieldInfo.
    Definition pydantic.py:18
    + +
    __init__(self, pydantic.fields.FieldInfo field)
    Initialize the field information.
    Definition pydantic.py:24
    + + +
    typing.Type[typing.Any]|None annotation(self)
    Definition pydantic.py:44
    + + +
    An abstract schema that describes some data.
    Definition schema.py:78
    + +
    CallableT callable_schema(CallableT func, *, ConfigDict config=None, bool validate_return=False)
    A decorator that wraps pydantic's validate_call.
    Definition pydantic.py:122
    +
    +
    + + + + diff --git a/v0.4.6/regex_8py.html b/v0.4.6/regex_8py.html new file mode 100644 index 00000000..c75ae0d8 --- /dev/null +++ b/v0.4.6/regex_8py.html @@ -0,0 +1,157 @@ + + + + + + + + +Formatron: src/formatron/formats/regex.py File Reference + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    regex.py File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Classes

    class  formatron.formats.regex.RegexExtractor
     An extractor that extracts a string using a regular expression. More...
     
    + + + + + + + + + +

    +Namespaces

    namespace  formatron
     
    namespace  formatron.formats
     This subpackage contains modules that operate with concrete formats, like json.
     
    namespace  formatron.formats.regex
     This module contains the RegexExtractor class, which is used to extract data using a regular expression.
     
    +
    +
    + + + + diff --git a/v0.4.6/regex_8py.js b/v0.4.6/regex_8py.js new file mode 100644 index 00000000..091cb77b --- /dev/null +++ b/v0.4.6/regex_8py.js @@ -0,0 +1,4 @@ +var regex_8py = +[ + [ "formatron.formats.regex.RegexExtractor", "classformatron_1_1formats_1_1regex_1_1RegexExtractor.html", "classformatron_1_1formats_1_1regex_1_1RegexExtractor" ] +]; \ No newline at end of file diff --git a/v0.4.6/regex_8py_source.html b/v0.4.6/regex_8py_source.html new file mode 100644 index 00000000..6483f770 --- /dev/null +++ b/v0.4.6/regex_8py_source.html @@ -0,0 +1,190 @@ + + + + + + + + +Formatron: src/formatron/formats/regex.py Source File + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    regex.py
    +
    +
    +Go to the documentation of this file.
    1"""
    +
    2This module contains the RegexExtractor class, which is used to extract data using a regular expression.
    +
    3"""
    +
    4import re
    +
    5import typing
    +
    6from formatron.extractor import NonterminalExtractor
    +
    7
    +
    8
    + +
    10 """
    +
    11 An extractor that extracts a string using a regular expression.
    +
    12 """
    +
    + +
    14 def __init__(self, regex: str, capture_name: str, nonterminal: str):
    +
    15 """
    +
    16 Initialize the regex extractor.
    +
    17
    +
    18 Args:
    +
    19 regex: The regular expression for extraction.
    +
    20 capture_name: The name of the capture, or `None` if the extractor does not capture.
    +
    21 nonterminal: The nonterminal representing the extractor.
    +
    22 """
    +
    +
    23 super().__init__(nonterminal, capture_name)
    +
    24 self._regex = re.compile(regex)
    + +
    26 def extract(self, input_str: str) -> typing.Optional[tuple[str, re.Match | None]]:
    +
    +
    27 """
    +
    28 Extract the string using the regular expression.
    +
    29 Specifically, the first match(if any) of the regex pattern in the input string is returned.
    +
    30
    +
    31 Args:
    +
    32 input_str: The input string.
    +
    33 Returns:
    +
    34 The remaining string and the extracted `re.Match` object, or `None` if the extraction failed.
    +
    35 """
    +
    +
    36 matched = self._regex.match(input_str)
    +
    37 if not matched:
    +
    38 return None
    +
    39 return input_str[matched.span()[1]:], matched
    +
    40
    +
    41 @property
    +
    +
    42 def kbnf_definition(self) -> str:
    +
    43 return f"{self.nonterminal} ::= #{repr(self._regex.pattern)};"
    +
    +
    An extractor that extracts data corresponding to a nonterminal.
    Definition extractor.py:98
    +
    An extractor that extracts a string using a regular expression.
    Definition regex.py:13
    + +
    __init__(self, str regex, str capture_name, str nonterminal)
    Initialize the regex extractor.
    Definition regex.py:23
    +
    typing.Optional[tuple[str, re.Match|None]] extract(self, str input_str)
    Extract the string using the regular expression.
    Definition regex.py:36
    + +
    Extractors for extracting data from generated strings.
    Definition extractor.py:1
    +
    +
    + + + + diff --git a/v0.4.6/resize.js b/v0.4.6/resize.js new file mode 100644 index 00000000..7d8cdc7d --- /dev/null +++ b/v0.4.6/resize.js @@ -0,0 +1,145 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ + +function initResizable(treeview) { + let sidenav,navtree,content,header,footer,barWidth=6; + const RESIZE_COOKIE_NAME = ''+'width'; + + function resizeWidth() { + const sidenavWidth = $(sidenav).outerWidth(); + content.css({marginLeft:parseInt(sidenavWidth)+"px"}); + if (typeof page_layout!=='undefined' && page_layout==1) { + footer.css({marginLeft:parseInt(sidenavWidth)+"px"}); + } + Cookie.writeSetting(RESIZE_COOKIE_NAME,sidenavWidth-barWidth); + } + + function restoreWidth(navWidth) { + content.css({marginLeft:parseInt(navWidth)+barWidth+"px"}); + if (typeof page_layout!=='undefined' && page_layout==1) { + footer.css({marginLeft:parseInt(navWidth)+barWidth+"px"}); + } + sidenav.css({width:navWidth + "px"}); + } + + function resizeHeight(treeview) { + const headerHeight = header.outerHeight(); + const windowHeight = $(window).height(); + let contentHeight; + if (treeview) + { + const footerHeight = footer.outerHeight(); + let navtreeHeight,sideNavHeight; + if (typeof page_layout==='undefined' || page_layout==0) { /* DISABLE_INDEX=NO */ + contentHeight = windowHeight - headerHeight - footerHeight; + navtreeHeight = contentHeight; + sideNavHeight = contentHeight; + } else if (page_layout==1) { /* DISABLE_INDEX=YES */ + contentHeight = windowHeight - footerHeight; + navtreeHeight = windowHeight - headerHeight; + sideNavHeight = windowHeight; + } + navtree.css({height:navtreeHeight + "px"}); + sidenav.css({height:sideNavHeight + "px"}); + } + else + { + contentHeight = windowHeight - headerHeight; + } + content.css({height:contentHeight + "px"}); + if (location.hash.slice(1)) { + (document.getElementById(location.hash.slice(1))||document.body).scrollIntoView(); + } + } + + function collapseExpand() { + let newWidth; + if (sidenav.width()>0) { + newWidth=0; + } else { + const width = Cookie.readSetting(RESIZE_COOKIE_NAME,250); + newWidth = (width>250 && width<$(window).width()) ? width : 250; + } + restoreWidth(newWidth); + const sidenavWidth = $(sidenav).outerWidth(); + Cookie.writeSetting(RESIZE_COOKIE_NAME,sidenavWidth-barWidth); + } + + header = $("#top"); + content = $("#doc-content"); + footer = $("#nav-path"); + sidenav = $("#side-nav"); + if (!treeview) { +// title = $("#titlearea"); +// titleH = $(title).height(); +// let animating = false; +// content.on("scroll", function() { +// slideOpts = { duration: 200, +// step: function() { +// contentHeight = $(window).height() - header.outerHeight(); +// content.css({ height : contentHeight + "px" }); +// }, +// done: function() { animating=false; } +// }; +// if (content.scrollTop()>titleH && title.css('display')!='none' && !animating) { +// title.slideUp(slideOpts); +// animating=true; +// } else if (content.scrollTop()<=titleH && title.css('display')=='none' && !animating) { +// title.slideDown(slideOpts); +// animating=true; +// } +// }); + } else { + navtree = $("#nav-tree"); + $(".side-nav-resizable").resizable({resize: function(e, ui) { resizeWidth(); } }); + $(sidenav).resizable({ minWidth: 0 }); + } + $(window).resize(function() { resizeHeight(treeview); }); + if (treeview) + { + const device = navigator.userAgent.toLowerCase(); + const touch_device = device.match(/(iphone|ipod|ipad|android)/); + if (touch_device) { /* wider split bar for touch only devices */ + $(sidenav).css({ paddingRight:'20px' }); + $('.ui-resizable-e').css({ width:'20px' }); + $('#nav-sync').css({ right:'34px' }); + barWidth=20; + } + const width = Cookie.readSetting(RESIZE_COOKIE_NAME,250); + if (width) { restoreWidth(width); } else { resizeWidth(); } + } + resizeHeight(treeview); + const url = location.href; + const i=url.indexOf("#"); + if (i>=0) window.location.hash=url.substr(i); + const _preventDefault = function(evt) { evt.preventDefault(); }; + if (treeview) + { + $("#splitbar").bind("dragstart", _preventDefault).bind("selectstart", _preventDefault); + $(".ui-resizable-handle").dblclick(collapseExpand); + } + $(window).on('load',resizeHeight); +} +/* @license-end */ diff --git a/v0.4.6/schema_8py.html b/v0.4.6/schema_8py.html new file mode 100644 index 00000000..68e9505e --- /dev/null +++ b/v0.4.6/schema_8py.html @@ -0,0 +1,161 @@ + + + + + + + + +Formatron: src/formatron/schemas/schema.py File Reference + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    schema.py File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + + + + + +

    +Classes

    class  formatron.schemas.schema.FieldInfo
     
    class  formatron.schemas.schema.TypeWithMetadata
     
    class  formatron.schemas.schema.Schema
     An abstract schema that describes some data. More...
     
    + + + + + + + + + +

    +Namespaces

    namespace  formatron
     
    namespace  formatron.schemas
     This subpackage contains modules that define schemas creation from various sources.
     
    namespace  formatron.schemas.schema
     This module contains the Schema abstract class and FieldInfo abstract class.
     
    +
    +
    + + + + diff --git a/v0.4.6/schema_8py.js b/v0.4.6/schema_8py.js new file mode 100644 index 00000000..be07dcc7 --- /dev/null +++ b/v0.4.6/schema_8py.js @@ -0,0 +1,6 @@ +var schema_8py = +[ + [ "formatron.schemas.schema.FieldInfo", "classformatron_1_1schemas_1_1schema_1_1FieldInfo.html", "classformatron_1_1schemas_1_1schema_1_1FieldInfo" ], + [ "formatron.schemas.schema.TypeWithMetadata", "classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata.html", "classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata" ], + [ "formatron.schemas.schema.Schema", "classformatron_1_1schemas_1_1schema_1_1Schema.html", "classformatron_1_1schemas_1_1schema_1_1Schema" ] +]; \ No newline at end of file diff --git a/v0.4.6/schema_8py_source.html b/v0.4.6/schema_8py_source.html new file mode 100644 index 00000000..f2bdc028 --- /dev/null +++ b/v0.4.6/schema_8py_source.html @@ -0,0 +1,203 @@ + + + + + + + + +Formatron: src/formatron/schemas/schema.py Source File + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    schema.py
    +
    +
    +Go to the documentation of this file.
    1"""
    +
    2This module contains the Schema abstract class and FieldInfo abstract class.
    +
    3"""
    +
    4import abc
    +
    5import typing
    +
    6
    +
    7
    +
    8class FieldInfo(abc.ABC):
    +
    +
    9 @property
    +
    10 @abc.abstractmethod
    +
    11 def annotation(self) -> typing.Type[typing.Any] | None:
    +
    12 """
    +
    13 Get the type annotation of the field.
    +
    14 """
    +
    15 pass
    +
    16
    +
    17 @property
    +
    18 @abc.abstractmethod
    +
    19 def required(self) -> bool:
    +
    20 """
    +
    21 Check if the field is required for the schema.
    +
    +
    22 """
    +
    23 pass
    +
    24
    +
    +
    25class TypeWithMetadata:
    +
    26 def __init__(self, type: typing.Type[typing.Any], metadata: dict[str, typing.Any]|None):
    +
    27 self._type = type
    +
    28 self._metadata = metadata
    +
    29
    +
    30 @property
    +
    31 def type(self) -> typing.Type[typing.Any]:
    +
    32 return self._type
    +
    33
    +
    34 @property
    +
    35 def metadata(self) -> dict[str, typing.Any]|None:
    +
    36 return self._metadata
    +
    37
    +
    38class Schema(abc.ABC):
    +
    +
    39 """
    +
    40 An abstract schema that describes some data.
    +
    41 """
    +
    +
    42 @classmethod
    +
    43 @abc.abstractmethod
    +
    +
    +
    44 def fields(cls) -> dict[str, FieldInfo]:
    +
    +
    45 """
    +
    46 Get the fields of the schema.
    +
    47 """
    +
    48 pass
    +
    +
    49
    +
    50 @classmethod
    +
    51 @abc.abstractmethod
    +
    52 def from_json(cls, json: str) -> "Schema":
    +
    53 """
    +
    54 Create a schema from a JSON string.
    +
    55 """
    +
    56 pass
    +
    + +
    typing.Type[typing.Any]|None annotation(self)
    Get the type annotation of the field.
    Definition schema.py:22
    +
    bool required(self)
    Check if the field is required for the schema.
    Definition schema.py:39
    +
    +
    + + + + diff --git a/v0.4.6/schemas_2____init_____8py.html b/v0.4.6/schemas_2____init_____8py.html new file mode 100644 index 00000000..208873e1 --- /dev/null +++ b/v0.4.6/schemas_2____init_____8py.html @@ -0,0 +1,147 @@ + + + + + + + + +Formatron: src/formatron/schemas/__init__.py File Reference + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    __init__.py File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + + + +

    +Namespaces

    namespace  formatron
     
    namespace  formatron.schemas
     This subpackage contains modules that define schemas creation from various sources.
     
    +
    +
    + + + + diff --git a/v0.4.6/schemas_2____init_____8py_source.html b/v0.4.6/schemas_2____init_____8py_source.html new file mode 100644 index 00000000..ad62d71d --- /dev/null +++ b/v0.4.6/schemas_2____init_____8py_source.html @@ -0,0 +1,142 @@ + + + + + + + + +Formatron: src/formatron/schemas/__init__.py Source File + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    __init__.py
    +
    +
    +Go to the documentation of this file.
    1"""
    +
    2This subpackage contains modules that define schemas creation from various sources.
    +
    3"""
    +
    4# the following imports are needed as python subpackage imports seem to have some issues
    +
    5from . import schema
    +
    6from . import pydantic
    +
    7from . import dict_inference
    +
    8from . import json_schema
    +
    +
    + + + + diff --git a/v0.4.6/search/all_0.js b/v0.4.6/search/all_0.js new file mode 100644 index 00000000..b9ee13c0 --- /dev/null +++ b/v0.4.6/search/all_0.js @@ -0,0 +1,74 @@ +var searchData= +[ + ['_5f_5fcall_5f_5f_0',['__call__',['../classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html#af5ec5643f3c51046cb3b5e73fbb04f2b',1,'formatron.integrations.transformers.FormattersLogitsProcessor.__call__()'],['../classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html#ad4a81bb45d259bb5408433cdb6cbafdd',1,'formatron.integrations.vllm.FormattersLogitsProcessor.__call__()']]], + ['_5f_5finit_5f_5f_1',['__init__',['../classformatron_1_1extractor_1_1Extractor.html#a569fc7895a82f4d4b59866719219d4e0',1,'formatron.extractor.Extractor.__init__()'],['../classformatron_1_1extractor_1_1NonterminalExtractor.html#a45c14f79c14b539837ebdd26c3b5567b',1,'formatron.extractor.NonterminalExtractor.__init__()'],['../classformatron_1_1extractor_1_1LiteralExtractor.html#ab4da390ad7efaf5a3aab0e0ccb78fab3',1,'formatron.extractor.LiteralExtractor.__init__()'],['../classformatron_1_1extractor_1_1ChoiceExtractor.html#a1a91b31475c7348a3cf9fab97c6d26f0',1,'formatron.extractor.ChoiceExtractor.__init__()'],['../classformatron_1_1extractor_1_1SubstringExtractor.html#a843997315c77b9c7c6eb84ba7e02ff83',1,'formatron.extractor.SubstringExtractor.__init__()'],['../classformatron_1_1formats_1_1json_1_1JsonExtractor.html#a7a51edd3cc7c24370c809d91e07771dc',1,'formatron.formats.json.JsonExtractor.__init__()'],['../classformatron_1_1formats_1_1regex_1_1RegexExtractor.html#a6fc2f05d044cce49935c415248de5e5a',1,'formatron.formats.regex.RegexExtractor.__init__()'],['../classformatron_1_1formatter_1_1Formatter.html#a369269f53f32be2f1d92663670354515',1,'formatron.formatter.Formatter.__init__()'],['../classformatron_1_1formatter_1_1FormatterBuilder.html#abb13104747355cae16e6ad0c3067fac8',1,'formatron.formatter.FormatterBuilder.__init__()'],['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#adc94d2f2ddd06f966dca93079f17df8c',1,'formatron.integrations.exllamav2.FormatterFilter.__init__()'],['../classformatron_1_1integrations_1_1RWKV_1_1PIPELINE__ARGS.html#a53a892118d9b168024aaa6062f92cd7c',1,'formatron.integrations.RWKV.PIPELINE_ARGS.__init__()'],['../classformatron_1_1integrations_1_1RWKV_1_1PIPELINE.html#aa646fb0bf5f3674d1daba91dd0320017',1,'formatron.integrations.RWKV.PIPELINE.__init__()'],['../classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html#aa70d2276eeb09fdf53066e4019df79df',1,'formatron.integrations.transformers.FormattersLogitsProcessor.__init__()'],['../classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html#a0ee5e6edc8fc11dfd7406c140c13b7b9',1,'formatron.integrations.vllm.FormattersLogitsProcessor.__init__()'],['../classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo.html#a0286ba9c9e6509ce23d530409209b5da',1,'formatron.schemas.dict_inference.FieldInfo.__init__()'],['../classformatron_1_1schemas_1_1json__schema_1_1FieldInfo.html#abc61867418b7f30a3545e71c9b28e708',1,'formatron.schemas.json_schema.FieldInfo.__init__()'],['../classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.html#a4a5a010c6acef15f8fe2d4318223696b',1,'formatron.schemas.pydantic.FieldInfo.__init__()'],['../classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata.html#a0c3cf51ceb503d4d195f5623d57e160b',1,'formatron.schemas.schema.TypeWithMetadata.__init__()']]], + ['_5f_5finit_5f_5f_2epy_2',['__init__.py',['../____init_____8py.html',1,'(Global Namespace)'],['../formats_2____init_____8py.html',1,'(Global Namespace)'],['../integrations_2____init_____8py.html',1,'(Global Namespace)'],['../schemas_2____init_____8py.html',1,'(Global Namespace)']]], + ['_5f_5frepr_5f_5f_3',['__repr__',['../classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.html#ad291e8df78d045d3364bc6a17582b416',1,'formatron::schemas::pydantic::FieldInfo']]], + ['_5f_5fstr_5f_5f_4',['__str__',['../classformatron_1_1extractor_1_1Extractor.html#afe6a1f745fd56540ccff5fdc5d00f0a5',1,'formatron.extractor.Extractor.__str__()'],['../classformatron_1_1formatter_1_1Formatter.html#a827c993f0ac74abff6276b3af6058e3f',1,'formatron.formatter.Formatter.__str__()'],['../classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.html#a49ac1734cddfadc1b7721f57775890a6',1,'formatron.schemas.pydantic.FieldInfo.__str__()']]], + ['_5fadd_5fcapture_5fname_5',['_add_capture_name',['../classformatron_1_1formatter_1_1FormatterBuilder.html#a1e97daf55b4149be6aaa5dd747ed6146',1,'formatron::formatter::FormatterBuilder']]], + ['_5fadd_5fextractor_6',['_add_extractor',['../classformatron_1_1formatter_1_1FormatterBuilder.html#a6e495e90b9da81108b6627166872bbbb',1,'formatron::formatter::FormatterBuilder']]], + ['_5fannotation_7',['_annotation',['../classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo.html#af85ec1a61b7ef87729757cef077c4df4',1,'formatron.schemas.dict_inference.FieldInfo._annotation'],['../classformatron_1_1schemas_1_1json__schema_1_1FieldInfo.html#a82c87a6773b72ee766add0dc893482b0',1,'formatron.schemas.json_schema.FieldInfo._annotation'],['../classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.html#aab00d20e817e3ea9fc15295a94e8242b',1,'formatron.schemas.pydantic.FieldInfo._annotation']]], + ['_5fassert_5fcapture_5fname_5fvalid_8',['_assert_capture_name_valid',['../classformatron_1_1formatter_1_1FormatterBuilder.html#ab5ad5186f55d35e3abd2d5c213302a25',1,'formatron::formatter::FormatterBuilder']]], + ['_5fautodetect_5fprocessors_9',['_autodetect_processors',['../namespaceformatron_1_1integrations_1_1__utils.html#a76ded8fc3ee5ad369ec55b595ae74153',1,'formatron::integrations::_utils']]], + ['_5fcapture_5fname_10',['_capture_name',['../classformatron_1_1extractor_1_1Extractor.html#a3299dc34a7276ab8ab553513048211d3',1,'formatron::extractor::Extractor']]], + ['_5fcapture_5fnames_11',['_capture_names',['../classformatron_1_1formatter_1_1FormatterBuilder.html#a68daf6b6bbd2f32843352dc6ea1f4b8f',1,'formatron::formatter::FormatterBuilder']]], + ['_5fcaptures_12',['_captures',['../classformatron_1_1formatter_1_1Formatter.html#a43964a72280fd307cd74528657beeca3',1,'formatron::formatter::Formatter']]], + ['_5fchoices_13',['_choices',['../classformatron_1_1extractor_1_1ChoiceExtractor.html#a6ea971d4c6915dc2b5ece64cd010a087',1,'formatron::extractor::ChoiceExtractor']]], + ['_5fconfig_14',['_config',['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#ae43a79de8cc0fb018df02e7edab028ee',1,'formatron::integrations::exllamav2::FormatterFilter']]], + ['_5fconfigs_15',['_configs',['../classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html#aef140b4278cf9892faa3644bd4c2ca99',1,'formatron::integrations::vllm::FormattersLogitsProcessor']]], + ['_5fconvert_5fjson_5fschema_5fto_5four_5fschema_16',['_convert_json_schema_to_our_schema',['../namespaceformatron_1_1schemas_1_1json__schema.html#a5f4856cb7c30aa340432d386836f25be',1,'formatron::schemas::json_schema']]], + ['_5fcounter_17',['_counter',['../classformatron_1_1formatter_1_1FormatterBuilder.html#a937af7ea452c8183053dc3e12cd44e1c',1,'formatron.formatter.FormatterBuilder._counter'],['../namespaceformatron_1_1schemas_1_1json__schema.html#a63e9b97210ccf01282f81aa529a86e50',1,'formatron.schemas.json_schema._counter']]], + ['_5fcreate_5fcustom_5ftype_18',['_create_custom_type',['../namespaceformatron_1_1schemas_1_1json__schema.html#a15dc86b65c90ac8423c8989054f8c9e5',1,'formatron::schemas::json_schema']]], + ['_5fcreate_5fnonterminal_19',['_create_nonterminal',['../classformatron_1_1formatter_1_1FormatterBuilder.html#aefe18951a4dc243909a22dd49b62fe21',1,'formatron::formatter::FormatterBuilder']]], + ['_5fdebug_5fcounter_20',['_debug_counter',['../classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html#a83ec1613155b800bd9d1b0f012dff371',1,'formatron::integrations::vllm::FormattersLogitsProcessor']]], + ['_5fdecode_5fcallback_21',['_decode_callback',['../classformatron_1_1formatter_1_1Formatter.html#a9535e6eb6b8001d6f5fc90ee549ecacb',1,'formatron::formatter::Formatter']]], + ['_5fengine_22',['_engine',['../classformatron_1_1formatter_1_1Formatter.html#a73ef6ac966b418215e6c216a90520860',1,'formatron::formatter::Formatter']]], + ['_5feos_5ftoken_5fid_23',['_eos_token_id',['../classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html#a7731ed1ab6807c0de6c29ebfefd6975f',1,'formatron.integrations.transformers.FormattersLogitsProcessor._eos_token_id'],['../classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html#a9c18332e5d1133b7524a8dde402f2677',1,'formatron.integrations.vllm.FormattersLogitsProcessor._eos_token_id']]], + ['_5fextract_5ffields_5ffrom_5fobject_5ftype_24',['_extract_fields_from_object_type',['../namespaceformatron_1_1schemas_1_1json__schema.html#af20251afc012b955e29c92922fcc83ef',1,'formatron::schemas::json_schema']]], + ['_5fextractors_25',['_extractors',['../classformatron_1_1formatter_1_1Formatter.html#a77fc80d958ed5878393546c1a24d75e5',1,'formatron.formatter.Formatter._extractors'],['../classformatron_1_1formatter_1_1FormatterBuilder.html#a4c10094d828cde5bf73bbd5d3d11e582',1,'formatron.formatter.FormatterBuilder._extractors']]], + ['_5ffield_26',['_field',['../classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.html#abb92e2d49fec513432cced795bd853e2',1,'formatron::schemas::pydantic::FieldInfo']]], + ['_5fformatter_27',['_formatter',['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#a568277b00bef848b3fccbfa7030c435f',1,'formatron::integrations::exllamav2::FormatterFilter']]], + ['_5fformatter_5fbuilder_5fcounter_28',['_formatter_builder_counter',['../classformatron_1_1formatter_1_1FormatterBuilder.html#aa8758ea6ca6a84da7583b28522e447a9',1,'formatron::formatter::FormatterBuilder']]], + ['_5fformatters_29',['_formatters',['../classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html#a50a0787df5f246965db8481f0700d0b4',1,'formatron.integrations.transformers.FormattersLogitsProcessor._formatters'],['../classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html#ab9ca25ee76354b711cb5dd892eb5ab0f',1,'formatron.integrations.vllm.FormattersLogitsProcessor._formatters']]], + ['_5fgenerate_5fkbnf_5fgrammar_30',['_generate_kbnf_grammar',['../namespaceformatron_1_1formats_1_1json.html#af4331f1a7679439503d898b2356d289e',1,'formatron::formats::json']]], + ['_5fget_5fliteral_31',['_get_literal',['../namespaceformatron_1_1schemas_1_1json__schema.html#a096ea829025ebd26b9ae165c17cf8976',1,'formatron::schemas::json_schema']]], + ['_5fgrammar_5fstr_32',['_grammar_str',['../classformatron_1_1formatter_1_1Formatter.html#aac1bf058d35745650f1838ea64b66ad2',1,'formatron::formatter::Formatter']]], + ['_5fhandle_5fanyof_33',['_handle_anyOf',['../namespaceformatron_1_1schemas_1_1json__schema.html#a6f88bf4e3c48d96b060ccdcbd80b3328',1,'formatron::schemas::json_schema']]], + ['_5fhandle_5flist_5fmetadata_34',['_handle_list_metadata',['../namespaceformatron_1_1schemas_1_1json__schema.html#aa80f28ccaf9ed4b404564f629139f9d1',1,'formatron::schemas::json_schema']]], + ['_5fhandle_5fliteral_35',['_handle_literal',['../namespaceformatron_1_1schemas_1_1json__schema.html#a969bd30894a578428528b94b0f82f1ba',1,'formatron::schemas::json_schema']]], + ['_5fhandle_5fnumeric_5fwith_5fmetadata_36',['_handle_numeric_with_metadata',['../namespaceformatron_1_1schemas_1_1json__schema.html#ad187a02f7616ccbb83c00462996a7fe1',1,'formatron::schemas::json_schema']]], + ['_5fhandle_5fstr_5fwith_5fmetadata_37',['_handle_str_with_metadata',['../namespaceformatron_1_1schemas_1_1json__schema.html#a32e51b70be50d55d3944e6c700bbd1a5',1,'formatron::schemas::json_schema']]], + ['_5finfer_5ftype_38',['_infer_type',['../namespaceformatron_1_1schemas_1_1dict__inference.html#ad5cac24e76dc097a995f31d3d0ff9efc',1,'formatron.schemas.dict_inference._infer_type()'],['../namespaceformatron_1_1schemas_1_1json__schema.html#ac742e1e581efccb6cc9742e7a23c25c2',1,'formatron.schemas.json_schema._infer_type()']]], + ['_5finstance_5fid_39',['_instance_id',['../classformatron_1_1formatter_1_1FormatterBuilder.html#a8a5b16f094013fb3926acfadd30c4456',1,'formatron::formatter::FormatterBuilder']]], + ['_5fiter_40',['_iter',['../classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html#ad7cf01b455ab6847df5c96912a5d2ae9',1,'formatron::integrations::vllm::FormattersLogitsProcessor']]], + ['_5flast_5finput_5fid_5flength_41',['_last_input_id_length',['../classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html#a24c02e28fdbae4450af7527f93400fa7',1,'formatron.integrations.transformers.FormattersLogitsProcessor._last_input_id_length'],['../classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html#aa6549c4f4130d1778f69e3e99942a87b',1,'formatron.integrations.vllm.FormattersLogitsProcessor._last_input_id_length']]], + ['_5fliteral_42',['_literal',['../classformatron_1_1extractor_1_1LiteralExtractor.html#a333e99fa481e15e9d907d35cda8ee728',1,'formatron::extractor::LiteralExtractor']]], + ['_5fmain_5frule_43',['_main_rule',['../classformatron_1_1formatter_1_1FormatterBuilder.html#a3c3ba1934b9207c412202c5ef29b002a',1,'formatron::formatter::FormatterBuilder']]], + ['_5fmerge_5fkey_44',['_merge_key',['../namespaceformatron_1_1schemas_1_1json__schema.html#a5fcddd43a5f64374b5b75d4aafeb9135',1,'formatron::schemas::json_schema']]], + ['_5fmerge_5freferenced_5fschema_45',['_merge_referenced_schema',['../namespaceformatron_1_1schemas_1_1json__schema.html#a45c9b97319a58c2013b8e3f10ad78c30',1,'formatron::schemas::json_schema']]], + ['_5fmetadata_46',['_metadata',['../classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata.html#a34312895f9d497d5c35cf372f9c498f3',1,'formatron::schemas::schema::TypeWithMetadata']]], + ['_5fmultiple_5freplace_47',['_multiple_replace',['../namespaceformatron_1_1integrations_1_1__utils.html#abf64c53a323448aedc1361d01515226a',1,'formatron::integrations::_utils']]], + ['_5fnonterminal_48',['_nonterminal',['../classformatron_1_1extractor_1_1NonterminalExtractor.html#a5c4c968b45e328b8caa4b2795ecc00fe',1,'formatron::extractor::NonterminalExtractor']]], + ['_5fnonterminal_5fto_5fextractor_49',['_nonterminal_to_extractor',['../classformatron_1_1formatter_1_1FormatterBuilder.html#a870a5075cfd903c77e5ee58b6c304e03',1,'formatron::formatter::FormatterBuilder']]], + ['_5fobtain_5faccepted_5foutput_50',['_obtain_accepted_output',['../classformatron_1_1formatter_1_1Formatter.html#ae4be840a942f608c1a0c256dbf68901b',1,'formatron::formatter::Formatter']]], + ['_5fobtain_5ftype_51',['_obtain_type',['../namespaceformatron_1_1schemas_1_1json__schema.html#a544d74edf1fdccbad9e216d9ff028a20',1,'formatron::schemas::json_schema']]], + ['_5fon_5fcompletion_52',['_on_completion',['../classformatron_1_1formatter_1_1FormatterBase.html#a469880a21192928e82823cc340a22ce2',1,'formatron.formatter.FormatterBase._on_completion()'],['../classformatron_1_1formatter_1_1Formatter.html#ac6f7e3f96c6318689c5cd0d44a1cdde7',1,'formatron.formatter.Formatter._on_completion()']]], + ['_5fpass_5ftokens_53',['_pass_tokens',['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#a370eaf641dd803b2759b4e5fc7f74a1c',1,'formatron::integrations::exllamav2::FormatterFilter']]], + ['_5frecursive_5fresolve_5freference_54',['_recursive_resolve_reference',['../namespaceformatron_1_1schemas_1_1json__schema.html#aaba012c79d101be93f4d96588c9f8cc2',1,'formatron::schemas::json_schema']]], + ['_5fregex_55',['_regex',['../classformatron_1_1formats_1_1regex_1_1RegexExtractor.html#a1df60401933eef6cf5a1ff041f11ec46',1,'formatron::formats::regex::RegexExtractor']]], + ['_5fregister_5fall_5fpredefined_5ftypes_56',['_register_all_predefined_types',['../namespaceformatron_1_1formats_1_1json.html#a311b750cba3838aee622b9809888f051',1,'formatron::formats::json']]], + ['_5frequired_57',['_required',['../classformatron_1_1schemas_1_1json__schema_1_1FieldInfo.html#a8ac1acf32bb578e121ef28a433857726',1,'formatron::schemas::json_schema::FieldInfo']]], + ['_5fresolve_5fnew_5furl_58',['_resolve_new_url',['../namespaceformatron_1_1schemas_1_1json__schema.html#a9dc9dc267e5dd7b6581e2367e9238152',1,'formatron::schemas::json_schema']]], + ['_5fresolve_5freference_59',['_resolve_reference',['../namespaceformatron_1_1schemas_1_1json__schema.html#a24b516494672cc5dbbf7300ea65479b1',1,'formatron::schemas::json_schema']]], + ['_5frule_5fstr_60',['_rule_str',['../classformatron_1_1formats_1_1json_1_1JsonExtractor.html#aecf88428e414da080f11ed0ab1e13a65',1,'formatron::formats::json::JsonExtractor']]], + ['_5frules_61',['_rules',['../classformatron_1_1formatter_1_1FormatterBuilder.html#a62c61ad02e40526b73ca460d0cf1d12c',1,'formatron::formatter::FormatterBuilder']]], + ['_5fstring_62',['_string',['../classformatron_1_1extractor_1_1SubstringExtractor.html#a3781b75c6c8c12f89fd70ea405e11293',1,'formatron::extractor::SubstringExtractor']]], + ['_5fsuffix_5fautomaton_63',['_suffix_automaton',['../classformatron_1_1extractor_1_1SubstringExtractor.html#a97cb3468674873adfc85bc17ff1a9a97',1,'formatron::extractor::SubstringExtractor']]], + ['_5fto_5fnext_5fbatch_5fstep_64',['_to_next_batch_step',['../classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html#ab87fea11f930a33130cecadd8cdf0cc6',1,'formatron::integrations::vllm::FormattersLogitsProcessor']]], + ['_5fto_5fobject_65',['_to_object',['../classformatron_1_1formats_1_1json_1_1JsonExtractor.html#a2e72d806c8dffc0136231b81eb724355',1,'formatron::formats::json::JsonExtractor']]], + ['_5ftoken_5fid_5for_5fbytes_66',['_token_id_or_bytes',['../classformatron_1_1formatter_1_1Formatter.html#adf232d46083546ae3363e4ce007a335b',1,'formatron::formatter::Formatter']]], + ['_5ftype_67',['_type',['../classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata.html#a4d1ea7d59f700634eb2545ce3d6cf324',1,'formatron::schemas::schema::TypeWithMetadata']]], + ['_5ftype_5fto_5fnonterminals_68',['_type_to_nonterminals',['../namespaceformatron_1_1formats_1_1json.html#a003a1dac95634ac70f86d51e768945a4',1,'formatron::formats::json']]], + ['_5futils_2epy_69',['_utils.py',['../__utils_8py.html',1,'']]], + ['_5fvalidate_5fjson_5fschema_70',['_validate_json_schema',['../namespaceformatron_1_1schemas_1_1json__schema.html#a51aa68e29951e6b295844b13177b7d6a',1,'formatron::schemas::json_schema']]] +]; diff --git a/v0.4.6/search/all_1.js b/v0.4.6/search/all_1.js new file mode 100644 index 00000000..fdcd31ec --- /dev/null +++ b/v0.4.6/search/all_1.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['accept_5fbytes_0',['accept_bytes',['../classformatron_1_1formatter_1_1FormatterBase.html#ac0f91549079380a53228322dd4473cf1',1,'formatron.formatter.FormatterBase.accept_bytes()'],['../classformatron_1_1formatter_1_1Formatter.html#a178a37715ce463e6e57c530166c7ec6d',1,'formatron.formatter.Formatter.accept_bytes()']]], + ['accept_5ftoken_1',['accept_token',['../classformatron_1_1formatter_1_1FormatterBase.html#a87d1513c3f70fdee18d65fae4f71101d',1,'formatron.formatter.FormatterBase.accept_token()'],['../classformatron_1_1formatter_1_1Formatter.html#a839eb7550ee4afbd305b25ddcca5c4dc',1,'formatron.formatter.Formatter.accept_token()']]], + ['annotation_2',['annotation',['../classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo.html#a163fde7bbaa2e613b5af3a4a12b9152d',1,'formatron.schemas.dict_inference.FieldInfo.annotation()'],['../classformatron_1_1schemas_1_1json__schema_1_1FieldInfo.html#a28f43dedc0eaf02cd16423172440208a',1,'formatron.schemas.json_schema.FieldInfo.annotation()'],['../classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.html#ac9e5af7e4cb356a450e9e48f3af24cfe',1,'formatron.schemas.pydantic.FieldInfo.annotation()'],['../classformatron_1_1schemas_1_1schema_1_1FieldInfo.html#a5c7b1d8b8d8d52426e95a3f326cf3e75',1,'formatron.schemas.schema.FieldInfo.annotation()']]], + ['append_5fline_3',['append_line',['../classformatron_1_1formatter_1_1FormatterBuilder.html#aa57e56f8d74b03eb4559106d189970c3',1,'formatron::formatter::FormatterBuilder']]], + ['append_5fmultiline_5fstr_4',['append_multiline_str',['../classformatron_1_1formatter_1_1FormatterBuilder.html#a0e4da27aacaa16880ed463a9f86edff4',1,'formatron::formatter::FormatterBuilder']]], + ['append_5fstr_5',['append_str',['../classformatron_1_1formatter_1_1FormatterBuilder.html#a171eca2a241aaf0f5f1fa8c117694337',1,'formatron::formatter::FormatterBuilder']]] +]; diff --git a/v0.4.6/search/all_10.js b/v0.4.6/search/all_10.js new file mode 100644 index 00000000..f64d4573 --- /dev/null +++ b/v0.4.6/search/all_10.js @@ -0,0 +1,12 @@ +var searchData= +[ + ['read_5fprompt_0',['read_prompt',['../classformatron_1_1config_1_1EngineGenerationConfig.html#af0b93e2a9f55937e342c649c1f177695',1,'formatron::config::EngineGenerationConfig']]], + ['regex_1',['regex',['../classformatron_1_1formatter_1_1FormatterBuilder.html#af34f97f7f62d2a1de4f9e863b1834619',1,'formatron::formatter::FormatterBuilder']]], + ['regex_2epy_2',['regex.py',['../regex_8py.html',1,'']]], + ['regexextractor_3',['RegexExtractor',['../classformatron_1_1formats_1_1regex_1_1RegexExtractor.html',1,'formatron::formats::regex']]], + ['register_5fgenerate_5fnonterminal_5fdef_4',['register_generate_nonterminal_def',['../namespaceformatron_1_1formats_1_1json.html#a55ae1cd2ef251d160e872a0c49e7ba7a',1,'formatron::formats::json']]], + ['required_5',['required',['../classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo.html#acd5625095baa17d3cf8f2b9562be0e06',1,'formatron.schemas.dict_inference.FieldInfo.required()'],['../classformatron_1_1schemas_1_1json__schema_1_1FieldInfo.html#af25ae318725070cd198febebe07e5efa',1,'formatron.schemas.json_schema.FieldInfo.required()'],['../classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.html#aeae1e2e12ad15628c69d896fae9aa477',1,'formatron.schemas.pydantic.FieldInfo.required()'],['../classformatron_1_1schemas_1_1schema_1_1FieldInfo.html#ac0d64035ccdc78e44a4cf6165d56081b',1,'formatron.schemas.schema.FieldInfo.required()']]], + ['reset_6',['reset',['../classformatron_1_1formatter_1_1FormatterBase.html#a522c78b1404697a99313f9edffa7a2a4',1,'formatron.formatter.FormatterBase.reset()'],['../classformatron_1_1formatter_1_1Formatter.html#a10ff1aac8dcd90e1bd983d2f6580a964',1,'formatron.formatter.Formatter.reset()'],['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#a984bc61ef20d16e88ffb40aa2f5afcc3',1,'formatron.integrations.exllamav2.FormatterFilter.reset()'],['../classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html#a966da36a950eaef6898bcd5ec5841df4',1,'formatron.integrations.transformers.FormattersLogitsProcessor.reset()'],['../classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html#a697bbd642308e22804f46729935e101b',1,'formatron.integrations.vllm.FormattersLogitsProcessor.reset()']]], + ['reset_5fat_5fbeginning_7',['reset_at_beginning',['../classformatron_1_1config_1_1EngineGenerationConfig.html#a95ef45b001b9c45f86bd3699a5675ad4',1,'formatron::config::EngineGenerationConfig']]], + ['rwkv_2epy_8',['RWKV.py',['../RWKV_8py.html',1,'']]] +]; diff --git a/v0.4.6/search/all_11.js b/v0.4.6/search/all_11.js new file mode 100644 index 00000000..5d92cf84 --- /dev/null +++ b/v0.4.6/search/all_11.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['schema_0',['Schema',['../classformatron_1_1schemas_1_1schema_1_1Schema.html',1,'formatron::schemas::schema']]], + ['schema_2epy_1',['schema.py',['../schema_8py.html',1,'']]], + ['space_5fnonterminal_2',['SPACE_NONTERMINAL',['../namespaceformatron_1_1formats_1_1json.html#af32c4b136b54f0356b017d6a319bb53d',1,'formatron::formats::json']]], + ['str_3',['str',['../classformatron_1_1formatter_1_1FormatterBuilder.html#ad467a40f82a47dff9bb2b95d1300ace0',1,'formatron::formatter::FormatterBuilder']]], + ['substr_4',['substr',['../classformatron_1_1formatter_1_1FormatterBuilder.html#ab98ad2c47fcb7be56521d3eadb4e643b',1,'formatron::formatter::FormatterBuilder']]], + ['substringextractor_5',['SubstringExtractor',['../classformatron_1_1extractor_1_1SubstringExtractor.html',1,'formatron::extractor']]] +]; diff --git a/v0.4.6/search/all_12.js b/v0.4.6/search/all_12.js new file mode 100644 index 00000000..335d8580 --- /dev/null +++ b/v0.4.6/search/all_12.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['transformers_2epy_0',['transformers.py',['../transformers_8py.html',1,'']]], + ['type_1',['type',['../classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata.html#ada7a24496aad9979411523441c53a6cf',1,'formatron::schemas::schema::TypeWithMetadata']]], + ['typewithmetadata_2',['TypeWithMetadata',['../classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata.html',1,'formatron::schemas::schema']]] +]; diff --git a/v0.4.6/search/all_13.js b/v0.4.6/search/all_13.js new file mode 100644 index 00000000..073ecfa7 --- /dev/null +++ b/v0.4.6/search/all_13.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['use_5fbackground_5fworker_0',['use_background_worker',['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#a9aa83a5922cefce88197d2cc3822a0c6',1,'formatron::integrations::exllamav2::FormatterFilter']]] +]; diff --git a/v0.4.6/search/all_14.js b/v0.4.6/search/all_14.js new file mode 100644 index 00000000..e856257f --- /dev/null +++ b/v0.4.6/search/all_14.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['vllm_2epy_0',['vllm.py',['../vllm_8py.html',1,'']]] +]; diff --git a/v0.4.6/search/all_2.js b/v0.4.6/search/all_2.js new file mode 100644 index 00000000..5172e30b --- /dev/null +++ b/v0.4.6/search/all_2.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['begin_0',['begin',['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#a31967e1c243ae325d5bf288c73e6635e',1,'formatron::integrations::exllamav2::FormatterFilter']]], + ['build_1',['build',['../classformatron_1_1formatter_1_1FormatterBuilder.html#aae2d235fef43c64305c076edbed41da5',1,'formatron::formatter::FormatterBuilder']]] +]; diff --git a/v0.4.6/search/all_3.js b/v0.4.6/search/all_3.js new file mode 100644 index 00000000..6e837bc0 --- /dev/null +++ b/v0.4.6/search/all_3.js @@ -0,0 +1,21 @@ +var searchData= +[ + ['callable_5fschema_0',['callable_schema',['../namespaceformatron_1_1schemas_1_1pydantic.html#a0b1aeb9a63626b0e782bc4b9e1ce18cf',1,'formatron::schemas::pydantic']]], + ['callablet_1',['CallableT',['../namespaceformatron_1_1schemas_1_1pydantic.html#acf48165db355935623fdcd27fafe2b27',1,'formatron::schemas::pydantic']]], + ['can_5fmask_5flogits_2',['can_mask_logits',['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#ad1269fb97cabd3381473bbd15ee59324',1,'formatron::integrations::exllamav2::FormatterFilter']]], + ['capture_5fname_3',['capture_name',['../classformatron_1_1extractor_1_1Extractor.html#abb72e0428a8b5835d075ebd889703e13',1,'formatron::extractor::Extractor']]], + ['captures_4',['captures',['../classformatron_1_1formatter_1_1FormatterBase.html#ab6682619840e83727264a945953fe964',1,'formatron.formatter.FormatterBase.captures()'],['../classformatron_1_1formatter_1_1Formatter.html#af69cc99bea2c85c4ca5af0ecc01c5db1',1,'formatron.formatter.Formatter.captures()']]], + ['choiceextractor_5',['ChoiceExtractor',['../classformatron_1_1extractor_1_1ChoiceExtractor.html',1,'formatron::extractor']]], + ['choose_6',['choose',['../classformatron_1_1formatter_1_1FormatterBuilder.html#a5594cefa0b28af7f159f374486e51618',1,'formatron::formatter::FormatterBuilder']]], + ['classschema_7',['ClassSchema',['../classformatron_1_1schemas_1_1pydantic_1_1ClassSchema.html',1,'formatron::schemas::pydantic']]], + ['clone_8',['clone',['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#a6ea0f3a9197afc9dd2b5b808fac2f157',1,'formatron::integrations::exllamav2::FormatterFilter']]], + ['compute_5fallowed_5ftokens_9',['compute_allowed_tokens',['../classformatron_1_1formatter_1_1FormatterBase.html#a927b160d994d43c4e38807f94ea69069',1,'formatron.formatter.FormatterBase.compute_allowed_tokens()'],['../classformatron_1_1formatter_1_1Formatter.html#a538f36e08b749716e6dd4c50679e2ee1',1,'formatron.formatter.Formatter.compute_allowed_tokens()']]], + ['config_2epy_10',['config.py',['../config_8py.html',1,'']]], + ['configs_11',['configs',['../classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html#a598fc8c32fb2670796d4ae2186f8a134',1,'formatron::integrations::transformers::FormattersLogitsProcessor']]], + ['create_5fengine_5fvocabulary_12',['create_engine_vocabulary',['../namespaceformatron_1_1integrations_1_1exllamav2.html#ab73e373da3d117082bfcb5e4020e0358',1,'formatron.integrations.exllamav2.create_engine_vocabulary()'],['../namespaceformatron_1_1integrations_1_1RWKV.html#a2fc99d20bbcc438cc823a728cbc999ea',1,'formatron.integrations.RWKV.create_engine_vocabulary()'],['../namespaceformatron_1_1integrations_1_1transformers.html#a1e2bb52e2c35fb3592fbc9fcff06f41a',1,'formatron.integrations.transformers.create_engine_vocabulary()'],['../namespaceformatron_1_1integrations_1_1vllm.html#acec47a067c2396265f1d7a941b0a7ab3',1,'formatron.integrations.vllm.create_engine_vocabulary()']]], + ['create_5fformatter_5ffilter_13',['create_formatter_filter',['../namespaceformatron_1_1integrations_1_1exllamav2.html#a8fb6a829f6fb28c956693fb2e4b39b63',1,'formatron::integrations::exllamav2']]], + ['create_5fformatter_5flogits_5fprocessor_14',['create_formatter_logits_processor',['../namespaceformatron_1_1integrations_1_1transformers.html#af8d1673116b56d3651e2e79934356a01',1,'formatron::integrations::transformers']]], + ['create_5fformatter_5flogits_5fprocessor_5flist_15',['create_formatter_logits_processor_list',['../namespaceformatron_1_1integrations_1_1transformers.html#a4036de8ad72188b3558f8e5a0fd289f4',1,'formatron::integrations::transformers']]], + ['create_5fformatters_5flogits_5fprocessor_16',['create_formatters_logits_processor',['../namespaceformatron_1_1integrations_1_1vllm.html#a995ec0f6519cf5b67bcc52d411653a26',1,'formatron::integrations::vllm']]], + ['create_5fschema_17',['create_schema',['../namespaceformatron_1_1schemas_1_1json__schema.html#ab2aeae10eb93ef3a3ca1c50013c6b380',1,'formatron::schemas::json_schema']]] +]; diff --git a/v0.4.6/search/all_4.js b/v0.4.6/search/all_4.js new file mode 100644 index 00000000..f11245c0 --- /dev/null +++ b/v0.4.6/search/all_4.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['dict_5finference_2epy_0',['dict_inference.py',['../dict__inference_8py.html',1,'']]] +]; diff --git a/v0.4.6/search/all_5.js b/v0.4.6/search/all_5.js new file mode 100644 index 00000000..a9a08634 --- /dev/null +++ b/v0.4.6/search/all_5.js @@ -0,0 +1,12 @@ +var searchData= +[ + ['engine_5fgen_5fconfig_0',['engine_gen_config',['../classformatron_1_1integrations_1_1RWKV_1_1PIPELINE__ARGS.html#a8f7501ec93400a3fbeadfd87a8886860',1,'formatron::integrations::RWKV::PIPELINE_ARGS']]], + ['enginegenerationconfig_1',['EngineGenerationConfig',['../classformatron_1_1config_1_1EngineGenerationConfig.html',1,'formatron::config']]], + ['eos_5flogits_2',['eos_logits',['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#a16819bffd3e4b1bb48e05ac7f696592a',1,'formatron::integrations::exllamav2::FormatterFilter']]], + ['exllamav2_2epy_3',['exllamav2.py',['../exllamav2_8py.html',1,'']]], + ['extract_4',['extract',['../classformatron_1_1extractor_1_1Extractor.html#a9efb2a75cf5fc5e0919c235aa1435469',1,'formatron.extractor.Extractor.extract()'],['../classformatron_1_1extractor_1_1LiteralExtractor.html#af80f5dc8710b59ced091d9b12afd828c',1,'formatron.extractor.LiteralExtractor.extract()'],['../classformatron_1_1extractor_1_1ChoiceExtractor.html#acfd6ee4d6b1ea910dd6f89a4c0fca41f',1,'formatron.extractor.ChoiceExtractor.extract()'],['../classformatron_1_1extractor_1_1SubstringExtractor.html#a1263c299229be0cd9d310e8d97401cd9',1,'formatron.extractor.SubstringExtractor.extract()'],['../classformatron_1_1formats_1_1json_1_1JsonExtractor.html#a6ad701c17988fe32b164135ebd39c783',1,'formatron.formats.json.JsonExtractor.extract()'],['../classformatron_1_1formats_1_1regex_1_1RegexExtractor.html#a73a98b3762aa24d4319e84c1123493c7',1,'formatron.formats.regex.RegexExtractor.extract()']]], + ['extract_5fempty_5fsubstring_5',['extract_empty_substring',['../classformatron_1_1extractor_1_1SubstringExtractor.html#a46d19c58ebefdba4c325f86c1ff17284',1,'formatron::extractor::SubstringExtractor']]], + ['extractor_6',['Extractor',['../classformatron_1_1extractor_1_1Extractor.html',1,'formatron::extractor']]], + ['extractor_7',['extractor',['../classformatron_1_1formatter_1_1FormatterBuilder.html#a8b6c87737912e390a1411d0b85080947',1,'formatron::formatter::FormatterBuilder']]], + ['extractor_2epy_8',['extractor.py',['../extractor_8py.html',1,'']]] +]; diff --git a/v0.4.6/search/all_6.js b/v0.4.6/search/all_6.js new file mode 100644 index 00000000..5af60484 --- /dev/null +++ b/v0.4.6/search/all_6.js @@ -0,0 +1,34 @@ +var searchData= +[ + ['feed_0',['feed',['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#a6896753ca9ce0cdb5cf998edd379123e',1,'formatron::integrations::exllamav2::FormatterFilter']]], + ['fieldinfo_1',['FieldInfo',['../classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo.html',1,'formatron.schemas.dict_inference.FieldInfo'],['../classformatron_1_1schemas_1_1json__schema_1_1FieldInfo.html',1,'formatron.schemas.json_schema.FieldInfo'],['../classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.html',1,'formatron.schemas.pydantic.FieldInfo'],['../classformatron_1_1schemas_1_1schema_1_1FieldInfo.html',1,'formatron.schemas.schema.FieldInfo']]], + ['fields_2',['fields',['../classformatron_1_1schemas_1_1pydantic_1_1ClassSchema.html#add30bb5902bbfd8ff4fa17f197994442',1,'formatron.schemas.pydantic.ClassSchema.fields()'],['../classformatron_1_1schemas_1_1schema_1_1Schema.html#a98d77a5645545d440b91126926d1aeb8',1,'formatron.schemas.schema.Schema.fields()']]], + ['formatron_3',['formatron',['../namespaceformatron.html',1,'']]], + ['formatron_3a_3aconfig_4',['config',['../namespaceformatron_1_1config.html',1,'formatron']]], + ['formatron_3a_3aextractor_5',['extractor',['../namespaceformatron_1_1extractor.html',1,'formatron']]], + ['formatron_3a_3aformats_6',['formats',['../namespaceformatron_1_1formats.html',1,'formatron']]], + ['formatron_3a_3aformats_3a_3ajson_7',['json',['../namespaceformatron_1_1formats_1_1json.html',1,'formatron::formats']]], + ['formatron_3a_3aformats_3a_3aregex_8',['regex',['../namespaceformatron_1_1formats_1_1regex.html',1,'formatron::formats']]], + ['formatron_3a_3aformatter_9',['formatter',['../namespaceformatron_1_1formatter.html',1,'formatron']]], + ['formatron_3a_3aintegrations_10',['integrations',['../namespaceformatron_1_1integrations.html',1,'formatron']]], + ['formatron_3a_3aintegrations_3a_3a_5futils_11',['_utils',['../namespaceformatron_1_1integrations_1_1__utils.html',1,'formatron::integrations']]], + ['formatron_3a_3aintegrations_3a_3aexllamav2_12',['exllamav2',['../namespaceformatron_1_1integrations_1_1exllamav2.html',1,'formatron::integrations']]], + ['formatron_3a_3aintegrations_3a_3arwkv_13',['RWKV',['../namespaceformatron_1_1integrations_1_1RWKV.html',1,'formatron::integrations']]], + ['formatron_3a_3aintegrations_3a_3atransformers_14',['transformers',['../namespaceformatron_1_1integrations_1_1transformers.html',1,'formatron::integrations']]], + ['formatron_3a_3aintegrations_3a_3avllm_15',['vllm',['../namespaceformatron_1_1integrations_1_1vllm.html',1,'formatron::integrations']]], + ['formatron_3a_3aschemas_16',['schemas',['../namespaceformatron_1_1schemas.html',1,'formatron']]], + ['formatron_3a_3aschemas_3a_3adict_5finference_17',['dict_inference',['../namespaceformatron_1_1schemas_1_1dict__inference.html',1,'formatron::schemas']]], + ['formatron_3a_3aschemas_3a_3ajson_5fschema_18',['json_schema',['../namespaceformatron_1_1schemas_1_1json__schema.html',1,'formatron::schemas']]], + ['formatron_3a_3aschemas_3a_3apydantic_19',['pydantic',['../namespaceformatron_1_1schemas_1_1pydantic.html',1,'formatron::schemas']]], + ['formatron_3a_3aschemas_3a_3aschema_20',['schema',['../namespaceformatron_1_1schemas_1_1schema.html',1,'formatron::schemas']]], + ['formatter_21',['Formatter',['../classformatron_1_1formatter_1_1Formatter.html',1,'formatron::formatter']]], + ['formatter_22',['formatter',['../classformatron_1_1integrations_1_1RWKV_1_1PIPELINE.html#a363de79042e852aa9e8388507d29265a',1,'formatron::integrations::RWKV::PIPELINE']]], + ['formatter_2epy_23',['formatter.py',['../formatter_8py.html',1,'']]], + ['formatter_5fcaptures_24',['formatter_captures',['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#ac1b4fa75c9e9009bd9990686efe1c2f5',1,'formatron::integrations::exllamav2::FormatterFilter']]], + ['formatterbase_25',['FormatterBase',['../classformatron_1_1formatter_1_1FormatterBase.html',1,'formatron::formatter']]], + ['formatterbuilder_26',['FormatterBuilder',['../classformatron_1_1formatter_1_1FormatterBuilder.html',1,'formatron::formatter']]], + ['formatterfilter_27',['FormatterFilter',['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html',1,'formatron::integrations::exllamav2']]], + ['formatters_5fcaptures_28',['formatters_captures',['../classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html#a148e8818c8d198d37e167d7030fa5746',1,'formatron.integrations.transformers.FormattersLogitsProcessor.formatters_captures()'],['../classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html#ae1387d693b21b6c34f7912a3bf7d182d',1,'formatron.integrations.vllm.FormattersLogitsProcessor.formatters_captures()']]], + ['formatterslogitsprocessor_29',['FormattersLogitsProcessor',['../classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html',1,'formatron.integrations.transformers.FormattersLogitsProcessor'],['../classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html',1,'formatron.integrations.vllm.FormattersLogitsProcessor']]], + ['from_5fjson_30',['from_json',['../classformatron_1_1schemas_1_1pydantic_1_1ClassSchema.html#aec269b72011e216e8f5fefdfa338253a',1,'formatron.schemas.pydantic.ClassSchema.from_json()'],['../classformatron_1_1schemas_1_1schema_1_1Schema.html#a8c45239aaa45574add14fa72fbdf16dc',1,'formatron.schemas.schema.Schema.from_json()']]] +]; diff --git a/v0.4.6/search/all_7.js b/v0.4.6/search/all_7.js new file mode 100644 index 00000000..990af198 --- /dev/null +++ b/v0.4.6/search/all_7.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['generate_0',['generate',['../classformatron_1_1integrations_1_1RWKV_1_1PIPELINE.html#a96f5091b6a8cc681e698a1a4cecdbd1f',1,'formatron::integrations::RWKV::PIPELINE']]], + ['get_5fallowed_5ftokens_5fsince_5flast_5fcomputation_1',['get_allowed_tokens_since_last_computation',['../classformatron_1_1formatter_1_1FormatterBase.html#ab77855193118e33bf8247c5709a0f485',1,'formatron.formatter.FormatterBase.get_allowed_tokens_since_last_computation()'],['../classformatron_1_1formatter_1_1Formatter.html#a5d565301d527fd3a56ca86a98df9afaf',1,'formatron.formatter.Formatter.get_allowed_tokens_since_last_computation()']]], + ['get_5foriginal_5fcharacters_2',['get_original_characters',['../namespaceformatron_1_1integrations_1_1__utils.html#ad30a176c08ead38cba6e7f425c7c6c08',1,'formatron::integrations::_utils']]], + ['grammar_5fheader_3',['GRAMMAR_HEADER',['../namespaceformatron_1_1formats_1_1json.html#ac81c86f8a6384cf3b11c47ddf2049ca7',1,'formatron::formats::json']]], + ['grammar_5fstr_4',['grammar_str',['../classformatron_1_1formatter_1_1Formatter.html#a2519969e1338beb864169289a6f36bb9',1,'formatron::formatter::Formatter']]] +]; diff --git a/v0.4.6/search/all_8.js b/v0.4.6/search/all_8.js new file mode 100644 index 00000000..2c9619a8 --- /dev/null +++ b/v0.4.6/search/all_8.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['huggingface_5fbytelevel_5fdecoder_0',['huggingface_bytelevel_decoder',['../namespaceformatron_1_1integrations_1_1__utils.html#a91dd89b0d6aecbea162244c5592f374b',1,'formatron::integrations::_utils']]] +]; diff --git a/v0.4.6/search/all_9.js b/v0.4.6/search/all_9.js new file mode 100644 index 00000000..b5de68c6 --- /dev/null +++ b/v0.4.6/search/all_9.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['infer_5fmapping_0',['infer_mapping',['../namespaceformatron_1_1schemas_1_1dict__inference.html#a850490b4a317260a236333130d36a5d8',1,'formatron::schemas::dict_inference']]], + ['is_5fcompleted_1',['is_completed',['../classformatron_1_1formatter_1_1FormatterBase.html#ac9af60077533ed0f3c9f42ee3a132899',1,'formatron.formatter.FormatterBase.is_completed()'],['../classformatron_1_1formatter_1_1Formatter.html#ac15aeec180daa5c78ad3c9bd93bd2b5b',1,'formatron.formatter.Formatter.is_completed()'],['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#adadb3652b5250cf08dfe7cc8824e2ec0',1,'formatron.integrations.exllamav2.FormatterFilter.is_completed()'],['../classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html#a0bf8e8613df954fcad9fb5368d0f7025',1,'formatron.integrations.transformers.FormattersLogitsProcessor.is_completed()'],['../classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html#ad6930fba60b378039db9698d811cb82a',1,'formatron.integrations.vllm.FormattersLogitsProcessor.is_completed()']]] +]; diff --git a/v0.4.6/search/all_a.js b/v0.4.6/search/all_a.js new file mode 100644 index 00000000..4dc64892 --- /dev/null +++ b/v0.4.6/search/all_a.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['json_0',['json',['../classformatron_1_1formatter_1_1FormatterBuilder.html#ad2a182c94ddec53d22aefe64f57d6514',1,'formatron::formatter::FormatterBuilder']]], + ['json_2epy_1',['json.py',['../json_8py.html',1,'']]], + ['json_5fschema_2epy_2',['json_schema.py',['../json__schema_8py.html',1,'']]], + ['jsonextractor_3',['JsonExtractor',['../classformatron_1_1formats_1_1json_1_1JsonExtractor.html',1,'formatron::formats::json']]] +]; diff --git a/v0.4.6/search/all_b.js b/v0.4.6/search/all_b.js new file mode 100644 index 00000000..c05d35b1 --- /dev/null +++ b/v0.4.6/search/all_b.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['kbnf_5fdefinition_0',['kbnf_definition',['../classformatron_1_1extractor_1_1Extractor.html#ae9abcfb6c5bae5b352de8a97f94be049',1,'formatron.extractor.Extractor.kbnf_definition()'],['../classformatron_1_1extractor_1_1LiteralExtractor.html#ada2b4df1008ae73880c5e1d35fca5939',1,'formatron.extractor.LiteralExtractor.kbnf_definition()'],['../classformatron_1_1extractor_1_1ChoiceExtractor.html#a5fe06cd727f3313d5e52a7ea6b81d5c4',1,'formatron.extractor.ChoiceExtractor.kbnf_definition()'],['../classformatron_1_1extractor_1_1SubstringExtractor.html#a13801ce1a7da7bf804317ea15f6e172e',1,'formatron.extractor.SubstringExtractor.kbnf_definition()'],['../classformatron_1_1formats_1_1json_1_1JsonExtractor.html#ace660f78408893ab8fb7facd410a9d60',1,'formatron.formats.json.JsonExtractor.kbnf_definition()'],['../classformatron_1_1formats_1_1regex_1_1RegexExtractor.html#a7b5fa1eb57e55ccf46d7762e1a6d0b9a',1,'formatron.formats.regex.RegexExtractor.kbnf_definition()']]], + ['kbnf_5freference_1',['kbnf_reference',['../classformatron_1_1extractor_1_1Extractor.html#abf347fc566ceca08b0845a5146347a5e',1,'formatron.extractor.Extractor.kbnf_reference()'],['../classformatron_1_1extractor_1_1NonterminalExtractor.html#a8c8a8f47ad90f6b9e4206ab6a56f302e',1,'formatron.extractor.NonterminalExtractor.kbnf_reference()'],['../classformatron_1_1extractor_1_1LiteralExtractor.html#acfc1bf5ad7fc06acef35ad8897ddf273',1,'formatron.extractor.LiteralExtractor.kbnf_reference()']]] +]; diff --git a/v0.4.6/search/all_c.js b/v0.4.6/search/all_c.js new file mode 100644 index 00000000..bca90218 --- /dev/null +++ b/v0.4.6/search/all_c.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['literalextractor_0',['LiteralExtractor',['../classformatron_1_1extractor_1_1LiteralExtractor.html',1,'formatron::extractor']]] +]; diff --git a/v0.4.6/search/all_d.js b/v0.4.6/search/all_d.js new file mode 100644 index 00000000..374eaabe --- /dev/null +++ b/v0.4.6/search/all_d.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['mask_5flogits_0',['mask_logits',['../classformatron_1_1formatter_1_1FormatterBase.html#ae8db7e92a900322ae5aa603b5c8f386f',1,'formatron.formatter.FormatterBase.mask_logits()'],['../classformatron_1_1formatter_1_1Formatter.html#a1068b4fa2167039fe04519ec4db65278',1,'formatron.formatter.Formatter.mask_logits()'],['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#a7a0e2e459eccf822cf79457a121a3a74',1,'formatron.integrations.exllamav2.FormatterFilter.mask_logits()']]], + ['metadata_1',['metadata',['../classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata.html#af8604b758b8af6878a130a4f0f28389b',1,'formatron::schemas::schema::TypeWithMetadata']]] +]; diff --git a/v0.4.6/search/all_e.js b/v0.4.6/search/all_e.js new file mode 100644 index 00000000..eb8ae0e6 --- /dev/null +++ b/v0.4.6/search/all_e.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['next_0',['next',['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#aaf7f64e93e611f4fc0ca9b7c2196c2f2',1,'formatron::integrations::exllamav2::FormatterFilter']]], + ['next_5fset_1',['next_set',['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#ac6f22aff80d80035bdd2118feff9f965',1,'formatron::integrations::exllamav2::FormatterFilter']]], + ['nonterminal_2',['nonterminal',['../classformatron_1_1extractor_1_1NonterminalExtractor.html#a1dd1fabcef2e668d00bf6ebb38dd017f',1,'formatron::extractor::NonterminalExtractor']]], + ['nonterminalextractor_3',['NonterminalExtractor',['../classformatron_1_1extractor_1_1NonterminalExtractor.html',1,'formatron::extractor']]] +]; diff --git a/v0.4.6/search/all_f.js b/v0.4.6/search/all_f.js new file mode 100644 index 00000000..1c42ebb7 --- /dev/null +++ b/v0.4.6/search/all_f.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['pipeline_0',['PIPELINE',['../classformatron_1_1integrations_1_1RWKV_1_1PIPELINE.html',1,'formatron::integrations::RWKV']]], + ['pipeline_5fargs_1',['PIPELINE_ARGS',['../classformatron_1_1integrations_1_1RWKV_1_1PIPELINE__ARGS.html',1,'formatron::integrations::RWKV']]], + ['prepare_5flogit_5fmask_2',['prepare_logit_mask',['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#aeb7f169a9c36b793867682069f00e928',1,'formatron::integrations::exllamav2::FormatterFilter']]], + ['processors_3',['Processors',['../namespaceformatron_1_1integrations_1_1__utils.html#ad5e049a7fd2978958881877de9eb6c1a',1,'formatron::integrations::_utils']]], + ['pydantic_2epy_4',['pydantic.py',['../pydantic_8py.html',1,'']]] +]; diff --git a/v0.4.6/search/classes_0.js b/v0.4.6/search/classes_0.js new file mode 100644 index 00000000..2ffa86e9 --- /dev/null +++ b/v0.4.6/search/classes_0.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['choiceextractor_0',['ChoiceExtractor',['../classformatron_1_1extractor_1_1ChoiceExtractor.html',1,'formatron::extractor']]], + ['classschema_1',['ClassSchema',['../classformatron_1_1schemas_1_1pydantic_1_1ClassSchema.html',1,'formatron::schemas::pydantic']]] +]; diff --git a/v0.4.6/search/classes_1.js b/v0.4.6/search/classes_1.js new file mode 100644 index 00000000..4a62e992 --- /dev/null +++ b/v0.4.6/search/classes_1.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['enginegenerationconfig_0',['EngineGenerationConfig',['../classformatron_1_1config_1_1EngineGenerationConfig.html',1,'formatron::config']]], + ['extractor_1',['Extractor',['../classformatron_1_1extractor_1_1Extractor.html',1,'formatron::extractor']]] +]; diff --git a/v0.4.6/search/classes_2.js b/v0.4.6/search/classes_2.js new file mode 100644 index 00000000..c57f639e --- /dev/null +++ b/v0.4.6/search/classes_2.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['fieldinfo_0',['FieldInfo',['../classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo.html',1,'formatron.schemas.dict_inference.FieldInfo'],['../classformatron_1_1schemas_1_1json__schema_1_1FieldInfo.html',1,'formatron.schemas.json_schema.FieldInfo'],['../classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.html',1,'formatron.schemas.pydantic.FieldInfo'],['../classformatron_1_1schemas_1_1schema_1_1FieldInfo.html',1,'formatron.schemas.schema.FieldInfo']]], + ['formatter_1',['Formatter',['../classformatron_1_1formatter_1_1Formatter.html',1,'formatron::formatter']]], + ['formatterbase_2',['FormatterBase',['../classformatron_1_1formatter_1_1FormatterBase.html',1,'formatron::formatter']]], + ['formatterbuilder_3',['FormatterBuilder',['../classformatron_1_1formatter_1_1FormatterBuilder.html',1,'formatron::formatter']]], + ['formatterfilter_4',['FormatterFilter',['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html',1,'formatron::integrations::exllamav2']]], + ['formatterslogitsprocessor_5',['FormattersLogitsProcessor',['../classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html',1,'formatron.integrations.transformers.FormattersLogitsProcessor'],['../classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html',1,'formatron.integrations.vllm.FormattersLogitsProcessor']]] +]; diff --git a/v0.4.6/search/classes_3.js b/v0.4.6/search/classes_3.js new file mode 100644 index 00000000..4bb886c3 --- /dev/null +++ b/v0.4.6/search/classes_3.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['jsonextractor_0',['JsonExtractor',['../classformatron_1_1formats_1_1json_1_1JsonExtractor.html',1,'formatron::formats::json']]] +]; diff --git a/v0.4.6/search/classes_4.js b/v0.4.6/search/classes_4.js new file mode 100644 index 00000000..bca90218 --- /dev/null +++ b/v0.4.6/search/classes_4.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['literalextractor_0',['LiteralExtractor',['../classformatron_1_1extractor_1_1LiteralExtractor.html',1,'formatron::extractor']]] +]; diff --git a/v0.4.6/search/classes_5.js b/v0.4.6/search/classes_5.js new file mode 100644 index 00000000..a73f06da --- /dev/null +++ b/v0.4.6/search/classes_5.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['nonterminalextractor_0',['NonterminalExtractor',['../classformatron_1_1extractor_1_1NonterminalExtractor.html',1,'formatron::extractor']]] +]; diff --git a/v0.4.6/search/classes_6.js b/v0.4.6/search/classes_6.js new file mode 100644 index 00000000..d5917786 --- /dev/null +++ b/v0.4.6/search/classes_6.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['pipeline_0',['PIPELINE',['../classformatron_1_1integrations_1_1RWKV_1_1PIPELINE.html',1,'formatron::integrations::RWKV']]], + ['pipeline_5fargs_1',['PIPELINE_ARGS',['../classformatron_1_1integrations_1_1RWKV_1_1PIPELINE__ARGS.html',1,'formatron::integrations::RWKV']]] +]; diff --git a/v0.4.6/search/classes_7.js b/v0.4.6/search/classes_7.js new file mode 100644 index 00000000..890c0e7d --- /dev/null +++ b/v0.4.6/search/classes_7.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['regexextractor_0',['RegexExtractor',['../classformatron_1_1formats_1_1regex_1_1RegexExtractor.html',1,'formatron::formats::regex']]] +]; diff --git a/v0.4.6/search/classes_8.js b/v0.4.6/search/classes_8.js new file mode 100644 index 00000000..dc04a993 --- /dev/null +++ b/v0.4.6/search/classes_8.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['schema_0',['Schema',['../classformatron_1_1schemas_1_1schema_1_1Schema.html',1,'formatron::schemas::schema']]], + ['substringextractor_1',['SubstringExtractor',['../classformatron_1_1extractor_1_1SubstringExtractor.html',1,'formatron::extractor']]] +]; diff --git a/v0.4.6/search/classes_9.js b/v0.4.6/search/classes_9.js new file mode 100644 index 00000000..99ffaccb --- /dev/null +++ b/v0.4.6/search/classes_9.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['typewithmetadata_0',['TypeWithMetadata',['../classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata.html',1,'formatron::schemas::schema']]] +]; diff --git a/v0.4.6/search/close.svg b/v0.4.6/search/close.svg new file mode 100644 index 00000000..337d6cc1 --- /dev/null +++ b/v0.4.6/search/close.svg @@ -0,0 +1,18 @@ + + + + + + diff --git a/v0.4.6/search/files_0.js b/v0.4.6/search/files_0.js new file mode 100644 index 00000000..8a787788 --- /dev/null +++ b/v0.4.6/search/files_0.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['_5f_5finit_5f_5f_2epy_0',['__init__.py',['../____init_____8py.html',1,'(Global Namespace)'],['../formats_2____init_____8py.html',1,'(Global Namespace)'],['../integrations_2____init_____8py.html',1,'(Global Namespace)'],['../schemas_2____init_____8py.html',1,'(Global Namespace)']]], + ['_5futils_2epy_1',['_utils.py',['../__utils_8py.html',1,'']]] +]; diff --git a/v0.4.6/search/files_1.js b/v0.4.6/search/files_1.js new file mode 100644 index 00000000..539cf2ca --- /dev/null +++ b/v0.4.6/search/files_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['config_2epy_0',['config.py',['../config_8py.html',1,'']]] +]; diff --git a/v0.4.6/search/files_2.js b/v0.4.6/search/files_2.js new file mode 100644 index 00000000..f11245c0 --- /dev/null +++ b/v0.4.6/search/files_2.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['dict_5finference_2epy_0',['dict_inference.py',['../dict__inference_8py.html',1,'']]] +]; diff --git a/v0.4.6/search/files_3.js b/v0.4.6/search/files_3.js new file mode 100644 index 00000000..2e6195b8 --- /dev/null +++ b/v0.4.6/search/files_3.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['exllamav2_2epy_0',['exllamav2.py',['../exllamav2_8py.html',1,'']]], + ['extractor_2epy_1',['extractor.py',['../extractor_8py.html',1,'']]] +]; diff --git a/v0.4.6/search/files_4.js b/v0.4.6/search/files_4.js new file mode 100644 index 00000000..0104fbd7 --- /dev/null +++ b/v0.4.6/search/files_4.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['formatter_2epy_0',['formatter.py',['../formatter_8py.html',1,'']]] +]; diff --git a/v0.4.6/search/files_5.js b/v0.4.6/search/files_5.js new file mode 100644 index 00000000..f1b091fa --- /dev/null +++ b/v0.4.6/search/files_5.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['json_2epy_0',['json.py',['../json_8py.html',1,'']]], + ['json_5fschema_2epy_1',['json_schema.py',['../json__schema_8py.html',1,'']]] +]; diff --git a/v0.4.6/search/files_6.js b/v0.4.6/search/files_6.js new file mode 100644 index 00000000..50eb1a19 --- /dev/null +++ b/v0.4.6/search/files_6.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['pydantic_2epy_0',['pydantic.py',['../pydantic_8py.html',1,'']]] +]; diff --git a/v0.4.6/search/files_7.js b/v0.4.6/search/files_7.js new file mode 100644 index 00000000..14f2508e --- /dev/null +++ b/v0.4.6/search/files_7.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['regex_2epy_0',['regex.py',['../regex_8py.html',1,'']]], + ['rwkv_2epy_1',['RWKV.py',['../RWKV_8py.html',1,'']]] +]; diff --git a/v0.4.6/search/files_8.js b/v0.4.6/search/files_8.js new file mode 100644 index 00000000..330ec96a --- /dev/null +++ b/v0.4.6/search/files_8.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['schema_2epy_0',['schema.py',['../schema_8py.html',1,'']]] +]; diff --git a/v0.4.6/search/files_9.js b/v0.4.6/search/files_9.js new file mode 100644 index 00000000..ce03ed47 --- /dev/null +++ b/v0.4.6/search/files_9.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['transformers_2epy_0',['transformers.py',['../transformers_8py.html',1,'']]] +]; diff --git a/v0.4.6/search/files_a.js b/v0.4.6/search/files_a.js new file mode 100644 index 00000000..e856257f --- /dev/null +++ b/v0.4.6/search/files_a.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['vllm_2epy_0',['vllm.py',['../vllm_8py.html',1,'']]] +]; diff --git a/v0.4.6/search/functions_0.js b/v0.4.6/search/functions_0.js new file mode 100644 index 00000000..d4e466c7 --- /dev/null +++ b/v0.4.6/search/functions_0.js @@ -0,0 +1,35 @@ +var searchData= +[ + ['_5f_5fcall_5f_5f_0',['__call__',['../classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html#af5ec5643f3c51046cb3b5e73fbb04f2b',1,'formatron.integrations.transformers.FormattersLogitsProcessor.__call__()'],['../classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html#ad4a81bb45d259bb5408433cdb6cbafdd',1,'formatron.integrations.vllm.FormattersLogitsProcessor.__call__()']]], + ['_5f_5finit_5f_5f_1',['__init__',['../classformatron_1_1extractor_1_1Extractor.html#a569fc7895a82f4d4b59866719219d4e0',1,'formatron.extractor.Extractor.__init__()'],['../classformatron_1_1extractor_1_1NonterminalExtractor.html#a45c14f79c14b539837ebdd26c3b5567b',1,'formatron.extractor.NonterminalExtractor.__init__()'],['../classformatron_1_1extractor_1_1LiteralExtractor.html#ab4da390ad7efaf5a3aab0e0ccb78fab3',1,'formatron.extractor.LiteralExtractor.__init__()'],['../classformatron_1_1extractor_1_1ChoiceExtractor.html#a1a91b31475c7348a3cf9fab97c6d26f0',1,'formatron.extractor.ChoiceExtractor.__init__()'],['../classformatron_1_1extractor_1_1SubstringExtractor.html#a843997315c77b9c7c6eb84ba7e02ff83',1,'formatron.extractor.SubstringExtractor.__init__()'],['../classformatron_1_1formats_1_1json_1_1JsonExtractor.html#a7a51edd3cc7c24370c809d91e07771dc',1,'formatron.formats.json.JsonExtractor.__init__()'],['../classformatron_1_1formats_1_1regex_1_1RegexExtractor.html#a6fc2f05d044cce49935c415248de5e5a',1,'formatron.formats.regex.RegexExtractor.__init__()'],['../classformatron_1_1formatter_1_1Formatter.html#a369269f53f32be2f1d92663670354515',1,'formatron.formatter.Formatter.__init__()'],['../classformatron_1_1formatter_1_1FormatterBuilder.html#abb13104747355cae16e6ad0c3067fac8',1,'formatron.formatter.FormatterBuilder.__init__()'],['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#adc94d2f2ddd06f966dca93079f17df8c',1,'formatron.integrations.exllamav2.FormatterFilter.__init__()'],['../classformatron_1_1integrations_1_1RWKV_1_1PIPELINE__ARGS.html#a53a892118d9b168024aaa6062f92cd7c',1,'formatron.integrations.RWKV.PIPELINE_ARGS.__init__()'],['../classformatron_1_1integrations_1_1RWKV_1_1PIPELINE.html#aa646fb0bf5f3674d1daba91dd0320017',1,'formatron.integrations.RWKV.PIPELINE.__init__()'],['../classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html#aa70d2276eeb09fdf53066e4019df79df',1,'formatron.integrations.transformers.FormattersLogitsProcessor.__init__()'],['../classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html#a0ee5e6edc8fc11dfd7406c140c13b7b9',1,'formatron.integrations.vllm.FormattersLogitsProcessor.__init__()'],['../classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo.html#a0286ba9c9e6509ce23d530409209b5da',1,'formatron.schemas.dict_inference.FieldInfo.__init__()'],['../classformatron_1_1schemas_1_1json__schema_1_1FieldInfo.html#abc61867418b7f30a3545e71c9b28e708',1,'formatron.schemas.json_schema.FieldInfo.__init__()'],['../classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.html#a4a5a010c6acef15f8fe2d4318223696b',1,'formatron.schemas.pydantic.FieldInfo.__init__()'],['../classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata.html#a0c3cf51ceb503d4d195f5623d57e160b',1,'formatron.schemas.schema.TypeWithMetadata.__init__()']]], + ['_5f_5frepr_5f_5f_2',['__repr__',['../classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.html#ad291e8df78d045d3364bc6a17582b416',1,'formatron::schemas::pydantic::FieldInfo']]], + ['_5f_5fstr_5f_5f_3',['__str__',['../classformatron_1_1extractor_1_1Extractor.html#afe6a1f745fd56540ccff5fdc5d00f0a5',1,'formatron.extractor.Extractor.__str__()'],['../classformatron_1_1formatter_1_1Formatter.html#a827c993f0ac74abff6276b3af6058e3f',1,'formatron.formatter.Formatter.__str__()'],['../classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.html#a49ac1734cddfadc1b7721f57775890a6',1,'formatron.schemas.pydantic.FieldInfo.__str__()']]], + ['_5fadd_5fcapture_5fname_4',['_add_capture_name',['../classformatron_1_1formatter_1_1FormatterBuilder.html#a1e97daf55b4149be6aaa5dd747ed6146',1,'formatron::formatter::FormatterBuilder']]], + ['_5fadd_5fextractor_5',['_add_extractor',['../classformatron_1_1formatter_1_1FormatterBuilder.html#a6e495e90b9da81108b6627166872bbbb',1,'formatron::formatter::FormatterBuilder']]], + ['_5fassert_5fcapture_5fname_5fvalid_6',['_assert_capture_name_valid',['../classformatron_1_1formatter_1_1FormatterBuilder.html#ab5ad5186f55d35e3abd2d5c213302a25',1,'formatron::formatter::FormatterBuilder']]], + ['_5fautodetect_5fprocessors_7',['_autodetect_processors',['../namespaceformatron_1_1integrations_1_1__utils.html#a76ded8fc3ee5ad369ec55b595ae74153',1,'formatron::integrations::_utils']]], + ['_5fconvert_5fjson_5fschema_5fto_5four_5fschema_8',['_convert_json_schema_to_our_schema',['../namespaceformatron_1_1schemas_1_1json__schema.html#a5f4856cb7c30aa340432d386836f25be',1,'formatron::schemas::json_schema']]], + ['_5fcreate_5fcustom_5ftype_9',['_create_custom_type',['../namespaceformatron_1_1schemas_1_1json__schema.html#a15dc86b65c90ac8423c8989054f8c9e5',1,'formatron::schemas::json_schema']]], + ['_5fcreate_5fnonterminal_10',['_create_nonterminal',['../classformatron_1_1formatter_1_1FormatterBuilder.html#aefe18951a4dc243909a22dd49b62fe21',1,'formatron::formatter::FormatterBuilder']]], + ['_5fextract_5ffields_5ffrom_5fobject_5ftype_11',['_extract_fields_from_object_type',['../namespaceformatron_1_1schemas_1_1json__schema.html#af20251afc012b955e29c92922fcc83ef',1,'formatron::schemas::json_schema']]], + ['_5fgenerate_5fkbnf_5fgrammar_12',['_generate_kbnf_grammar',['../namespaceformatron_1_1formats_1_1json.html#af4331f1a7679439503d898b2356d289e',1,'formatron::formats::json']]], + ['_5fget_5fliteral_13',['_get_literal',['../namespaceformatron_1_1schemas_1_1json__schema.html#a096ea829025ebd26b9ae165c17cf8976',1,'formatron::schemas::json_schema']]], + ['_5fhandle_5fanyof_14',['_handle_anyOf',['../namespaceformatron_1_1schemas_1_1json__schema.html#a6f88bf4e3c48d96b060ccdcbd80b3328',1,'formatron::schemas::json_schema']]], + ['_5fhandle_5flist_5fmetadata_15',['_handle_list_metadata',['../namespaceformatron_1_1schemas_1_1json__schema.html#aa80f28ccaf9ed4b404564f629139f9d1',1,'formatron::schemas::json_schema']]], + ['_5fhandle_5fliteral_16',['_handle_literal',['../namespaceformatron_1_1schemas_1_1json__schema.html#a969bd30894a578428528b94b0f82f1ba',1,'formatron::schemas::json_schema']]], + ['_5fhandle_5fnumeric_5fwith_5fmetadata_17',['_handle_numeric_with_metadata',['../namespaceformatron_1_1schemas_1_1json__schema.html#ad187a02f7616ccbb83c00462996a7fe1',1,'formatron::schemas::json_schema']]], + ['_5fhandle_5fstr_5fwith_5fmetadata_18',['_handle_str_with_metadata',['../namespaceformatron_1_1schemas_1_1json__schema.html#a32e51b70be50d55d3944e6c700bbd1a5',1,'formatron::schemas::json_schema']]], + ['_5finfer_5ftype_19',['_infer_type',['../namespaceformatron_1_1schemas_1_1dict__inference.html#ad5cac24e76dc097a995f31d3d0ff9efc',1,'formatron.schemas.dict_inference._infer_type()'],['../namespaceformatron_1_1schemas_1_1json__schema.html#ac742e1e581efccb6cc9742e7a23c25c2',1,'formatron.schemas.json_schema._infer_type(dict[str, typing.Any] schema, dict[int, typing.Type] json_schema_id_to_schema)']]], + ['_5fmerge_5fkey_20',['_merge_key',['../namespaceformatron_1_1schemas_1_1json__schema.html#a5fcddd43a5f64374b5b75d4aafeb9135',1,'formatron::schemas::json_schema']]], + ['_5fmerge_5freferenced_5fschema_21',['_merge_referenced_schema',['../namespaceformatron_1_1schemas_1_1json__schema.html#a45c9b97319a58c2013b8e3f10ad78c30',1,'formatron::schemas::json_schema']]], + ['_5fmultiple_5freplace_22',['_multiple_replace',['../namespaceformatron_1_1integrations_1_1__utils.html#abf64c53a323448aedc1361d01515226a',1,'formatron::integrations::_utils']]], + ['_5fobtain_5faccepted_5foutput_23',['_obtain_accepted_output',['../classformatron_1_1formatter_1_1Formatter.html#ae4be840a942f608c1a0c256dbf68901b',1,'formatron::formatter::Formatter']]], + ['_5fobtain_5ftype_24',['_obtain_type',['../namespaceformatron_1_1schemas_1_1json__schema.html#a544d74edf1fdccbad9e216d9ff028a20',1,'formatron::schemas::json_schema']]], + ['_5fon_5fcompletion_25',['_on_completion',['../classformatron_1_1formatter_1_1FormatterBase.html#a469880a21192928e82823cc340a22ce2',1,'formatron.formatter.FormatterBase._on_completion()'],['../classformatron_1_1formatter_1_1Formatter.html#ac6f7e3f96c6318689c5cd0d44a1cdde7',1,'formatron.formatter.Formatter._on_completion()']]], + ['_5frecursive_5fresolve_5freference_26',['_recursive_resolve_reference',['../namespaceformatron_1_1schemas_1_1json__schema.html#aaba012c79d101be93f4d96588c9f8cc2',1,'formatron::schemas::json_schema']]], + ['_5fregister_5fall_5fpredefined_5ftypes_27',['_register_all_predefined_types',['../namespaceformatron_1_1formats_1_1json.html#a311b750cba3838aee622b9809888f051',1,'formatron::formats::json']]], + ['_5fresolve_5fnew_5furl_28',['_resolve_new_url',['../namespaceformatron_1_1schemas_1_1json__schema.html#a9dc9dc267e5dd7b6581e2367e9238152',1,'formatron::schemas::json_schema']]], + ['_5fresolve_5freference_29',['_resolve_reference',['../namespaceformatron_1_1schemas_1_1json__schema.html#a24b516494672cc5dbbf7300ea65479b1',1,'formatron::schemas::json_schema']]], + ['_5fto_5fnext_5fbatch_5fstep_30',['_to_next_batch_step',['../classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html#ab87fea11f930a33130cecadd8cdf0cc6',1,'formatron::integrations::vllm::FormattersLogitsProcessor']]], + ['_5fvalidate_5fjson_5fschema_31',['_validate_json_schema',['../namespaceformatron_1_1schemas_1_1json__schema.html#a51aa68e29951e6b295844b13177b7d6a',1,'formatron::schemas::json_schema']]] +]; diff --git a/v0.4.6/search/functions_1.js b/v0.4.6/search/functions_1.js new file mode 100644 index 00000000..fdcd31ec --- /dev/null +++ b/v0.4.6/search/functions_1.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['accept_5fbytes_0',['accept_bytes',['../classformatron_1_1formatter_1_1FormatterBase.html#ac0f91549079380a53228322dd4473cf1',1,'formatron.formatter.FormatterBase.accept_bytes()'],['../classformatron_1_1formatter_1_1Formatter.html#a178a37715ce463e6e57c530166c7ec6d',1,'formatron.formatter.Formatter.accept_bytes()']]], + ['accept_5ftoken_1',['accept_token',['../classformatron_1_1formatter_1_1FormatterBase.html#a87d1513c3f70fdee18d65fae4f71101d',1,'formatron.formatter.FormatterBase.accept_token()'],['../classformatron_1_1formatter_1_1Formatter.html#a839eb7550ee4afbd305b25ddcca5c4dc',1,'formatron.formatter.Formatter.accept_token()']]], + ['annotation_2',['annotation',['../classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo.html#a163fde7bbaa2e613b5af3a4a12b9152d',1,'formatron.schemas.dict_inference.FieldInfo.annotation()'],['../classformatron_1_1schemas_1_1json__schema_1_1FieldInfo.html#a28f43dedc0eaf02cd16423172440208a',1,'formatron.schemas.json_schema.FieldInfo.annotation()'],['../classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.html#ac9e5af7e4cb356a450e9e48f3af24cfe',1,'formatron.schemas.pydantic.FieldInfo.annotation()'],['../classformatron_1_1schemas_1_1schema_1_1FieldInfo.html#a5c7b1d8b8d8d52426e95a3f326cf3e75',1,'formatron.schemas.schema.FieldInfo.annotation()']]], + ['append_5fline_3',['append_line',['../classformatron_1_1formatter_1_1FormatterBuilder.html#aa57e56f8d74b03eb4559106d189970c3',1,'formatron::formatter::FormatterBuilder']]], + ['append_5fmultiline_5fstr_4',['append_multiline_str',['../classformatron_1_1formatter_1_1FormatterBuilder.html#a0e4da27aacaa16880ed463a9f86edff4',1,'formatron::formatter::FormatterBuilder']]], + ['append_5fstr_5',['append_str',['../classformatron_1_1formatter_1_1FormatterBuilder.html#a171eca2a241aaf0f5f1fa8c117694337',1,'formatron::formatter::FormatterBuilder']]] +]; diff --git a/v0.4.6/search/functions_10.js b/v0.4.6/search/functions_10.js new file mode 100644 index 00000000..f44c4e1e --- /dev/null +++ b/v0.4.6/search/functions_10.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['type_0',['type',['../classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata.html#ada7a24496aad9979411523441c53a6cf',1,'formatron::schemas::schema::TypeWithMetadata']]] +]; diff --git a/v0.4.6/search/functions_11.js b/v0.4.6/search/functions_11.js new file mode 100644 index 00000000..073ecfa7 --- /dev/null +++ b/v0.4.6/search/functions_11.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['use_5fbackground_5fworker_0',['use_background_worker',['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#a9aa83a5922cefce88197d2cc3822a0c6',1,'formatron::integrations::exllamav2::FormatterFilter']]] +]; diff --git a/v0.4.6/search/functions_2.js b/v0.4.6/search/functions_2.js new file mode 100644 index 00000000..5172e30b --- /dev/null +++ b/v0.4.6/search/functions_2.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['begin_0',['begin',['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#a31967e1c243ae325d5bf288c73e6635e',1,'formatron::integrations::exllamav2::FormatterFilter']]], + ['build_1',['build',['../classformatron_1_1formatter_1_1FormatterBuilder.html#aae2d235fef43c64305c076edbed41da5',1,'formatron::formatter::FormatterBuilder']]] +]; diff --git a/v0.4.6/search/functions_3.js b/v0.4.6/search/functions_3.js new file mode 100644 index 00000000..22bed75d --- /dev/null +++ b/v0.4.6/search/functions_3.js @@ -0,0 +1,16 @@ +var searchData= +[ + ['callable_5fschema_0',['callable_schema',['../namespaceformatron_1_1schemas_1_1pydantic.html#a0b1aeb9a63626b0e782bc4b9e1ce18cf',1,'formatron::schemas::pydantic']]], + ['can_5fmask_5flogits_1',['can_mask_logits',['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#ad1269fb97cabd3381473bbd15ee59324',1,'formatron::integrations::exllamav2::FormatterFilter']]], + ['capture_5fname_2',['capture_name',['../classformatron_1_1extractor_1_1Extractor.html#abb72e0428a8b5835d075ebd889703e13',1,'formatron::extractor::Extractor']]], + ['captures_3',['captures',['../classformatron_1_1formatter_1_1FormatterBase.html#ab6682619840e83727264a945953fe964',1,'formatron.formatter.FormatterBase.captures()'],['../classformatron_1_1formatter_1_1Formatter.html#af69cc99bea2c85c4ca5af0ecc01c5db1',1,'formatron.formatter.Formatter.captures()']]], + ['choose_4',['choose',['../classformatron_1_1formatter_1_1FormatterBuilder.html#a5594cefa0b28af7f159f374486e51618',1,'formatron::formatter::FormatterBuilder']]], + ['clone_5',['clone',['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#a6ea0f3a9197afc9dd2b5b808fac2f157',1,'formatron::integrations::exllamav2::FormatterFilter']]], + ['compute_5fallowed_5ftokens_6',['compute_allowed_tokens',['../classformatron_1_1formatter_1_1FormatterBase.html#a927b160d994d43c4e38807f94ea69069',1,'formatron.formatter.FormatterBase.compute_allowed_tokens()'],['../classformatron_1_1formatter_1_1Formatter.html#a538f36e08b749716e6dd4c50679e2ee1',1,'formatron.formatter.Formatter.compute_allowed_tokens()']]], + ['create_5fengine_5fvocabulary_7',['create_engine_vocabulary',['../namespaceformatron_1_1integrations_1_1exllamav2.html#ab73e373da3d117082bfcb5e4020e0358',1,'formatron.integrations.exllamav2.create_engine_vocabulary()'],['../namespaceformatron_1_1integrations_1_1RWKV.html#a2fc99d20bbcc438cc823a728cbc999ea',1,'formatron.integrations.RWKV.create_engine_vocabulary()'],['../namespaceformatron_1_1integrations_1_1transformers.html#a1e2bb52e2c35fb3592fbc9fcff06f41a',1,'formatron.integrations.transformers.create_engine_vocabulary()'],['../namespaceformatron_1_1integrations_1_1vllm.html#acec47a067c2396265f1d7a941b0a7ab3',1,'formatron.integrations.vllm.create_engine_vocabulary()']]], + ['create_5fformatter_5ffilter_8',['create_formatter_filter',['../namespaceformatron_1_1integrations_1_1exllamav2.html#a8fb6a829f6fb28c956693fb2e4b39b63',1,'formatron::integrations::exllamav2']]], + ['create_5fformatter_5flogits_5fprocessor_9',['create_formatter_logits_processor',['../namespaceformatron_1_1integrations_1_1transformers.html#af8d1673116b56d3651e2e79934356a01',1,'formatron::integrations::transformers']]], + ['create_5fformatter_5flogits_5fprocessor_5flist_10',['create_formatter_logits_processor_list',['../namespaceformatron_1_1integrations_1_1transformers.html#a4036de8ad72188b3558f8e5a0fd289f4',1,'formatron::integrations::transformers']]], + ['create_5fformatters_5flogits_5fprocessor_11',['create_formatters_logits_processor',['../namespaceformatron_1_1integrations_1_1vllm.html#a995ec0f6519cf5b67bcc52d411653a26',1,'formatron::integrations::vllm']]], + ['create_5fschema_12',['create_schema',['../namespaceformatron_1_1schemas_1_1json__schema.html#ab2aeae10eb93ef3a3ca1c50013c6b380',1,'formatron::schemas::json_schema']]] +]; diff --git a/v0.4.6/search/functions_4.js b/v0.4.6/search/functions_4.js new file mode 100644 index 00000000..03e1fc61 --- /dev/null +++ b/v0.4.6/search/functions_4.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['extract_0',['extract',['../classformatron_1_1extractor_1_1Extractor.html#a9efb2a75cf5fc5e0919c235aa1435469',1,'formatron.extractor.Extractor.extract()'],['../classformatron_1_1extractor_1_1LiteralExtractor.html#af80f5dc8710b59ced091d9b12afd828c',1,'formatron.extractor.LiteralExtractor.extract()'],['../classformatron_1_1extractor_1_1ChoiceExtractor.html#acfd6ee4d6b1ea910dd6f89a4c0fca41f',1,'formatron.extractor.ChoiceExtractor.extract()'],['../classformatron_1_1extractor_1_1SubstringExtractor.html#a1263c299229be0cd9d310e8d97401cd9',1,'formatron.extractor.SubstringExtractor.extract()'],['../classformatron_1_1formats_1_1json_1_1JsonExtractor.html#a6ad701c17988fe32b164135ebd39c783',1,'formatron.formats.json.JsonExtractor.extract()'],['../classformatron_1_1formats_1_1regex_1_1RegexExtractor.html#a73a98b3762aa24d4319e84c1123493c7',1,'formatron.formats.regex.RegexExtractor.extract()']]], + ['extractor_1',['extractor',['../classformatron_1_1formatter_1_1FormatterBuilder.html#a8b6c87737912e390a1411d0b85080947',1,'formatron::formatter::FormatterBuilder']]] +]; diff --git a/v0.4.6/search/functions_5.js b/v0.4.6/search/functions_5.js new file mode 100644 index 00000000..310a66ea --- /dev/null +++ b/v0.4.6/search/functions_5.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['feed_0',['feed',['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#a6896753ca9ce0cdb5cf998edd379123e',1,'formatron::integrations::exllamav2::FormatterFilter']]], + ['fields_1',['fields',['../classformatron_1_1schemas_1_1pydantic_1_1ClassSchema.html#add30bb5902bbfd8ff4fa17f197994442',1,'formatron.schemas.pydantic.ClassSchema.fields()'],['../classformatron_1_1schemas_1_1schema_1_1Schema.html#a98d77a5645545d440b91126926d1aeb8',1,'formatron.schemas.schema.Schema.fields()']]], + ['formatter_5fcaptures_2',['formatter_captures',['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#ac1b4fa75c9e9009bd9990686efe1c2f5',1,'formatron::integrations::exllamav2::FormatterFilter']]], + ['formatters_5fcaptures_3',['formatters_captures',['../classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html#a148e8818c8d198d37e167d7030fa5746',1,'formatron.integrations.transformers.FormattersLogitsProcessor.formatters_captures()'],['../classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html#ae1387d693b21b6c34f7912a3bf7d182d',1,'formatron.integrations.vllm.FormattersLogitsProcessor.formatters_captures()']]], + ['from_5fjson_4',['from_json',['../classformatron_1_1schemas_1_1pydantic_1_1ClassSchema.html#aec269b72011e216e8f5fefdfa338253a',1,'formatron.schemas.pydantic.ClassSchema.from_json()'],['../classformatron_1_1schemas_1_1schema_1_1Schema.html#a8c45239aaa45574add14fa72fbdf16dc',1,'formatron.schemas.schema.Schema.from_json()']]] +]; diff --git a/v0.4.6/search/functions_6.js b/v0.4.6/search/functions_6.js new file mode 100644 index 00000000..e576fcf9 --- /dev/null +++ b/v0.4.6/search/functions_6.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['generate_0',['generate',['../classformatron_1_1integrations_1_1RWKV_1_1PIPELINE.html#a96f5091b6a8cc681e698a1a4cecdbd1f',1,'formatron::integrations::RWKV::PIPELINE']]], + ['get_5fallowed_5ftokens_5fsince_5flast_5fcomputation_1',['get_allowed_tokens_since_last_computation',['../classformatron_1_1formatter_1_1FormatterBase.html#ab77855193118e33bf8247c5709a0f485',1,'formatron.formatter.FormatterBase.get_allowed_tokens_since_last_computation()'],['../classformatron_1_1formatter_1_1Formatter.html#a5d565301d527fd3a56ca86a98df9afaf',1,'formatron.formatter.Formatter.get_allowed_tokens_since_last_computation()']]], + ['get_5foriginal_5fcharacters_2',['get_original_characters',['../namespaceformatron_1_1integrations_1_1__utils.html#ad30a176c08ead38cba6e7f425c7c6c08',1,'formatron::integrations::_utils']]], + ['grammar_5fstr_3',['grammar_str',['../classformatron_1_1formatter_1_1Formatter.html#a2519969e1338beb864169289a6f36bb9',1,'formatron::formatter::Formatter']]] +]; diff --git a/v0.4.6/search/functions_7.js b/v0.4.6/search/functions_7.js new file mode 100644 index 00000000..2c9619a8 --- /dev/null +++ b/v0.4.6/search/functions_7.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['huggingface_5fbytelevel_5fdecoder_0',['huggingface_bytelevel_decoder',['../namespaceformatron_1_1integrations_1_1__utils.html#a91dd89b0d6aecbea162244c5592f374b',1,'formatron::integrations::_utils']]] +]; diff --git a/v0.4.6/search/functions_8.js b/v0.4.6/search/functions_8.js new file mode 100644 index 00000000..b5de68c6 --- /dev/null +++ b/v0.4.6/search/functions_8.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['infer_5fmapping_0',['infer_mapping',['../namespaceformatron_1_1schemas_1_1dict__inference.html#a850490b4a317260a236333130d36a5d8',1,'formatron::schemas::dict_inference']]], + ['is_5fcompleted_1',['is_completed',['../classformatron_1_1formatter_1_1FormatterBase.html#ac9af60077533ed0f3c9f42ee3a132899',1,'formatron.formatter.FormatterBase.is_completed()'],['../classformatron_1_1formatter_1_1Formatter.html#ac15aeec180daa5c78ad3c9bd93bd2b5b',1,'formatron.formatter.Formatter.is_completed()'],['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#adadb3652b5250cf08dfe7cc8824e2ec0',1,'formatron.integrations.exllamav2.FormatterFilter.is_completed()'],['../classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html#a0bf8e8613df954fcad9fb5368d0f7025',1,'formatron.integrations.transformers.FormattersLogitsProcessor.is_completed()'],['../classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html#ad6930fba60b378039db9698d811cb82a',1,'formatron.integrations.vllm.FormattersLogitsProcessor.is_completed()']]] +]; diff --git a/v0.4.6/search/functions_9.js b/v0.4.6/search/functions_9.js new file mode 100644 index 00000000..ca21cb96 --- /dev/null +++ b/v0.4.6/search/functions_9.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['json_0',['json',['../classformatron_1_1formatter_1_1FormatterBuilder.html#ad2a182c94ddec53d22aefe64f57d6514',1,'formatron::formatter::FormatterBuilder']]] +]; diff --git a/v0.4.6/search/functions_a.js b/v0.4.6/search/functions_a.js new file mode 100644 index 00000000..c05d35b1 --- /dev/null +++ b/v0.4.6/search/functions_a.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['kbnf_5fdefinition_0',['kbnf_definition',['../classformatron_1_1extractor_1_1Extractor.html#ae9abcfb6c5bae5b352de8a97f94be049',1,'formatron.extractor.Extractor.kbnf_definition()'],['../classformatron_1_1extractor_1_1LiteralExtractor.html#ada2b4df1008ae73880c5e1d35fca5939',1,'formatron.extractor.LiteralExtractor.kbnf_definition()'],['../classformatron_1_1extractor_1_1ChoiceExtractor.html#a5fe06cd727f3313d5e52a7ea6b81d5c4',1,'formatron.extractor.ChoiceExtractor.kbnf_definition()'],['../classformatron_1_1extractor_1_1SubstringExtractor.html#a13801ce1a7da7bf804317ea15f6e172e',1,'formatron.extractor.SubstringExtractor.kbnf_definition()'],['../classformatron_1_1formats_1_1json_1_1JsonExtractor.html#ace660f78408893ab8fb7facd410a9d60',1,'formatron.formats.json.JsonExtractor.kbnf_definition()'],['../classformatron_1_1formats_1_1regex_1_1RegexExtractor.html#a7b5fa1eb57e55ccf46d7762e1a6d0b9a',1,'formatron.formats.regex.RegexExtractor.kbnf_definition()']]], + ['kbnf_5freference_1',['kbnf_reference',['../classformatron_1_1extractor_1_1Extractor.html#abf347fc566ceca08b0845a5146347a5e',1,'formatron.extractor.Extractor.kbnf_reference()'],['../classformatron_1_1extractor_1_1NonterminalExtractor.html#a8c8a8f47ad90f6b9e4206ab6a56f302e',1,'formatron.extractor.NonterminalExtractor.kbnf_reference()'],['../classformatron_1_1extractor_1_1LiteralExtractor.html#acfc1bf5ad7fc06acef35ad8897ddf273',1,'formatron.extractor.LiteralExtractor.kbnf_reference()']]] +]; diff --git a/v0.4.6/search/functions_b.js b/v0.4.6/search/functions_b.js new file mode 100644 index 00000000..374eaabe --- /dev/null +++ b/v0.4.6/search/functions_b.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['mask_5flogits_0',['mask_logits',['../classformatron_1_1formatter_1_1FormatterBase.html#ae8db7e92a900322ae5aa603b5c8f386f',1,'formatron.formatter.FormatterBase.mask_logits()'],['../classformatron_1_1formatter_1_1Formatter.html#a1068b4fa2167039fe04519ec4db65278',1,'formatron.formatter.Formatter.mask_logits()'],['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#a7a0e2e459eccf822cf79457a121a3a74',1,'formatron.integrations.exllamav2.FormatterFilter.mask_logits()']]], + ['metadata_1',['metadata',['../classformatron_1_1schemas_1_1schema_1_1TypeWithMetadata.html#af8604b758b8af6878a130a4f0f28389b',1,'formatron::schemas::schema::TypeWithMetadata']]] +]; diff --git a/v0.4.6/search/functions_c.js b/v0.4.6/search/functions_c.js new file mode 100644 index 00000000..98ccf6c1 --- /dev/null +++ b/v0.4.6/search/functions_c.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['next_0',['next',['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#aaf7f64e93e611f4fc0ca9b7c2196c2f2',1,'formatron::integrations::exllamav2::FormatterFilter']]], + ['next_5fset_1',['next_set',['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#ac6f22aff80d80035bdd2118feff9f965',1,'formatron::integrations::exllamav2::FormatterFilter']]], + ['nonterminal_2',['nonterminal',['../classformatron_1_1extractor_1_1NonterminalExtractor.html#a1dd1fabcef2e668d00bf6ebb38dd017f',1,'formatron::extractor::NonterminalExtractor']]] +]; diff --git a/v0.4.6/search/functions_d.js b/v0.4.6/search/functions_d.js new file mode 100644 index 00000000..24df5d18 --- /dev/null +++ b/v0.4.6/search/functions_d.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['prepare_5flogit_5fmask_0',['prepare_logit_mask',['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#aeb7f169a9c36b793867682069f00e928',1,'formatron::integrations::exllamav2::FormatterFilter']]] +]; diff --git a/v0.4.6/search/functions_e.js b/v0.4.6/search/functions_e.js new file mode 100644 index 00000000..6e0689d2 --- /dev/null +++ b/v0.4.6/search/functions_e.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['regex_0',['regex',['../classformatron_1_1formatter_1_1FormatterBuilder.html#af34f97f7f62d2a1de4f9e863b1834619',1,'formatron::formatter::FormatterBuilder']]], + ['register_5fgenerate_5fnonterminal_5fdef_1',['register_generate_nonterminal_def',['../namespaceformatron_1_1formats_1_1json.html#a55ae1cd2ef251d160e872a0c49e7ba7a',1,'formatron::formats::json']]], + ['required_2',['required',['../classformatron_1_1schemas_1_1dict__inference_1_1FieldInfo.html#acd5625095baa17d3cf8f2b9562be0e06',1,'formatron.schemas.dict_inference.FieldInfo.required()'],['../classformatron_1_1schemas_1_1json__schema_1_1FieldInfo.html#af25ae318725070cd198febebe07e5efa',1,'formatron.schemas.json_schema.FieldInfo.required()'],['../classformatron_1_1schemas_1_1pydantic_1_1FieldInfo.html#aeae1e2e12ad15628c69d896fae9aa477',1,'formatron.schemas.pydantic.FieldInfo.required()'],['../classformatron_1_1schemas_1_1schema_1_1FieldInfo.html#ac0d64035ccdc78e44a4cf6165d56081b',1,'formatron.schemas.schema.FieldInfo.required()']]], + ['reset_3',['reset',['../classformatron_1_1formatter_1_1FormatterBase.html#a522c78b1404697a99313f9edffa7a2a4',1,'formatron.formatter.FormatterBase.reset()'],['../classformatron_1_1formatter_1_1Formatter.html#a10ff1aac8dcd90e1bd983d2f6580a964',1,'formatron.formatter.Formatter.reset()'],['../classformatron_1_1integrations_1_1exllamav2_1_1FormatterFilter.html#a984bc61ef20d16e88ffb40aa2f5afcc3',1,'formatron.integrations.exllamav2.FormatterFilter.reset()'],['../classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html#a966da36a950eaef6898bcd5ec5841df4',1,'formatron.integrations.transformers.FormattersLogitsProcessor.reset()'],['../classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html#a697bbd642308e22804f46729935e101b',1,'formatron.integrations.vllm.FormattersLogitsProcessor.reset()']]] +]; diff --git a/v0.4.6/search/functions_f.js b/v0.4.6/search/functions_f.js new file mode 100644 index 00000000..965b933b --- /dev/null +++ b/v0.4.6/search/functions_f.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['str_0',['str',['../classformatron_1_1formatter_1_1FormatterBuilder.html#ad467a40f82a47dff9bb2b95d1300ace0',1,'formatron::formatter::FormatterBuilder']]], + ['substr_1',['substr',['../classformatron_1_1formatter_1_1FormatterBuilder.html#ab98ad2c47fcb7be56521d3eadb4e643b',1,'formatron::formatter::FormatterBuilder']]] +]; diff --git a/v0.4.6/search/mag.svg b/v0.4.6/search/mag.svg new file mode 100644 index 00000000..ffb6cf0d --- /dev/null +++ b/v0.4.6/search/mag.svg @@ -0,0 +1,24 @@ + + + + + + + diff --git a/v0.4.6/search/mag_d.svg b/v0.4.6/search/mag_d.svg new file mode 100644 index 00000000..4122773f --- /dev/null +++ b/v0.4.6/search/mag_d.svg @@ -0,0 +1,24 @@ + + + + + + + diff --git a/v0.4.6/search/mag_sel.svg b/v0.4.6/search/mag_sel.svg new file mode 100644 index 00000000..553dba87 --- /dev/null +++ b/v0.4.6/search/mag_sel.svg @@ -0,0 +1,31 @@ + + + + + + + + + diff --git a/v0.4.6/search/mag_seld.svg b/v0.4.6/search/mag_seld.svg new file mode 100644 index 00000000..c906f84c --- /dev/null +++ b/v0.4.6/search/mag_seld.svg @@ -0,0 +1,31 @@ + + + + + + + + + diff --git a/v0.4.6/search/namespaces_0.js b/v0.4.6/search/namespaces_0.js new file mode 100644 index 00000000..ab92372a --- /dev/null +++ b/v0.4.6/search/namespaces_0.js @@ -0,0 +1,21 @@ +var searchData= +[ + ['formatron_0',['formatron',['../namespaceformatron.html',1,'']]], + ['formatron_3a_3aconfig_1',['config',['../namespaceformatron_1_1config.html',1,'formatron']]], + ['formatron_3a_3aextractor_2',['extractor',['../namespaceformatron_1_1extractor.html',1,'formatron']]], + ['formatron_3a_3aformats_3',['formats',['../namespaceformatron_1_1formats.html',1,'formatron']]], + ['formatron_3a_3aformats_3a_3ajson_4',['json',['../namespaceformatron_1_1formats_1_1json.html',1,'formatron::formats']]], + ['formatron_3a_3aformats_3a_3aregex_5',['regex',['../namespaceformatron_1_1formats_1_1regex.html',1,'formatron::formats']]], + ['formatron_3a_3aformatter_6',['formatter',['../namespaceformatron_1_1formatter.html',1,'formatron']]], + ['formatron_3a_3aintegrations_7',['integrations',['../namespaceformatron_1_1integrations.html',1,'formatron']]], + ['formatron_3a_3aintegrations_3a_3a_5futils_8',['_utils',['../namespaceformatron_1_1integrations_1_1__utils.html',1,'formatron::integrations']]], + ['formatron_3a_3aintegrations_3a_3aexllamav2_9',['exllamav2',['../namespaceformatron_1_1integrations_1_1exllamav2.html',1,'formatron::integrations']]], + ['formatron_3a_3aintegrations_3a_3arwkv_10',['RWKV',['../namespaceformatron_1_1integrations_1_1RWKV.html',1,'formatron::integrations']]], + ['formatron_3a_3aintegrations_3a_3atransformers_11',['transformers',['../namespaceformatron_1_1integrations_1_1transformers.html',1,'formatron::integrations']]], + ['formatron_3a_3aintegrations_3a_3avllm_12',['vllm',['../namespaceformatron_1_1integrations_1_1vllm.html',1,'formatron::integrations']]], + ['formatron_3a_3aschemas_13',['schemas',['../namespaceformatron_1_1schemas.html',1,'formatron']]], + ['formatron_3a_3aschemas_3a_3adict_5finference_14',['dict_inference',['../namespaceformatron_1_1schemas_1_1dict__inference.html',1,'formatron::schemas']]], + ['formatron_3a_3aschemas_3a_3ajson_5fschema_15',['json_schema',['../namespaceformatron_1_1schemas_1_1json__schema.html',1,'formatron::schemas']]], + ['formatron_3a_3aschemas_3a_3apydantic_16',['pydantic',['../namespaceformatron_1_1schemas_1_1pydantic.html',1,'formatron::schemas']]], + ['formatron_3a_3aschemas_3a_3aschema_17',['schema',['../namespaceformatron_1_1schemas_1_1schema.html',1,'formatron::schemas']]] +]; diff --git a/v0.4.6/search/search.css b/v0.4.6/search/search.css new file mode 100644 index 00000000..d7b0f90b --- /dev/null +++ b/v0.4.6/search/search.css @@ -0,0 +1,291 @@ +/*---------------- Search Box positioning */ + +#main-menu > li:last-child { + /* This
  • object is the parent of the search bar */ + display: flex; + justify-content: center; + align-items: center; + height: 36px; + margin-right: 1em; +} + +/*---------------- Search box styling */ + +.SRPage * { + font-weight: normal; + line-height: normal; +} + +dark-mode-toggle { + margin-left: 5px; + display: flex; + float: right; +} + +#MSearchBox { + display: inline-block; + white-space : nowrap; + background: white; + border-radius: 0.65em; + box-shadow: inset 0.5px 0.5px 3px 0px #555; + z-index: 102; +} + +#MSearchBox .left { + display: inline-block; + vertical-align: middle; + height: 1.4em; +} + +#MSearchSelect { + display: inline-block; + vertical-align: middle; + width: 20px; + height: 19px; + background-image: url('mag_sel.svg'); + margin: 0 0 0 0.3em; + padding: 0; +} + +#MSearchSelectExt { + display: inline-block; + vertical-align: middle; + width: 10px; + height: 19px; + background-image: url('mag.svg'); + margin: 0 0 0 0.5em; + padding: 0; +} + + +#MSearchField { + display: inline-block; + vertical-align: middle; + width: 7.5em; + height: 19px; + margin: 0 0.15em; + padding: 0; + line-height: 1em; + border:none; + color: #909090; + outline: none; + font-family: Arial,Verdana,sans-serif; + -webkit-border-radius: 0px; + border-radius: 0px; + background: none; +} + +@media(hover: none) { + /* to avoid zooming on iOS */ + #MSearchField { + font-size: 16px; + } +} + +#MSearchBox .right { + display: inline-block; + vertical-align: middle; + width: 1.4em; + height: 1.4em; +} + +#MSearchClose { + display: none; + font-size: inherit; + background : none; + border: none; + margin: 0; + padding: 0; + outline: none; + +} + +#MSearchCloseImg { + padding: 0.3em; + margin: 0; +} + +.MSearchBoxActive #MSearchField { + color: black; +} + + + +/*---------------- Search filter selection */ + +#MSearchSelectWindow { + display: none; + position: absolute; + left: 0; top: 0; + border: 1px solid #90A5CE; + background-color: #F9FAFC; + z-index: 10001; + padding-top: 4px; + padding-bottom: 4px; + -moz-border-radius: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +.SelectItem { + font: 8pt Arial,Verdana,sans-serif; + padding-left: 2px; + padding-right: 12px; + border: 0px; +} + +span.SelectionMark { + margin-right: 4px; + font-family: 'JetBrains Mono',Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace,fixed; + outline-style: none; + text-decoration: none; +} + +a.SelectItem { + display: block; + outline-style: none; + color: black; + text-decoration: none; + padding-left: 6px; + padding-right: 12px; +} + +a.SelectItem:focus, +a.SelectItem:active { + color: black; + outline-style: none; + text-decoration: none; +} + +a.SelectItem:hover { + color: white; + background-color: #3D578C; + outline-style: none; + text-decoration: none; + cursor: pointer; + display: block; +} + +/*---------------- Search results window */ + +iframe#MSearchResults { + /*width: 60ex;*/ + height: 15em; +} + +#MSearchResultsWindow { + display: none; + position: absolute; + left: 0; top: 0; + border: 1px solid black; + background-color: #EEF1F7; + z-index:10000; + width: 300px; + height: 400px; + overflow: auto; +} + +/* ----------------------------------- */ + + +#SRIndex { + clear:both; +} + +.SREntry { + font-size: 10pt; + padding-left: 1ex; +} + +.SRPage .SREntry { + font-size: 8pt; + padding: 1px 5px; +} + +div.SRPage { + margin: 5px 2px; + background-color: #EEF1F7; +} + +.SRChildren { + padding-left: 3ex; padding-bottom: .5em +} + +.SRPage .SRChildren { + display: none; +} + +.SRSymbol { + font-weight: bold; + color: #425E97; + font-family: Arial,Verdana,sans-serif; + text-decoration: none; + outline: none; +} + +a.SRScope { + display: block; + color: #425E97; + font-family: Arial,Verdana,sans-serif; + font-size: 8pt; + text-decoration: none; + outline: none; +} + +a.SRSymbol:focus, a.SRSymbol:active, +a.SRScope:focus, a.SRScope:active { + text-decoration: underline; +} + +span.SRScope { + padding-left: 4px; + font-family: Arial,Verdana,sans-serif; +} + +.SRPage .SRStatus { + padding: 2px 5px; + font-size: 8pt; + font-style: italic; + font-family: Arial,Verdana,sans-serif; +} + +.SRResult { + display: none; +} + +div.searchresults { + margin-left: 10px; + margin-right: 10px; +} + +/*---------------- External search page results */ + +.pages b { + color: white; + padding: 5px 5px 3px 5px; + background-image: url("../tab_a.png"); + background-repeat: repeat-x; + text-shadow: 0 1px 1px #000000; +} + +.pages { + line-height: 17px; + margin-left: 4px; + text-decoration: none; +} + +.hl { + font-weight: bold; +} + +#searchresults { + margin-bottom: 20px; +} + +.searchpages { + margin-top: 10px; +} + diff --git a/v0.4.6/search/search.js b/v0.4.6/search/search.js new file mode 100644 index 00000000..666af01e --- /dev/null +++ b/v0.4.6/search/search.js @@ -0,0 +1,694 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ +const SEARCH_COOKIE_NAME = ''+'search_grp'; + +const searchResults = new SearchResults(); + +/* A class handling everything associated with the search panel. + + Parameters: + name - The name of the global variable that will be + storing this instance. Is needed to be able to set timeouts. + resultPath - path to use for external files +*/ +function SearchBox(name, resultsPath, extension) { + if (!name || !resultsPath) { alert("Missing parameters to SearchBox."); } + if (!extension || extension == "") { extension = ".html"; } + + function getXPos(item) { + let x = 0; + if (item.offsetWidth) { + while (item && item!=document.body) { + x += item.offsetLeft; + item = item.offsetParent; + } + } + return x; + } + + function getYPos(item) { + let y = 0; + if (item.offsetWidth) { + while (item && item!=document.body) { + y += item.offsetTop; + item = item.offsetParent; + } + } + return y; + } + + // ---------- Instance variables + this.name = name; + this.resultsPath = resultsPath; + this.keyTimeout = 0; + this.keyTimeoutLength = 500; + this.closeSelectionTimeout = 300; + this.lastSearchValue = ""; + this.lastResultsPage = ""; + this.hideTimeout = 0; + this.searchIndex = 0; + this.searchActive = false; + this.extension = extension; + + // ----------- DOM Elements + + this.DOMSearchField = () => document.getElementById("MSearchField"); + this.DOMSearchSelect = () => document.getElementById("MSearchSelect"); + this.DOMSearchSelectWindow = () => document.getElementById("MSearchSelectWindow"); + this.DOMPopupSearchResults = () => document.getElementById("MSearchResults"); + this.DOMPopupSearchResultsWindow = () => document.getElementById("MSearchResultsWindow"); + this.DOMSearchClose = () => document.getElementById("MSearchClose"); + this.DOMSearchBox = () => document.getElementById("MSearchBox"); + + // ------------ Event Handlers + + // Called when focus is added or removed from the search field. + this.OnSearchFieldFocus = function(isActive) { + this.Activate(isActive); + } + + this.OnSearchSelectShow = function() { + const searchSelectWindow = this.DOMSearchSelectWindow(); + const searchField = this.DOMSearchSelect(); + + const left = getXPos(searchField); + const top = getYPos(searchField) + searchField.offsetHeight; + + // show search selection popup + searchSelectWindow.style.display='block'; + searchSelectWindow.style.left = left + 'px'; + searchSelectWindow.style.top = top + 'px'; + + // stop selection hide timer + if (this.hideTimeout) { + clearTimeout(this.hideTimeout); + this.hideTimeout=0; + } + return false; // to avoid "image drag" default event + } + + this.OnSearchSelectHide = function() { + this.hideTimeout = setTimeout(this.CloseSelectionWindow.bind(this), + this.closeSelectionTimeout); + } + + // Called when the content of the search field is changed. + this.OnSearchFieldChange = function(evt) { + if (this.keyTimeout) { // kill running timer + clearTimeout(this.keyTimeout); + this.keyTimeout = 0; + } + + const e = evt ? evt : window.event; // for IE + if (e.keyCode==40 || e.keyCode==13) { + if (e.shiftKey==1) { + this.OnSearchSelectShow(); + const win=this.DOMSearchSelectWindow(); + for (let i=0;i do a search + this.Search(); + } + } + + this.OnSearchSelectKey = function(evt) { + const e = (evt) ? evt : window.event; // for IE + if (e.keyCode==40 && this.searchIndex0) { // Up + this.searchIndex--; + this.OnSelectItem(this.searchIndex); + } else if (e.keyCode==13 || e.keyCode==27) { + e.stopPropagation(); + this.OnSelectItem(this.searchIndex); + this.CloseSelectionWindow(); + this.DOMSearchField().focus(); + } + return false; + } + + // --------- Actions + + // Closes the results window. + this.CloseResultsWindow = function() { + this.DOMPopupSearchResultsWindow().style.display = 'none'; + this.DOMSearchClose().style.display = 'none'; + this.Activate(false); + } + + this.CloseSelectionWindow = function() { + this.DOMSearchSelectWindow().style.display = 'none'; + } + + // Performs a search. + this.Search = function() { + this.keyTimeout = 0; + + // strip leading whitespace + const searchValue = this.DOMSearchField().value.replace(/^ +/, ""); + + const code = searchValue.toLowerCase().charCodeAt(0); + let idxChar = searchValue.substr(0, 1).toLowerCase(); + if ( 0xD800 <= code && code <= 0xDBFF && searchValue > 1) { // surrogate pair + idxChar = searchValue.substr(0, 2); + } + + let jsFile; + let idx = indexSectionsWithContent[this.searchIndex].indexOf(idxChar); + if (idx!=-1) { + const hexCode=idx.toString(16); + jsFile = this.resultsPath + indexSectionNames[this.searchIndex] + '_' + hexCode + '.js'; + } + + const loadJS = function(url, impl, loc) { + const scriptTag = document.createElement('script'); + scriptTag.src = url; + scriptTag.onload = impl; + scriptTag.onreadystatechange = impl; + loc.appendChild(scriptTag); + } + + const domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow(); + const domSearchBox = this.DOMSearchBox(); + const domPopupSearchResults = this.DOMPopupSearchResults(); + const domSearchClose = this.DOMSearchClose(); + const resultsPath = this.resultsPath; + + const handleResults = function() { + document.getElementById("Loading").style.display="none"; + if (typeof searchData !== 'undefined') { + createResults(resultsPath); + document.getElementById("NoMatches").style.display="none"; + } + + if (idx!=-1) { + searchResults.Search(searchValue); + } else { // no file with search results => force empty search results + searchResults.Search('===='); + } + + if (domPopupSearchResultsWindow.style.display!='block') { + domSearchClose.style.display = 'inline-block'; + let left = getXPos(domSearchBox) + 150; + let top = getYPos(domSearchBox) + 20; + domPopupSearchResultsWindow.style.display = 'block'; + left -= domPopupSearchResults.offsetWidth; + const maxWidth = document.body.clientWidth; + const maxHeight = document.body.clientHeight; + let width = 300; + if (left<10) left=10; + if (width+left+8>maxWidth) width=maxWidth-left-8; + let height = 400; + if (height+top+8>maxHeight) height=maxHeight-top-8; + domPopupSearchResultsWindow.style.top = top + 'px'; + domPopupSearchResultsWindow.style.left = left + 'px'; + domPopupSearchResultsWindow.style.width = width + 'px'; + domPopupSearchResultsWindow.style.height = height + 'px'; + } + } + + if (jsFile) { + loadJS(jsFile, handleResults, this.DOMPopupSearchResultsWindow()); + } else { + handleResults(); + } + + this.lastSearchValue = searchValue; + } + + // -------- Activation Functions + + // Activates or deactivates the search panel, resetting things to + // their default values if necessary. + this.Activate = function(isActive) { + if (isActive || // open it + this.DOMPopupSearchResultsWindow().style.display == 'block' + ) { + this.DOMSearchBox().className = 'MSearchBoxActive'; + this.searchActive = true; + } else if (!isActive) { // directly remove the panel + this.DOMSearchBox().className = 'MSearchBoxInactive'; + this.searchActive = false; + this.lastSearchValue = '' + this.lastResultsPage = ''; + this.DOMSearchField().value = ''; + } + } +} + +// ----------------------------------------------------------------------- + +// The class that handles everything on the search results page. +function SearchResults() { + + function convertToId(search) { + let result = ''; + for (let i=0;i. + this.lastMatchCount = 0; + this.lastKey = 0; + this.repeatOn = false; + + // Toggles the visibility of the passed element ID. + this.FindChildElement = function(id) { + const parentElement = document.getElementById(id); + let element = parentElement.firstChild; + + while (element && element!=parentElement) { + if (element.nodeName.toLowerCase() == 'div' && element.className == 'SRChildren') { + return element; + } + + if (element.nodeName.toLowerCase() == 'div' && element.hasChildNodes()) { + element = element.firstChild; + } else if (element.nextSibling) { + element = element.nextSibling; + } else { + do { + element = element.parentNode; + } + while (element && element!=parentElement && !element.nextSibling); + + if (element && element!=parentElement) { + element = element.nextSibling; + } + } + } + } + + this.Toggle = function(id) { + const element = this.FindChildElement(id); + if (element) { + if (element.style.display == 'block') { + element.style.display = 'none'; + } else { + element.style.display = 'block'; + } + } + } + + // Searches for the passed string. If there is no parameter, + // it takes it from the URL query. + // + // Always returns true, since other documents may try to call it + // and that may or may not be possible. + this.Search = function(search) { + if (!search) { // get search word from URL + search = window.location.search; + search = search.substring(1); // Remove the leading '?' + search = unescape(search); + } + + search = search.replace(/^ +/, ""); // strip leading spaces + search = search.replace(/ +$/, ""); // strip trailing spaces + search = search.toLowerCase(); + search = convertToId(search); + + const resultRows = document.getElementsByTagName("div"); + let matches = 0; + + let i = 0; + while (i < resultRows.length) { + const row = resultRows.item(i); + if (row.className == "SRResult") { + let rowMatchName = row.id.toLowerCase(); + rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_' + + if (search.length<=rowMatchName.length && + rowMatchName.substr(0, search.length)==search) { + row.style.display = 'block'; + matches++; + } else { + row.style.display = 'none'; + } + } + i++; + } + document.getElementById("Searching").style.display='none'; + if (matches == 0) { // no results + document.getElementById("NoMatches").style.display='block'; + } else { // at least one result + document.getElementById("NoMatches").style.display='none'; + } + this.lastMatchCount = matches; + return true; + } + + // return the first item with index index or higher that is visible + this.NavNext = function(index) { + let focusItem; + for (;;) { + const focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') { + break; + } else if (!focusItem) { // last element + break; + } + focusItem=null; + index++; + } + return focusItem; + } + + this.NavPrev = function(index) { + let focusItem; + for (;;) { + const focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') { + break; + } else if (!focusItem) { // last element + break; + } + focusItem=null; + index--; + } + return focusItem; + } + + this.ProcessKeys = function(e) { + if (e.type == "keydown") { + this.repeatOn = false; + this.lastKey = e.keyCode; + } else if (e.type == "keypress") { + if (!this.repeatOn) { + if (this.lastKey) this.repeatOn = true; + return false; // ignore first keypress after keydown + } + } else if (e.type == "keyup") { + this.lastKey = 0; + this.repeatOn = false; + } + return this.lastKey!=0; + } + + this.Nav = function(evt,itemIndex) { + const e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) { // Up + const newIndex = itemIndex-1; + let focusItem = this.NavPrev(newIndex); + if (focusItem) { + let child = this.FindChildElement(focusItem.parentNode.parentNode.id); + if (child && child.style.display == 'block') { // children visible + let n=0; + let tmpElem; + for (;;) { // search for last child + tmpElem = document.getElementById('Item'+newIndex+'_c'+n); + if (tmpElem) { + focusItem = tmpElem; + } else { // found it! + break; + } + n++; + } + } + } + if (focusItem) { + focusItem.focus(); + } else { // return focus to search field + document.getElementById("MSearchField").focus(); + } + } else if (this.lastKey==40) { // Down + const newIndex = itemIndex+1; + let focusItem; + const item = document.getElementById('Item'+itemIndex); + const elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem && elem.style.display == 'block') { // children visible + focusItem = document.getElementById('Item'+itemIndex+'_c0'); + } + if (!focusItem) focusItem = this.NavNext(newIndex); + if (focusItem) focusItem.focus(); + } else if (this.lastKey==39) { // Right + const item = document.getElementById('Item'+itemIndex); + const elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'block'; + } else if (this.lastKey==37) { // Left + const item = document.getElementById('Item'+itemIndex); + const elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'none'; + } else if (this.lastKey==27) { // Escape + e.stopPropagation(); + searchBox.CloseResultsWindow(); + document.getElementById("MSearchField").focus(); + } else if (this.lastKey==13) { // Enter + return true; + } + return false; + } + + this.NavChild = function(evt,itemIndex,childIndex) { + const e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) { // Up + if (childIndex>0) { + const newIndex = childIndex-1; + document.getElementById('Item'+itemIndex+'_c'+newIndex).focus(); + } else { // already at first child, jump to parent + document.getElementById('Item'+itemIndex).focus(); + } + } else if (this.lastKey==40) { // Down + const newIndex = childIndex+1; + let elem = document.getElementById('Item'+itemIndex+'_c'+newIndex); + if (!elem) { // last child, jump to parent next parent + elem = this.NavNext(itemIndex+1); + } + if (elem) { + elem.focus(); + } + } else if (this.lastKey==27) { // Escape + e.stopPropagation(); + searchBox.CloseResultsWindow(); + document.getElementById("MSearchField").focus(); + } else if (this.lastKey==13) { // Enter + return true; + } + return false; + } +} + +function createResults(resultsPath) { + + function setKeyActions(elem,action) { + elem.setAttribute('onkeydown',action); + elem.setAttribute('onkeypress',action); + elem.setAttribute('onkeyup',action); + } + + function setClassAttr(elem,attr) { + elem.setAttribute('class',attr); + elem.setAttribute('className',attr); + } + + const results = document.getElementById("SRResults"); + results.innerHTML = ''; + searchData.forEach((elem,index) => { + const id = elem[0]; + const srResult = document.createElement('div'); + srResult.setAttribute('id','SR_'+id); + setClassAttr(srResult,'SRResult'); + const srEntry = document.createElement('div'); + setClassAttr(srEntry,'SREntry'); + const srLink = document.createElement('a'); + srLink.setAttribute('id','Item'+index); + setKeyActions(srLink,'return searchResults.Nav(event,'+index+')'); + setClassAttr(srLink,'SRSymbol'); + srLink.innerHTML = elem[1][0]; + srEntry.appendChild(srLink); + if (elem[1].length==2) { // single result + srLink.setAttribute('href',resultsPath+elem[1][1][0]); + srLink.setAttribute('onclick','searchBox.CloseResultsWindow()'); + if (elem[1][1][1]) { + srLink.setAttribute('target','_parent'); + } else { + srLink.setAttribute('target','_blank'); + } + const srScope = document.createElement('span'); + setClassAttr(srScope,'SRScope'); + srScope.innerHTML = elem[1][1][2]; + srEntry.appendChild(srScope); + } else { // multiple results + srLink.setAttribute('href','javascript:searchResults.Toggle("SR_'+id+'")'); + const srChildren = document.createElement('div'); + setClassAttr(srChildren,'SRChildren'); + for (let c=0; c-{AmhX=Jf(#6djGiuzAr*{o?=JLmPLyc> z_*`QK&+BH@jWrYJ7>r6%keRM@)Qyv8R=enp0jiI>aWlGyB58O zFVR20d+y`K7vDw(hJF3;>dD*3-?v=<8M)@x|EEGLnJsniYK!2U1 Y!`|5biEc?d1`HDhPgg&ebxsLQ02F6;9RL6T literal 0 HcmV?d00001 diff --git a/v0.4.6/splitbard.png b/v0.4.6/splitbard.png new file mode 100644 index 0000000000000000000000000000000000000000..8367416d757fd7b6dc4272b6432dc75a75abd068 GIT binary patch literal 282 zcmeAS@N?(olHy`uVBq!ia0vp^Yzz!63>-{AmhX=Jf@VhhFKy35^fiT zT~&lUj3=cDh^%3HDY9k5CEku}PHXNoNC(_$U3XPb&Q*ME25pT;2(*BOgAf<+R$lzakPG`kF31()Fx{L5Wrac|GQzjeE= zueY1`Ze{#x<8=S|`~MgGetGce)#vN&|J{Cd^tS%;tBYTo?+^d68<#n_Y_xx`J||4O V@QB{^CqU0Kc)I$ztaD0e0svEzbJzd? literal 0 HcmV?d00001 diff --git a/v0.4.6/sync_off.png b/v0.4.6/sync_off.png new file mode 100644 index 0000000000000000000000000000000000000000..3b443fc62892114406e3d399421b2a881b897acc GIT binary patch literal 853 zcmV-b1FHOqP)oT|#XixUYy%lpuf3i8{fX!o zUyDD0jOrAiT^tq>fLSOOABs-#u{dV^F$b{L9&!2=9&RmV;;8s^x&UqB$PCj4FdKbh zoB1WTskPUPu05XzFbA}=KZ-GP1fPpAfSs>6AHb12UlR%-i&uOlTpFNS7{jm@mkU1V zh`nrXr~+^lsV-s1dkZOaI|kYyVj3WBpPCY{n~yd%u%e+d=f%`N0FItMPtdgBb@py; zq@v6NVArhyTC7)ULw-Jy8y42S1~4n(3LkrW8mW(F-4oXUP3E`e#g**YyqI7h-J2zK zK{m9##m4ri!7N>CqQqCcnI3hqo1I;Yh&QLNY4T`*ptiQGozK>FF$!$+84Z`xwmeMh zJ0WT+OH$WYFALEaGj2_l+#DC3t7_S`vHpSivNeFbP6+r50cO8iu)`7i%Z4BTPh@_m3Tk!nAm^)5Bqnr%Ov|Baunj#&RPtRuK& z4RGz|D5HNrW83-#ydk}tVKJrNmyYt-sTxLGlJY5nc&Re zU4SgHNPx8~Yxwr$bsju?4q&%T1874xxzq+_%?h8_ofw~(bld=o3iC)LUNR*BY%c0y zWd_jX{Y8`l%z+ol1$@Qa?Cy!(0CVIEeYpKZ`(9{z>3$CIe;pJDQk$m3p}$>xBm4lb zKo{4S)`wdU9Ba9jJbVJ0C=SOefZe%d$8=2r={nu<_^a3~>c#t_U6dye5)JrR(_a^E f@}b6j1K9lwFJq@>o)+Ry00000NkvXXu0mjfWa5j* literal 0 HcmV?d00001 diff --git a/v0.4.6/sync_on.png b/v0.4.6/sync_on.png new file mode 100644 index 0000000000000000000000000000000000000000..e08320fb64e6fa33b573005ed6d8fe294e19db76 GIT binary patch literal 845 zcmV-T1G4;yP)Y;xxyHF2B5Wzm| zOOGupOTn@c(JmBOl)e;XMNnZuiTJP>rM8<|Q`7I_))aP?*T)ow&n59{}X4$3Goat zgjs?*aasfbrokzG5cT4K=uG`E14xZl@z)F={P0Y^?$4t z>v!teRnNZym<6h{7sLyF1V0HsfEl+l6TrZpsfr1}luH~F7L}ktXu|*uVX^RG$L0`K zWs3j|0tIvVe(N%_?2{(iCPFGf#B6Hjy6o&}D$A%W%jfO8_W%ZO#-mh}EM$LMn7joJ z05dHr!5Y92g+31l<%i1(=L1a1pXX+OYnalY>31V4K}BjyRe3)9n#;-cCVRD_IG1fT zOKGeNY8q;TL@K{dj@D^scf&VCs*-Jb>8b>|`b*osv52-!A?BpbYtTQBns5EAU**$m zSnVSm(teh>tQi*S*A>#ySc=n;`BHz`DuG4&g4Kf8lLhca+zvZ7t7RflD6-i-mcK=M z!=^P$*u2)bkY5asG4gsss!Hn%u~>}kIW`vMs%lJLH+u*9<4PaV_c6U`KqWXQH%+Nu zTv41O(^ZVi@qhjQdG!fbZw&y+2o!iYymO^?ud3{P*HdoX83YV*Uu_HB=?U&W9%AU# z80}k1SS-CXTU7dcQlsm<^oYLxVSseqY6NO}dc`Nj?8vrhNuCdm@^{a3AQ_>6myOj+ z`1RsLUXF|dm|3k7s2jD(B{rzE>WI2scH8i1;=O5Cc9xB3^aJk%fQjqsu+kH#0=_5a z0nCE8@dbQa-|YIuUVvG0L_IwHMEhOj$Mj4Uq05 X8=0q~qBNan00000NkvXXu0mjfptF>5 literal 0 HcmV?d00001 diff --git a/v0.4.6/tab_a.png b/v0.4.6/tab_a.png new file mode 100644 index 0000000000000000000000000000000000000000..3b725c41c5a527a3a3e40097077d0e206a681247 GIT binary patch literal 142 zcmeAS@N?(olHy`uVBq!ia0vp^j6kfy!2~3aiye;!QlXwMjv*C{Z|8b*H5dputLHD# z=<0|*y7z(Vor?d;H&?EG&cXR}?!j-Lm&u1OOI7AIF5&c)RFE;&p0MYK>*Kl@eiymD r@|NpwKX@^z+;{u_Z~trSBfrMKa%3`zocFjEXaR$#tDnm{r-UW|TZ1%4 literal 0 HcmV?d00001 diff --git a/v0.4.6/tab_ad.png b/v0.4.6/tab_ad.png new file mode 100644 index 0000000000000000000000000000000000000000..e34850acfc24be58da6d2fd1ccc6b29cc84fe34d GIT binary patch literal 135 zcmeAS@N?(olHy`uVBq!ia0vp^j6kfy!2~3aiye;!QhuH;jv*C{Z|5d*H3V=pKi{In zd2jxLclDRPylmD}^l7{QOtL{vUjO{-WqItb5sQp2h-99b8^^Scr-=2mblCdZuUm?4 jzOJvgvt3{(cjKLW5(A@0qPS@<&}0TrS3j3^P6y&q2{!U5bk+Tso_B!YCpDh>v z{CM*1U8YvQRyBUHt^Ju0W_sq-?;9@_4equ-bavTs=gk796zopr0EBT&m;e9( literal 0 HcmV?d00001 diff --git a/v0.4.6/tab_s.png b/v0.4.6/tab_s.png new file mode 100644 index 0000000000000000000000000000000000000000..ab478c95b67371d700a20869f7de1ddd73522d50 GIT binary patch literal 184 zcmeAS@N?(olHy`uVBq!ia0vp^j6kfy!2~3aiye;!QuUrLjv*C{Z|^p8HaRdjTwH7) zC?wLlL}}I{)n%R&r+1}IGmDnq;&J#%V6)9VsYhS`O^BVBQlxOUep0c$RENLq#g8A$ z)z7%K_bI&n@J+X_=x}fJoEKed-$<>=ZI-;YrdjIl`U`uzuDWSP?o#Dmo{%SgM#oan kX~E1%D-|#H#QbHoIja2U-MgvsK&LQxy85}Sb4q9e0Efg%P5=M^ literal 0 HcmV?d00001 diff --git a/v0.4.6/tab_sd.png b/v0.4.6/tab_sd.png new file mode 100644 index 0000000000000000000000000000000000000000..757a565ced4730f85c833fb2547d8e199ae68f19 GIT binary patch literal 188 zcmeAS@N?(olHy`uVBq!ia0vp^j6kfy!2~3aiye;!Qq7(&jv*C{Z|_!fH5o7*c=%9% zcILh!EA=pAQKdx-Cdiev=v{eg{8Ht<{e8_NAN~b=)%W>-WDCE0PyDHGemi$BoXwcK z{>e9^za6*c1ilttWw&V+U;WCPlV9{LdC~Ey%_H(qj`xgfES(4Yz5jSTZfCt`4E$0YRsR*S^mTCR^;V&sxC8{l_Cp7w8-YPgg&ebxsLQ00$vXK>z>% literal 0 HcmV?d00001 diff --git a/v0.4.6/tabs.css b/v0.4.6/tabs.css new file mode 100644 index 00000000..6c21d61c --- /dev/null +++ b/v0.4.6/tabs.css @@ -0,0 +1 @@ +.sm{position:relative;z-index:9999}.sm,.sm ul,.sm li{display:block;list-style:none;margin:0;padding:0;line-height:normal;direction:ltr;text-align:left;-webkit-tap-highlight-color:rgba(0,0,0,0)}.sm-rtl,.sm-rtl ul,.sm-rtl li{direction:rtl;text-align:right}.sm>li>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.main-menu-btn{position:relative;display:inline-block;width:36px;height:36px;text-indent:36px;margin-left:8px;white-space:nowrap;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0)}.main-menu-btn-icon,.main-menu-btn-icon:before,.main-menu-btn-icon:after{position:absolute;top:50%;left:2px;height:2px;width:24px;background:#364D7C;-webkit-transition:all .25s;transition:all .25s}.main-menu-btn-icon:before{content:'';top:-7px;left:0}.main-menu-btn-icon:after{content:'';top:7px;left:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon{height:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:before{top:0;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:after{top:0;-webkit-transform:rotate(45deg);transform:rotate(45deg)}#main-menu-state{position:absolute;width:1px;height:1px;margin:-1px;border:0;padding:0;overflow:hidden;clip:rect(1px,1px,1px,1px)}#main-menu-state:not(:checked) ~ #main-menu{display:none}#main-menu-state:checked ~ #main-menu{display:block}@media(min-width:768px){.main-menu-btn{position:absolute;top:-99999px}#main-menu-state:not(:checked) ~ #main-menu{display:block}}.sm-dox{background-image:url('tab_b.png')}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0 12px;padding-right:43px;font-family:'Lucida Grande',Geneva,Helvetica,Arial,sans-serif;font-size:13px;font-weight:bold;line-height:36px;text-decoration:none;text-shadow:0px 1px 1px rgba(255, 255, 255, 0.9);color:#283A5D;outline:0}.sm-dox a:hover{background-image:url('tab_a.png');background-repeat:repeat-x;color:white;text-shadow:0px 1px 1px rgba(0, 0, 0, 1.0)}.sm-dox a.current{color:#d23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace !important;text-align:center;text-shadow:none;background:rgba(255, 255, 255, 0.5);-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox a span.sub-arrow:before{display:block;content:'+'}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{-moz-border-radius:5px 5px 0 0;-webkit-border-radius:5px;border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{-moz-border-radius:0 0 5px 5px;-webkit-border-radius:0;border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox ul{background:white}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:white;background-image:none}.sm-dox ul a:hover{background-image:url('tab_a.png');background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media(min-width:768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-image:url('tab_b.png');line-height:36px}.sm-dox a span.sub-arrow{top:50%;margin-top:-2px;right:12px;width:0;height:0;border-width:4px;border-style:solid dashed dashed dashed;border-color:#283A5D transparent transparent transparent;background:transparent;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0 12px;background-image:url('tab_s.png');background-repeat:no-repeat;background-position:right;-moz-border-radius:0 !important;-webkit-border-radius:0;border-radius:0 !important}.sm-dox a:hover{background-image:url('tab_a.png');background-repeat:repeat-x;color:white;text-shadow:0px 1px 1px rgba(0, 0, 0, 1.0)}.sm-dox a:hover span.sub-arrow{border-color:white transparent transparent transparent}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent white transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:white;-moz-border-radius:5px !important;-webkit-border-radius:5px;border-radius:5px !important;-moz-box-shadow:0 5px 9px rgba(0,0,0,0.2);-webkit-box-shadow:0 5px 9px rgba(0,0,0,0.2);box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent #555555;border-style:dashed dashed dashed solid}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:#555555;background-image:none;border:0 !important}.sm-dox ul a:hover{background-image:url('tab_a.png');background-repeat:repeat-x;color:white;text-shadow:0px 1px 1px rgba(0, 0, 0, 1.0)}.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent white}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:white;height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #d23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#d23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent #555555 transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:#555555 transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:12px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:12px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px !important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a.disabled{background-image:url('tab_b.png')}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:white}} \ No newline at end of file diff --git a/v0.4.6/transformers_8py.html b/v0.4.6/transformers_8py.html new file mode 100644 index 00000000..569d3ebd --- /dev/null +++ b/v0.4.6/transformers_8py.html @@ -0,0 +1,170 @@ + + + + + + + + +Formatron: src/formatron/integrations/transformers.py File Reference + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    transformers.py File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Classes

    class  formatron.integrations.transformers.FormattersLogitsProcessor
     Logit processor that uses formatters to mask batch logits. More...
     
    + + + + + + + + + +

    +Namespaces

    namespace  formatron
     
    namespace  formatron.integrations
     This subpackage contains integrations with other frameworks and libraries.
     
    namespace  formatron.integrations.transformers
     This module integrates the transformers library by providing convenience utilities.
     
    + + + + + + + + + + +

    +Functions

    kbnf.Vocabulary formatron.integrations.transformers.create_engine_vocabulary (PreTrainedTokenizerBase tokenizer)
     Create a vocabulary for the KBNF engine.
     
    LogitsProcessor formatron.integrations.transformers.create_formatter_logits_processor (PreTrainedTokenizerBase tokenizer, typing.Sequence[FormatterBuilder|None]|FormatterBuilder formatter_builders, typing.Sequence[EngineGenerationConfig] configs=None)
     Create a formatter logits processor.
     
    LogitsProcessorList formatron.integrations.transformers.create_formatter_logits_processor_list (PreTrainedTokenizerBase tokenizer, typing.Sequence[FormatterBuilder|None]|FormatterBuilder formatter_builders, typing.Sequence[EngineGenerationConfig] configs=None)
     Create a formatter logits processor list.
     
    +
    +
    + + + + diff --git a/v0.4.6/transformers_8py.js b/v0.4.6/transformers_8py.js new file mode 100644 index 00000000..b50fe601 --- /dev/null +++ b/v0.4.6/transformers_8py.js @@ -0,0 +1,7 @@ +var transformers_8py = +[ + [ "formatron.integrations.transformers.FormattersLogitsProcessor", "classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor.html", "classformatron_1_1integrations_1_1transformers_1_1FormattersLogitsProcessor" ], + [ "create_engine_vocabulary", "transformers_8py.html#a1e2bb52e2c35fb3592fbc9fcff06f41a", null ], + [ "create_formatter_logits_processor", "transformers_8py.html#af8d1673116b56d3651e2e79934356a01", null ], + [ "create_formatter_logits_processor_list", "transformers_8py.html#a4036de8ad72188b3558f8e5a0fd289f4", null ] +]; \ No newline at end of file diff --git a/v0.4.6/transformers_8py_source.html b/v0.4.6/transformers_8py_source.html new file mode 100644 index 00000000..b371fd6d --- /dev/null +++ b/v0.4.6/transformers_8py_source.html @@ -0,0 +1,287 @@ + + + + + + + + +Formatron: src/formatron/integrations/transformers.py Source File + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    transformers.py
    +
    +
    +Go to the documentation of this file.
    1"""
    +
    2This module integrates the transformers library by providing convenience utilities.
    +
    3"""
    +
    4import collections
    +
    5import typing
    +
    6
    +
    7import kbnf
    +
    8from transformers import LogitsProcessor, PreTrainedTokenizerBase, LogitsProcessorList
    +
    9
    +
    10from formatron.config import EngineGenerationConfig
    +
    11from formatron.formatter import FormatterBuilder, FormatterBase
    +
    12from formatron.integrations._utils import get_original_characters
    +
    13
    +
    14
    +
    15def create_engine_vocabulary(tokenizer: PreTrainedTokenizerBase) -> kbnf.Vocabulary:
    +
    16 """
    +
    17 Create a vocabulary for the KBNF engine.
    +
    18 """
    +
    +
    19 vocab = tokenizer.get_vocab()
    +
    20 new_vocab = get_original_characters(vocab)
    +
    21 return kbnf.Vocabulary({k: kbnf.Token(v) for k, v in new_vocab.items()},
    +
    22 {v: k for k, v in vocab.items()})
    +
    23
    +
    24
    +
    25def create_formatter_logits_processor(tokenizer: PreTrainedTokenizerBase,
    +
    +
    26 formatter_builders: typing.Sequence[FormatterBuilder | None] | FormatterBuilder,
    +
    27 configs: typing.Sequence[EngineGenerationConfig] = None) -> LogitsProcessor:
    +
    28 """
    +
    +
    29 Create a formatter logits processor.
    +
    30 """
    +
    31 vocab = create_engine_vocabulary(tokenizer)
    +
    32 if not isinstance(formatter_builders, collections.abc.Sequence):
    +
    33 formatter_builders = [formatter_builders]
    +
    34 formatters = [i.build(vocab, lambda tokens: tokenizer.decode(tokens)) if i is not None else None
    +
    35 for i in formatter_builders]
    +
    36 return FormattersLogitsProcessor(formatters, tokenizer.eos_token_id, configs)
    +
    37
    +
    38
    +
    39def create_formatter_logits_processor_list(tokenizer: PreTrainedTokenizerBase,
    +
    +
    40 formatter_builders: typing.Sequence[FormatterBuilder | None] | FormatterBuilder,
    +
    41 configs: typing.Sequence[EngineGenerationConfig] = None) \
    +
    42 -> LogitsProcessorList:
    +
    +
    43 """
    +
    44 Create a formatter logits processor list.
    +
    45 """
    +
    46 return LogitsProcessorList([create_formatter_logits_processor(tokenizer,
    +
    47 formatter_builders, configs)])
    +
    48
    +
    49
    +
    50class FormattersLogitsProcessor(LogitsProcessor):
    +
    +
    51 """
    +
    52 Logit processor that uses formatters to mask batch logits.
    +
    53 """
    +
    + +
    55 def __init__(self, formatters: typing.Sequence[FormatterBase | None], eos_token_id: int,
    +
    +
    56 configs: typing.Sequence[EngineGenerationConfig] | None = None):
    +
    57 self._formatters = formatters
    +
    58 self._eos_token_id = eos_token_id
    + +
    60 if configs is None:
    +
    61 configs = [EngineGenerationConfig() for _ in formatters]
    +
    62 assert len(configs) == len(formatters), \
    +
    63 f"Number of formatters({len(formatters)}) must match number of configs({len(configs)})"
    +
    64 self.configs = configs
    + +
    66 def reset(self) -> None:
    +
    +
    + +
    68 for f in self._formatters:
    +
    69 if f is not None:
    +
    70 f.reset()
    +
    71
    +
    72 @property
    +
    +
    73 def formatters_captures(self) -> list[dict[str, typing.Any] | None]:
    +
    74 """
    +
    75 Get the captures of the formatters. Each element in the list corresponds to the
    +
    76 captures of the formatter at the same index. If the formatter is None, the element
    +
    77 is None.
    +
    78 """
    +
    79 return [f.captures if f is not None else None for f in self._formatters]
    +
    80
    +
    81 def is_completed(self) -> list[bool | None]:
    +
    82 """
    +
    83 Check if the formatters are completed. Each boolean in the list corresponds to the
    +
    84 completion status of the formatter at the same index. If the formatter is None,
    +
    85 the element is None.
    +
    +
    86 """
    +
    87 return [f.is_completed() if f is not None else None for f in self._formatters]
    +
    88
    +
    +
    89 def __call__(self, input_ids, scores):
    +
    90 assert input_ids.shape[0] == len(self._formatters), (f"Number of formatters({len(self._formatters)})"
    +
    91 f" must match batch size({input_ids.shape[0]})")
    +
    92 if self._last_input_id_length is None: # First iteration
    +
    93 self._last_input_id_length = input_ids.shape[1]
    +
    94 for formatter, config, prompt in zip(self._formatters, self.configs, input_ids):
    +
    95 if formatter is None:
    +
    +
    96 continue
    +
    97 if config.reset_at_beginning:
    +
    98 formatter.reset()
    +
    +
    +
    99 if config.read_prompt:
    +
    100 for token in prompt:
    +
    101 formatter.accept_token(token)
    +
    102 else:
    +
    103 assert input_ids.shape[1] == self._last_input_id_length + 1, ("One iteration in generation loop"
    +
    104 " must add exactly one token.")
    +
    105 self._last_input_id_length += 1
    +
    106 for formatter, input_id in zip(self._formatters, input_ids[:, -1]):
    +
    107 if formatter is not None and not formatter.is_completed():
    +
    108 formatter.accept_token(input_id)
    +
    109 for i, formatter in enumerate(self._formatters):
    +
    110 if formatter is None:
    +
    111 continue
    +
    112 if formatter.is_completed():
    +
    113 scores[i, :] = float("-inf")
    +
    114 scores[i, self._eos_token_id] = 0.0
    +
    115 continue
    +
    116 formatter.compute_allowed_tokens()
    +
    117 scores[i, :] = formatter.mask_logits(scores[i, :])
    +
    118 return scores
    +
    +
    +
    Configuration for how an KBNF engine should be used in text generation.
    Definition config.py:14
    +
    Logit processor that uses formatters to mask batch logits.
    +
    list[bool|None] is_completed(self)
    Check if the formatters are completed.
    +
    list[dict[str, typing.Any]|None] formatters_captures(self)
    Get the captures of the formatters.
    + + + + + +
    __init__(self, typing.Sequence[FormatterBase|None] formatters, int eos_token_id, typing.Sequence[EngineGenerationConfig]|None configs=None)
    + +
    Configuration classes for Formatron.
    Definition config.py:1
    +
    This module contains the Formatter class and its related classes.
    Definition formatter.py:1
    + +
    kbnf.Vocabulary create_engine_vocabulary(PreTrainedTokenizerBase tokenizer)
    Create a vocabulary for the KBNF engine.
    +
    LogitsProcessorList create_formatter_logits_processor_list(PreTrainedTokenizerBase tokenizer, typing.Sequence[FormatterBuilder|None]|FormatterBuilder formatter_builders, typing.Sequence[EngineGenerationConfig] configs=None)
    Create a formatter logits processor list.
    +
    LogitsProcessor create_formatter_logits_processor(PreTrainedTokenizerBase tokenizer, typing.Sequence[FormatterBuilder|None]|FormatterBuilder formatter_builders, typing.Sequence[EngineGenerationConfig] configs=None)
    Create a formatter logits processor.
    +
    +
    + + + + diff --git a/v0.4.6/vllm_8py.html b/v0.4.6/vllm_8py.html new file mode 100644 index 00000000..2bc93150 --- /dev/null +++ b/v0.4.6/vllm_8py.html @@ -0,0 +1,167 @@ + + + + + + + + +Formatron: src/formatron/integrations/vllm.py File Reference + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    vllm.py File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Classes

    class  formatron.integrations.vllm.FormattersLogitsProcessor
     Logit processor that uses formatters to mask batch logits. More...
     
    + + + + + + + + + +

    +Namespaces

    namespace  formatron
     
    namespace  formatron.integrations
     This subpackage contains integrations with other frameworks and libraries.
     
    namespace  formatron.integrations.vllm
     This module integrates the vllm library by providing convenience utilities.
     
    + + + + + + + +

    +Functions

    kbnf.Vocabulary formatron.integrations.vllm.create_engine_vocabulary (LLM llm)
     Create a vocabulary for the KBNF engine.
     
    FormattersLogitsProcessor formatron.integrations.vllm.create_formatters_logits_processor (LLM llm, typing.Sequence[FormatterBuilder|None]|FormatterBuilder formatter_builders, typing.Sequence[EngineGenerationConfig] configs=None)
     Create a formatter logits processor.
     
    +
    +
    + + + + diff --git a/v0.4.6/vllm_8py.js b/v0.4.6/vllm_8py.js new file mode 100644 index 00000000..23b5a788 --- /dev/null +++ b/v0.4.6/vllm_8py.js @@ -0,0 +1,6 @@ +var vllm_8py = +[ + [ "formatron.integrations.vllm.FormattersLogitsProcessor", "classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor.html", "classformatron_1_1integrations_1_1vllm_1_1FormattersLogitsProcessor" ], + [ "create_engine_vocabulary", "vllm_8py.html#acec47a067c2396265f1d7a941b0a7ab3", null ], + [ "create_formatters_logits_processor", "vllm_8py.html#a995ec0f6519cf5b67bcc52d411653a26", null ] +]; \ No newline at end of file diff --git a/v0.4.6/vllm_8py_source.html b/v0.4.6/vllm_8py_source.html new file mode 100644 index 00000000..47377162 --- /dev/null +++ b/v0.4.6/vllm_8py_source.html @@ -0,0 +1,295 @@ + + + + + + + + +Formatron: src/formatron/integrations/vllm.py Source File + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Formatron v0.4.6 + + +
    +
    Formatron empowers everyone to control the output format of language models with minimal overhead.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    vllm.py
    +
    +
    +Go to the documentation of this file.
    1"""
    +
    2This module integrates the vllm library by providing convenience utilities.
    +
    3"""
    +
    4import collections.abc
    +
    5import time
    +
    6import typing
    +
    7import kbnf
    +
    8import torch
    +
    9from vllm import LLM
    +
    10from formatron.config import EngineGenerationConfig
    +
    11from formatron.formatter import FormatterBase, FormatterBuilder
    +
    12from formatron.integrations._utils import get_original_characters
    +
    13
    +
    14
    + +
    16 """
    +
    17 Logit processor that uses formatters to mask batch logits.
    +
    18 """
    +
    + +
    20 def __init__(self, formatters: typing.Sequence[FormatterBase | None], eos_token_id: int,
    +
    +
    21 configs: typing.Sequence[EngineGenerationConfig] | None = None):
    +
    22 self._formatters = formatters
    +
    23 self._eos_token_id = eos_token_id
    + +
    25 if configs is None:
    +
    26 configs = [EngineGenerationConfig() for _ in formatters]
    +
    27 assert len(configs) == len(formatters), \
    +
    28 f"Number of formatters({len(formatters)}) must match number of configs({len(configs)})"
    +
    29 self._configs = configs
    +
    30 self._iter = zip(self._formatters, self._configs)
    + + +
    33 @property
    +
    +
    34 def formatters_captures(self) -> list[dict[str, typing.Any] | None]:
    +
    35 return [f.captures if f is not None else None for f in self._formatters]
    +
    36
    +
    37 def is_completed(self) -> list[bool | None]:
    +
    38 """
    +
    39 Check if the formatters are completed. Each boolean in the list corresponds to the
    +
    40 completion status of the formatter at the same index.
    +
    41 """
    +
    +
    42 return [f.is_completed() if f is not None else None for f in self._formatters]
    +
    43
    +
    44 def reset(self) -> None:
    +
    +
    45 for f in self._formatters:
    +
    46 if f is not None:
    +
    47 f.reset()
    + + +
    50
    +
    + +
    52 self._iter = zip(self._formatters, self._configs)
    +
    53 self._debug_counter = 0
    +
    +
    + +
    55 def __call__(self, prompt, generated_tokens, logits):
    +
    56 result = next(self._iter, None)
    +
    57 if result is None and len(generated_tokens) == self._last_input_id_length:
    +
    58 # We exhausted all formatters but still have sequences to process in this batch
    +
    59 raise ValueError(f"Batch size {self._debug_counter} "
    +
    60 f"is greater than number of formatters({len(self._formatters)})!")
    +
    +
    +
    61 if len(generated_tokens) == 0: # First iteration
    +
    62 self._debug_counter += 1
    +
    63 formatter, config = result
    +
    64 if formatter is None:
    +
    +
    +
    65 return logits
    +
    66 if config.reset_at_beginning and formatter.is_completed():
    +
    67 formatter.reset()
    +
    68 if config.read_prompt:
    +
    69 for token in prompt:
    +
    70 formatter.accept_token(token)
    +
    71 elif len(generated_tokens) == self._last_input_id_length + 1: # to next batch step
    +
    72 assert result is None, (f"Batch size {self._debug_counter} "
    +
    73 f"is less than number of formatters({len(self._formatters)})!")
    + +
    75 result = next(self._iter)
    +
    76 self._last_input_id_length += 1
    +
    77 formatter, _ = result
    +
    78 if formatter is None:
    +
    79 return logits
    +
    80 while formatter.is_completed():
    +
    81 if generated_tokens[-1] == self._eos_token_id:
    +
    82 return logits
    +
    83 formatter, _ = next(self._iter)
    +
    84 if formatter is None:
    +
    85 return logits
    +
    86 if len(generated_tokens) != 0: # accept new token
    +
    87 input_id = generated_tokens[-1]
    +
    88 if not formatter.is_completed():
    +
    89 formatter.accept_token(input_id)
    +
    90
    +
    91 if formatter.is_completed():
    +
    92 logits[:] = float("-inf")
    +
    93 logits[self._eos_token_id] = 1000
    +
    94 return logits
    +
    95 formatter.compute_allowed_tokens()
    +
    96 logits = formatter.mask_logits(logits)
    +
    97 return logits
    +
    98
    +
    99
    +
    100def create_engine_vocabulary(llm: LLM) -> kbnf.Vocabulary:
    +
    101 """
    +
    102 Create a vocabulary for the KBNF engine.
    +
    103 """
    +
    104 tokenizer = llm.get_tokenizer()
    +
    105 vocab = tokenizer.get_vocab()
    +
    106 new_vocab = get_original_characters(vocab)
    +
    107 return kbnf.Vocabulary({k: kbnf.Token(v) for k, v in new_vocab.items()}, {
    +
    108 v: k for k, v in vocab.items()})
    +
    109
    +
    +
    +
    110
    + +
    112 formatter_builders: typing.Sequence[FormatterBuilder | None] | FormatterBuilder,
    +
    +
    113 configs: typing.Sequence[EngineGenerationConfig] = None) \
    +
    114 -> FormattersLogitsProcessor:
    +
    115 """
    +
    116 Create a formatter logits processor.
    +
    117 """
    +
    118 tokenizer = llm.get_tokenizer()
    +
    119 vocab = create_engine_vocabulary(llm)
    +
    120 if not isinstance(formatter_builders, collections.abc.Sequence):
    +
    +
    121 formatter_builders = [formatter_builders]
    +
    122 formatters = [i.build(vocab, lambda tokens: tokenizer.decode(tokens)) if i is not None else None
    +
    123 for i in formatter_builders]
    +
    +
    124 return FormattersLogitsProcessor(formatters, tokenizer.eos_token_id, configs)
    +
    +
    Configuration for how an KBNF engine should be used in text generation.
    Definition config.py:14
    +
    Logit processor that uses formatters to mask batch logits.
    Definition vllm.py:19
    +
    __init__(self, typing.Sequence[FormatterBase|None] formatters, int eos_token_id, typing.Sequence[EngineGenerationConfig]|None configs=None)
    Definition vllm.py:22
    + + + + + + +
    __call__(self, prompt, generated_tokens, logits)
    Definition vllm.py:65
    +
    list[bool|None] is_completed(self)
    Check if the formatters are completed.
    Definition vllm.py:51
    + +
    list[dict[str, typing.Any]|None] formatters_captures(self)
    Definition vllm.py:42
    + +
    Configuration classes for Formatron.
    Definition config.py:1
    +
    This module contains the Formatter class and its related classes.
    Definition formatter.py:1
    + +
    FormattersLogitsProcessor create_formatters_logits_processor(LLM llm, typing.Sequence[FormatterBuilder|None]|FormatterBuilder formatter_builders, typing.Sequence[EngineGenerationConfig] configs=None)
    Create a formatter logits processor.
    Definition vllm.py:127
    +
    kbnf.Vocabulary create_engine_vocabulary(LLM llm)
    Create a vocabulary for the KBNF engine.
    Definition vllm.py:113
    +
    +
    + + + +