Skip to content

Make defining output structure more natural and intuitive #92

@swerner

Description

@swerner

The way to phrase and use the llm_output_adapter directive isn't super intuitive and we frequently run into cases where we confuse the LLM resulting in issues like #43 on top of that, as we add more types of output adapters it becomes a harder documentation problem where you need to remember the different names for the different adapters you want to use.

This problem is partially resolved with the generator generator in that it can usually get you the output structure you want, but it would be nice to be easier to write.

Came up with an idea the other night of changing it to something like:

# Single String
generates name: "description"

# List of named strings
generates review_summaries: [
  review: {
    movie_title: "the title of the movie",
    reviewer_name: "the name of the reviewer",
    rating: { description: "the rating given by the reviewer (out of 5 stars)", type: :integer},
    brief_comment: "a brief summary of the movie"
  }
]

Where we'd do a bunch of processing behind the scenes to map them to the different output adapters.

The benefits of going down this route are that you're able to use the symbols and literals that you're familiar with to imply the structure you want back, simply write out the names and descriptions of the variables that you want the llm to generate, and implies the perspective that you should be describing the output as: "from the perspective of the model"

The one downside I see here is that it does somewhat look like a giant blob of json, but the more complex output adapters I've been putting out feel like they're getting kind of ugly and we're reaching the end of usefulness of that design...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions