flock-core 0.4.520__py3-none-any.whl → 0.4.522__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/flock_factory.py +2 -0
- flock/evaluators/declarative/declarative_evaluator.py +24 -1
- flock/webapp/app/api/execution.py +9 -2
- {flock_core-0.4.520.dist-info → flock_core-0.4.522.dist-info}/METADATA +1 -1
- {flock_core-0.4.520.dist-info → flock_core-0.4.522.dist-info}/RECORD +8 -8
- {flock_core-0.4.520.dist-info → flock_core-0.4.522.dist-info}/WHEEL +0 -0
- {flock_core-0.4.520.dist-info → flock_core-0.4.522.dist-info}/entry_points.txt +0 -0
- {flock_core-0.4.520.dist-info → flock_core-0.4.522.dist-info}/licenses/LICENSE +0 -0
flock/core/flock_factory.py
CHANGED
|
@@ -413,6 +413,7 @@ class FlockFactory:
|
|
|
413
413
|
write_to_file: bool = False,
|
|
414
414
|
stream: bool = False,
|
|
415
415
|
include_thought_process: bool = False,
|
|
416
|
+
include_reasoning: bool = False,
|
|
416
417
|
temporal_activity_config: TemporalActivityConfig | None = None,
|
|
417
418
|
) -> FlockAgent:
|
|
418
419
|
"""Creates a default FlockAgent.
|
|
@@ -433,6 +434,7 @@ class FlockFactory:
|
|
|
433
434
|
max_retries=max_retries,
|
|
434
435
|
stream=stream,
|
|
435
436
|
include_thought_process=include_thought_process,
|
|
437
|
+
include_reasoning=include_reasoning,
|
|
436
438
|
)
|
|
437
439
|
|
|
438
440
|
evaluator = DeclarativeEvaluator(name="default", config=eval_config)
|
|
@@ -36,6 +36,10 @@ class DeclarativeEvaluatorConfig(FlockEvaluatorConfig):
|
|
|
36
36
|
default=False,
|
|
37
37
|
description="Include the thought process in the output.",
|
|
38
38
|
)
|
|
39
|
+
include_reasoning: bool = Field(
|
|
40
|
+
default=False,
|
|
41
|
+
description="Include the reasoning in the output.",
|
|
42
|
+
)
|
|
39
43
|
kwargs: dict[str, Any] = Field(default_factory=dict)
|
|
40
44
|
|
|
41
45
|
|
|
@@ -154,6 +158,9 @@ class DeclarativeEvaluator(
|
|
|
154
158
|
self._lm_history = lm_history
|
|
155
159
|
|
|
156
160
|
console.print("\n")
|
|
161
|
+
result_dict = self.filter_reasoning(
|
|
162
|
+
result_dict, self.config.include_reasoning
|
|
163
|
+
)
|
|
157
164
|
return self.filter_thought_process(
|
|
158
165
|
result_dict, self.config.include_thought_process
|
|
159
166
|
)
|
|
@@ -170,6 +177,9 @@ class DeclarativeEvaluator(
|
|
|
170
177
|
)
|
|
171
178
|
self._cost = cost
|
|
172
179
|
self._lm_history = lm_history
|
|
180
|
+
result_dict = self.filter_reasoning(
|
|
181
|
+
result_dict, self.config.include_reasoning
|
|
182
|
+
)
|
|
173
183
|
return self.filter_thought_process(
|
|
174
184
|
result_dict, self.config.include_thought_process
|
|
175
185
|
)
|
|
@@ -190,5 +200,18 @@ class DeclarativeEvaluator(
|
|
|
190
200
|
return {
|
|
191
201
|
k: v
|
|
192
202
|
for k, v in result_dict.items()
|
|
193
|
-
if not (k.startswith("
|
|
203
|
+
if not (k.startswith("trajectory"))
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
def filter_reasoning(
|
|
207
|
+
self, result_dict: dict[str, Any], include_reasoning: bool
|
|
208
|
+
) -> dict[str, Any]:
|
|
209
|
+
"""Filter out reasoning from the result dictionary."""
|
|
210
|
+
if include_reasoning:
|
|
211
|
+
return result_dict
|
|
212
|
+
else:
|
|
213
|
+
return {
|
|
214
|
+
k: v
|
|
215
|
+
for k, v in result_dict.items()
|
|
216
|
+
if not (k.startswith("reasoning"))
|
|
194
217
|
}
|
|
@@ -12,6 +12,7 @@ from fastapi import ( # Ensure Form and HTTPException are imported
|
|
|
12
12
|
)
|
|
13
13
|
from fastapi.responses import HTMLResponse
|
|
14
14
|
from fastapi.templating import Jinja2Templates
|
|
15
|
+
from pydantic import BaseModel
|
|
15
16
|
|
|
16
17
|
if TYPE_CHECKING:
|
|
17
18
|
from flock.core.flock import Flock
|
|
@@ -151,7 +152,10 @@ async def htmx_run_flock(
|
|
|
151
152
|
return HTMLResponse(f"<p class='error'>Error processing inputs for {start_agent_name}: {e_parse}</p>")
|
|
152
153
|
|
|
153
154
|
result_data = await run_current_flock_service(start_agent_name, inputs, request.app.state)
|
|
154
|
-
|
|
155
|
+
if isinstance(result_data, BaseModel):
|
|
156
|
+
raw_json_for_template = result_data.model_dump_json(indent=2, ensure_ascii=False)
|
|
157
|
+
else:
|
|
158
|
+
raw_json_for_template = json.dumps(result_data, indent=2, ensure_ascii=False)
|
|
155
159
|
# Unescape newlines for proper display in HTML <pre> tag
|
|
156
160
|
result_data_raw_json_str = raw_json_for_template.replace('\\n', '\n')
|
|
157
161
|
root_path = request.scope.get("root_path", "")
|
|
@@ -215,7 +219,10 @@ async def htmx_run_shared_flock(
|
|
|
215
219
|
|
|
216
220
|
shared_logger.info(f"HTMX Run Shared: Executing agent '{start_agent_name}' in pre-loaded Flock '{temp_flock.name}'. Inputs: {list(inputs.keys())}")
|
|
217
221
|
result_data = await temp_flock.run_async(start_agent=start_agent_name, input=inputs, box_result=False)
|
|
218
|
-
|
|
222
|
+
if isinstance(result_data, BaseModel):
|
|
223
|
+
raw_json_for_template = result_data.model_dump_json(indent=2, ensure_ascii=False)
|
|
224
|
+
else:
|
|
225
|
+
raw_json_for_template = json.dumps(result_data, indent=2, ensure_ascii=False)
|
|
219
226
|
# Unescape newlines for proper display in HTML <pre> tag
|
|
220
227
|
result_data_raw_json_str = raw_json_for_template.replace('\\n', '\n')
|
|
221
228
|
shared_logger.info(f"HTMX Run Shared: Agent '{start_agent_name}' executed. Result keys: {list(result_data.keys()) if isinstance(result_data, dict) else 'N/A'}")
|
|
@@ -29,7 +29,7 @@ flock/core/__init__.py,sha256=juwyNr3QqKXUS5-E3hlMYRhgqHgQBqgtP12OF3tUCAI,1249
|
|
|
29
29
|
flock/core/flock.py,sha256=iR4i0_z0w2ns_iHbP7FqN--7wlsPIWch1H-BVecPs_I,38205
|
|
30
30
|
flock/core/flock_agent.py,sha256=Hl6TONSiJi2I-N_49-1hkW2q_hyPXMebMr-5oZLI-PY,48842
|
|
31
31
|
flock/core/flock_evaluator.py,sha256=TPy6u6XX3cqkY1r9NW1w2lTwCMNW7pxhFYKLefnEbXg,1820
|
|
32
|
-
flock/core/flock_factory.py,sha256=
|
|
32
|
+
flock/core/flock_factory.py,sha256=QI5qzxSyg3z3T3wRHoTOyegeaquyfUO5cJjpT_QgRl8,18814
|
|
33
33
|
flock/core/flock_module.py,sha256=ObILimpVaPnaaqYvcBYJJ20lQzfrjgTdADplaNRjHU0,7448
|
|
34
34
|
flock/core/flock_registry.py,sha256=KzdFfc3QC-Dk42G24hdf6Prp3HvGj9ymXR3TTBe-T-A,27161
|
|
35
35
|
flock/core/flock_router.py,sha256=1OAXDsdaIIFApEfo6SRfFEDoTuGt3Si7n2MXiySEfis,2644
|
|
@@ -97,7 +97,7 @@ flock/core/util/loader.py,sha256=j3q2qem5bFMP2SmMuYjb-ISxsNGNZd1baQmpvAnRUUk,224
|
|
|
97
97
|
flock/core/util/splitter.py,sha256=rDLnZX158PWkmW8vi2UfMLAMRXcHQFUIydAABd-lDGw,7154
|
|
98
98
|
flock/evaluators/__init__.py,sha256=Y0cEkx0dujRmy--TDpKoTqFSLzbyFz8BwEOv8kdSUhg,22
|
|
99
99
|
flock/evaluators/declarative/__init__.py,sha256=Y0cEkx0dujRmy--TDpKoTqFSLzbyFz8BwEOv8kdSUhg,22
|
|
100
|
-
flock/evaluators/declarative/declarative_evaluator.py,sha256=
|
|
100
|
+
flock/evaluators/declarative/declarative_evaluator.py,sha256=vEdScni2uzOKFliFgSZEE1mgcDWM0s9MdOEga6a_nUM,8186
|
|
101
101
|
flock/evaluators/memory/memory_evaluator.py,sha256=ySwz7kcc8suXMJ7gKNSWThW8iOMlE8lUcUzEAHvv8rw,3559
|
|
102
102
|
flock/evaluators/test/test_case_evaluator.py,sha256=3Emcoty0LOLLBIuPGxSpKphuZC9Fu1DTr1vbGg-hd0Q,1233
|
|
103
103
|
flock/evaluators/zep/zep_evaluator.py,sha256=6_5vTdU0yJAH8I8w3-MPXiAZx6iUPhAVCsHjrHzkPLM,2058
|
|
@@ -502,7 +502,7 @@ flock/webapp/app/theme_mapper.py,sha256=QzWwLWpED78oYp3FjZ9zxv1KxCyj43m8MZ0fhfzz
|
|
|
502
502
|
flock/webapp/app/utils.py,sha256=RF8DMKKAj1XPmm4txUdo2OdswI1ATQ7cqUm6G9JFDzA,2942
|
|
503
503
|
flock/webapp/app/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
504
504
|
flock/webapp/app/api/agent_management.py,sha256=5xqO94QjjAYvxImyjKV9EGUQOvo4n3eqs7pGwGPSQJ4,10394
|
|
505
|
-
flock/webapp/app/api/execution.py,sha256=
|
|
505
|
+
flock/webapp/app/api/execution.py,sha256=COPHVpyzjhGACZuQsrrudweGE4bHgtrxR4hoAopI2BA,13497
|
|
506
506
|
flock/webapp/app/api/flock_management.py,sha256=1o-6-36kTnUjI3am_BqLpdrcz0aqFXrxE-hQHIFcCsg,4869
|
|
507
507
|
flock/webapp/app/api/registry_viewer.py,sha256=IoInxJiRR0yFlecG_l2_eRc6l35RQQyEDMG9BcBkipY,1020
|
|
508
508
|
flock/webapp/app/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -562,8 +562,8 @@ flock/workflow/agent_execution_activity.py,sha256=Gy6FtuVAjf0NiUXmC3syS2eJpNQF4R
|
|
|
562
562
|
flock/workflow/flock_workflow.py,sha256=iSUF_soFvWar0ffpkzE4irkDZRx0p4HnwmEBi_Ne2sY,9666
|
|
563
563
|
flock/workflow/temporal_config.py,sha256=3_8O7SDEjMsSMXsWJBfnb6XTp0TFaz39uyzSlMTSF_I,3988
|
|
564
564
|
flock/workflow/temporal_setup.py,sha256=YIHnSBntzOchHfMSh8hoLeNXrz3B1UbR14YrR6soM7A,1606
|
|
565
|
-
flock_core-0.4.
|
|
566
|
-
flock_core-0.4.
|
|
567
|
-
flock_core-0.4.
|
|
568
|
-
flock_core-0.4.
|
|
569
|
-
flock_core-0.4.
|
|
565
|
+
flock_core-0.4.522.dist-info/METADATA,sha256=ihZdtIEwkGF3FUhglU0fQo9EYJEZSTpqB3m10FlgtSk,22786
|
|
566
|
+
flock_core-0.4.522.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
567
|
+
flock_core-0.4.522.dist-info/entry_points.txt,sha256=rWaS5KSpkTmWySURGFZk6PhbJ87TmvcFQDi2uzjlagQ,37
|
|
568
|
+
flock_core-0.4.522.dist-info/licenses/LICENSE,sha256=iYEqWy0wjULzM9GAERaybP4LBiPeu7Z1NEliLUdJKSc,1072
|
|
569
|
+
flock_core-0.4.522.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|