data-designer-config 0.4.0rc1__py3-none-any.whl → 0.4.0rc2__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.
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.4.0rc1'
32
- __version_tuple__ = version_tuple = (0, 4, 0, 'rc1')
31
+ __version__ = version = '0.4.0rc2'
32
+ __version_tuple__ = version_tuple = (0, 4, 0, 'rc2')
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -3,6 +3,7 @@
3
3
 
4
4
  from __future__ import annotations
5
5
 
6
+ import json
6
7
  import logging
7
8
  from abc import ABC, abstractmethod
8
9
  from enum import Enum
@@ -65,7 +66,7 @@ class ModalityContext(ABC, BaseModel):
65
66
  data_type: ModalityDataType
66
67
 
67
68
  @abstractmethod
68
- def get_context(self, record: dict) -> dict[str, Any]: ...
69
+ def get_contexts(self, record: dict) -> list[dict[str, Any]]: ...
69
70
 
70
71
 
71
72
  class ImageContext(ModalityContext):
@@ -81,25 +82,53 @@ class ImageContext(ModalityContext):
81
82
  modality: Modality = Modality.IMAGE
82
83
  image_format: ImageFormat | None = None
83
84
 
84
- def get_context(self, record: dict) -> dict[str, Any]:
85
- """Get the context for the image modality.
85
+ def get_contexts(self, record: dict) -> list[dict[str, Any]]:
86
+ """Get the contexts for the image modality.
86
87
 
87
88
  Args:
88
- record: The record containing the image data.
89
+ record: The record containing the image data. The data can be:
90
+ - A JSON serialized list of strings
91
+ - A list of strings
92
+ - A single string
89
93
 
90
94
  Returns:
91
- The context for the image modality.
95
+ A list of image contexts.
92
96
  """
93
- context = dict(type="image_url")
94
- context_value = record[self.column_name]
95
- if self.data_type == ModalityDataType.URL:
96
- context["image_url"] = context_value
97
+ raw_value = record[self.column_name]
98
+
99
+ # Normalize to list of strings
100
+ if isinstance(raw_value, str):
101
+ # Try to parse as JSON first
102
+ try:
103
+ parsed_value = json.loads(raw_value)
104
+ if isinstance(parsed_value, list):
105
+ context_values = parsed_value
106
+ else:
107
+ context_values = [raw_value]
108
+ except (json.JSONDecodeError, TypeError):
109
+ context_values = [raw_value]
110
+ elif isinstance(raw_value, list):
111
+ context_values = raw_value
112
+ elif hasattr(raw_value, "__iter__") and not isinstance(raw_value, (str, bytes, dict)):
113
+ # Handle array-like objects (numpy arrays, pandas Series, etc.)
114
+ context_values = list(raw_value)
97
115
  else:
98
- context["image_url"] = {
99
- "url": f"data:image/{self.image_format.value};base64,{context_value}",
100
- "format": self.image_format.value,
101
- }
102
- return context
116
+ context_values = [raw_value]
117
+
118
+ # Build context list
119
+ contexts = []
120
+ for context_value in context_values:
121
+ context = dict(type="image_url")
122
+ if self.data_type == ModalityDataType.URL:
123
+ context["image_url"] = context_value
124
+ else:
125
+ context["image_url"] = {
126
+ "url": f"data:image/{self.image_format.value};base64,{context_value}",
127
+ "format": self.image_format.value,
128
+ }
129
+ contexts.append(context)
130
+
131
+ return contexts
103
132
 
104
133
  @model_validator(mode="after")
105
134
  def _validate_image_format(self) -> Self:
@@ -399,12 +428,14 @@ class ModelConfig(ConfigBase):
399
428
  inference_parameters: Inference parameters for the model (temperature, top_p, max_tokens, etc.).
400
429
  The generation_type is determined by the type of inference_parameters.
401
430
  provider: Optional model provider name if using custom providers.
431
+ skip_health_check: Whether to skip the health check for this model. Defaults to False.
402
432
  """
403
433
 
404
434
  alias: str
405
435
  model: str
406
436
  inference_parameters: InferenceParamsT = Field(default_factory=ChatCompletionInferenceParams)
407
437
  provider: str | None = None
438
+ skip_health_check: bool = False
408
439
 
409
440
  @property
410
441
  def generation_type(self) -> GenerationType:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: data-designer-config
3
- Version: 0.4.0rc1
3
+ Version: 0.4.0rc2
4
4
  Summary: Configuration layer for DataDesigner synthetic data generation
5
5
  License-Expression: Apache-2.0
6
6
  Classifier: Development Status :: 4 - Beta
@@ -3,7 +3,7 @@ data_designer/lazy_heavy_imports.py,sha256=5X04vUj9TYbKgfDmY2qvhzRf5-IZWKOanIpi3
3
3
  data_designer/logging.py,sha256=_x-tDj34ClrgSnU57Dh0mZdDxrnA73vgs09KooUvbEA,5444
4
4
  data_designer/plugin_manager.py,sha256=C2ZkZiXlcMRiaxfrrho5Shz6DKdExVeBha7ch-d4CnU,2695
5
5
  data_designer/config/__init__.py,sha256=MWzRZhXA41sTpc0sL_xq2baA3kSlV37alT6g8RlP8dU,4919
6
- data_designer/config/_version.py,sha256=yib4WPM_pEWXdpIHBdFnf29aurTH5f4xrnwVlv7cijo,714
6
+ data_designer/config/_version.py,sha256=FvItxCBzPigrdVpFPfL1gQeV1-km5r7nCNGUzrYebTU,714
7
7
  data_designer/config/base.py,sha256=IGj6sy_GnKzC94uu2rdxe12EqR_AmGJ6O3rl2MxOv6g,2449
8
8
  data_designer/config/column_configs.py,sha256=JBYIeqmIiwdZzA-NXTw4qghs2Y30RZPQ_-koqPVcQ9g,20384
9
9
  data_designer/config/column_types.py,sha256=xGXuu0EBy3Y5Jd74f2VM6x5jHq72GmK9leA6qOnAz8c,5423
@@ -14,7 +14,7 @@ data_designer/config/dataset_metadata.py,sha256=UTlEgnHWgjwPuc7bP95T7gaKmcr7pIhF
14
14
  data_designer/config/default_model_settings.py,sha256=c-llH2otfG0tMCMsxoz3ZcS1nFxIQQPfRedFXAydDbc,4868
15
15
  data_designer/config/errors.py,sha256=JhvUYecfLmP0gZjQzqA3OmfaSs9TRlC5E-ubnV_-3gs,560
16
16
  data_designer/config/interface.py,sha256=ikmpm_KwencTpM-yg0auo7XMgcmMSa67S75IqdpFLfk,1676
17
- data_designer/config/models.py,sha256=OekrXEVnI9WdHzEVk-8fO0NtxLZtjKVtCL03RY8qwYs,15457
17
+ data_designer/config/models.py,sha256=_NctRk4brgBeb5q5V7r_hXE5OORlLh6SCVZP0eu2LGo,16721
18
18
  data_designer/config/preview_results.py,sha256=WnPlDcHElIHNfjV_P-nLu_Dpul8D3Eyb5qyi3E173Gs,1744
19
19
  data_designer/config/processors.py,sha256=lnyUZA1EhO9NWjjVFFioYxSgeYpoAaM1J7UzwOYkvms,6028
20
20
  data_designer/config/run_config.py,sha256=oJ163DpHXu9PzST5Hn9px-bIP9DYjIkCO7UGB93J7bI,2663
@@ -45,6 +45,6 @@ data_designer/plugins/__init__.py,sha256=qe1alcTEtnMSMdzknjb57vvjqKgFE5cEHXxBj8t
45
45
  data_designer/plugins/errors.py,sha256=d7FMed3ueQvZHwuhwyPLzF4E34bO1mdj3aBVEw6p34o,386
46
46
  data_designer/plugins/plugin.py,sha256=TVyyOaQBWAt0FQwUmtihTZ9MDJD85HwggrQ3L9CviPQ,5367
47
47
  data_designer/plugins/registry.py,sha256=Cnt33Q25o9bS2v2YDbV3QPM57VNrtIBKAb4ERQRE_dY,3053
48
- data_designer_config-0.4.0rc1.dist-info/METADATA,sha256=EvLUDu0U0oK7FuylbCr44meSR8H5Ty-bt-EdUIagmi4,2286
49
- data_designer_config-0.4.0rc1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
50
- data_designer_config-0.4.0rc1.dist-info/RECORD,,
48
+ data_designer_config-0.4.0rc2.dist-info/METADATA,sha256=sEtB9CR6HT9TCz7nptAitc_pH9N62tDBddnEFMw9MYM,2286
49
+ data_designer_config-0.4.0rc2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
50
+ data_designer_config-0.4.0rc2.dist-info/RECORD,,