chore: migration to update vision_analyze prompt in DB
Captures the current working vision prompt (MODEL_NAME/MODEL_NUMBER split) as a versioned migration so fresh installs get the correct prompt without manual intervention. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
32da9bb48f
commit
b8dd64eeba
1 changed files with 57 additions and 0 deletions
57
migrations/Version20260520040000.php
Normal file
57
migrations/Version20260520040000.php
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20260520040000 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Update vision_analyze prompt: split MODEL into MODEL_NAME/MODEL_NUMBER';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$body = <<<'PROMPT'
|
||||
Look at this nameplate/label photo of IT hardware.
|
||||
Extract the manufacturer, any model identifier (name or number), and serial number visible on the label.
|
||||
If the label shows both a product name (e.g. "ThinkPad T490s") and a separate part/product code (e.g. "20NXS0BA00"), put the product name in MODEL_NAME and the code in MODEL_NUMBER.
|
||||
If only one model field is visible, put it in MODEL_NAME and leave MODEL_NUMBER completely empty.
|
||||
MODEL_NUMBER must never contain the serial number.
|
||||
Do not guess or add information not visible on the label.
|
||||
Respond in exactly this format:
|
||||
MANUFACTURER:
|
||||
MODEL_NAME:
|
||||
MODEL_NUMBER:
|
||||
SERIAL:
|
||||
Use empty string (nothing after the colon) when a field is not visible.
|
||||
PROMPT;
|
||||
|
||||
$this->addSql('UPDATE app.prompt_templates SET body = :body, updated_at = NOW() WHERE key = :key', [
|
||||
'body' => $body,
|
||||
'key' => 'vision_analyze',
|
||||
]);
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$body = <<<'PROMPT'
|
||||
Look at this nameplate/label photo of IT hardware.
|
||||
Extract the manufacturer (brand), model number/designation, and serial number visible on the label.
|
||||
Do not guess or add information not on the label.
|
||||
Respond in exactly this format (use empty string if not visible):
|
||||
MANUFACTURER: <brand name, e.g. Dell, HP, Lenovo, Medion>
|
||||
MODEL: <model number or designation>
|
||||
SERIAL: <serial number>
|
||||
PROMPT;
|
||||
|
||||
$this->addSql('UPDATE app.prompt_templates SET body = :body, updated_at = NOW() WHERE key = :key', [
|
||||
'body' => $body,
|
||||
'key' => 'vision_analyze',
|
||||
]);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue