flock-core 0.5.0b25__py3-none-any.whl → 0.5.0b27__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.

@@ -121,6 +121,14 @@ class DeclarativeEvaluationConfig(AgentComponentConfig):
121
121
  default=False,
122
122
  description="Include the reasoning in the output.",
123
123
  )
124
+ status_output_field: str = Field(
125
+ default="_status_output",
126
+ description="The field name for the status output.",
127
+ )
128
+ include_status_output: bool = Field(
129
+ default=False,
130
+ description="Include the status output in the finaloutput.",
131
+ )
124
132
  adapter: Literal["chat", "json", "xml", "two_step"] | None = Field(
125
133
  default=None,
126
134
  description="Optional DSPy adapter to use for formatting/parsing.",
@@ -296,6 +304,7 @@ class DeclarativeEvaluationComponent(
296
304
  from rich.live import Live
297
305
 
298
306
  signature_order = []
307
+ status_field = self.config.status_output_field
299
308
  try:
300
309
  signature_order = list(signature.output_fields.keys())
301
310
  except Exception:
@@ -309,7 +318,10 @@ class DeclarativeEvaluationComponent(
309
318
  if field_name not in display_data:
310
319
  display_data[field_name] = ""
311
320
 
321
+ display_data[status_field] = ""
322
+
312
323
  stream_buffers: defaultdict[str, list[str]] = defaultdict(list)
324
+ stream_buffers[status_field] = []
313
325
 
314
326
  formatter = theme_dict = styles = agent_label = None
315
327
  live_cm = nullcontext()
@@ -359,9 +371,14 @@ class DeclarativeEvaluationComponent(
359
371
  _d = None
360
372
 
361
373
  if isinstance(value, StatusMessage):
362
- message = getattr(value, "message", "")
363
- if message and live is not None:
364
- live.console.log(f"[status] {message}")
374
+ token = getattr(value, "message", "")
375
+ if token:
376
+ stream_buffers[status_field].append(str(token) + "\n")
377
+ display_data[status_field] = "".join(
378
+ stream_buffers[status_field]
379
+ )
380
+ if formatter is not None:
381
+ _refresh_panel()
365
382
  continue
366
383
 
367
384
  if isinstance(value, StreamResponse):
@@ -387,14 +404,37 @@ class DeclarativeEvaluationComponent(
387
404
  continue
388
405
 
389
406
  if isinstance(value, ModelResponseStream):
390
- try:
391
- chunk = value
392
- text = chunk.choices[0].delta.content or ""
393
- if text and live is not None:
394
- live.console.log(text)
395
- except Exception:
396
- pass
407
+ for callback in self.config.stream_callbacks or []:
408
+ try:
409
+ callback(value)
410
+ except Exception as e:
411
+ logger.warning(f"Stream callback error: {e}")
412
+
413
+ chunk = value
414
+ token = chunk.choices[0].delta.content or ""
415
+ signature_field = getattr(
416
+ value, "signature_field_name", None
417
+ )
418
+ if signature_field:
419
+ if signature_field not in display_data:
420
+ display_data[signature_field] = ""
421
+ if token:
422
+ stream_buffers[signature_field].append(str(token))
423
+ display_data[signature_field] = "".join(
424
+ stream_buffers[signature_field]
425
+ )
426
+ if formatter is not None:
427
+ _refresh_panel()
428
+ else:
429
+ if token:
430
+ stream_buffers[status_field].append(str(token))
431
+ display_data[status_field] = "".join(
432
+ stream_buffers[status_field]
433
+ )
434
+ if formatter is not None:
435
+ _refresh_panel()
397
436
  continue
437
+
398
438
 
399
439
  if _d and isinstance(value, _d.Prediction):
400
440
  result_dict, cost, lm_history = self._process_result(
@@ -414,9 +454,14 @@ class DeclarativeEvaluationComponent(
414
454
  ordered_final[field_name] = final_result[
415
455
  field_name
416
456
  ]
457
+
458
+
417
459
  for key, val in final_result.items():
418
460
  if key not in ordered_final:
419
461
  ordered_final[key] = val
462
+
463
+ if self.config.include_status_output:
464
+ ordered_final[self.config.status_output_field] = display_data[self.config.status_output_field]
420
465
  display_data.clear()
421
466
  display_data.update(ordered_final)
422
467
  _refresh_panel()
@@ -533,6 +578,19 @@ class DeclarativeEvaluationComponent(
533
578
  for k, v in result_dict.items()
534
579
  if not (k.startswith("reasoning") or k.startswith("trajectory"))
535
580
  }
581
+
582
+ def filter_status_output(
583
+ self, result_dict: dict[str, Any], include_status_output: bool
584
+ ) -> dict[str, Any]:
585
+ """Filter out status output from the result dictionary."""
586
+ if include_status_output:
587
+ return result_dict
588
+ else:
589
+ return {
590
+ k: v
591
+ for k, v in result_dict.items()
592
+ if not (k.startswith("_status_output"))
593
+ }
536
594
 
537
595
  def filter_reasoning(
538
596
  self, result_dict: dict[str, Any], include_reasoning: bool
@@ -44,13 +44,14 @@ class DefaultAgent(FlockAgent):
44
44
  use_cache: bool = False,
45
45
  temperature: float = 0.7,
46
46
  max_tokens: int | None = None,
47
- max_tool_calls: int = 0,
47
+ max_tool_calls: int = 10,
48
48
  max_retries: int = 2,
49
49
  stream: bool = True,
50
50
  stream_callbacks: list[Callable[..., Any] | Any] | None = None,
51
51
  stream_vertical_overflow: Literal["crop", "ellipsis", "crop_above", "visible"] = "crop_above",
52
52
  include_thought_process: bool = False,
53
53
  include_reasoning: bool = False,
54
+ include_status_output: bool = False,
54
55
  # Output utility parameters
55
56
  enable_rich_tables: bool = True,
56
57
  output_theme: OutputTheme | None = None,
@@ -90,6 +91,7 @@ class DefaultAgent(FlockAgent):
90
91
  stream_vertical_overflow: Rich Live overflow handling ('ellipsis', 'crop', 'crop_above', 'visible')
91
92
  include_thought_process: Include reasoning in output
92
93
  include_reasoning: Include detailed reasoning steps
94
+ include_status_output: Include status output in output
93
95
  enable_rich_tables: Enable rich table formatting for output
94
96
  output_theme: Theme for output formatting
95
97
  no_output: Disable output printing
@@ -129,6 +131,7 @@ class DefaultAgent(FlockAgent):
129
131
  stream_vertical_overflow=stream_vertical_overflow,
130
132
  include_thought_process=include_thought_process,
131
133
  include_reasoning=include_reasoning,
134
+ include_status_output=include_status_output,
132
135
  )
133
136
  if max_tokens is not None:
134
137
  _eval_kwargs["max_tokens"] = max_tokens
@@ -256,6 +256,14 @@ def create_rich_renderable(
256
256
  if styles is None:
257
257
  styles = get_default_styles(theme)
258
258
 
259
+ # Convert Pydantic BaseModel instances to dicts for rendering
260
+ try:
261
+ from pydantic import BaseModel
262
+ if isinstance(value, BaseModel):
263
+ value = value.model_dump()
264
+ except ImportError:
265
+ pass
266
+
259
267
  # If the value is a dictionary, render it as a table.
260
268
  if isinstance(value, dict):
261
269
  # Convert table_box string into an actual box style.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flock-core
3
- Version: 0.5.0b25
3
+ Version: 0.5.0b27
4
4
  Summary: Declarative LLM Orchestration at Scale
5
5
  Author-email: Andre Ratzenberger <andre.ratzenberger@whiteduck.de>
6
6
  License-File: LICENSE
@@ -27,7 +27,7 @@ flock/cli/yaml_editor.py,sha256=K3N0bh61G1TSDAZDnurqW9e_-hO6CtSQKXQqlDhCjVo,1252
27
27
  flock/cli/assets/release_notes.md,sha256=bqnk50jxM3w5uY44Dc7MkdT8XmRREFxrVBAG9XCOSSU,4896
28
28
  flock/components/__init__.py,sha256=qDcaP0O7_b5RlUEXluqwskpKCkhM73kSMeNXReze63M,963
29
29
  flock/components/evaluation/__init__.py,sha256=_M3UlRFeNN90fEny6byt5VdLDE5o5khbd0EPT0o9S9k,303
30
- flock/components/evaluation/declarative_evaluation_component.py,sha256=SiW6NddBsNNLte3sPiqkLe-sPCH1ACCyximhZoUsvpY,20706
30
+ flock/components/evaluation/declarative_evaluation_component.py,sha256=tEMs5mENuQL84ZXJlQObvSygqajaJcu0LLOEKAdaYoE,23195
31
31
  flock/components/routing/__init__.py,sha256=BH_pFm9T6bUuf8HH4byDJ0dO0fzEVHv9m-ghUdDVdm0,542
32
32
  flock/components/routing/conditional_routing_component.py,sha256=WqZLMz-0Dhfb97xvttNrJCIVe6FNMLEQ2m4KQTDpIbI,21374
33
33
  flock/components/routing/default_routing_component.py,sha256=ZHt2Kjf-GHB5n7evU5NSGeQJ1Wuims5soeMswqaUb1E,3370
@@ -43,7 +43,7 @@ flock/core/flock_factory.py,sha256=Z6GJpYXN9_DXuOqvBH9ir0SMoUw78DkWhrhkm90luAQ,2
43
43
  flock/core/flock_scheduler.py,sha256=ng_s7gyijmc-AmYvBn5rtg61CSUZiIkXPRSlA1xO6VQ,8766
44
44
  flock/core/flock_server_manager.py,sha256=tM_nOs37vAbEvxmhwy_DL2JPvgFViWroNxrRSu5MfUQ,4523
45
45
  flock/core/agent/__init__.py,sha256=l32KFMJnC_gidMXpAXK8-OX228bWOhNc8OY_NzXm59Q,515
46
- flock/core/agent/default_agent.py,sha256=924SWDx8axJ57JCWREZuLzV8039Wt_-5WIBNTvx479Y,7483
46
+ flock/core/agent/default_agent.py,sha256=faeWCgMbMmU_QyTxeBxxc_nsD3h-wHHVTzUaFXgvcM4,7653
47
47
  flock/core/agent/flock_agent_components.py,sha256=LamOgpRC7wDKuU3d6enDG0UFlNxyKPErLpH7SQ_Pi74,4539
48
48
  flock/core/agent/flock_agent_execution.py,sha256=pdOddBGv8y1P89Ix8XFWa1eW9i3bWjOYiQQxeY2K0yo,4217
49
49
  flock/core/agent/flock_agent_integration.py,sha256=fnxzEA8-gIopHwD1de8QKt2A7Ilb1iH5Koxk1uiASas,10737
@@ -80,7 +80,7 @@ flock/core/logging/telemetry.py,sha256=2T_o5qjvWWGMEP3UmlF9pbiTr4HDUcojHNrAbsad0
80
80
  flock/core/logging/trace_and_logged.py,sha256=5vNrK1kxuPMoPJ0-QjQg-EDJL1oiEzvU6UNi6X8FiMs,2117
81
81
  flock/core/logging/formatters/enum_builder.py,sha256=LgEYXUv84wK5vwHflZ5h8HBGgvLH3sByvUQe8tZiyY0,981
82
82
  flock/core/logging/formatters/theme_builder.py,sha256=Wnaal3HuUDA4HFg9tdql1BxYwK83ACOZBBQy-DXnxcA,17342
83
- flock/core/logging/formatters/themed_formatter.py,sha256=f9BiIBUk3cLma6eAPbW8BnvUqTzPzcPhjLNQoia7pI4,20656
83
+ flock/core/logging/formatters/themed_formatter.py,sha256=7SjkayQINY7ttxcqMWeZ0mxrqXWq6tgUgeEPKeLgddk,20888
84
84
  flock/core/logging/formatters/themes.py,sha256=80BRJJB0LZr11N0yQw2f8vdb_9179qjQO8PoeBaLMN0,10680
85
85
  flock/core/logging/span_middleware/baggage_span_processor.py,sha256=gJfRl8FeB6jdtghTaRHCrOaTo4fhPMRKgjqtZj-8T48,1118
86
86
  flock/core/logging/telemetry_exporter/base_exporter.py,sha256=rQJJzS6q9n2aojoSqwCnl7ZtHrh5LZZ-gkxUuI5WfrQ,1124
@@ -552,8 +552,8 @@ flock/workflow/agent_execution_activity.py,sha256=0exwmeWKYXXxdUqDf4YaUVpn0zl06S
552
552
  flock/workflow/flock_workflow.py,sha256=sKFsRIL_bDGonXSNhK1zwu6UechghC_PihJJMidI-VI,9139
553
553
  flock/workflow/temporal_config.py,sha256=3_8O7SDEjMsSMXsWJBfnb6XTp0TFaz39uyzSlMTSF_I,3988
554
554
  flock/workflow/temporal_setup.py,sha256=KR6MlWOrpMtv8NyhaIPAsfl4tjobt81OBByQvg8Kw-Y,1948
555
- flock_core-0.5.0b25.dist-info/METADATA,sha256=OK1IlaUsnVvLIeIBbjn3lGPnCRUl6TTnjJQJ1-1Yu9M,9997
556
- flock_core-0.5.0b25.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
557
- flock_core-0.5.0b25.dist-info/entry_points.txt,sha256=rWaS5KSpkTmWySURGFZk6PhbJ87TmvcFQDi2uzjlagQ,37
558
- flock_core-0.5.0b25.dist-info/licenses/LICENSE,sha256=iYEqWy0wjULzM9GAERaybP4LBiPeu7Z1NEliLUdJKSc,1072
559
- flock_core-0.5.0b25.dist-info/RECORD,,
555
+ flock_core-0.5.0b27.dist-info/METADATA,sha256=CZTMnb9cOHSI6w5UQHSR9H9Ps3RKIakJndLB-OX66Vw,9997
556
+ flock_core-0.5.0b27.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
557
+ flock_core-0.5.0b27.dist-info/entry_points.txt,sha256=rWaS5KSpkTmWySURGFZk6PhbJ87TmvcFQDi2uzjlagQ,37
558
+ flock_core-0.5.0b27.dist-info/licenses/LICENSE,sha256=iYEqWy0wjULzM9GAERaybP4LBiPeu7Z1NEliLUdJKSc,1072
559
+ flock_core-0.5.0b27.dist-info/RECORD,,