flock-core 0.2.13__py3-none-any.whl → 0.2.15__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/__init__.py +56 -0
- flock/cli/constants.py +23 -0
- flock/cli/create_agent.py +1 -0
- flock/cli/create_flock.py +1 -0
- flock/cli/load_agent.py +1 -0
- flock/cli/load_examples.py +1 -0
- flock/cli/load_flock.py +38 -0
- flock/cli/settings.py +1 -0
- flock/config.py +0 -1
- flock/core/execution/local_executor.py +7 -3
- flock/core/execution/temporal_executor.py +1 -8
- flock/core/flock.py +197 -34
- flock/core/flock_agent.py +89 -9
- flock/core/logging/formatters/enum_builder.py +38 -0
- flock/core/logging/formatters/theme_builder.py +2 -6
- flock/core/logging/formatters/themed_formatter.py +127 -19
- flock/core/logging/formatters/themes.py +340 -0
- flock/core/logging/telemetry.py +1 -1
- flock/core/mixin/dspy_integration.py +6 -1
- flock/workflow/activities.py +2 -19
- {flock_core-0.2.13.dist-info → flock_core-0.2.15.dist-info}/METADATA +2 -1
- {flock_core-0.2.13.dist-info → flock_core-0.2.15.dist-info}/RECORD +25 -20
- flock/core/logging/formatters/base_formatter.py +0 -36
- flock/core/logging/formatters/formatter_factory.py +0 -38
- flock/core/logging/formatters/pprint_formatter.py +0 -25
- flock/core/logging/formatters/rich_formatters.py +0 -132
- {flock_core-0.2.13.dist-info → flock_core-0.2.15.dist-info}/WHEEL +0 -0
- {flock_core-0.2.13.dist-info → flock_core-0.2.15.dist-info}/entry_points.txt +0 -0
- {flock_core-0.2.13.dist-info → flock_core-0.2.15.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class OutputTheme(Enum):
|
|
5
|
+
tomorrow_night_eighties = "tomorrow-night-eighties"
|
|
6
|
+
builtin_light = "builtin-light"
|
|
7
|
+
iterm2_dark_background = "iterm2-dark-background"
|
|
8
|
+
zenbones = "zenbones"
|
|
9
|
+
iterm2_tango_dark = "iterm2-tango-dark"
|
|
10
|
+
gruber_darker = "gruber-darker"
|
|
11
|
+
scarlet_protocol = "scarlet-protocol"
|
|
12
|
+
purplepeter = "purplepeter"
|
|
13
|
+
seashells = "seashells"
|
|
14
|
+
monokai_soda = "monokai-soda"
|
|
15
|
+
wildcherry = "wildcherry"
|
|
16
|
+
builtin_solarized_light = "builtin-solarized-light"
|
|
17
|
+
firewatch = "firewatch"
|
|
18
|
+
builtin_tango_dark = "builtin-tango-dark"
|
|
19
|
+
spacedust = "spacedust"
|
|
20
|
+
paraiso_dark = "paraiso-dark"
|
|
21
|
+
nightlion_v2 = "nightlion-v2"
|
|
22
|
+
misterioso = "misterioso"
|
|
23
|
+
shades_of_purple = "shades-of-purple"
|
|
24
|
+
red_planet = "red-planet"
|
|
25
|
+
flat = "flat"
|
|
26
|
+
terafox = "terafox"
|
|
27
|
+
crayonponyfish = "crayonponyfish"
|
|
28
|
+
elementary = "elementary"
|
|
29
|
+
blulocolight = "blulocolight"
|
|
30
|
+
blazer = "blazer"
|
|
31
|
+
purple_rain = "purple-rain"
|
|
32
|
+
aurora = "aurora"
|
|
33
|
+
neutron = "neutron"
|
|
34
|
+
alienblood = "alienblood"
|
|
35
|
+
symfonic = "symfonic"
|
|
36
|
+
pro = "pro"
|
|
37
|
+
highway = "highway"
|
|
38
|
+
grape = "grape"
|
|
39
|
+
hax0r_blue = "hax0r-blue"
|
|
40
|
+
zenwritten_light = "zenwritten-light"
|
|
41
|
+
spacegray = "spacegray"
|
|
42
|
+
everblush = "everblush"
|
|
43
|
+
popping_and_locking = "popping-and-locking"
|
|
44
|
+
zenburn = "zenburn"
|
|
45
|
+
monalisa = "monalisa"
|
|
46
|
+
deep = "deep"
|
|
47
|
+
ir_black = "ir-black"
|
|
48
|
+
wombat = "wombat"
|
|
49
|
+
zenbones_light = "zenbones-light"
|
|
50
|
+
darkermatrix = "darkermatrix"
|
|
51
|
+
wez = "wez"
|
|
52
|
+
matrix = "matrix"
|
|
53
|
+
farmhouse_light = "farmhouse-light"
|
|
54
|
+
sublette = "sublette"
|
|
55
|
+
nocturnal_winter = "nocturnal-winter"
|
|
56
|
+
ryuuko = "ryuuko"
|
|
57
|
+
jackie_brown = "jackie-brown"
|
|
58
|
+
framer = "framer"
|
|
59
|
+
_3024_day = "3024-day"
|
|
60
|
+
lovelace = "lovelace"
|
|
61
|
+
teerb = "teerb"
|
|
62
|
+
fairyfloss = "fairyfloss"
|
|
63
|
+
tokyonight = "tokyonight"
|
|
64
|
+
xcodelighthc = "xcodelighthc"
|
|
65
|
+
iceberg_light = "iceberg-light"
|
|
66
|
+
gruvboxlight = "gruvboxlight"
|
|
67
|
+
tomorrow = "tomorrow"
|
|
68
|
+
sleepyhollow = "sleepyhollow"
|
|
69
|
+
monokai_vivid = "monokai-vivid"
|
|
70
|
+
synthwave_everything = "synthwave-everything"
|
|
71
|
+
tomorrow_night_burns = "tomorrow-night-burns"
|
|
72
|
+
hurtado = "hurtado"
|
|
73
|
+
dotgov = "dotgov"
|
|
74
|
+
adventure = "adventure"
|
|
75
|
+
tomorrow_night = "tomorrow-night"
|
|
76
|
+
arthur = "arthur"
|
|
77
|
+
fahrenheit = "fahrenheit"
|
|
78
|
+
oxocarbon = "oxocarbon"
|
|
79
|
+
violet_dark = "violet-dark"
|
|
80
|
+
adventuretime = "adventuretime"
|
|
81
|
+
vesper = "vesper"
|
|
82
|
+
overnight_slumber = "overnight-slumber"
|
|
83
|
+
japanesque = "japanesque"
|
|
84
|
+
encom = "encom"
|
|
85
|
+
brogrammer = "brogrammer"
|
|
86
|
+
_3024_night = "3024-night"
|
|
87
|
+
hivacruz = "hivacruz"
|
|
88
|
+
darkmatrix = "darkmatrix"
|
|
89
|
+
synthwavealpha = "synthwavealpha"
|
|
90
|
+
aardvark_blue = "aardvark-blue"
|
|
91
|
+
xcodewwdc = "xcodewwdc"
|
|
92
|
+
chester = "chester"
|
|
93
|
+
flatland = "flatland"
|
|
94
|
+
n0tch2k = "n0tch2k"
|
|
95
|
+
molokai = "molokai"
|
|
96
|
+
violet_light = "violet-light"
|
|
97
|
+
solarized_darcula = "solarized-darcula"
|
|
98
|
+
espresso = "espresso"
|
|
99
|
+
darkside = "darkside"
|
|
100
|
+
flexoki_light = "flexoki-light"
|
|
101
|
+
bright_lights = "bright-lights"
|
|
102
|
+
clrs = "clrs"
|
|
103
|
+
firefly_traditional = "firefly-traditional"
|
|
104
|
+
forestblue = "forestblue"
|
|
105
|
+
batman = "batman"
|
|
106
|
+
snazzy = "snazzy"
|
|
107
|
+
wryan = "wryan"
|
|
108
|
+
kurokula = "kurokula"
|
|
109
|
+
iterm2_pastel_dark_background = "iterm2-pastel-dark-background"
|
|
110
|
+
afterglow = "afterglow"
|
|
111
|
+
seoulbones_light = "seoulbones-light"
|
|
112
|
+
ollie = "ollie"
|
|
113
|
+
shaman = "shaman"
|
|
114
|
+
liquidcarbontransparent = "liquidcarbontransparent"
|
|
115
|
+
ayu_mirage = "ayu-mirage"
|
|
116
|
+
kolorit = "kolorit"
|
|
117
|
+
red_sands = "red-sands"
|
|
118
|
+
funforrest = "funforrest"
|
|
119
|
+
unikitty = "unikitty"
|
|
120
|
+
espresso_libre = "espresso-libre"
|
|
121
|
+
ultraviolent = "ultraviolent"
|
|
122
|
+
ayu_light = "ayu-light"
|
|
123
|
+
terminal_basic = "terminal-basic"
|
|
124
|
+
paulmillr = "paulmillr"
|
|
125
|
+
github = "github"
|
|
126
|
+
hacktober = "hacktober"
|
|
127
|
+
ayu_copy = "ayu copy"
|
|
128
|
+
material = "material"
|
|
129
|
+
vimbones = "vimbones"
|
|
130
|
+
arcoiris = "arcoiris"
|
|
131
|
+
wilmersdorf = "wilmersdorf"
|
|
132
|
+
desert = "desert"
|
|
133
|
+
rouge_2 = "rouge-2"
|
|
134
|
+
doom_peacock = "doom-peacock"
|
|
135
|
+
smyck = "smyck"
|
|
136
|
+
cutiepro = "cutiepro"
|
|
137
|
+
nvimlight = "nvimlight"
|
|
138
|
+
hipster_green = "hipster-green"
|
|
139
|
+
spiderman = "spiderman"
|
|
140
|
+
nvimdark = "nvimdark"
|
|
141
|
+
sugarplum = "sugarplum"
|
|
142
|
+
catppuccin_latte = "catppuccin-latte"
|
|
143
|
+
dayfox = "dayfox"
|
|
144
|
+
seafoam_pastel = "seafoam-pastel"
|
|
145
|
+
peppermint = "peppermint"
|
|
146
|
+
tokyonight_storm = "tokyonight-storm"
|
|
147
|
+
mariana = "mariana"
|
|
148
|
+
novel = "novel"
|
|
149
|
+
argonaut_copy = "argonaut copy"
|
|
150
|
+
twilight = "twilight"
|
|
151
|
+
xcodelight = "xcodelight"
|
|
152
|
+
homebrew = "homebrew"
|
|
153
|
+
ateliersulphurpool = "ateliersulphurpool"
|
|
154
|
+
thayer_bright = "thayer-bright"
|
|
155
|
+
konsolas = "konsolas"
|
|
156
|
+
iterm2_solarized_light = "iterm2-solarized-light"
|
|
157
|
+
midnight_in_mojave = "midnight-in-mojave"
|
|
158
|
+
materialdarker = "materialdarker"
|
|
159
|
+
royal = "royal"
|
|
160
|
+
builtin_tango_light = "builtin-tango-light"
|
|
161
|
+
idletoes = "idletoes"
|
|
162
|
+
operator_mono_dark = "operator-mono-dark"
|
|
163
|
+
cyberdyne = "cyberdyne"
|
|
164
|
+
atom = "atom"
|
|
165
|
+
hybrid = "hybrid"
|
|
166
|
+
slate = "slate"
|
|
167
|
+
duckbones = "duckbones"
|
|
168
|
+
tinacious_design__dark_ = "tinacious-design-(dark)"
|
|
169
|
+
kibble = "kibble"
|
|
170
|
+
sakura = "sakura"
|
|
171
|
+
lab_fox = "lab-fox"
|
|
172
|
+
blue_matrix = "blue-matrix"
|
|
173
|
+
materialdesigncolors = "materialdesigncolors"
|
|
174
|
+
seoulbones_dark = "seoulbones-dark"
|
|
175
|
+
seti = "seti"
|
|
176
|
+
solarized_dark_higher_contrast = "solarized-dark-higher-contrast"
|
|
177
|
+
chalkboard = "chalkboard"
|
|
178
|
+
mathias = "mathias"
|
|
179
|
+
neobones_dark = "neobones-dark"
|
|
180
|
+
alabaster = "alabaster"
|
|
181
|
+
djangorebornagain = "djangorebornagain"
|
|
182
|
+
ayu = "ayu"
|
|
183
|
+
iterm2_default = "iterm2-default"
|
|
184
|
+
mirage = "mirage"
|
|
185
|
+
firefoxdev = "firefoxdev"
|
|
186
|
+
nightfox = "nightfox"
|
|
187
|
+
grey_green = "grey-green"
|
|
188
|
+
broadcast = "broadcast"
|
|
189
|
+
solarized_dark___patched = "solarized-dark---patched"
|
|
190
|
+
flexoki_dark = "flexoki-dark"
|
|
191
|
+
challengerdeep = "challengerdeep"
|
|
192
|
+
onehalflight = "onehalflight"
|
|
193
|
+
earthsong = "earthsong"
|
|
194
|
+
kanagawabones = "kanagawabones"
|
|
195
|
+
gruvboxdarkhard = "gruvboxdarkhard"
|
|
196
|
+
abernathy = "abernathy"
|
|
197
|
+
oceanicmaterial = "oceanicmaterial"
|
|
198
|
+
medallion = "medallion"
|
|
199
|
+
pnevma = "pnevma"
|
|
200
|
+
birdsofparadise = "birdsofparadise"
|
|
201
|
+
toychest = "toychest"
|
|
202
|
+
dimidium = "dimidium"
|
|
203
|
+
cyberpunk = "cyberpunk"
|
|
204
|
+
duotone_dark = "duotone-dark"
|
|
205
|
+
whimsy = "whimsy"
|
|
206
|
+
nord_light = "nord-light"
|
|
207
|
+
belafonte_day = "belafonte-day"
|
|
208
|
+
square = "square"
|
|
209
|
+
retro = "retro"
|
|
210
|
+
pandora = "pandora"
|
|
211
|
+
galaxy = "galaxy"
|
|
212
|
+
the_hulk = "the-hulk"
|
|
213
|
+
rose_pine_moon = "rose-pine-moon"
|
|
214
|
+
coffee_theme = "coffee-theme"
|
|
215
|
+
tomorrow_night_bright = "tomorrow-night-bright"
|
|
216
|
+
blulocodark = "blulocodark"
|
|
217
|
+
sundried = "sundried"
|
|
218
|
+
rippedcasts = "rippedcasts"
|
|
219
|
+
glacier = "glacier"
|
|
220
|
+
zenwritten_dark = "zenwritten-dark"
|
|
221
|
+
xcodedarkhc = "xcodedarkhc"
|
|
222
|
+
iterm2_solarized_dark = "iterm2-solarized-dark"
|
|
223
|
+
softserver = "softserver"
|
|
224
|
+
jubi = "jubi"
|
|
225
|
+
fishtank = "fishtank"
|
|
226
|
+
spacegray_eighties_dull = "spacegray-eighties-dull"
|
|
227
|
+
raycast_light = "raycast-light"
|
|
228
|
+
tinacious_design__light_ = "tinacious-design-(light)"
|
|
229
|
+
gruvboxdark = "gruvboxdark"
|
|
230
|
+
piatto_light = "piatto-light"
|
|
231
|
+
grass = "grass"
|
|
232
|
+
catppuccin_mocha = "catppuccin-mocha"
|
|
233
|
+
hardcore = "hardcore"
|
|
234
|
+
tokyonight_day = "tokyonight-day"
|
|
235
|
+
underthesea = "underthesea"
|
|
236
|
+
guezwhoz = "guezwhoz"
|
|
237
|
+
borland = "borland"
|
|
238
|
+
argonaut = "argonaut"
|
|
239
|
+
farmhouse_dark = "farmhouse-dark"
|
|
240
|
+
rapture = "rapture"
|
|
241
|
+
zenbones_dark = "zenbones-dark"
|
|
242
|
+
iceberg_dark = "iceberg-dark"
|
|
243
|
+
pro_light = "pro-light"
|
|
244
|
+
jellybeans = "jellybeans"
|
|
245
|
+
later_this_evening = "later-this-evening"
|
|
246
|
+
blueberrypie = "blueberrypie"
|
|
247
|
+
vibrantink = "vibrantink"
|
|
248
|
+
dimmedmonokai = "dimmedmonokai"
|
|
249
|
+
catppuccin_macchiato = "catppuccin-macchiato"
|
|
250
|
+
ocean = "ocean"
|
|
251
|
+
banana_blueberry = "banana-blueberry"
|
|
252
|
+
dark_ = "dark+"
|
|
253
|
+
neopolitan = "neopolitan"
|
|
254
|
+
relaxed = "relaxed"
|
|
255
|
+
galizur = "galizur"
|
|
256
|
+
liquidcarbon = "liquidcarbon"
|
|
257
|
+
hax0r_gr33n = "hax0r-gr33n"
|
|
258
|
+
ic_orange_ppl = "ic-orange-ppl"
|
|
259
|
+
niji = "niji"
|
|
260
|
+
liquidcarbontransparentinverse = "liquidcarbontransparentinverse"
|
|
261
|
+
github_dark = "github-dark"
|
|
262
|
+
zenburned = "zenburned"
|
|
263
|
+
django = "django"
|
|
264
|
+
rose_pine_dawn = "rose-pine-dawn"
|
|
265
|
+
builtin_dark = "builtin-dark"
|
|
266
|
+
iterm2_smoooooth = "iterm2-smoooooth"
|
|
267
|
+
neon = "neon"
|
|
268
|
+
raycast_dark = "raycast-dark"
|
|
269
|
+
palenighthc = "palenighthc"
|
|
270
|
+
laser = "laser"
|
|
271
|
+
builtin_solarized_dark = "builtin-solarized-dark"
|
|
272
|
+
cobalt2 = "cobalt2"
|
|
273
|
+
breeze = "breeze"
|
|
274
|
+
apple_classic = "apple-classic"
|
|
275
|
+
c64 = "c64"
|
|
276
|
+
calamity = "calamity"
|
|
277
|
+
onehalfdark = "onehalfdark"
|
|
278
|
+
neobones_light = "neobones-light"
|
|
279
|
+
dracula = "dracula"
|
|
280
|
+
spring = "spring"
|
|
281
|
+
monokai_remastered = "monokai-remastered"
|
|
282
|
+
lavandula = "lavandula"
|
|
283
|
+
night_owlish_light = "night-owlish-light"
|
|
284
|
+
builtin_pastel_dark = "builtin-pastel-dark"
|
|
285
|
+
frontenddelight = "frontenddelight"
|
|
286
|
+
tango_adapted = "tango-adapted"
|
|
287
|
+
ubuntu = "ubuntu"
|
|
288
|
+
oceanic_next = "oceanic-next"
|
|
289
|
+
primary = "primary"
|
|
290
|
+
materialdark = "materialdark"
|
|
291
|
+
doomone = "doomone"
|
|
292
|
+
rose_pine = "rose-pine"
|
|
293
|
+
chalk = "chalk"
|
|
294
|
+
andromeda = "andromeda"
|
|
295
|
+
djangosmooth = "djangosmooth"
|
|
296
|
+
red_alert = "red-alert"
|
|
297
|
+
warmneon = "warmneon"
|
|
298
|
+
man_page = "man-page"
|
|
299
|
+
hopscotch = "hopscotch"
|
|
300
|
+
urple = "urple"
|
|
301
|
+
tomorrow_night_blue = "tomorrow-night-blue"
|
|
302
|
+
atomonelight = "atomonelight"
|
|
303
|
+
pencillight = "pencillight"
|
|
304
|
+
ciapre = "ciapre"
|
|
305
|
+
dracula_ = "dracula+"
|
|
306
|
+
hopscotch_256 = "hopscotch.256"
|
|
307
|
+
fideloper = "fideloper"
|
|
308
|
+
treehouse = "treehouse"
|
|
309
|
+
ic_green_ppl = "ic-green-ppl"
|
|
310
|
+
tango_half_adapted = "tango-half-adapted"
|
|
311
|
+
belafonte_night = "belafonte-night"
|
|
312
|
+
iterm2_light_background = "iterm2-light-background"
|
|
313
|
+
harper = "harper"
|
|
314
|
+
mellifluous = "mellifluous"
|
|
315
|
+
rebecca = "rebecca"
|
|
316
|
+
cga = "cga"
|
|
317
|
+
cobalt_neon = "cobalt-neon"
|
|
318
|
+
synthwave = "synthwave"
|
|
319
|
+
pencildark = "pencildark"
|
|
320
|
+
cyberpunkscarletprotocol = "cyberpunkscarletprotocol"
|
|
321
|
+
iterm2_tango_light = "iterm2-tango-light"
|
|
322
|
+
subliminal = "subliminal"
|
|
323
|
+
idea = "idea"
|
|
324
|
+
xcodedark = "xcodedark"
|
|
325
|
+
apple_system_colors = "apple-system-colors"
|
|
326
|
+
hax0r_r3d = "hax0r-r3d"
|
|
327
|
+
atom_test = "atom_test"
|
|
328
|
+
floraverse = "floraverse"
|
|
329
|
+
materialocean = "materialocean"
|
|
330
|
+
nord = "nord"
|
|
331
|
+
vaughn = "vaughn"
|
|
332
|
+
obsidian = "obsidian"
|
|
333
|
+
jetbrains_darcula = "jetbrains-darcula"
|
|
334
|
+
elemental = "elemental"
|
|
335
|
+
spacegray_eighties = "spacegray-eighties"
|
|
336
|
+
nightlion_v1 = "nightlion-v1"
|
|
337
|
+
bluedolphin = "bluedolphin"
|
|
338
|
+
catppuccin_frappe = "catppuccin-frappe"
|
|
339
|
+
dark_pastel = "dark-pastel"
|
|
340
|
+
ultradark = "ultradark"
|
flock/core/logging/telemetry.py
CHANGED
|
@@ -118,7 +118,7 @@ class TelemetryConfig:
|
|
|
118
118
|
provider.add_span_processor(
|
|
119
119
|
BaggageAttributeSpanProcessor(baggage_keys=["session_id", "run_id"])
|
|
120
120
|
)
|
|
121
|
-
self.global_tracer = trace.get_tracer("flock")
|
|
121
|
+
# self.global_tracer = trace.get_tracer("flock")
|
|
122
122
|
sys.excepthook = self.log_exception_to_otel
|
|
123
123
|
|
|
124
124
|
def log_exception_to_otel(self, exc_type, exc_value, exc_traceback):
|
|
@@ -147,7 +147,12 @@ class DSPyIntegrationMixin:
|
|
|
147
147
|
import dspy
|
|
148
148
|
|
|
149
149
|
"""Initialize and configure the language model using dspy."""
|
|
150
|
-
lm = dspy.LM(
|
|
150
|
+
lm = dspy.LM(
|
|
151
|
+
self.model,
|
|
152
|
+
cache=self.use_cache,
|
|
153
|
+
temperature=self.config.temperature,
|
|
154
|
+
max_tokens=self.config.max_tokens,
|
|
155
|
+
)
|
|
151
156
|
dspy.configure(lm=lm)
|
|
152
157
|
|
|
153
158
|
def _select_task(
|
flock/workflow/activities.py
CHANGED
|
@@ -8,8 +8,6 @@ from temporalio import activity
|
|
|
8
8
|
from flock.core.context.context import FlockContext
|
|
9
9
|
from flock.core.context.context_vars import FLOCK_CURRENT_AGENT
|
|
10
10
|
from flock.core.flock_agent import FlockAgent, HandOff
|
|
11
|
-
from flock.core.logging.formatters.base_formatter import FormatterOptions
|
|
12
|
-
from flock.core.logging.formatters.formatter_factory import FormatterFactory
|
|
13
11
|
from flock.core.logging.logging import get_logger
|
|
14
12
|
from flock.core.registry.agent_registry import Registry
|
|
15
13
|
from flock.core.util.input_resolver import resolve_inputs
|
|
@@ -19,9 +17,7 @@ tracer = trace.get_tracer(__name__)
|
|
|
19
17
|
|
|
20
18
|
|
|
21
19
|
@activity.defn
|
|
22
|
-
async def run_agent(
|
|
23
|
-
context: FlockContext, output_formatter: FormatterOptions = None
|
|
24
|
-
) -> dict:
|
|
20
|
+
async def run_agent(context: FlockContext) -> dict:
|
|
25
21
|
"""Runs a chain of agents using the provided context.
|
|
26
22
|
|
|
27
23
|
The context contains state, history, and agent definitions.
|
|
@@ -64,7 +60,7 @@ async def run_agent(
|
|
|
64
60
|
with tracer.start_as_current_span("execute_agent") as exec_span:
|
|
65
61
|
logger.info("Executing agent", agent=agent.name)
|
|
66
62
|
try:
|
|
67
|
-
result = await agent.
|
|
63
|
+
result = await agent.run_async(agent_inputs)
|
|
68
64
|
exec_span.set_attribute("result", str(result))
|
|
69
65
|
logger.debug(
|
|
70
66
|
"Agent execution completed", agent=agent.name
|
|
@@ -78,19 +74,6 @@ async def run_agent(
|
|
|
78
74
|
exec_span.record_exception(e)
|
|
79
75
|
raise
|
|
80
76
|
|
|
81
|
-
# Optionally display formatted output.
|
|
82
|
-
display_output = True
|
|
83
|
-
if agent.config:
|
|
84
|
-
display_output = not agent.config.disable_output
|
|
85
|
-
|
|
86
|
-
if output_formatter and display_output:
|
|
87
|
-
formatter = FormatterFactory.create_formatter(
|
|
88
|
-
output_formatter
|
|
89
|
-
)
|
|
90
|
-
formatter.display(
|
|
91
|
-
result, agent.name, output_formatter.wait_for_input
|
|
92
|
-
)
|
|
93
|
-
|
|
94
77
|
# If there is no handoff, record the result and finish.
|
|
95
78
|
if not agent.hand_off:
|
|
96
79
|
context.record(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flock-core
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.15
|
|
4
4
|
Summary: Declarative LLM Orchestration at Scale
|
|
5
5
|
Author-email: Andre Ratzenberger <andre.ratzenberger@whiteduck.de>
|
|
6
6
|
License-File: LICENSE
|
|
@@ -24,6 +24,7 @@ Requires-Dist: opentelemetry-sdk>=1.30.0
|
|
|
24
24
|
Requires-Dist: pydantic>=2.10.5
|
|
25
25
|
Requires-Dist: python-box>=7.3.2
|
|
26
26
|
Requires-Dist: python-decouple>=3.8
|
|
27
|
+
Requires-Dist: questionary>=2.1.0
|
|
27
28
|
Requires-Dist: rich>=13.9.4
|
|
28
29
|
Requires-Dist: temporalio>=1.9.0
|
|
29
30
|
Requires-Dist: toml>=0.10.2
|
|
@@ -1,28 +1,33 @@
|
|
|
1
|
-
flock/__init__.py,sha256=
|
|
2
|
-
flock/config.py,sha256=
|
|
1
|
+
flock/__init__.py,sha256=Aw2FBlpdyOMFlV87CgBQkyHZx-FChzzGcBbZaE5EW0A,1420
|
|
2
|
+
flock/config.py,sha256=O5QJGlStf4DWSK4ovZsKw01ud4YK3_ij6Ay8sWU8ih0,1522
|
|
3
|
+
flock/cli/constants.py,sha256=nKdpNBPTjpoq7bfX8GP3fouRG_rYREsIgS-NffCWmaA,627
|
|
4
|
+
flock/cli/create_agent.py,sha256=DkeLUlrb7rGx3nZ04aADU9HXXu5mZTf_DBwT0xhzIv4,7
|
|
5
|
+
flock/cli/create_flock.py,sha256=DkeLUlrb7rGx3nZ04aADU9HXXu5mZTf_DBwT0xhzIv4,7
|
|
6
|
+
flock/cli/load_agent.py,sha256=DkeLUlrb7rGx3nZ04aADU9HXXu5mZTf_DBwT0xhzIv4,7
|
|
7
|
+
flock/cli/load_examples.py,sha256=DkeLUlrb7rGx3nZ04aADU9HXXu5mZTf_DBwT0xhzIv4,7
|
|
8
|
+
flock/cli/load_flock.py,sha256=3JdECvt5X7uyOG2vZS3-Zk5C5SI_84_QZjcsB3oJmfA,932
|
|
9
|
+
flock/cli/settings.py,sha256=DkeLUlrb7rGx3nZ04aADU9HXXu5mZTf_DBwT0xhzIv4,7
|
|
3
10
|
flock/core/__init__.py,sha256=0Xq_txurlxxjKGXjRn6GNJusGTiBcd7zw2eF0L7JyuU,183
|
|
4
|
-
flock/core/flock.py,sha256=
|
|
5
|
-
flock/core/flock_agent.py,sha256=
|
|
11
|
+
flock/core/flock.py,sha256=3EQqrAej3Tb1vLYsILkXBcV9Feb2b1ABUviM3Xp9tMs,17151
|
|
12
|
+
flock/core/flock_agent.py,sha256=GlmNGaN7lgJwDYbkQMUNY5yOAAq4rL5r7QvPLvtIs0Y,30576
|
|
6
13
|
flock/core/context/context.py,sha256=jH06w4C_O5CEL-YxjX_x_dmgLe9Rcllnn1Ebs0dvwaE,6171
|
|
7
14
|
flock/core/context/context_manager.py,sha256=qMySVny_dbTNLh21RHK_YT0mNKIOrqJDZpi9ZVdBsxU,1103
|
|
8
15
|
flock/core/context/context_vars.py,sha256=0Hn6fM2iNc0_jIIU0B7KX-K2o8qXqtZ5EYtwujETQ7U,272
|
|
9
|
-
flock/core/execution/local_executor.py,sha256=
|
|
10
|
-
flock/core/execution/temporal_executor.py,sha256=
|
|
16
|
+
flock/core/execution/local_executor.py,sha256=rnIQvaJOs6zZORUcR3vvyS6LPREDJTjaygl_Db0M8ao,952
|
|
17
|
+
flock/core/execution/temporal_executor.py,sha256=OF_uXgQsoUGp6U1ZkcuaidAEKyH7XDtbfrtdF10XQ_4,1675
|
|
11
18
|
flock/core/logging/__init__.py,sha256=Q8hp9-1ilPIUIV0jLgJ3_cP7COrea32cVwL7dicPnlM,82
|
|
12
19
|
flock/core/logging/logging.py,sha256=dOo_McbAt9_dST9Hr8RTpAGU-MHR_QvskIdmXrSvZRc,4789
|
|
13
|
-
flock/core/logging/telemetry.py,sha256=
|
|
20
|
+
flock/core/logging/telemetry.py,sha256=3E9Tyj6AUR6A5RlIufcdCdWm5BAA7tbOsCa7lHoUQaU,5404
|
|
14
21
|
flock/core/logging/trace_and_logged.py,sha256=5vNrK1kxuPMoPJ0-QjQg-EDJL1oiEzvU6UNi6X8FiMs,2117
|
|
15
|
-
flock/core/logging/formatters/
|
|
16
|
-
flock/core/logging/formatters/
|
|
17
|
-
flock/core/logging/formatters/
|
|
18
|
-
flock/core/logging/formatters/
|
|
19
|
-
flock/core/logging/formatters/theme_builder.py,sha256=1RUEwPIDfCjwTapbK1liasA5SdukOn7YwbZ4H4j1WkI,17364
|
|
20
|
-
flock/core/logging/formatters/themed_formatter.py,sha256=CbxmqUC7zkLzyIxngk-3dcpQ6vxPR6zaDNA2TAMitCI,16714
|
|
22
|
+
flock/core/logging/formatters/enum_builder.py,sha256=LgEYXUv84wK5vwHflZ5h8HBGgvLH3sByvUQe8tZiyY0,981
|
|
23
|
+
flock/core/logging/formatters/theme_builder.py,sha256=Wnaal3HuUDA4HFg9tdql1BxYwK83ACOZBBQy-DXnxcA,17342
|
|
24
|
+
flock/core/logging/formatters/themed_formatter.py,sha256=kCmGXLD8yzhfzENJUQOsqX3Sdo2PuN8JIZvBBWO22JI,20834
|
|
25
|
+
flock/core/logging/formatters/themes.py,sha256=vZqDyPlxZ1RGwzp8QCm0-Y0aXBZ62gTllulK6nbi_L4,10675
|
|
21
26
|
flock/core/logging/span_middleware/baggage_span_processor.py,sha256=gJfRl8FeB6jdtghTaRHCrOaTo4fhPMRKgjqtZj-8T48,1118
|
|
22
27
|
flock/core/logging/telemetry_exporter/base_exporter.py,sha256=rQJJzS6q9n2aojoSqwCnl7ZtHrh5LZZ-gkxUuI5WfrQ,1124
|
|
23
28
|
flock/core/logging/telemetry_exporter/file_exporter.py,sha256=nKAjJSZtA7FqHSTuTiFtYYepaxOq7l1rDvs8U8rSBlA,3023
|
|
24
29
|
flock/core/logging/telemetry_exporter/sqlite_exporter.py,sha256=CDsiMb9QcqeXelZ6ZqPSS56ovMPGqOu6whzBZRK__Vg,3498
|
|
25
|
-
flock/core/mixin/dspy_integration.py,sha256=
|
|
30
|
+
flock/core/mixin/dspy_integration.py,sha256=d4O3UdF6QTNWM29YtBNVb_iLWUrTUj6ovfy_iJs7DUc,8316
|
|
26
31
|
flock/core/mixin/prompt_parser.py,sha256=eOqI-FK3y17gVqpc_y5GF-WmK1Jv8mFlkZxTcgweoxI,5121
|
|
27
32
|
flock/core/registry/agent_registry.py,sha256=YkYIyvFNjm7gYKRAiQQdOvVYMtsYH5cijfrv_GP4ZHc,4889
|
|
28
33
|
flock/core/tools/basic_tools.py,sha256=OwWaFu4NoVrc3Uijj56RY9XDDaP_mOnEa5B3wSWwwLE,4756
|
|
@@ -370,12 +375,12 @@ flock/themes/zenburned.toml,sha256=UEmquBbcAO3Zj652XKUwCsNoC2iQSlIh-q5c6DH-7Kc,1
|
|
|
370
375
|
flock/themes/zenwritten-dark.toml,sha256=To5l6520_3UqAGiEumpzGWsHhXxqu9ThrMildXKgIO0,1669
|
|
371
376
|
flock/themes/zenwritten-light.toml,sha256=G1iEheCPfBNsMTGaVpEVpDzYBHA_T-MV27rolUYolmE,1666
|
|
372
377
|
flock/workflow/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
373
|
-
flock/workflow/activities.py,sha256=
|
|
378
|
+
flock/workflow/activities.py,sha256=2zcYyDoCuYs9oQbnhLjCzBUdEi7d5IEIemKJ7TV_B8w,6932
|
|
374
379
|
flock/workflow/agent_activities.py,sha256=NhBZscflEf2IMfSRa_pBM_TRP7uVEF_O0ROvWZ33eDc,963
|
|
375
380
|
flock/workflow/temporal_setup.py,sha256=VWBgmBgfTBjwM5ruS_dVpA5AVxx6EZ7oFPGw4j3m0l0,1091
|
|
376
381
|
flock/workflow/workflow.py,sha256=I9MryXW_bqYVTHx-nl2epbTqeRy27CAWHHA7ZZA0nAk,1696
|
|
377
|
-
flock_core-0.2.
|
|
378
|
-
flock_core-0.2.
|
|
379
|
-
flock_core-0.2.
|
|
380
|
-
flock_core-0.2.
|
|
381
|
-
flock_core-0.2.
|
|
382
|
+
flock_core-0.2.15.dist-info/METADATA,sha256=pDJnGyAiez6KJ4Sbw8crQrrjy_y4_UMgANYiNg0xJYg,12057
|
|
383
|
+
flock_core-0.2.15.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
384
|
+
flock_core-0.2.15.dist-info/entry_points.txt,sha256=rWaS5KSpkTmWySURGFZk6PhbJ87TmvcFQDi2uzjlagQ,37
|
|
385
|
+
flock_core-0.2.15.dist-info/licenses/LICENSE,sha256=iYEqWy0wjULzM9GAERaybP4LBiPeu7Z1NEliLUdJKSc,1072
|
|
386
|
+
flock_core-0.2.15.dist-info/RECORD,,
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
from abc import ABC, abstractmethod
|
|
2
|
-
from dataclasses import dataclass, field
|
|
3
|
-
from typing import Any
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class BaseFormatter(ABC):
|
|
7
|
-
def __init__(self, max_length: int = 1000) -> None:
|
|
8
|
-
self.max_length = max_length
|
|
9
|
-
|
|
10
|
-
def display(
|
|
11
|
-
self,
|
|
12
|
-
result: dict[str, Any],
|
|
13
|
-
agent_name: str,
|
|
14
|
-
wait: bool = False,
|
|
15
|
-
) -> None:
|
|
16
|
-
self.display_result(result, agent_name)
|
|
17
|
-
if wait:
|
|
18
|
-
input("Press Enter to continue...")
|
|
19
|
-
|
|
20
|
-
@abstractmethod
|
|
21
|
-
def display_result(self, result: dict[str, Any], agent_name: str) -> None:
|
|
22
|
-
"""Display an agent's result."""
|
|
23
|
-
raise NotImplementedError
|
|
24
|
-
|
|
25
|
-
@abstractmethod
|
|
26
|
-
def display_data(self, data: dict[str, Any]) -> None:
|
|
27
|
-
"""Display arbitrary data."""
|
|
28
|
-
raise NotImplementedError
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
@dataclass
|
|
32
|
-
class FormatterOptions:
|
|
33
|
-
formatter: type[BaseFormatter] = field(default=None)
|
|
34
|
-
wait_for_input: bool = field(default=False)
|
|
35
|
-
max_length: int = field(default=1000)
|
|
36
|
-
settings: Any | None = field(default=None)
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
from dataclasses import dataclass
|
|
2
|
-
from typing import Any
|
|
3
|
-
|
|
4
|
-
from flock.core.logging.formatters.base_formatter import (
|
|
5
|
-
BaseFormatter,
|
|
6
|
-
FormatterOptions,
|
|
7
|
-
)
|
|
8
|
-
from flock.core.logging.formatters.pprint_formatter import PrettyPrintFormatter
|
|
9
|
-
from flock.core.logging.formatters.rich_formatters import RichTables
|
|
10
|
-
from flock.core.logging.formatters.themed_formatter import (
|
|
11
|
-
ThemedAgentResultFormatter,
|
|
12
|
-
)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
@dataclass
|
|
16
|
-
class FormatterOptions:
|
|
17
|
-
formatter: type[BaseFormatter]
|
|
18
|
-
wait_for_input: bool = False
|
|
19
|
-
settings: dict[str, Any] | None = None
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
class FormatterFactory:
|
|
23
|
-
_formatter_map = {
|
|
24
|
-
PrettyPrintFormatter: PrettyPrintFormatter,
|
|
25
|
-
RichTables: RichTables,
|
|
26
|
-
ThemedAgentResultFormatter: ThemedAgentResultFormatter,
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
@staticmethod
|
|
30
|
-
def create_formatter(options: FormatterOptions) -> BaseFormatter:
|
|
31
|
-
formatter_cls = options.formatter
|
|
32
|
-
max_length = options.max_length
|
|
33
|
-
if formatter_cls in FormatterFactory._formatter_map:
|
|
34
|
-
formatter = FormatterFactory._formatter_map[formatter_cls]
|
|
35
|
-
if options.settings:
|
|
36
|
-
return formatter(max_length=max_length, **options.settings)
|
|
37
|
-
return formatter(max_length=max_length)
|
|
38
|
-
raise ValueError(f"Unknown formatter: {formatter_cls}")
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
from typing import Any
|
|
2
|
-
|
|
3
|
-
from flock.core.logging.formatters.base_formatter import BaseFormatter
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class PrettyPrintFormatter(BaseFormatter):
|
|
7
|
-
def display_result(
|
|
8
|
-
self, result: dict[str, Any], agent_name: str, **kwargs
|
|
9
|
-
) -> None:
|
|
10
|
-
"""Print an agent's result using Rich formatting."""
|
|
11
|
-
from devtools import pformat
|
|
12
|
-
from rich.console import Console
|
|
13
|
-
from rich.panel import Panel
|
|
14
|
-
|
|
15
|
-
console = Console()
|
|
16
|
-
|
|
17
|
-
s = pformat(result, highlight=False)
|
|
18
|
-
|
|
19
|
-
console.print(Panel(s, title=agent_name, highlight=True))
|
|
20
|
-
|
|
21
|
-
def display_data(self, data: dict[str, Any], **kwargs) -> None:
|
|
22
|
-
"""Print an agent's result using Rich formatting."""
|
|
23
|
-
from devtools import sprint
|
|
24
|
-
|
|
25
|
-
sprint(data, sprint.green)
|