kiln-ai 0.6.0__tar.gz → 0.6.1__tar.gz
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-0.6.0 → kiln_ai-0.6.1}/PKG-INFO +1 -1
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/adapters/__init__.py +9 -1
- kiln_ai-0.6.1/kiln_ai/adapters/data_gen/__init__.py +11 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/adapters/data_gen/data_gen_task.py +69 -1
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/adapters/data_gen/test_data_gen_task.py +1 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/pyproject.toml +1 -1
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/.gitignore +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/.python-version +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/LICENSE.txt +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/README.md +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/core_library_docs/index.html +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/core_library_docs/kiln_ai/adapters/base_adapter.html +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/core_library_docs/kiln_ai/adapters/langchain_adapters.html +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/core_library_docs/kiln_ai/adapters/ml_model_list.html +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/core_library_docs/kiln_ai/adapters/prompt_builders.html +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/core_library_docs/kiln_ai/adapters/repair/repair_task.html +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/core_library_docs/kiln_ai/adapters/repair.html +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/core_library_docs/kiln_ai/adapters.html +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/core_library_docs/kiln_ai/datamodel/basemodel.html +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/core_library_docs/kiln_ai/datamodel/json_schema.html +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/core_library_docs/kiln_ai/datamodel.html +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/core_library_docs/kiln_ai/utils/config.html +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/core_library_docs/kiln_ai/utils/formatting.html +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/core_library_docs/kiln_ai/utils.html +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/core_library_docs/kiln_ai.html +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/core_library_docs/search.js +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/kiln_core_docs/index.html +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/kiln_core_docs/kiln_ai/adapters/base_adapter.html +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/kiln_core_docs/kiln_ai/adapters/langchain_adapters.html +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/kiln_core_docs/kiln_ai/adapters/ml_model_list.html +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/kiln_core_docs/kiln_ai/adapters/prompt_builders.html +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/kiln_core_docs/kiln_ai/adapters/repair/repair_task.html +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/kiln_core_docs/kiln_ai/adapters/repair.html +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/kiln_core_docs/kiln_ai/adapters.html +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/kiln_core_docs/kiln_ai/datamodel/basemodel.html +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/kiln_core_docs/kiln_ai/datamodel/json_schema.html +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/kiln_core_docs/kiln_ai/datamodel.html +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/kiln_core_docs/kiln_ai/utils/config.html +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/kiln_core_docs/kiln_ai/utils/formatting.html +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/kiln_core_docs/kiln_ai/utils.html +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/kiln_core_docs/kiln_ai.html +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/kiln_core_docs/search.js +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/__init__.py +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/adapters/base_adapter.py +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/adapters/data_gen/data_gen_prompts.py +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/adapters/langchain_adapters.py +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/adapters/ml_model_list.py +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/adapters/prompt_builders.py +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/adapters/repair/__init__.py +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/adapters/repair/repair_task.py +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/adapters/repair/test_repair_task.py +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/adapters/test_langchain_adapter.py +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/adapters/test_ml_model_list.py +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/adapters/test_prompt_adaptors.py +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/adapters/test_prompt_builders.py +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/adapters/test_saving_adapter_results.py +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/adapters/test_structured_output.py +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/datamodel/__init__.py +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/datamodel/basemodel.py +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/datamodel/json_schema.py +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/datamodel/test_basemodel.py +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/datamodel/test_datasource.py +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/datamodel/test_example_models.py +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/datamodel/test_json_schema.py +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/datamodel/test_models.py +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/datamodel/test_nested_save.py +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/datamodel/test_output_rating.py +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/utils/__init__.py +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/utils/config.py +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/utils/formatting.py +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/kiln_ai/utils/test_config.py +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/setup.cfg +0 -0
- {kiln_ai-0.6.0 → kiln_ai-0.6.1}/uv.lock +0 -0
|
@@ -12,7 +12,14 @@ The prompt_builders submodule contains classes that build prompts for use with t
|
|
|
12
12
|
The repair submodule contains an adapter for the repair task.
|
|
13
13
|
"""
|
|
14
14
|
|
|
15
|
-
from . import
|
|
15
|
+
from . import (
|
|
16
|
+
base_adapter,
|
|
17
|
+
data_gen,
|
|
18
|
+
langchain_adapters,
|
|
19
|
+
ml_model_list,
|
|
20
|
+
prompt_builders,
|
|
21
|
+
repair,
|
|
22
|
+
)
|
|
16
23
|
|
|
17
24
|
__all__ = [
|
|
18
25
|
"base_adapter",
|
|
@@ -20,4 +27,5 @@ __all__ = [
|
|
|
20
27
|
"ml_model_list",
|
|
21
28
|
"prompt_builders",
|
|
22
29
|
"repair",
|
|
30
|
+
"data_gen",
|
|
23
31
|
]
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""
|
|
2
|
+
# Data Generation
|
|
3
|
+
|
|
4
|
+
A task to generate synthetic data for Kiln Tasks. This generates the inputs, which then can be run through the task.
|
|
5
|
+
|
|
6
|
+
Optional human guidance can be provided to guide the generation process.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from . import data_gen_task
|
|
10
|
+
|
|
11
|
+
__all__ = ["data_gen_task"]
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import json
|
|
2
2
|
|
|
3
|
+
from pydantic import BaseModel
|
|
4
|
+
|
|
3
5
|
from kiln_ai.adapters.prompt_builders import SimplePromptBuilder
|
|
4
6
|
from kiln_ai.datamodel import Project, Task
|
|
5
|
-
from pydantic import BaseModel
|
|
6
7
|
|
|
7
8
|
from .data_gen_prompts import (
|
|
8
9
|
SAMPLE_GENERATION_PROMPT,
|
|
@@ -11,6 +12,16 @@ from .data_gen_prompts import (
|
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
class DataGenCategoriesTaskInput(BaseModel):
|
|
15
|
+
"""Input model for generating categories/subtopics.
|
|
16
|
+
|
|
17
|
+
Attributes:
|
|
18
|
+
node_path: List of strings representing the hierarchical path to current node
|
|
19
|
+
system_prompt: System prompt to guide the AI generation
|
|
20
|
+
num_subtopics: Number of subtopics to generate
|
|
21
|
+
human_guidance: Optional human guidance to influence generation
|
|
22
|
+
existing_topics: Optional list of existing topics to avoid duplication
|
|
23
|
+
"""
|
|
24
|
+
|
|
14
25
|
node_path: list[str]
|
|
15
26
|
system_prompt: str
|
|
16
27
|
num_subtopics: int
|
|
@@ -26,6 +37,18 @@ class DataGenCategoriesTaskInput(BaseModel):
|
|
|
26
37
|
human_guidance: str | None = None,
|
|
27
38
|
existing_topics: list[str] | None = None,
|
|
28
39
|
) -> "DataGenCategoriesTaskInput":
|
|
40
|
+
"""Create a DataGenCategoriesTaskInput instance from a Task.
|
|
41
|
+
|
|
42
|
+
Args:
|
|
43
|
+
task: The source Task object
|
|
44
|
+
node_path: Path to current node in topic hierarchy
|
|
45
|
+
num_subtopics: Number of subtopics to generate
|
|
46
|
+
human_guidance: Optional guidance for generation
|
|
47
|
+
existing_topics: Optional list of existing topics
|
|
48
|
+
|
|
49
|
+
Returns:
|
|
50
|
+
A new DataGenCategoriesTaskInput instance
|
|
51
|
+
"""
|
|
29
52
|
prompt_builder = SimplePromptBuilder(task=task)
|
|
30
53
|
return cls(
|
|
31
54
|
node_path=node_path,
|
|
@@ -37,10 +60,22 @@ class DataGenCategoriesTaskInput(BaseModel):
|
|
|
37
60
|
|
|
38
61
|
|
|
39
62
|
class DataGenCategoriesTaskOutput(BaseModel):
|
|
63
|
+
"""Output model for generated categories/subtopics.
|
|
64
|
+
|
|
65
|
+
Attributes:
|
|
66
|
+
subtopics: List of generated subtopic strings
|
|
67
|
+
"""
|
|
68
|
+
|
|
40
69
|
subtopics: list[str]
|
|
41
70
|
|
|
42
71
|
|
|
43
72
|
class DataGenCategoriesTask(Task, parent_of={}):
|
|
73
|
+
"""Task for generating hierarchical categories/subtopics.
|
|
74
|
+
|
|
75
|
+
Generates synthetic data categories which can be used to generate
|
|
76
|
+
training data for model learning.
|
|
77
|
+
"""
|
|
78
|
+
|
|
44
79
|
def __init__(self):
|
|
45
80
|
# Keep the typechecker happy. TODO: shouldn't need this or parent_of above.
|
|
46
81
|
tmp_project = Project(name="DataGen")
|
|
@@ -59,6 +94,15 @@ class DataGenCategoriesTask(Task, parent_of={}):
|
|
|
59
94
|
|
|
60
95
|
|
|
61
96
|
class DataGenSampleTaskInput(BaseModel):
|
|
97
|
+
"""Input model for generating data samples for a kiln task.
|
|
98
|
+
|
|
99
|
+
Attributes:
|
|
100
|
+
topic: List of strings representing the topic path
|
|
101
|
+
system_prompt: System prompt to guide the AI generation
|
|
102
|
+
num_samples: Number of samples to generate
|
|
103
|
+
human_guidance: Optional human guidance to influence generation
|
|
104
|
+
"""
|
|
105
|
+
|
|
62
106
|
topic: list[str]
|
|
63
107
|
system_prompt: str
|
|
64
108
|
num_samples: int
|
|
@@ -72,6 +116,17 @@ class DataGenSampleTaskInput(BaseModel):
|
|
|
72
116
|
num_samples: int = 8,
|
|
73
117
|
human_guidance: str | None = None,
|
|
74
118
|
) -> "DataGenSampleTaskInput":
|
|
119
|
+
"""Create a DataGenSampleTaskInput instance from a Task.
|
|
120
|
+
|
|
121
|
+
Args:
|
|
122
|
+
task: The source Task object
|
|
123
|
+
topic: Topic path for sample generation
|
|
124
|
+
num_samples: Number of samples to generate
|
|
125
|
+
human_guidance: Optional guidance for generation
|
|
126
|
+
|
|
127
|
+
Returns:
|
|
128
|
+
A new DataGenSampleTaskInput instance
|
|
129
|
+
"""
|
|
75
130
|
prompt_builder = SimplePromptBuilder(task=task)
|
|
76
131
|
return cls(
|
|
77
132
|
topic=topic,
|
|
@@ -82,6 +137,14 @@ class DataGenSampleTaskInput(BaseModel):
|
|
|
82
137
|
|
|
83
138
|
|
|
84
139
|
def list_json_schema_for_task(task: Task) -> str:
|
|
140
|
+
"""Generate a JSON schema for a list of task inputs (json schema)
|
|
141
|
+
|
|
142
|
+
Args:
|
|
143
|
+
task: Task object whose input schema will be used
|
|
144
|
+
|
|
145
|
+
Returns:
|
|
146
|
+
JSON string representing the schema for a list of task inputs
|
|
147
|
+
"""
|
|
85
148
|
if task.input_json_schema:
|
|
86
149
|
items_schema = json.loads(task.input_json_schema)
|
|
87
150
|
else:
|
|
@@ -104,6 +167,11 @@ def list_json_schema_for_task(task: Task) -> str:
|
|
|
104
167
|
|
|
105
168
|
|
|
106
169
|
class DataGenSampleTask(Task, parent_of={}):
|
|
170
|
+
"""Task for generating data samples for a given topic.
|
|
171
|
+
|
|
172
|
+
Generates synthetic data samples based on provided topics and subtopics.
|
|
173
|
+
"""
|
|
174
|
+
|
|
107
175
|
def __init__(self, target_task: Task, num_samples: int = 8):
|
|
108
176
|
# Keep the typechecker happy. TODO: shouldn't need this or parent_of above.
|
|
109
177
|
tmp_project = Project(name="DataGenSample")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/core_library_docs/kiln_ai/adapters/langchain_adapters.html
RENAMED
|
File without changes
|
|
File without changes
|
{kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/core_library_docs/kiln_ai/adapters/prompt_builders.html
RENAMED
|
File without changes
|
{kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/core_library_docs/kiln_ai/adapters/repair/repair_task.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/kiln_core_docs/kiln_ai/adapters/langchain_adapters.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{kiln_ai-0.6.0 → kiln_ai-0.6.1}/docs/kiln_core_docs/kiln_ai/adapters/repair/repair_task.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|