festbench-web/database/factories/SoftbenchResultFactory.php

38 lines
1.4 KiB
PHP
Raw Permalink Normal View History

<?php
namespace Database\Factories;
use App\Models\BenchmarkRun;
use App\Models\SoftbenchResult;
use Illuminate\Database\Eloquent\Factories\Factory;
/** @extends Factory<SoftbenchResult> */
class SoftbenchResultFactory extends Factory
{
public function definition(): array
{
$ttft = round($this->faker->randomFloat(2, 0.1, 4), 2);
return [
'benchmark_run_id' => BenchmarkRun::factory(),
'ran_at' => now(),
'task' => $this->faker->randomElement(['first_occurrence', 'merge_intervals', 'version_compare']),
'level' => $this->faker->randomElement(['off', 'low', 'medium', 'xhigh']),
'ok' => $this->faker->boolean(70),
'decode' => round($this->faker->randomFloat(2, 10, 150), 2),
'user_tps' => round($this->faker->randomFloat(2, 5, 100), 2),
'ttft' => $ttft,
't_answer' => $ttft,
'wall' => round($ttft + $this->faker->randomFloat(2, 0.5, 30), 2),
'reasoning' => $this->faker->numberBetween(0, 2000),
'visible' => $this->faker->numberBetween(20, 400),
'total' => $this->faker->numberBetween(20, 2000),
'finish' => 'stop',
'detail' => null,
'section' => $this->faker->randomElement(['code', 'reasoning', 'constraints']),
'tool_calls' => $this->faker->optional()->numberBetween(1, 5),
'payload' => ['ok' => true],
];
}
}