kiln-ai 0.5.5__py3-none-any.whl → 0.6.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of kiln-ai might be problematic. Click here for more details.
- kiln_ai/adapters/__init__.py +9 -1
- kiln_ai/adapters/base_adapter.py +24 -35
- kiln_ai/adapters/data_gen/__init__.py +11 -0
- kiln_ai/adapters/data_gen/data_gen_prompts.py +73 -0
- kiln_ai/adapters/data_gen/data_gen_task.py +185 -0
- kiln_ai/adapters/data_gen/test_data_gen_task.py +293 -0
- kiln_ai/adapters/langchain_adapters.py +39 -7
- kiln_ai/adapters/ml_model_list.py +55 -1
- kiln_ai/adapters/prompt_builders.py +66 -0
- kiln_ai/adapters/repair/test_repair_task.py +4 -1
- kiln_ai/adapters/test_langchain_adapter.py +73 -0
- kiln_ai/adapters/test_ml_model_list.py +56 -0
- kiln_ai/adapters/test_prompt_adaptors.py +52 -18
- kiln_ai/adapters/test_prompt_builders.py +97 -7
- kiln_ai/adapters/test_saving_adapter_results.py +16 -6
- kiln_ai/adapters/test_structured_output.py +33 -5
- kiln_ai/datamodel/__init__.py +28 -7
- kiln_ai/datamodel/json_schema.py +1 -0
- kiln_ai/datamodel/test_models.py +44 -8
- kiln_ai/utils/config.py +3 -2
- kiln_ai/utils/test_config.py +7 -0
- {kiln_ai-0.5.5.dist-info → kiln_ai-0.6.1.dist-info}/METADATA +1 -2
- kiln_ai-0.6.1.dist-info/RECORD +37 -0
- {kiln_ai-0.5.5.dist-info → kiln_ai-0.6.1.dist-info}/WHEEL +1 -1
- kiln_ai-0.5.5.dist-info/RECORD +0 -33
- {kiln_ai-0.5.5.dist-info → kiln_ai-0.6.1.dist-info}/licenses/LICENSE.txt +0 -0
kiln_ai/datamodel/test_models.py
CHANGED
|
@@ -3,7 +3,14 @@ import json
|
|
|
3
3
|
import pytest
|
|
4
4
|
from pydantic import ValidationError
|
|
5
5
|
|
|
6
|
-
from kiln_ai.datamodel import
|
|
6
|
+
from kiln_ai.datamodel import (
|
|
7
|
+
DataSource,
|
|
8
|
+
DataSourceType,
|
|
9
|
+
Project,
|
|
10
|
+
Task,
|
|
11
|
+
TaskOutput,
|
|
12
|
+
TaskRun,
|
|
13
|
+
)
|
|
7
14
|
from kiln_ai.datamodel.test_json_schema import json_joke_schema
|
|
8
15
|
|
|
9
16
|
|
|
@@ -62,9 +69,7 @@ def test_save_to_file(test_project_file):
|
|
|
62
69
|
|
|
63
70
|
def test_task_defaults():
|
|
64
71
|
task = Task(name="Test Task", instruction="Test Instruction")
|
|
65
|
-
assert task.description
|
|
66
|
-
assert task.priority == Priority.p2
|
|
67
|
-
assert task.determinism == TaskDeterminism.flexible
|
|
72
|
+
assert task.description is None
|
|
68
73
|
|
|
69
74
|
|
|
70
75
|
def test_task_serialization(test_project_file):
|
|
@@ -73,9 +78,8 @@ def test_task_serialization(test_project_file):
|
|
|
73
78
|
parent=project,
|
|
74
79
|
name="Test Task",
|
|
75
80
|
description="Test Description",
|
|
76
|
-
determinism=TaskDeterminism.semantic_match,
|
|
77
|
-
priority=Priority.p0,
|
|
78
81
|
instruction="Test Base Task Instruction",
|
|
82
|
+
thinking_instruction="Test Thinking Instruction",
|
|
79
83
|
)
|
|
80
84
|
|
|
81
85
|
task.save_to_file()
|
|
@@ -84,8 +88,7 @@ def test_task_serialization(test_project_file):
|
|
|
84
88
|
assert parsed_task.name == "Test Task"
|
|
85
89
|
assert parsed_task.description == "Test Description"
|
|
86
90
|
assert parsed_task.instruction == "Test Base Task Instruction"
|
|
87
|
-
assert parsed_task.
|
|
88
|
-
assert parsed_task.priority == Priority.p0
|
|
91
|
+
assert parsed_task.thinking_instruction == "Test Thinking Instruction"
|
|
89
92
|
|
|
90
93
|
|
|
91
94
|
def test_save_to_file_without_path():
|
|
@@ -189,3 +192,36 @@ def test_task_output_schema(tmp_path):
|
|
|
189
192
|
task = Task(name="Test Task", output_json_schema="{'asdf':{}}", path=path)
|
|
190
193
|
with pytest.raises(ValidationError):
|
|
191
194
|
task = Task(name="Test Task", input_json_schema="{asdf", path=path)
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
def test_task_run_intermediate_outputs():
|
|
198
|
+
# Create a basic task output
|
|
199
|
+
output = TaskOutput(
|
|
200
|
+
output="test output",
|
|
201
|
+
source=DataSource(
|
|
202
|
+
type=DataSourceType.synthetic,
|
|
203
|
+
properties={
|
|
204
|
+
"model_name": "test-model",
|
|
205
|
+
"model_provider": "test-provider",
|
|
206
|
+
"adapter_name": "test-adapter",
|
|
207
|
+
},
|
|
208
|
+
),
|
|
209
|
+
)
|
|
210
|
+
|
|
211
|
+
# Test valid intermediate outputs
|
|
212
|
+
task_run = TaskRun(
|
|
213
|
+
input="test input",
|
|
214
|
+
input_source=DataSource(
|
|
215
|
+
type=DataSourceType.human,
|
|
216
|
+
properties={"created_by": "test-user"},
|
|
217
|
+
),
|
|
218
|
+
output=output,
|
|
219
|
+
intermediate_outputs={
|
|
220
|
+
"cot": "chain of thought output",
|
|
221
|
+
"draft": "draft output",
|
|
222
|
+
},
|
|
223
|
+
)
|
|
224
|
+
assert task_run.intermediate_outputs == {
|
|
225
|
+
"cot": "chain of thought output",
|
|
226
|
+
"draft": "draft output",
|
|
227
|
+
}
|
kiln_ai/utils/config.py
CHANGED
|
@@ -97,7 +97,8 @@ class Config:
|
|
|
97
97
|
|
|
98
98
|
# Check if the value is in settings
|
|
99
99
|
if name in self._settings:
|
|
100
|
-
|
|
100
|
+
value = self._settings[name]
|
|
101
|
+
return value if value is None else property_config.type(value)
|
|
101
102
|
|
|
102
103
|
# Check environment variable
|
|
103
104
|
if property_config.env_var and property_config.env_var in os.environ:
|
|
@@ -110,7 +111,7 @@ class Config:
|
|
|
110
111
|
else:
|
|
111
112
|
value = property_config.default
|
|
112
113
|
|
|
113
|
-
return property_config.type(value)
|
|
114
|
+
return None if value is None else property_config.type(value)
|
|
114
115
|
|
|
115
116
|
def __setattr__(self, name, value):
|
|
116
117
|
if name in ("_properties", "_settings"):
|
kiln_ai/utils/test_config.py
CHANGED
|
@@ -26,6 +26,7 @@ def config_with_yaml(mock_yaml_file):
|
|
|
26
26
|
str, default="default_value", env_var="EXAMPLE_PROPERTY"
|
|
27
27
|
),
|
|
28
28
|
"int_property": ConfigProperty(int, default=0),
|
|
29
|
+
"empty_property": ConfigProperty(str),
|
|
29
30
|
}
|
|
30
31
|
)
|
|
31
32
|
|
|
@@ -67,6 +68,12 @@ def test_nonexistent_property(config_with_yaml):
|
|
|
67
68
|
config.nonexistent_property
|
|
68
69
|
|
|
69
70
|
|
|
71
|
+
def test_nonexistent_property_get_value(config_with_yaml):
|
|
72
|
+
config = config_with_yaml
|
|
73
|
+
assert config.get_value("nonexistent_property") is None
|
|
74
|
+
assert config.get_value("empty_property") is None
|
|
75
|
+
|
|
76
|
+
|
|
70
77
|
def test_property_type_conversion(config_with_yaml):
|
|
71
78
|
config = config_with_yaml
|
|
72
79
|
config = Config(properties={"int_property": ConfigProperty(int, default="42")})
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: kiln-ai
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.1
|
|
4
4
|
Summary: Kiln AI
|
|
5
5
|
Project-URL: Homepage, https://getkiln.ai
|
|
6
6
|
Project-URL: Repository, https://github.com/Kiln-AI/kiln
|
|
7
7
|
Project-URL: Documentation, https://kiln-ai.github.io/Kiln/kiln_core_docs/kiln_ai.html
|
|
8
8
|
Project-URL: Issues, https://github.com/Kiln-AI/kiln/issues
|
|
9
9
|
Author-email: "Steve Cosman, Chesterfield Laboratories Inc" <scosman@users.noreply.github.com>
|
|
10
|
-
License-File: LICENSE.txt
|
|
11
10
|
Classifier: Intended Audience :: Developers
|
|
12
11
|
Classifier: License :: OSI Approved :: MIT License
|
|
13
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
kiln_ai/__init__.py,sha256=Sc4z8LRVFMwJUoc_DPVUriSXTZ6PO9MaJ80PhRbKyB8,34
|
|
2
|
+
kiln_ai/adapters/__init__.py,sha256=o4zubg6oHEVS15rhRHiWPmrxdgr_IXwQZ4Cr_XYT7zo,938
|
|
3
|
+
kiln_ai/adapters/base_adapter.py,sha256=E_RfXxzEhW-i066xOhZdPuTM7OPKQv70hDpfMsxfYEs,6145
|
|
4
|
+
kiln_ai/adapters/langchain_adapters.py,sha256=iN26w-BTM14AtnaTU_maq57j7Lm2uKfrOlVronyHsno,6712
|
|
5
|
+
kiln_ai/adapters/ml_model_list.py,sha256=maEawe9BQ3T-2qSssbQ6tkB7mUzi0YhHP5R7uwmF6iA,26084
|
|
6
|
+
kiln_ai/adapters/prompt_builders.py,sha256=Mdu-f1mC9hWIDwoF7Qwd9F99GDx6oNGvtEZN-SrOsNM,10325
|
|
7
|
+
kiln_ai/adapters/test_langchain_adapter.py,sha256=sQU_ZDF2p022wU9eYg4QFKQva8yQvw8QRb6DoCvfywk,4703
|
|
8
|
+
kiln_ai/adapters/test_ml_model_list.py,sha256=3O0T86yLOXDF1XTc9BxdK-pYPRN0eRV_rgB_AfFCwbM,6375
|
|
9
|
+
kiln_ai/adapters/test_prompt_adaptors.py,sha256=T8ecAzQ9HMcEkxJIAKvF-Om6d0eIHT_FTIgZAJ_r9x0,7414
|
|
10
|
+
kiln_ai/adapters/test_prompt_builders.py,sha256=sU0bSBZa9Y4Q-mmkDf3HbQ0MNSWk5o9bC9sNgtnBokk,14598
|
|
11
|
+
kiln_ai/adapters/test_saving_adapter_results.py,sha256=SYYh2xY1zmeKhFHfWAuEY4pEiLd8SitSV5ewGOTmaOI,6447
|
|
12
|
+
kiln_ai/adapters/test_structured_output.py,sha256=o3w7r7pSjFxVUh4AIRflkbLRByLAG7A20M6nvdTwHkI,10035
|
|
13
|
+
kiln_ai/adapters/data_gen/__init__.py,sha256=QTZWaf7kq5BorhPvexJfwDEKmjRmIbhwW9ei8LW2SIs,276
|
|
14
|
+
kiln_ai/adapters/data_gen/data_gen_prompts.py,sha256=kudjHnAz7L3q0k_NLyTlaIV7M0uRFrxXNcfcnjOE2uc,5810
|
|
15
|
+
kiln_ai/adapters/data_gen/data_gen_task.py,sha256=vwjC47YDrsl4GtBJpK6FWh07TGd8CalhZOX4p4YBX8w,5904
|
|
16
|
+
kiln_ai/adapters/data_gen/test_data_gen_task.py,sha256=vym6qOTLeFrG54wh3qLFPH0qZtop2ZaGX8AbzlUtlp8,9429
|
|
17
|
+
kiln_ai/adapters/repair/__init__.py,sha256=dOO9MEpEhjiwzDVFg3MNfA2bKMPlax9iekDatpTkX8E,217
|
|
18
|
+
kiln_ai/adapters/repair/repair_task.py,sha256=VXvX1l9AYDE_GV0i3S_vPThltJoQlCFVCCHV9m-QA7k,3297
|
|
19
|
+
kiln_ai/adapters/repair/test_repair_task.py,sha256=kYCEIgRj_-b0AUqXokzheg7RzloWsRHWbUU_J6EQWDM,7938
|
|
20
|
+
kiln_ai/datamodel/__init__.py,sha256=bWuJnJl6whe-kTJEp9yQorzCbweEOjkHnIQHYBEARpY,15406
|
|
21
|
+
kiln_ai/datamodel/basemodel.py,sha256=lNSxZQO2isNP1JhDpc-bK6VqKWz1oY_Cc9RUT3T-Pz8,17535
|
|
22
|
+
kiln_ai/datamodel/json_schema.py,sha256=l4BIq1ItLHgcSHqsqDOchegLLHY48U4yR0SP2aMb4i0,2449
|
|
23
|
+
kiln_ai/datamodel/test_basemodel.py,sha256=679aT4UplglHtTVYmHGgT4v5uyJd7J2w8dBicZlLomk,9439
|
|
24
|
+
kiln_ai/datamodel/test_datasource.py,sha256=GAiZz31qezVVPwFqnt8wHMu15WvtlV89jw8C1Ue6YNI,3165
|
|
25
|
+
kiln_ai/datamodel/test_example_models.py,sha256=PxDtC8H3EfZem4kAQ-waFlRMlqnV4YlLEFKzz0Pq4tM,20013
|
|
26
|
+
kiln_ai/datamodel/test_json_schema.py,sha256=vdLnTQxxrcmuSrf6iOmkrmpfh7JnxqIw4B4dbDAAcZ4,3199
|
|
27
|
+
kiln_ai/datamodel/test_models.py,sha256=4VwggmkHEpTi8yHN48guVwtRUuBmDo7D_OQpA6DDXMo,6731
|
|
28
|
+
kiln_ai/datamodel/test_nested_save.py,sha256=xciCddqvPyKyoyjC5Lx_3Kh1t4LJv1xYRAPazR3SRcs,5588
|
|
29
|
+
kiln_ai/datamodel/test_output_rating.py,sha256=iw7fVUAPORA-0-VFiikZV3NDycGFaFMHSX1a38t_aQA,2647
|
|
30
|
+
kiln_ai/utils/__init__.py,sha256=PTD0MwBCKAMIOGsTAwsFaJOusTJJoRFTfOGqRvCaU-E,142
|
|
31
|
+
kiln_ai/utils/config.py,sha256=hjfshIWKLNMvNfpmgLJfermC3G6bgEgCXOSFogHG9FQ,5505
|
|
32
|
+
kiln_ai/utils/formatting.py,sha256=VtB9oag0lOGv17dwT7OPX_3HzBfaU9GsLH-iLete0yM,97
|
|
33
|
+
kiln_ai/utils/test_config.py,sha256=pTYItz5WD15rTRdxKE7vszXF_mb-dik2qrFWzkVemEY,7671
|
|
34
|
+
kiln_ai-0.6.1.dist-info/METADATA,sha256=kBG2FmTo2mz0myHGIBimYMuzv5jOYUD8qXCgT2J-zkI,2979
|
|
35
|
+
kiln_ai-0.6.1.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
36
|
+
kiln_ai-0.6.1.dist-info/licenses/LICENSE.txt,sha256=_NA5pnTYgRRr4qH6lE3X-TuZJ8iRcMUi5ASoGr-lEx8,1209
|
|
37
|
+
kiln_ai-0.6.1.dist-info/RECORD,,
|
kiln_ai-0.5.5.dist-info/RECORD
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
kiln_ai/__init__.py,sha256=Sc4z8LRVFMwJUoc_DPVUriSXTZ6PO9MaJ80PhRbKyB8,34
|
|
2
|
-
kiln_ai/adapters/__init__.py,sha256=3NC1lE_Sg1bF4IsKCoUgje2GL0IwTd1atw1BcDLI8IA,883
|
|
3
|
-
kiln_ai/adapters/base_adapter.py,sha256=xXCISAJHaPCYHad28CS0wZEUlx711FZ_6AwW4rJx4jk,6688
|
|
4
|
-
kiln_ai/adapters/langchain_adapters.py,sha256=WNxhuTdjGCsCyqmXJNLe7HJ-MzJ08yagGV-eAHPZF-E,5411
|
|
5
|
-
kiln_ai/adapters/ml_model_list.py,sha256=ueh2jUqCmgGg-jMv0exn5siOU_6p0rGeJs3jy8ZWvuE,23821
|
|
6
|
-
kiln_ai/adapters/prompt_builders.py,sha256=nfZnEr1E30ZweQhEzIP21rNrL2Or1ILajyX8gU3B7w0,7796
|
|
7
|
-
kiln_ai/adapters/test_langchain_adapter.py,sha256=_xHpVAkkoGh0PRO3BFFqvVj95SVtYZPOdFbYGYfzvQ0,1876
|
|
8
|
-
kiln_ai/adapters/test_ml_model_list.py,sha256=XHbwEFFb7WvZ6UkArqIiQ_yhS_urezHtgvJOSnaricY,4660
|
|
9
|
-
kiln_ai/adapters/test_prompt_adaptors.py,sha256=W3TeacWs5iPA3BE1OJ6VkIftrHWzXd3edBoUgFaQAek,6389
|
|
10
|
-
kiln_ai/adapters/test_prompt_builders.py,sha256=WmTR59tnKnKQ5gnX1X9EqvEUdQr0PQ8OvadYtRQR5sQ,11483
|
|
11
|
-
kiln_ai/adapters/test_saving_adapter_results.py,sha256=tQvpLawo8mR2scPwmRCIz9Sp0ZkerS3kVJKBzlcjwRE,6041
|
|
12
|
-
kiln_ai/adapters/test_structured_output.py,sha256=Z9A2R-TC-2atsdr8sGVGDlJhfa7uytW8Xi8PKBdEEAw,9033
|
|
13
|
-
kiln_ai/adapters/repair/__init__.py,sha256=dOO9MEpEhjiwzDVFg3MNfA2bKMPlax9iekDatpTkX8E,217
|
|
14
|
-
kiln_ai/adapters/repair/repair_task.py,sha256=VXvX1l9AYDE_GV0i3S_vPThltJoQlCFVCCHV9m-QA7k,3297
|
|
15
|
-
kiln_ai/adapters/repair/test_repair_task.py,sha256=12PHb4SgBvVdLUzjZz31M8OTa8D8QjHD0Du4s7ij-i8,7819
|
|
16
|
-
kiln_ai/datamodel/__init__.py,sha256=zkqabC2tdK3ia7qp-pur5lo3LFRYeszsA6SdjCdxerE,14761
|
|
17
|
-
kiln_ai/datamodel/basemodel.py,sha256=lNSxZQO2isNP1JhDpc-bK6VqKWz1oY_Cc9RUT3T-Pz8,17535
|
|
18
|
-
kiln_ai/datamodel/json_schema.py,sha256=mrb_oXf6gT-ahjBlzfIw2lT7iTmmowmMYxHnmVqPTgE,2334
|
|
19
|
-
kiln_ai/datamodel/test_basemodel.py,sha256=679aT4UplglHtTVYmHGgT4v5uyJd7J2w8dBicZlLomk,9439
|
|
20
|
-
kiln_ai/datamodel/test_datasource.py,sha256=GAiZz31qezVVPwFqnt8wHMu15WvtlV89jw8C1Ue6YNI,3165
|
|
21
|
-
kiln_ai/datamodel/test_example_models.py,sha256=PxDtC8H3EfZem4kAQ-waFlRMlqnV4YlLEFKzz0Pq4tM,20013
|
|
22
|
-
kiln_ai/datamodel/test_json_schema.py,sha256=vdLnTQxxrcmuSrf6iOmkrmpfh7JnxqIw4B4dbDAAcZ4,3199
|
|
23
|
-
kiln_ai/datamodel/test_models.py,sha256=FS0G4HRrE9SqX98ZO4SnEwire4AcXw5V96JIPu_Wi9Q,5930
|
|
24
|
-
kiln_ai/datamodel/test_nested_save.py,sha256=xciCddqvPyKyoyjC5Lx_3Kh1t4LJv1xYRAPazR3SRcs,5588
|
|
25
|
-
kiln_ai/datamodel/test_output_rating.py,sha256=iw7fVUAPORA-0-VFiikZV3NDycGFaFMHSX1a38t_aQA,2647
|
|
26
|
-
kiln_ai/utils/__init__.py,sha256=PTD0MwBCKAMIOGsTAwsFaJOusTJJoRFTfOGqRvCaU-E,142
|
|
27
|
-
kiln_ai/utils/config.py,sha256=jXUB8lwFkxLNEaizwIsoeFLg1BwjWr39-5KdEGF37Bg,5424
|
|
28
|
-
kiln_ai/utils/formatting.py,sha256=VtB9oag0lOGv17dwT7OPX_3HzBfaU9GsLH-iLete0yM,97
|
|
29
|
-
kiln_ai/utils/test_config.py,sha256=lbN0NhgKPEZ0idaS-zTn6mWsSAV6omo32JcIy05h2-M,7411
|
|
30
|
-
kiln_ai-0.5.5.dist-info/METADATA,sha256=rD2UKYBIVHUrfsPP7-BhaUXGdLXVkcJDIUs8i75GSX8,3005
|
|
31
|
-
kiln_ai-0.5.5.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
32
|
-
kiln_ai-0.5.5.dist-info/licenses/LICENSE.txt,sha256=_NA5pnTYgRRr4qH6lE3X-TuZJ8iRcMUi5ASoGr-lEx8,1209
|
|
33
|
-
kiln_ai-0.5.5.dist-info/RECORD,,
|
|
File without changes
|