Skip to content

Commit a47dae8

Browse files
as_chat_history adapted
1 parent c2b3c47 commit a47dae8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mellea/stdlib/chat.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
from mellea.stdlib.base import (
88
CBlock,
99
Component,
10+
Context,
1011
ImageBlock,
11-
LegacyContext,
1212
ModelOutputThunk,
1313
ModelToolCall,
1414
TemplateRepresentation,
@@ -113,7 +113,7 @@ def __str__(self):
113113
return f'mellea.Message(role="{self.role}", content="{self.content}", name="{self.name}")'
114114

115115

116-
def as_chat_history(ctx: LegacyContext) -> list[Message]:
116+
def as_chat_history(ctx: Context) -> list[Message]:
117117
"""Returns a list of Messages corresponding to a Context."""
118118

119119
def _to_msg(c: CBlock | Component | ModelOutputThunk) -> Message | None:
@@ -129,7 +129,7 @@ def _to_msg(c: CBlock | Component | ModelOutputThunk) -> Message | None:
129129
case _:
130130
return None
131131

132-
all_ctx_events = ctx.full_event_log()
132+
all_ctx_events = ctx.full_data_as_list()
133133
if all_ctx_events is None:
134134
raise Exception("Trying to cast a non-linear history into a chat history.")
135135
else:

0 commit comments

Comments
 (0)