SuperSeller3000/migrations/Version20260520050000.php

64 lines
2.3 KiB
PHP
Raw Permalink Normal View History

<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20260520050000 extends AbstractMigration
{
public function getDescription(): string
{
return 'Update specs_research prompt to report corrected model numbers';
}
public function up(Schema $schema): void
{
$body = <<<'PROMPT'
You are a hardware specifications expert. Extract the technical specifications for the {{articleType}}: "{{subject}}".
Web search results:
{{searchResults}}
Based on the search results above, list all technical specifications including:
processor, RAM, storage variants, display size and resolution, GPU, battery capacity,
ports, connectivity, weight, dimensions, OS, and any other relevant specs.
Be specific and accurate. If a spec is not found in the search results, omit it rather than guessing.
If the search results reveal that the model number in "{{subject}}" contains an OCR error
(e.g. a letter misread as a digit), output the corrected model number on the very first line
in exactly this format, then leave a blank line before the specs:
CORRECTED_MODEL_NUMBER: <corrected number>
If the model number is correct or no model number was provided, omit the CORRECTED_MODEL_NUMBER line entirely.
PROMPT;
$this->addSql('UPDATE app.prompt_templates SET body = :body, updated_at = NOW() WHERE key = :key', [
'body' => $body,
'key' => 'specs_research',
]);
}
public function down(Schema $schema): void
{
$body = <<<'PROMPT'
You are a hardware specifications expert. Extract the technical specifications for the {{articleType}}: "{{subject}}".
Web search results:
{{searchResults}}
Based on the search results above, list all technical specifications including:
processor, RAM, storage variants, display size and resolution, GPU, battery capacity,
ports, connectivity, weight, dimensions, OS, and any other relevant specs.
Be specific and accurate. If a spec is not found in the search results, omit it rather than guessing.
PROMPT;
$this->addSql('UPDATE app.prompt_templates SET body = :body, updated_at = NOW() WHERE key = :key', [
'body' => $body,
'key' => 'specs_research',
]);
}
}