Skip to content
Open
3 changes: 2 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,15 @@ Contains the test cases.
```

### 4. BigQuery Reporting (Centralized Metrics)
To upload metrics directly to Google BigQuery and create Looker Studio dashboard links, configure the `bigquery` key in your `reporting` section:
To upload metrics directly to Google BigQuery (via streaming inserts, `tabledata.insertAll`, into `configs`, `results`, `scores`, `summary`, and `run_stats`) and create Looker Studio dashboard links, configure the `bigquery` key in your `reporting` section (see [run-config.md](docs/configs/run-config.md#5-reporting-configurations) for batching, truncation, and retry details):

```yaml
reporting:
bigquery:
gcp_project_id: 'your-gcp-project-id'
dataset_id: 'evalbench' # Optional, defaults to 'evalbench'
dataset_location: 'US' # Optional, defaults to 'US'
chunk_size: 500 # Optional, max rows per streaming batch
```

---
Expand Down
9 changes: 8 additions & 1 deletion docs/configs/run-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,18 @@ The `reporting` section specifies how and where the evaluation results will be r
| ---------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `truncate_execution_outputs`| Optional (defaults to 250 rows) | This allows overriding the truncation of outputs in reporting (CSVs, BQ) to the number of rows specified. This affects the following reporting fields: `generated_result`, `golden_result`, `golden_eval_results` `eval_results`. This prevents logging incredibly large results with potentially thousands or millions of rows. *NOTE: This does not affect any logic other than reporting.* |
| `csv` | Optional | Configuration for CSV reporting. <br>**Subkey:** `output_directory` specifies the directory where CSV results will be saved (e.g., `'results'`). |
| `bigquery` | Optional | Configuration for reporting to Google BigQuery. <br>**Subkeys:** `gcp_project_id` specifies the Google Cloud Project ID for BigQuery integration (e.g., `my_cool_gcp_project`). `dataset_id` overrides the BigQuery dataset that results are written to (`<project>.<dataset_id>`), defaulting to `evalbench`. |
| `bigquery` | Optional | Configuration for reporting to Google BigQuery via streaming inserts (`tabledata.insertAll`). <br>**Subkeys:** `gcp_project_id` specifies the Google Cloud Project ID for BigQuery integration (e.g., `my_cool_gcp_project`). `dataset_id` overrides the BigQuery dataset (`<project>.<dataset_id>`), defaulting to `evalbench`. `dataset_location` sets the dataset region, defaulting to `US`. `chunk_size` sets the maximum rows per streaming batch, defaulting to `500`. |

---
> bigquery project_id: You can globally set your GCP project_id using the environment variables `EVAL_GCP_PROJECT_ID` or identify it separately.

### BigQuery streaming notes

- **Tables and quota:** `bigquery` appends rows to `configs`, `results`, `scores`, `summary`, and (for multi-trial agent runs) `run_stats` using streaming inserts (`tabledata.insertAll`) rather than batch load jobs, avoiding BigQuery's 1,500 load-jobs-per-table daily limit. Note that streaming inserts are billed per GB ingested and require `bigquery.tables.updateData` (plus `bigquery.datasets.create`, `bigquery.tables.create`, and `bigquery.tables.update` when auto-creating or evolving tables).
- **Schema evolution and retries:** Missing tables are created automatically and new top-level columns are appended via `update_table`. Transient transport errors retry with a 30 s per-request timeout and 120 s deadline (excluding `SSLError`), and post-DDL streaming cache lag (`404 NotFound` or verified `no such field`) retries up to 120 s using stable per-row `insertId` values for best-effort deduplication. Missing fields absent from the server schema (such as unknown nested `RECORD` subfields) fail immediately.
- **Batching and oversized rows:** Batches are capped at both `chunk_size` rows and 8 MiB serialized payload (below BigQuery's 10 MB `insertAll` limit). If a single row exceeds 8 MiB, its largest non-repeated `STRING` columns are truncated with `... [truncated for BigQuery streaming size limit]` and a warning. If a row still exceeds 8 MiB (for example, an oversized `JSON`, `RECORD`, or `REPEATED` column), all other valid rows are still streamed and `store()` then raises `RuntimeError` listing the skipped rows.
- **Numeric columns in `summary` and `scores`:** To match historical schemas, `metric_score`, `totalLatencyMs`, `total_results_count`, and `correct_results_count` round fractional floats to `INTEGER`; multi-trial suite stats (`pass_rate`, `interval_low`, `interval_high`, `flakiness`, `confidence`, `flaky_scenarios`, `trial_min`, `trial_median`, `trial_max`) stay numeric; other non-repeated float columns are inferred as `STRING`. Exact whole floats (from nullable pandas integer columns widened to `float64`) convert losslessly to `INTEGER`; fractional floats in other `INTEGER` columns are not rounded.

## Example Configuration Snippet

Below is an example snippet of how this configuration file might appear:
Expand Down
Loading
Loading