DeepFabric 4.7.1__py3-none-any.whl → 4.8.0__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.
deepfabric/schemas.py CHANGED
@@ -4,11 +4,12 @@ import logging
4
4
  import re
5
5
  import secrets
6
6
  import string
7
+ import warnings
7
8
 
8
9
  from decimal import ROUND_HALF_UP, Decimal
9
10
  from typing import Annotated, Any, Literal
10
11
 
11
- from pydantic import BaseModel, BeforeValidator, Field, field_validator
12
+ from pydantic import BaseModel, BeforeValidator, Field, field_validator, model_validator
12
13
 
13
14
  logger = logging.getLogger(__name__)
14
15
 
@@ -796,15 +797,35 @@ class ReasoningTrace(BaseModel):
796
797
  class ToolContext(BaseModel):
797
798
  """Tool execution history - present when tools are used.
798
799
 
799
- Note: available_tools has been removed as it was redundant with the
800
- top-level 'tools' field in Conversation. Use 'tools' for the OpenAI-format
801
- tool definitions needed by chat templates.
800
+ Note: available_tools has been deprecated in favor of the top-level 'tools'
801
+ field in Conversation. Use 'tools' for the OpenAI-format tool definitions
802
+ needed by chat templates. The field is kept here for backward compatibility
803
+ with existing datasets.
802
804
  """
803
805
 
804
806
  executions: list[ToolExecution] = Field(
805
807
  default_factory=list,
806
808
  description="Tool executions performed during the conversation (may be empty if agent answered without tools)",
807
809
  )
810
+ # Deprecated: kept for backward compatibility with existing datasets
811
+ available_tools: list[dict[str, Any]] | None = Field(
812
+ default=None,
813
+ description="Deprecated: Use top-level 'tools' field instead. Kept for backward compatibility.",
814
+ )
815
+
816
+ @model_validator(mode="after")
817
+ def warn_on_deprecated_available_tools(self) -> "ToolContext":
818
+ """Warn if the deprecated `available_tools` field is used."""
819
+ if self.available_tools is not None:
820
+ warnings.warn(
821
+ (
822
+ "'tool_context.available_tools' is deprecated and will be removed in a future version. "
823
+ "Use the top-level 'tools' field in Conversation instead."
824
+ ),
825
+ DeprecationWarning,
826
+ stacklevel=2,
827
+ )
828
+ return self
808
829
 
809
830
  class Config:
810
831
  extra = "forbid"
@@ -28,7 +28,7 @@ Usage:
28
28
 
29
29
  Environment Variables:
30
30
  DEEPFABRIC_API_KEY: API key for authentication
31
- DEEPFABRIC_API_URL: SaaS backend URL (default: https://api.deepfabric.ai)
31
+ DEEPFABRIC_API_URL: SaaS backend URL (default: https://api.deepfabric.cloud)
32
32
  """
33
33
 
34
34
  from __future__ import annotations
@@ -127,9 +127,9 @@ def _show_notebook_prompt() -> str | None:
127
127
  </div>
128
128
  <p style="margin: 0; font-size: 14px; opacity: 0.9;">
129
129
  Enter your API key to automatically log training metrics.<br>
130
- Get your key at <a href="https://app.deepfabric.ai/settings/api"
130
+ You can create a key from your profile page: <a href="https://deepfabric.cloud/profile"
131
131
  target="_blank" style="color: #fff; text-decoration: underline;">
132
- app.deepfabric.ai/settings/api</a>
132
+ deepfabric.cloud/profile</a>
133
133
  </p>
134
134
  </div>
135
135
  """
@@ -182,8 +182,8 @@ def _show_colab_prompt() -> str | None:
182
182
  </div>
183
183
  <p style="margin: 0; font-size: 14px; opacity: 0.9;">
184
184
  Enter your API key below to log training metrics.<br>
185
- Get your key at <a href="https://app.deepfabric.ai/settings/api"
186
- target="_blank" style="color: #fff;">app.deepfabric.ai/settings/api</a><br>
185
+ You can create a key from your profile page: <a href="https://deepfabric.cloud/profile"
186
+ target="_blank" style="color: #fff;">deepfabric.cloud/profile</a><br>
187
187
  <em>Press Enter without typing to skip.</em>
188
188
  </p>
189
189
  </div>
@@ -211,7 +211,7 @@ def _show_terminal_prompt() -> str | None:
211
211
  print("=" * 60)
212
212
  print()
213
213
  print(" Enter your API key to log training metrics to DeepFabric.")
214
- print(" Get your key at: https://app.deepfabric.ai/settings/api")
214
+ print(" You can create a key from your profile page: https://deepfabric.cloud/profile")
215
215
  print()
216
216
  print(" Press Enter without typing to skip (disable logging).")
217
217
  print()
@@ -43,7 +43,7 @@ class DeepFabricCallback:
43
43
 
44
44
  Environment Variables:
45
45
  DEEPFABRIC_API_KEY: API key (alternative to constructor arg)
46
- DEEPFABRIC_API_URL: Backend URL (default: https://api.deepfabric.ai)
46
+ DEEPFABRIC_API_URL: Backend URL (default: https://api.deepfabric.cloud)
47
47
  """
48
48
 
49
49
  def __init__(
@@ -67,7 +67,7 @@ class DeepFabricCallback:
67
67
  """
68
68
  # Get API key from arg, env, or prompt
69
69
  self.api_key = api_key or get_api_key()
70
- self.endpoint = endpoint or os.getenv("DEEPFABRIC_API_URL", "https://api.deepfabric.ai")
70
+ self.endpoint = endpoint or os.getenv("DEEPFABRIC_API_URL", "https://api.deepfabric.cloud")
71
71
  self.pipeline_id = pipeline_id or self._get_pipeline_id()
72
72
  self.run_id = str(uuid.uuid4())
73
73
  self.enabled = enabled and self.api_key is not None
@@ -24,7 +24,7 @@ class MetricsSender:
24
24
 
25
25
  Example:
26
26
  sender = MetricsSender(
27
- endpoint="https://api.deepfabric.ai",
27
+ endpoint="https://api.deepfabric.cloud",
28
28
  api_key="your-api-key",
29
29
  )
30
30
  sender.send_metrics({"loss": 2.5, "step": 100})
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: DeepFabric
3
- Version: 4.7.1
3
+ Version: 4.8.0
4
4
  Summary: Curate High Quality Datasets, Train, Evaluate and Ship
5
- Author-email: Luke Hinds <luke@alwaysfurther.ai>
5
+ Author-email: DeepFabric Team <oss@alwaysfurther.ai>
6
6
  License-File: LICENSE
7
7
  Requires-Python: >=3.10
8
8
  Requires-Dist: accelerate>=0.20.0
@@ -21,7 +21,7 @@ deepfabric/loader.py,sha256=YNTGZZE-POjR0BIlx6WCT4bIzf0T4lW_fQl7ev9UFqE,18584
21
21
  deepfabric/metrics.py,sha256=iwtNHBX4ZTYUg2FZgtFcG3U0e9RlV2c1cm1Kp34FeWU,6129
22
22
  deepfabric/progress.py,sha256=3XQQrf2pUZlyd-8eRcNATH1v0Oi8JMedVHGbhPcca-8,9354
23
23
  deepfabric/prompts.py,sha256=JVFMeeBa2qqOMvmP_xx8bWzZ6ot9eyqOP3u8XzzPx3g,10290
24
- deepfabric/schemas.py,sha256=bBI1zOgsL05dIOpc-MBUS2p5zKhHr5roCjIfVNPFj2w,36466
24
+ deepfabric/schemas.py,sha256=ckzAjDc6IlC8Y-Pi2hyYRqcSwARX7z_GELuCypXuSgI,37401
25
25
  deepfabric/stream_simulator.py,sha256=GzvAxWxHVsuTwgXlqwXNfrTUDn6sND2kJOoQuYg88FA,3028
26
26
  deepfabric/topic_manager.py,sha256=6YxMO6dQHaGyxghsI8iNJGP1miaekBe5Mh1WdYeLqdI,11164
27
27
  deepfabric/topic_model.py,sha256=i_wYpw2kUl8NLodOSaqNu-C4_d6caYT1kPe_vkKjoyw,707
@@ -64,13 +64,13 @@ deepfabric/tools/__init__.py,sha256=hV65lJmVH2qrWCvzHb-IS3VxYP9lal1j8-J3DzBGieM,
64
64
  deepfabric/tools/defaults.py,sha256=NcvrYo88OC1ID4U0CuKg_WYKz2pwFowsjBjSMZip-bI,2372
65
65
  deepfabric/tools/loader.py,sha256=Bv56D-76JChlK_QXfHLw_rneGLZYRhkn5ETbJMIdJsA,2910
66
66
  deepfabric/tools/mcp_client.py,sha256=uQRrlDSVwF0ZatOl9bidBNU7IgXgJKQU-xG50dK0Uy4,23377
67
- deepfabric/training/__init__.py,sha256=MqIyBnloX-4_zqAgoEaGzKXTVXroi40wEs4V7lbQNqk,1563
68
- deepfabric/training/api_key_prompt.py,sha256=bzcdzeK6ql_8Vz0cbR2vmxxtMRNRFpzYAJx7i8GNI3U,9315
69
- deepfabric/training/callback.py,sha256=vYh7nnCNf3xhbJEamWBKNXW4T7XNazXvmRqEkFyIwXI,13045
67
+ deepfabric/training/__init__.py,sha256=MJazTELfrTB15rIiCE04hDeUL8LSSg4-4LWWG6j2BRw,1566
68
+ deepfabric/training/api_key_prompt.py,sha256=pSIMX3eDGyV9x_r7MHE4TyIsIB2SqYb8gKCdAtTY-q8,9371
69
+ deepfabric/training/callback.py,sha256=NUNrMAEYKt9kPjrX9mckvs8H4uoeVtRWPsfrjW90fWI,13051
70
70
  deepfabric/training/dataset_utils.py,sha256=klx8DoawEwuMigBDP-RpMAfe7FvYxRbhj599MErxBr4,7313
71
- deepfabric/training/metrics_sender.py,sha256=_x0Has8ZR8ehXsdmv3nJbRDml5ioju4hZFv5ndsldpQ,10830
72
- deepfabric-4.7.1.dist-info/METADATA,sha256=FFTmSpKgb6pbOrYHQ9C1eCkKV6FPUAxlaH71Ij7KGwc,20423
73
- deepfabric-4.7.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
74
- deepfabric-4.7.1.dist-info/entry_points.txt,sha256=zatevils13hfs8x29_vmUyivQ6rTtq7hE2RBusZw1Fo,50
75
- deepfabric-4.7.1.dist-info/licenses/LICENSE,sha256=-qRt8wmrhQ9aMf7KhmZXc2vrTETYZF-6_T1KCeUhvHY,11340
76
- deepfabric-4.7.1.dist-info/RECORD,,
71
+ deepfabric/training/metrics_sender.py,sha256=ZCyvMv5hRu8XJnQYVGXJ9wh7HEMJ0l3Ktyi8_etOpZs,10833
72
+ deepfabric-4.8.0.dist-info/METADATA,sha256=N3ttE4MjkF2rk_Zq75-wjDds3BM0L8jEciHz8wnAnx0,20427
73
+ deepfabric-4.8.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
74
+ deepfabric-4.8.0.dist-info/entry_points.txt,sha256=zatevils13hfs8x29_vmUyivQ6rTtq7hE2RBusZw1Fo,50
75
+ deepfabric-4.8.0.dist-info/licenses/LICENSE,sha256=-qRt8wmrhQ9aMf7KhmZXc2vrTETYZF-6_T1KCeUhvHY,11340
76
+ deepfabric-4.8.0.dist-info/RECORD,,