API Reference

This page contains the API reference for public objects and functions in Guidance.

functions

guidance.gen([name, max_tokens, ...])

Generate a set of tokens until a given stop criteria has been met.

guidance.select(options[, name, list_append])

Choose between a set of options.

guidance.json([name, schema, temperature, ...])

Generate valid JSON according to the supplied JSON schema or pydantic model.

context blocks

guidance.system()

Indicate the 'system' prompt

guidance.user()

Indicate the 'user' prompt

guidance.assistant()

Indicate the 'assistant' prompt

models

guidance.models.Model(client, state[, echo])

guidance.models.LlamaCpp([model, echo, ...])

guidance.models.Transformers(model[, ...])

guidance.models.OpenAI(model[, echo, api_key])