Skip to content

Better @generative documentation in the tutorial #1

Closed

Description

@nrfulton

The tutorial "jumps right in" too quickly.

We should start with a simple one-function example. We should demonstrate how you can swap out the model and how to specify model_options. Sketch below.

How it Works

@generative
def my_function(...) -> ...:
    """ .... """

results in a GenerativeSlot object, which has the following call signature (all the uppercase letters are generic types):

    def __call__(
        self, m, model_options: dict | None = None, *args: P.args, **kwargs: P.kwargs
    ) -> R:

[[TODO: point to code repo]]

where m: MelleaSession. Sessions hold a Backend which has a model_id. You can pass whatever session you want into a generative slot. So, via the first parameter to any generative slot, you are able to specify the LLM.
The model_options dict allows you to additionally control params.
We should start more gadually in the tutorial, pointing out these options.

Activity

  1. self-assigned this
    on Aug 19, 2025
  2. added a commit that references this issue on Jan 7, 2026
  3. psschwei commented on May 12, 2026

    @psschwei
    Contributor

    we've updated tutorial

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