toolchemy 0.2.193__tar.gz → 0.2.195__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.
- {toolchemy-0.2.193 → toolchemy-0.2.195}/PKG-INFO +1 -1
- {toolchemy-0.2.193 → toolchemy-0.2.195}/pyproject.toml +1 -1
- {toolchemy-0.2.193 → toolchemy-0.2.195}/toolchemy/ai/trackers/common.py +25 -0
- {toolchemy-0.2.193 → toolchemy-0.2.195}/toolchemy/ai/trackers/mlflow_tracker.py +16 -0
- {toolchemy-0.2.193 → toolchemy-0.2.195}/toolchemy/ai/trackers/neptune_tracker.py +4 -0
- {toolchemy-0.2.193 → toolchemy-0.2.195}/LICENSE +0 -0
- {toolchemy-0.2.193 → toolchemy-0.2.195}/toolchemy/__main__.py +0 -0
- {toolchemy-0.2.193 → toolchemy-0.2.195}/toolchemy/ai/clients/__init__.py +0 -0
- {toolchemy-0.2.193 → toolchemy-0.2.195}/toolchemy/ai/clients/common.py +0 -0
- {toolchemy-0.2.193 → toolchemy-0.2.195}/toolchemy/ai/clients/dummy_model_client.py +0 -0
- {toolchemy-0.2.193 → toolchemy-0.2.195}/toolchemy/ai/clients/factory.py +0 -0
- {toolchemy-0.2.193 → toolchemy-0.2.195}/toolchemy/ai/clients/gemini_client.py +0 -0
- {toolchemy-0.2.193 → toolchemy-0.2.195}/toolchemy/ai/clients/ollama_client.py +0 -0
- {toolchemy-0.2.193 → toolchemy-0.2.195}/toolchemy/ai/clients/openai_client.py +0 -0
- {toolchemy-0.2.193 → toolchemy-0.2.195}/toolchemy/ai/clients/pricing.py +0 -0
- {toolchemy-0.2.193 → toolchemy-0.2.195}/toolchemy/ai/clients/whisper_client.py +0 -0
- {toolchemy-0.2.193 → toolchemy-0.2.195}/toolchemy/ai/prompter.py +0 -0
- {toolchemy-0.2.193 → toolchemy-0.2.195}/toolchemy/ai/trackers/__init__.py +0 -0
- {toolchemy-0.2.193 → toolchemy-0.2.195}/toolchemy/db/lightdb.py +0 -0
- {toolchemy-0.2.193 → toolchemy-0.2.195}/toolchemy/utils/__init__.py +0 -0
- {toolchemy-0.2.193 → toolchemy-0.2.195}/toolchemy/utils/at_exit_collector.py +0 -0
- {toolchemy-0.2.193 → toolchemy-0.2.195}/toolchemy/utils/cacher/__init__.py +0 -0
- {toolchemy-0.2.193 → toolchemy-0.2.195}/toolchemy/utils/cacher/cacher_diskcache.py +0 -0
- {toolchemy-0.2.193 → toolchemy-0.2.195}/toolchemy/utils/cacher/cacher_pickle.py +0 -0
- {toolchemy-0.2.193 → toolchemy-0.2.195}/toolchemy/utils/cacher/cacher_shelve.py +0 -0
- {toolchemy-0.2.193 → toolchemy-0.2.195}/toolchemy/utils/cacher/common.py +0 -0
- {toolchemy-0.2.193 → toolchemy-0.2.195}/toolchemy/utils/datestimes.py +0 -0
- {toolchemy-0.2.193 → toolchemy-0.2.195}/toolchemy/utils/locations.py +0 -0
- {toolchemy-0.2.193 → toolchemy-0.2.195}/toolchemy/utils/logger.py +0 -0
- {toolchemy-0.2.193 → toolchemy-0.2.195}/toolchemy/utils/timer.py +0 -0
- {toolchemy-0.2.193 → toolchemy-0.2.195}/toolchemy/utils/utils.py +0 -0
- {toolchemy-0.2.193 → toolchemy-0.2.195}/toolchemy/vision/__init__.py +0 -0
- {toolchemy-0.2.193 → toolchemy-0.2.195}/toolchemy/vision/caption_overlay.py +0 -0
- {toolchemy-0.2.193 → toolchemy-0.2.195}/toolchemy/vision/image.py +0 -0
|
@@ -11,11 +11,21 @@ class ITracker(ABC):
|
|
|
11
11
|
def experiment_name(self) -> str:
|
|
12
12
|
pass
|
|
13
13
|
|
|
14
|
+
@property
|
|
15
|
+
@abstractmethod
|
|
16
|
+
def experiment_id(self) -> str:
|
|
17
|
+
pass
|
|
18
|
+
|
|
14
19
|
@property
|
|
15
20
|
@abstractmethod
|
|
16
21
|
def run_name(self) -> str:
|
|
17
22
|
pass
|
|
18
23
|
|
|
24
|
+
@property
|
|
25
|
+
@abstractmethod
|
|
26
|
+
def run_id(self) -> str:
|
|
27
|
+
pass
|
|
28
|
+
|
|
19
29
|
@abstractmethod
|
|
20
30
|
def start_run(
|
|
21
31
|
self, run_id: str = None,
|
|
@@ -83,6 +93,10 @@ class ITracker(ABC):
|
|
|
83
93
|
def get_data(self) -> dict:
|
|
84
94
|
pass
|
|
85
95
|
|
|
96
|
+
@abstractmethod
|
|
97
|
+
def get_traces(self, filter_name: str | None = None):
|
|
98
|
+
pass
|
|
99
|
+
|
|
86
100
|
|
|
87
101
|
class TrackerBase(ITracker, ABC):
|
|
88
102
|
def __init__(self, experiment_name: str, with_artifact_logging: bool = True, disabled: bool = False):
|
|
@@ -101,6 +115,10 @@ class TrackerBase(ITracker, ABC):
|
|
|
101
115
|
def experiment_name(self) -> str:
|
|
102
116
|
return self._experiment_name
|
|
103
117
|
|
|
118
|
+
@property
|
|
119
|
+
def experiment_id(self) -> str:
|
|
120
|
+
return self._experiment_name
|
|
121
|
+
|
|
104
122
|
def get_max_metric_value(self, name: str) -> float:
|
|
105
123
|
return max(self._metrics[name], key=lambda el: el['value'])
|
|
106
124
|
|
|
@@ -118,6 +136,9 @@ class TrackerBase(ITracker, ABC):
|
|
|
118
136
|
"tags": self._tags.copy(),
|
|
119
137
|
}
|
|
120
138
|
|
|
139
|
+
def get_traces(self, filter_name: str | None = None):
|
|
140
|
+
raise NotImplementedError()
|
|
141
|
+
|
|
121
142
|
def _store_param(self, name: str, value: Any):
|
|
122
143
|
if self._disabled:
|
|
123
144
|
raise RuntimeError(f"Disabled trackers cannot store params!")
|
|
@@ -166,6 +187,10 @@ class InMemoryTracker(TrackerBase):
|
|
|
166
187
|
def run_name(self) -> str:
|
|
167
188
|
return self._run_name
|
|
168
189
|
|
|
190
|
+
@property
|
|
191
|
+
def run_id(self) -> str:
|
|
192
|
+
return self._run_name
|
|
193
|
+
|
|
169
194
|
def start_run(
|
|
170
195
|
self, run_id: str = None,
|
|
171
196
|
run_name: str = None,
|
|
@@ -39,6 +39,16 @@ class MLFlowTracker(TrackerBase):
|
|
|
39
39
|
raise RuntimeError("There is no active run!")
|
|
40
40
|
return self._active_run.info.run_name
|
|
41
41
|
|
|
42
|
+
@property
|
|
43
|
+
def run_id(self) -> str:
|
|
44
|
+
if not self._active_run:
|
|
45
|
+
raise RuntimeError("There is no active run!")
|
|
46
|
+
return self._active_run.info.run_id
|
|
47
|
+
|
|
48
|
+
@property
|
|
49
|
+
def experiment_id(self) -> str:
|
|
50
|
+
return self._experiment_id
|
|
51
|
+
|
|
42
52
|
def start_run(
|
|
43
53
|
self, run_id: str = None,
|
|
44
54
|
run_name: str = None,
|
|
@@ -185,6 +195,12 @@ class MLFlowTracker(TrackerBase):
|
|
|
185
195
|
self._store_tag(name, value)
|
|
186
196
|
self._client.set_experiment_tag(self._experiment_id, name, value)
|
|
187
197
|
|
|
198
|
+
def get_traces(self, filter_name: str | None = None):
|
|
199
|
+
filter_string = None
|
|
200
|
+
if filter_name:
|
|
201
|
+
filter_string = f"trace.name = '{filter_name}'"
|
|
202
|
+
return self._client.search_traces(experiment_ids=[self.experiment_id], run_id=self.run_id, filter_string=filter_string)
|
|
203
|
+
|
|
188
204
|
def _reset_run(self):
|
|
189
205
|
self._active_run = None
|
|
190
206
|
self._active_run_id = None
|
|
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
|