add system prompt and chunks index views and edit

This commit is contained in:
team2
2026-02-15 21:33:31 +01:00
parent 59e48242b5
commit 3416678cf4
12 changed files with 743 additions and 7 deletions

View File

@@ -0,0 +1,38 @@
<?php
// src/Repository/SystemPromptRepository.php
declare(strict_types=1);
namespace App\Repository;
use App\Entity\SystemPrompt;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
class SystemPromptRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, SystemPrompt::class);
}
public function findActive(): ?SystemPrompt
{
return $this->createQueryBuilder('p')
->andWhere('p.active = true')
->orderBy('p.version', 'DESC')
->setMaxResults(1)
->getQuery()
->getOneOrNullResult();
}
public function getNextVersion(): int
{
$max = $this->createQueryBuilder('p')
->select('MAX(p.version)')
->getQuery()
->getSingleScalarResult();
return ((int)$max) + 1;
}
}