Skip to content

feat(agent): store the run stats in BigQuery - #716

Open
omkargaikwad23 wants to merge 2 commits into
feat/agent-run-statsfrom
feat/agent-run-stats-bigquery
Open

omkargaikwad23 wants to merge 2 commits into
feat/agent-run-statsfrom
feat/agent-run-stats-bigquery

Conversation

@omkargaikwad23

Copy link
Copy Markdown
Collaborator

Stacked on #713.

What

With num_trials above 1, the bigquery reporter also stores the stats of each scenario. It appends the rows to a new run_stats table, in the same dataset as the other tables.

  • The table has the same columns as run_stats.csv. Numbers stay numbers, so a query can aggregate them.
  • If a column name has a character that BigQuery does not accept, the character becomes _.
  • Each stats column now has one type in every job. Before, a job without the goal_completion scorer gave text for 7 columns that are numbers in other jobs.
  • The results and scores tables need no change. A multi-trial job already sends prompt_id and trial_index with each row.

Nothing changes with one trial. A delegated reporter (delegated: true) does not get the stats.

Why

run_stats.csv stays on the machine that ran the job. In BigQuery, a team can compare the stats of many jobs and use them in dashboards.

Testing

  • 8 new unit tests. They use a fake BigQuery client.
  • An offline check with the schema helper of the BigQuery client. The stats of 4 kinds of job give the same type for each of the 26 columns. Output: https://paste.googleplex.com/6755399437151114 (Google-internal)

Not run: a job that writes to BigQuery.

With num_trials above 1, the bigquery reporter appends the stats of each
scenario to the run_stats table. Each stats column now has one type in
every job, so a later load into the same table does not fail.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant