flock-core 0.5.22__py3-none-any.whl → 0.5.23__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/core/agent.py +1 -5
- flock/core/orchestrator.py +17 -1
- flock/semantic/embedding_service.py +6 -2
- {flock_core-0.5.22.dist-info → flock_core-0.5.23.dist-info}/METADATA +2 -2
- {flock_core-0.5.22.dist-info → flock_core-0.5.23.dist-info}/RECORD +8 -8
- {flock_core-0.5.22.dist-info → flock_core-0.5.23.dist-info}/WHEEL +0 -0
- {flock_core-0.5.22.dist-info → flock_core-0.5.23.dist-info}/entry_points.txt +0 -0
- {flock_core-0.5.22.dist-info → flock_core-0.5.23.dist-info}/licenses/LICENSE +0 -0
flock/core/agent.py
CHANGED
|
@@ -226,11 +226,7 @@ class Agent(metaclass=AutoTracedMeta):
|
|
|
226
226
|
comp_name = self._component_display_name(component)
|
|
227
227
|
priority = getattr(component, "priority", 0)
|
|
228
228
|
logger.info(
|
|
229
|
-
"Agent
|
|
230
|
-
self.name,
|
|
231
|
-
comp_name,
|
|
232
|
-
priority,
|
|
233
|
-
len(self.utilities),
|
|
229
|
+
f"Agent {self.name}: utility added: component={comp_name}, priority={priority}, total_utilities={len(self.utilities)}"
|
|
234
230
|
)
|
|
235
231
|
self.utilities.sort(key=lambda comp: getattr(comp, "priority", 0))
|
|
236
232
|
|
flock/core/orchestrator.py
CHANGED
|
@@ -492,13 +492,17 @@ class Flock(metaclass=AutoTracedMeta):
|
|
|
492
492
|
|
|
493
493
|
# Runtime --------------------------------------------------------------
|
|
494
494
|
|
|
495
|
-
async def run_until_idle(self) -> None:
|
|
495
|
+
async def run_until_idle(self, *, wait_for_input: bool = False) -> None:
|
|
496
496
|
"""Wait for all scheduled agent tasks to complete.
|
|
497
497
|
|
|
498
498
|
This method blocks until the blackboard reaches a stable state where no
|
|
499
499
|
agents are queued for execution. Essential for batch processing and ensuring
|
|
500
500
|
all agent cascades complete before continuing.
|
|
501
501
|
|
|
502
|
+
Args:
|
|
503
|
+
wait_for_input: If True, waits for user input before returning (default: False).
|
|
504
|
+
Useful for debugging or step-by-step execution.
|
|
505
|
+
|
|
502
506
|
Note:
|
|
503
507
|
Automatically resets circuit breaker counters and shuts down MCP connections
|
|
504
508
|
when idle. Used with publish() for event-driven workflows.
|
|
@@ -514,6 +518,12 @@ class Flock(metaclass=AutoTracedMeta):
|
|
|
514
518
|
>>> await flock.publish_many([task1, task2, task3])
|
|
515
519
|
>>> await flock.run_until_idle() # All tasks processed in parallel
|
|
516
520
|
|
|
521
|
+
>>> # Step-by-step execution with user prompts
|
|
522
|
+
>>> await flock.publish(task1)
|
|
523
|
+
>>> await flock.run_until_idle(wait_for_input=True) # Pauses for user input
|
|
524
|
+
>>> await flock.publish(task2)
|
|
525
|
+
>>> await flock.run_until_idle(wait_for_input=True) # Pauses again
|
|
526
|
+
|
|
517
527
|
See Also:
|
|
518
528
|
- publish(): Event-driven artifact publishing
|
|
519
529
|
- publish_many(): Batch publishing for parallel execution
|
|
@@ -553,6 +563,12 @@ class Flock(metaclass=AutoTracedMeta):
|
|
|
553
563
|
# Automatically shutdown MCP connections when idle
|
|
554
564
|
await self.shutdown(include_components=False)
|
|
555
565
|
|
|
566
|
+
# Wait for user input if requested
|
|
567
|
+
if wait_for_input:
|
|
568
|
+
# Use asyncio.to_thread to avoid blocking the event loop
|
|
569
|
+
# since input() is a blocking I/O operation
|
|
570
|
+
await asyncio.to_thread(input, "Press any key to continue....")
|
|
571
|
+
|
|
556
572
|
async def direct_invoke(
|
|
557
573
|
self, agent: Agent, inputs: Sequence[BaseModel | Mapping[str, Any] | Artifact]
|
|
558
574
|
) -> list[Artifact]:
|
|
@@ -4,13 +4,13 @@ This module provides a singleton service for generating and caching embeddings
|
|
|
4
4
|
using sentence-transformers.
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
from flock.logging.logging import get_logger
|
|
8
8
|
from collections import OrderedDict
|
|
9
9
|
|
|
10
10
|
import numpy as np
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
logger =
|
|
13
|
+
logger = get_logger(__name__)
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
class LRUCache:
|
|
@@ -213,6 +213,10 @@ class EmbeddingService:
|
|
|
213
213
|
|
|
214
214
|
similarity = dot_product / (norm1 * norm2)
|
|
215
215
|
|
|
216
|
+
logger.debug(
|
|
217
|
+
f"Computed similarity: {similarity:.4f} between texts '{text1}' and '{text2}'",
|
|
218
|
+
)
|
|
219
|
+
|
|
216
220
|
# Clamp to [0, 1] and handle floating point errors
|
|
217
221
|
return float(max(0.0, min(1.0, similarity)))
|
|
218
222
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flock-core
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.23
|
|
4
4
|
Summary: Flock: A declrative framework for building and orchestrating AI agents.
|
|
5
5
|
Author-email: Andre Ratzenberger <andre.ratzenberger@whiteduck.de>
|
|
6
6
|
License: MIT
|
|
@@ -43,7 +43,7 @@ Description-Content-Type: text/markdown
|
|
|
43
43
|
<a href="LICENSE" target="_blank"><img alt="License" src="https://img.shields.io/github/license/whiteducksoftware/flock?style=for-the-badge"></a>
|
|
44
44
|
<a href="https://whiteduck.de" target="_blank"><img alt="Built by white duck" src="https://img.shields.io/badge/Built%20by-white%20duck%20GmbH-white?style=for-the-badge&labelColor=black"></a>
|
|
45
45
|
<a href="https://codecov.io/gh/whiteducksoftware/flock" target="_blank"><img alt="Test Coverage" src="https://codecov.io/gh/whiteducksoftware/flock/branch/main/graph/badge.svg?token=YOUR_TOKEN_HERE&style=for-the-badge"></a>
|
|
46
|
-
<img alt="Tests" src="https://img.shields.io/badge/tests-
|
|
46
|
+
<img alt="Tests" src="https://img.shields.io/badge/tests-1400+-brightgreen?style=for-the-badge">
|
|
47
47
|
</p>
|
|
48
48
|
|
|
49
49
|
---
|
|
@@ -23,10 +23,10 @@ flock/components/orchestrator/circuit_breaker.py,sha256=SH4pNFpe7MnkIRuK5TmRFBBO
|
|
|
23
23
|
flock/components/orchestrator/collection.py,sha256=oTXDqNZgliwVqZO8e49mX3yEWxflzeZdD7UnbcHWypk,5572
|
|
24
24
|
flock/components/orchestrator/deduplication.py,sha256=w4fwg3nLmb2TXPSSN3GEq5XPwviEEmmwu3fceSejBXw,2464
|
|
25
25
|
flock/core/__init__.py,sha256=pEE4dbPtSEIC1WQYK8USWbF0EmZhccTfDO7eh7lzD-s,574
|
|
26
|
-
flock/core/agent.py,sha256=
|
|
26
|
+
flock/core/agent.py,sha256=iP6AfNUb_446eu-4NAJsqVuGLyf4H46n-aZUXw1Jqk4,38118
|
|
27
27
|
flock/core/artifacts.py,sha256=dHDjn3DgS0Yo62oFoafQcdYNtqFrqLCzkvUytwm5VGU,2532
|
|
28
28
|
flock/core/context_provider.py,sha256=1RG4lYhDNTshAQA1PwZELtUF2UDdC5NZWcBlE4BKDtc,20260
|
|
29
|
-
flock/core/orchestrator.py,sha256=
|
|
29
|
+
flock/core/orchestrator.py,sha256=nORdp2BtNUL1U3DKxOQEYk4_t3ykUws7KnDTO2HehPw,42991
|
|
30
30
|
flock/core/store.py,sha256=4Zyh73RjjiUTtYTYiZ1pajWVXWKIew0dFERTNgQxRAA,31964
|
|
31
31
|
flock/core/subscription.py,sha256=x2kkbaAbqFqR2woCYhc0a7Xi2k4-EYt8-LCNnTtN-jQ,10768
|
|
32
32
|
flock/core/visibility.py,sha256=uwscg32t6Dp9LuA_EVDT5-_1lotzZWWS9Dl1foyJDxo,2926
|
|
@@ -235,7 +235,7 @@ flock/patches/__init__.py,sha256=KfRTpO_rz547iKxJDknymar1P3lS_8AhDh-sR1BkcZ0,194
|
|
|
235
235
|
flock/patches/dspy_streaming_patch.py,sha256=OQeLYWmL-7rqudphMwERnpvXhXamnvYn3xNcySajacY,2879
|
|
236
236
|
flock/semantic/__init__.py,sha256=ECd5EhdJjnlNA3BJiVlArvvJlVVjUPBlL5aH0Au7P5g,1568
|
|
237
237
|
flock/semantic/context_provider.py,sha256=qkJ2_KHBZk2Mjj3cvtdzdIkvZON79WFLkHUTeyGn7X0,5793
|
|
238
|
-
flock/semantic/embedding_service.py,sha256=
|
|
238
|
+
flock/semantic/embedding_service.py,sha256=_oRl9z7srZu55gokLxt7IntsgfL9UcEKNLfpqy3hyQ8,7166
|
|
239
239
|
flock/storage/__init__.py,sha256=9-p-RTpxGJOksfDavbpUsTghSIjDGtWCEC3bpVuYZY0,249
|
|
240
240
|
flock/storage/artifact_aggregator.py,sha256=wMpoXjko9UmfMmQ_qUTzSX-nhb0k8BVRlzRLHlkKEug,5176
|
|
241
241
|
flock/storage/in_memory/__init__.py,sha256=XPYxGNnpDjiv_L1tj8AxfORA_xHP16FV8t5UqrhtFLk,138
|
|
@@ -594,8 +594,8 @@ flock/utils/utilities.py,sha256=E3EQDo5SLU4XeoL3-PCc4lOatJHFEkMHKbZhnGhdMG4,1248
|
|
|
594
594
|
flock/utils/validation.py,sha256=Vqzd8Qi73ttJNSHdr8EUEonyfzAYWVfEyW0fhLs1bA4,1847
|
|
595
595
|
flock/utils/visibility.py,sha256=riJfHFWH8R2vk3DU7PYNi2LMaE8cy8pnMvxxiqWq-4I,2349
|
|
596
596
|
flock/utils/visibility_utils.py,sha256=eGA28aL8FnGyGzsbVNvqI1UoPauu1Jedl5LUZ5oWZZ0,3874
|
|
597
|
-
flock_core-0.5.
|
|
598
|
-
flock_core-0.5.
|
|
599
|
-
flock_core-0.5.
|
|
600
|
-
flock_core-0.5.
|
|
601
|
-
flock_core-0.5.
|
|
597
|
+
flock_core-0.5.23.dist-info/METADATA,sha256=OBvwI2Axlv2FqwJ34d1c437TH93uRAKCS5_L5k0iOkY,31235
|
|
598
|
+
flock_core-0.5.23.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
599
|
+
flock_core-0.5.23.dist-info/entry_points.txt,sha256=UQdPmtHd97gSA_IdLt9MOd-1rrf_WO-qsQeIiHWVrp4,42
|
|
600
|
+
flock_core-0.5.23.dist-info/licenses/LICENSE,sha256=U3IZuTbC0yLj7huwJdldLBipSOHF4cPf6cUOodFiaBE,1072
|
|
601
|
+
flock_core-0.5.23.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|