A Generation is the output or answer produced by an LLM. A generation can be part of a Step, and contains both the input sent to an LLM and its completion.

Generations can be viewed on their own page in Literal AI. In a single generation, you can see all the data that was sent to and retrieved from the LLM model, which follows the Prompt template, including System messages, User messages, Assistant messages, and Tool messages.

You can add Tags and Scores to Generations. Additionally, you can add Generations to a Dataset, to use later on in for example Evaluation.

An example of a Generation on Literal AI

Get Generations

Generations are available via the SDKs (Python, TypeScript).

To get all generations of the application, you can use the following code:

Create new Generation

To create a new Generation:

Was this page helpful?