-
Notifications
You must be signed in to change notification settings - Fork 53
Closed
Labels
Description
Description
Calling m.last_prompt() after running a genslot function does not return the last prompt.
Steps to Reproduce
import mellea
from mellea import LinearContext, generative
m = mellea.start_session(ctx=LinearContext())
@generative
def name_the_integer(x: int) -> str:
"""Generate the name of the integer in english and spanish"""
name_the_integer(m, x=5)
print(m.last_prompt())Expected Behavior
Expected to print the last prompt.
Actual Behavior
prints nothing.
Additional Context
This is most likely due to the fact that we are not passing anything to generate_logs here:
mellea/mellea/stdlib/session.py
Lines 359 to 365 in 7ff924a
| result: ModelOutputThunk = self.backend.generate_from_context( | |
| action=gen_slot, | |
| ctx=self.ctx, | |
| model_options=model_options, | |
| format=format, | |
| tool_calls=tool_calls, | |
| ) |
We might want to set the generate_logs to a list here:
mellea/mellea/backends/__init__.py
Line 44 in 7ff924a
| generate_logs: list[GenerateLog] | None = None, |