chore(benchmarks): fix undefined in GitHub question generation

This commit is contained in:
Johann Schopplich
2025-11-06 16:06:31 +01:00
parent a9d52fc69b
commit e22884308b
3 changed files with 8 additions and 5 deletions

View File

@@ -61,7 +61,6 @@ export interface AnalyticsMetric {
export interface Repository { export interface Repository {
id: number id: number
name: string name: string
owner: string
repo: string repo: string
description: string description: string
stars: number stars: number

View File

@@ -135,6 +135,10 @@ export function generateEventLogsQuestions(logs: EventLog[], getId: () => string
// Filtering: multi-condition (level AND status) // Filtering: multi-condition (level AND status)
for (const level of levels.slice(0, QUESTION_LIMITS.eventLogs.filteringLevelAndStatus)) { for (const level of levels.slice(0, QUESTION_LIMITS.eventLogs.filteringLevelAndStatus)) {
// Skip `info` level as it never has status >= 400 by design
if (level === 'info')
continue
const count = logs.filter(l => l.level === level && l.statusCode >= 400).length const count = logs.filter(l => l.level === level && l.statusCode >= 400).length
questions.push( questions.push(
new QuestionBuilder() new QuestionBuilder()

View File

@@ -13,28 +13,28 @@ export function generateGithubQuestions(repos: Repository[], getId: () => string
const repoFieldGenerators: Array<(repo: Repository, getId: () => string) => Question> = [ const repoFieldGenerators: Array<(repo: Repository, getId: () => string) => Question> = [
(repo, getId) => new QuestionBuilder() (repo, getId) => new QuestionBuilder()
.id(getId()) .id(getId())
.prompt(`How many stars does ${repo.owner}/${repo.name} have?`) .prompt(`How many stars does ${repo.repo} have?`)
.groundTruth(String(repo.stars)) .groundTruth(String(repo.stars))
.type('field-retrieval') .type('field-retrieval')
.dataset('github') .dataset('github')
.build(), .build(),
(repo, getId) => new QuestionBuilder() (repo, getId) => new QuestionBuilder()
.id(getId()) .id(getId())
.prompt(`How many forks does ${repo.owner}/${repo.name} have?`) .prompt(`How many forks does ${repo.repo} have?`)
.groundTruth(String(repo.forks)) .groundTruth(String(repo.forks))
.type('field-retrieval') .type('field-retrieval')
.dataset('github') .dataset('github')
.build(), .build(),
(repo, getId) => new QuestionBuilder() (repo, getId) => new QuestionBuilder()
.id(getId()) .id(getId())
.prompt(`How many watchers does ${repo.owner}/${repo.name} have?`) .prompt(`How many watchers does ${repo.repo} have?`)
.groundTruth(String(repo.watchers)) .groundTruth(String(repo.watchers))
.type('field-retrieval') .type('field-retrieval')
.dataset('github') .dataset('github')
.build(), .build(),
(repo, getId) => new QuestionBuilder() (repo, getId) => new QuestionBuilder()
.id(getId()) .id(getId())
.prompt(`What is the main branch of ${repo.owner}/${repo.name}?`) .prompt(`What is the main branch of ${repo.repo}?`)
.groundTruth(repo.defaultBranch) .groundTruth(repo.defaultBranch)
.type('field-retrieval') .type('field-retrieval')
.dataset('github') .dataset('github')