diff --git a/llm/cli.py b/llm/cli.py index ebf57d0..4f1fc4f 100644 --- a/llm/cli.py +++ b/llm/cli.py @@ -379,6 +379,7 @@ def prompt( to_save, indent=4, default_flow_style=False, + sort_keys=False, ), "utf-8", ) diff --git a/tests/test_templates.py b/tests/test_templates.py index 381fb42..1abb8ef 100644 --- a/tests/test_templates.py +++ b/tests/test_templates.py @@ -97,10 +97,17 @@ def test_templates_list(templates_path, args): {"system": "write python", "extract": True}, None, ), - # So should schemas + # So should schemas (and should not sort properties) ( - ["--schema", '{"properties": {"name": {"type": "string"}}}'], - {"schema_object": {"properties": {"name": {"type": "string"}}}}, + [ + "--schema", + '{"properties": {"b": {"type": "string"}, "a": {"type": "string"}}}', + ], + { + "schema_object": { + "properties": {"b": {"type": "string"}, "a": {"type": "string"}} + } + }, None, ), ),