Skip to content

Error in template lookup logic #37

Closed

Description

@nrfulton

@vazirim discovered this bug. The following code results in an AttributeError because lower() is called on a string that is None:

from mellea import generative, start_session
from mellea.backends.model_ids import ModelIdentifier

META_LLAMA_3_3_8B = ModelIdentifier(
    ollama_name="llama3:8b",
)

m = start_session(model_id=META_LLAMA_3_3_8B)

@generative
def f(x: int) -> str:
    """ number as english word. """

m.genslot(f)

In case it helps in your rca, this does not fail:

>>> import mellea
>>> m = mellea.start_session(model_id"llama3:8b")
>>> from mellea import generative
>>> @generative
... def f(x: int) -> str:
...     """ number as english word. """
... 
>>> m.genslot(f)
CBlock(One, {'chat_response': ChatResponse(model='llama3:8b', created_at='2025-08-11T19:40:32.43534Z', done=True, done_reason='stop', total_duration=1401738084, load_duration=1050467667, prompt_eval_count=57, prompt_eval_duration=329656750, eval_count=2, eval_duration=20208792, message=Message(role='assistant', content='One', thinking=None, images=None, tool_name=None, tool_calls=None))})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions