43 lines
1.7 KiB
PHP
43 lines
1.7 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace Database\Factories;
|
||
|
|
|
||
|
|
use App\Models\BenchmarkRun;
|
||
|
|
use App\Models\ProsebenchResult;
|
||
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||
|
|
|
||
|
|
/** @extends Factory<ProsebenchResult> */
|
||
|
|
class ProsebenchResultFactory extends Factory
|
||
|
|
{
|
||
|
|
public function definition(): array
|
||
|
|
{
|
||
|
|
$ttft = round($this->faker->randomFloat(2, 0.1, 4), 2);
|
||
|
|
$checksTotal = $this->faker->numberBetween(3, 8);
|
||
|
|
|
||
|
|
return [
|
||
|
|
'benchmark_run_id' => BenchmarkRun::factory(),
|
||
|
|
'ran_at' => now(),
|
||
|
|
'task' => $this->faker->randomElement(['grief_email', 'refund_denial', 'status_update']),
|
||
|
|
'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(['sensitive', 'actionable']),
|
||
|
|
'checks_passed' => $this->faker->numberBetween(0, $checksTotal),
|
||
|
|
'checks_total' => $checksTotal,
|
||
|
|
'judge' => null,
|
||
|
|
'prefill' => round($this->faker->randomFloat(1, 50, 400), 1),
|
||
|
|
'prompt_tokens' => $this->faker->numberBetween(100, 500),
|
||
|
|
'payload' => ['ok' => true],
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|