-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to config JsonSchemaParser heuristics via environment var…
…iables / config objects (#97) * Added configuration options that can be controlled via env vars - max consecutive whitespaces and force json order * Added documentation on how to use env var / configuration objects * More documentation * Whitespace cleanup
- Loading branch information
Showing
8 changed files
with
116 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,15 @@ | ||
COMPLETE_ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()_+-=[]{};:,./<>? `'\"" | ||
MAX_CONSECUTIVE_WHITESPACES = 12 | ||
DEFAULT_MAX_CONSECUTIVE_WHITESPACES = 12 | ||
DEFAULT_FORCE_JSON_FIELD_ORDER = False | ||
WHITESPACE_CHARACTERS = " \t\n\r" | ||
BACKSLASH = "\\" | ||
BACKSLASH_ESCAPING_CHARACTERS = '"\\/bfnrt' # Characters allowed after an escaping backslash, except unicode | ||
BACKSLACH_UNICODE_ESCAPE = "u" | ||
|
||
CONFIG_ENV_VAR_MAX_CONSECUTIVE_WHITESPACES = 'LMFE_MAX_CONSECUTIVE_WHITESPACES' | ||
"""Environment variable for externally controlling how many consective whitespaces the | ||
JsonSchemaParser will allow. Default: 12""" | ||
|
||
CONFIG_ENV_VAR_LMFE_FORCE_JSON_FIELD_ORDER = 'LMFE_FORCE_JSON_FIELD_ORDER' | ||
"""Environment variable for externally controlling whether the JsonSchemaParser will force | ||
fields to appear in the order of the 'required' field in the schema. Default: false""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "lm-format-enforcer" | ||
version = "0.9.10" | ||
version = "0.10.1" | ||
description = "Enforce the output format (JSON Schema, Regex etc) of a language model" | ||
authors = ["Noam Gat <[email protected]>"] | ||
license = "MIT" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters