Skip to content

Commit 94e3372

Browse files
committed
refactor: change to use
Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
1 parent 4ff9387 commit 94e3372

4 files changed

Lines changed: 8 additions & 9 deletions

File tree

mellea/stdlib/functional.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ async def aact(
601601
pre_exec_payload = ComponentPreExecutePayload(
602602
component_type=_component_type_name,
603603
action=action,
604-
context_view=context.as_list(),
604+
context_view=context.view_for_generation(),
605605
requirements=requirements or [],
606606
model_options=model_options or {},
607607
format=format,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ switch = [
109109
backends = ["mellea[watsonx,hf,litellm]"]
110110

111111
hooks = [
112-
"cpex>=0.1.0.dev12; python_version >= '3.11'",
112+
"cpex>=0.1.0rc1",
113113
"grpcio>=1.78.0",
114114
]
115115

test/plugins/test_hook_call_sites.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ async def recorder(payload: Any, ctx: Any) -> Any:
265265
assert observed[0].component_type == "Instruction"
266266

267267
async def test_component_pre_execute_payload_has_context_view(self) -> None:
268-
"""COMPONENT_PRE_EXECUTE payload.context_view contains the context snapshot."""
268+
"""COMPONENT_PRE_EXECUTE payload.context_view mirrors view_for_generation()."""
269269
from mellea.stdlib.components import Instruction
270270
from mellea.stdlib.functional import aact
271271

@@ -283,8 +283,7 @@ async def recorder(payload: Any, ctx: Any) -> Any:
283283

284284
await aact(action, ctx, backend, strategy=None)
285285
assert observed[0].context_view is not None
286-
assert len(observed[0].context_view) == 1
287-
assert isinstance(observed[0].context_view[0], CBlock)
286+
assert observed[0].context_view == ctx.view_for_generation()
288287

289288
async def test_component_pre_execute_empty_context_gives_empty_list(self) -> None:
290289
"""COMPONENT_PRE_EXECUTE on a fresh context gives an empty list, not None."""

uv.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)