Skip to content

generative does return the last prompt from MelleaSession.last_prompt() #51

@avinash2692

Description

@avinash2692

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:

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:

generate_logs: list[GenerateLog] | None = None,

Metadata

Metadata

Assignees

Labels

PrioritybugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions