Skip to content

prai v0.4.0

Latest
Compare
Choose a tag to compare
@bbohlender bbohlender released this 11 Jun 19:29
· 27 commits to main since this release

prai v0.4.0

Drastical abstraction improvements

Steps can take a history and model option allowing for full context and model control per step.
Steps are more concise and the history allows to re-use previous schema definitions.
Using history.reference allows for a much cleaner way to reference results of previous steps.

const model = new Model({ name: 'gpt-4.1-mini', apiKey: 'insert key here', provider: openai({ apiKey: "" }) })

const history = new History()

const adjectives = await step(
  `list some adjectives fitting the design of the ${brandName} brand which is a ${brandDescription}`,
  z.array(z.string()),
  { model, history }
)