---
title: "Getting Started with AutoGenAI"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Getting Started with AutoGenAI}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")
```

`AutoGenAI` treats a generative AI workflow as a configuration containing a
prompt, a provider, and a generation strategy. The package can benchmark these
configurations using a task-specific scorer and then select configurations under
quality, cost, and latency objectives.

## Offline example

```{r}
library(AutoGenAI)
ex <- autogenai_example()
fit <- optimize_ai(
  ex$task,
  ex$data,
  ex$providers,
  ex$prompts,
  temperatures = 0,
  strategies = "single"
)
fit
```

## Pareto-efficient choices

```{r}
pareto_ai(fit)
```

## Robustness

```{r}
st <- stress_test(
  ex$task,
  ex$data,
  ex$providers[[1]],
  ex$prompts[[1]]
)
st
robustness_score(st)
```

## Real providers

A real provider is any R function accepting `prompt`, `input`, and `params` and
returning one text value. This deliberately keeps model-specific credentials and
network behavior outside the package core.
