flock-core 0.5.0b18__py3-none-any.whl → 0.5.0b19__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 flock-core might be problematic. Click here for more details.
- flock/components/utility/metrics_utility_component.py +9 -2
- {flock_core-0.5.0b18.dist-info → flock_core-0.5.0b19.dist-info}/METADATA +1 -1
- {flock_core-0.5.0b18.dist-info → flock_core-0.5.0b19.dist-info}/RECORD +6 -6
- {flock_core-0.5.0b18.dist-info → flock_core-0.5.0b19.dist-info}/WHEEL +0 -0
- {flock_core-0.5.0b18.dist-info → flock_core-0.5.0b19.dist-info}/entry_points.txt +0 -0
- {flock_core-0.5.0b18.dist-info → flock_core-0.5.0b19.dist-info}/licenses/LICENSE +0 -0
|
@@ -15,9 +15,13 @@ from pydantic import BaseModel, Field, field_validator
|
|
|
15
15
|
from flock.core.component.agent_component_base import AgentComponentConfig
|
|
16
16
|
from flock.core.component.utility_component import UtilityComponent
|
|
17
17
|
from flock.core.context.context import FlockContext
|
|
18
|
+
from flock.core.logging.logging import get_logger
|
|
18
19
|
from flock.core.mcp.flock_mcp_server import FlockMCPServer
|
|
19
20
|
from flock.core.registry import flock_component
|
|
20
21
|
|
|
22
|
+
logger = get_logger(__name__)
|
|
23
|
+
|
|
24
|
+
|
|
21
25
|
if TYPE_CHECKING:
|
|
22
26
|
from flock.core.flock_agent import FlockAgent
|
|
23
27
|
|
|
@@ -181,7 +185,7 @@ class MetricsUtilityComponent(UtilityComponent):
|
|
|
181
185
|
|
|
182
186
|
return dict(metrics)
|
|
183
187
|
except Exception as e:
|
|
184
|
-
|
|
188
|
+
logger.error(f"Error loading metrics from files: {e}")
|
|
185
189
|
return {}
|
|
186
190
|
|
|
187
191
|
def get_metrics(
|
|
@@ -419,11 +423,12 @@ class MetricsUtilityComponent(UtilityComponent):
|
|
|
419
423
|
if self.config.collect_timing and self._start_time:
|
|
420
424
|
latency = time.time() - self._start_time
|
|
421
425
|
self._record_metric("latency", latency, {"agent": agent.name})
|
|
426
|
+
print(f"Latency: {latency * 1000:.2f}ms")
|
|
422
427
|
|
|
423
428
|
# Check for alerts
|
|
424
429
|
if self._should_alert("latency", latency):
|
|
425
430
|
# In practice, you'd want to integrate with a proper alerting system
|
|
426
|
-
|
|
431
|
+
logger.warning(f"ALERT: High latency detected!")
|
|
427
432
|
|
|
428
433
|
if self.config.collect_token_usage and result:
|
|
429
434
|
# Calculate output tokens and cost
|
|
@@ -440,6 +445,8 @@ class MetricsUtilityComponent(UtilityComponent):
|
|
|
440
445
|
else:
|
|
441
446
|
total_output_cost += cost[1]
|
|
442
447
|
|
|
448
|
+
print(f"Total output tokens: {total_output_tokens}")
|
|
449
|
+
|
|
443
450
|
self._record_metric(
|
|
444
451
|
"tokens",
|
|
445
452
|
total_output_tokens,
|
|
@@ -34,7 +34,7 @@ flock/components/routing/default_routing_component.py,sha256=ZHt2Kjf-GHB5n7evU5N
|
|
|
34
34
|
flock/components/routing/llm_routing_component.py,sha256=SAaOFjlnhnenM6QEBn3WIpjjNXO-tFpP44TS73zvqzQ,7502
|
|
35
35
|
flock/components/utility/__init__.py,sha256=JRj932upddjzZMWs1avOupEFr_GZNu21ac66Rhw_XgY,532
|
|
36
36
|
flock/components/utility/memory_utility_component.py,sha256=26Io61bbCGjD8UQ4BltMA5RLkMXp8tQoQmddXbQSrzA,20183
|
|
37
|
-
flock/components/utility/metrics_utility_component.py,sha256=
|
|
37
|
+
flock/components/utility/metrics_utility_component.py,sha256=Mck_sFCkfXvNpoSgW2N_WOLnjxazzx8jh79tIx5zJhw,24635
|
|
38
38
|
flock/components/utility/output_utility_component.py,sha256=c4K_PL3bGqdyy_v6dnOrmTqV-MkWKAB2w0HS8kzg82k,7613
|
|
39
39
|
flock/core/__init__.py,sha256=OkjsVjRkAB-I6ibeTKVikZ3MxLIcTIzWKphHTbzbr7s,3231
|
|
40
40
|
flock/core/flock.py,sha256=wRycQlGeaq-Vd75mFpPe02qyWTOEyXthT873iBhA3TI,23388
|
|
@@ -551,8 +551,8 @@ flock/workflow/agent_execution_activity.py,sha256=0exwmeWKYXXxdUqDf4YaUVpn0zl06S
|
|
|
551
551
|
flock/workflow/flock_workflow.py,sha256=sKFsRIL_bDGonXSNhK1zwu6UechghC_PihJJMidI-VI,9139
|
|
552
552
|
flock/workflow/temporal_config.py,sha256=3_8O7SDEjMsSMXsWJBfnb6XTp0TFaz39uyzSlMTSF_I,3988
|
|
553
553
|
flock/workflow/temporal_setup.py,sha256=KR6MlWOrpMtv8NyhaIPAsfl4tjobt81OBByQvg8Kw-Y,1948
|
|
554
|
-
flock_core-0.5.
|
|
555
|
-
flock_core-0.5.
|
|
556
|
-
flock_core-0.5.
|
|
557
|
-
flock_core-0.5.
|
|
558
|
-
flock_core-0.5.
|
|
554
|
+
flock_core-0.5.0b19.dist-info/METADATA,sha256=IIENs1thHIvHmhkyhR3G62jimiMS7_ImCmVLv3AKAlQ,9997
|
|
555
|
+
flock_core-0.5.0b19.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
556
|
+
flock_core-0.5.0b19.dist-info/entry_points.txt,sha256=rWaS5KSpkTmWySURGFZk6PhbJ87TmvcFQDi2uzjlagQ,37
|
|
557
|
+
flock_core-0.5.0b19.dist-info/licenses/LICENSE,sha256=iYEqWy0wjULzM9GAERaybP4LBiPeu7Z1NEliLUdJKSc,1072
|
|
558
|
+
flock_core-0.5.0b19.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|