Skip to content

Commit 72c874e

Browse files
committed
Rename messages aggregator into context
Signed-off-by: Louis Mandel <[email protected]>
1 parent 87ae8b5 commit 72c874e

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

pdl-live-react/src/pdl_ast.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ export type PdlId2 = string | null
512512
export type PdlIsLeaf2 = true
513513
export type Kind2 = "aggregator"
514514
export type Aggregator =
515-
| ("messages" | "stdout" | "stderr")
515+
| ("context" | "stdout" | "stderr")
516516
| FileAggregatorConfig
517517
/**
518518
* Documentation associated to the aggregator config.

src/pdl/pdl-schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@
384384
"anyOf": [
385385
{
386386
"enum": [
387-
"messages",
387+
"context",
388388
"stdout",
389389
"stderr"
390390
],

src/pdl/pdl_ast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ class FileAggregatorConfig(AggregatorConfig):
978978

979979

980980
AggregatorType: TypeAlias = (
981-
Literal["messages", "stdout", "stderr"] | FileAggregatorConfig
981+
Literal["context", "stdout", "stderr"] | FileAggregatorConfig
982982
)
983983

984984

src/pdl/pdl_dumper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ def contribute_to_list(
471471

472472
def aggregator_to_dict(aggregator: AggregatorType):
473473
match aggregator:
474-
case "messages" | "stdout" | "stderr":
474+
case "context" | "stdout" | "stderr":
475475
result = aggregator
476476
case FileAggregatorConfig():
477477
result = aggregator.model_dump()

src/pdl/pdl_interpreter.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2146,7 +2146,7 @@ def contribute(
21462146
"""
21472147

21482148

2149-
class MessagesAggregator(Aggregator):
2149+
class ContextAggregator(Aggregator):
21502150
def __init__(self, messages: Optional[LazyMessages] = None):
21512151
if messages is None:
21522152
self.messages: LazyMessages = DependentContext([])
@@ -2159,7 +2159,7 @@ def contribute(
21592159
role: Optional[RoleType] = None,
21602160
loc: Optional[PdlLocationType] = None,
21612161
block: Optional[BlockType] = None,
2162-
) -> "MessagesAggregator":
2162+
) -> "ContextAggregator":
21632163
match block:
21642164
case None | StructuredBlock():
21652165
return self
@@ -2170,7 +2170,7 @@ def contribute(
21702170
msg = {"role": role, "content": result}
21712171
new_messages: LazyMessages = SingletonContext(PdlDict(msg))
21722172
messages = DependentContext([self.messages, new_messages])
2173-
return MessagesAggregator(messages)
2173+
return ContextAggregator(messages)
21742174

21752175

21762176
class FileAggregator(Aggregator):
@@ -2201,8 +2201,8 @@ def process_aggregator(
22012201
) -> tuple[PdlLazy[Aggregator], LazyMessages, ScopeType, AggregatorBlock]:
22022202
aggregator: Aggregator
22032203
match block.aggregator:
2204-
case "messages":
2205-
aggregator = MessagesAggregator()
2204+
case "context":
2205+
aggregator = ContextAggregator()
22062206
case "stdout":
22072207
aggregator = FileAggregator(sys.stdout)
22082208
case "stderr":

tests/test_examples_run.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
update_results: false
2-
check: []
2+
check: [examples/aggregators/debug.pdl]
33
skip:
44
- examples/cldk/cldk-assistant.pdl
55
- examples/gsm8k/gsm8.pdl

0 commit comments

Comments
 (0)