Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/CoreBundle/AiProvider/AiTutorChatService.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
use Symfony\Component\HttpFoundation\RequestStack;
use Throwable;

use const DATE_ATOM;
use const ENT_QUOTES;
use const ENT_SUBSTITUTE;

Expand Down
1 change: 1 addition & 0 deletions src/CoreBundle/Controller/AiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4052,7 +4052,7 @@
->andWhere('message.content LIKE :sourceMetadata')
->andWhere('message.content LIKE :courseMetadata')
->andWhere('message.content LIKE :sessionMetadata')
->setParameter('user', $user)

Check failure on line 4055 in src/CoreBundle/Controller/AiController.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 Test on ubuntu-latest

QueryBuilderSetParameter

src/CoreBundle/Controller/AiController.php:4055:36: QueryBuilderSetParameter: To improve performance set explicit type for objects
->setParameter('receiverType', MessageRelUser::TYPE_TO)
->setParameter('messageType', Message::MESSAGE_TYPE_INBOX)
->setParameter('deletedStatus', Message::MESSAGE_STATUS_DELETED)
Expand Down Expand Up @@ -4138,6 +4138,7 @@
) {
$relation->addTag($tag);
$this->em->persist($relation);

break;
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/CoreBundle/Controller/ChatController.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
use Symfony\Contracts\Translation\TranslatorInterface;
use Throwable;

use const DATE_ATOM;
use const ENT_QUOTES;
use const ENT_SUBSTITUTE;
use const JSON_UNESCAPED_SLASHES;
Expand Down Expand Up @@ -1678,7 +1679,7 @@ private function getGlobalAiTutorArchiveMessages(ManagerRegistry $doctrine, int
}

/**
* @param list<array{role:string,content:string,date:string}> $messages
* @param list<array{role:string,content:string,date:string}> $messages
* @param array{source:string,mode:string,course_id:int,session_id:int,conversation_id:int,provider:string,path:string} $metadata
*/
private function buildAiTutorArchiveHtml(
Expand Down Expand Up @@ -1759,6 +1760,7 @@ private function tagAiTutorArchiveMessage(
$relation->addTag($tag);
$entityManager->persist($relation);
$entityManager->flush();

break;
}
}
Expand Down
10 changes: 2 additions & 8 deletions src/CoreBundle/Mcp/GenerateStudentSuccessFeedbackTool.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,7 @@ public function generateStudentSuccessFeedback(
} catch (AccessDeniedException|InvalidArgumentException|RuntimeException $exception) {
throw new ToolCallException($exception->getMessage());
} catch (Throwable $throwable) {
throw new ToolCallException(
'The Student Success feedback could not be generated because of an unexpected server error. Check the Chamilo log for technical details.',
0,
$throwable,
);
throw new ToolCallException('The Student Success feedback could not be generated because of an unexpected server error. Check the Chamilo log for technical details.', 0, $throwable);
}
}

Expand Down Expand Up @@ -108,9 +104,7 @@ private function doGenerateStudentSuccessFeedback(

$teacherPrompt = trim($teacherPrompt);
if (mb_strlen($teacherPrompt) > self::MAX_TEACHER_PROMPT_LENGTH) {
throw new InvalidArgumentException(
sprintf('Additional instructions must be %d characters or fewer.', self::MAX_TEACHER_PROMPT_LENGTH),
);
throw new InvalidArgumentException(\sprintf('Additional instructions must be %d characters or fewer.', self::MAX_TEACHER_PROMPT_LENGTH));
}

$provider = null === $provider ? null : trim($provider);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ private function systemPrompt(Course $course, array $evidenceSources): string
}

/**
* @param array<string, mixed> $raw
* @param array<string, mixed> $raw
* @param array<string, array{title:string,url:string}> $evidenceSources
*
* @return array<string, mixed>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ private function createToolWithoutDependencies(): GenerateStudentSuccessFeedback
$reflection = new ReflectionClass(GenerateStudentSuccessFeedbackTool::class);

/** @var GenerateStudentSuccessFeedbackTool $tool */
$tool = $reflection->newInstanceWithoutConstructor();

return $tool;
return $reflection->newInstanceWithoutConstructor();
}
}
Loading