From 94d28e6ea47716ecc8becec7dda498be423f9061 Mon Sep 17 00:00:00 2001 From: Martin Ficzel Date: Wed, 10 Apr 2024 12:35:14 +0200 Subject: [PATCH] TASK: Use .json instead of .jsonl as storage format for the source of knowledge --- Classes/Domain/Knowledge/JsonlRecordCollection.php | 4 ++-- Classes/Domain/Knowledge/KnowledgeFilename.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Classes/Domain/Knowledge/JsonlRecordCollection.php b/Classes/Domain/Knowledge/JsonlRecordCollection.php index 522aebc..0f0d8fa 100644 --- a/Classes/Domain/Knowledge/JsonlRecordCollection.php +++ b/Classes/Domain/Knowledge/JsonlRecordCollection.php @@ -35,7 +35,7 @@ public function count(): int public function __toString(): string { - return implode("\n", array_map( + return '[' . "\n" . implode("\n", array_map( fn (JsonlRecord $record): string => \str_replace( PHP_EOL, "\\\\n", @@ -45,6 +45,6 @@ public function __toString(): string ) ), $this->items - )); + )) . "\n" . ']'; } } diff --git a/Classes/Domain/Knowledge/KnowledgeFilename.php b/Classes/Domain/Knowledge/KnowledgeFilename.php index d5d00a1..0530697 100644 --- a/Classes/Domain/Knowledge/KnowledgeFilename.php +++ b/Classes/Domain/Knowledge/KnowledgeFilename.php @@ -10,7 +10,7 @@ #[Flow\Proxy(false)] final class KnowledgeFilename { - private const FILE_ENDING = '.jsonl'; + private const FILE_ENDING = '.json'; public function __construct( public readonly KnowledgeSourceDiscriminator $knowledgeSourceDiscriminator,