Skip to content

Commit ed5e977

Browse files
committed
-
1 parent 8c104c2 commit ed5e977

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed

demo/src/Blog/Chat.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,12 @@ public function __construct(
3232
public function loadMessages(): MessageBag
3333
{
3434
$messages = new MessageBag(
35-
Message::forSystem(
36-
<<<PROMPT
37-
You are an helpful assistant that knows about the latest blog content of the Symfony's framework website.
38-
To search for content you use the tool 'similarity_search' for generating the answer. Only use content
39-
that you get from searching with that tool or your previous answers. Don't make up information and if you
40-
can't find something, just say so. Also provide links to the blog posts you use as sources.
41-
PROMPT
35+
Message::forSystem(<<<PROMPT
36+
You are an helpful assistant that knows about the latest blog content of the Symfony's framework website.
37+
To search for content you use the tool 'similarity_search' for generating the answer. Only use content
38+
that you get from searching with that tool or your previous answers. Don't make up information and if you
39+
can't find something, just say so. Also provide links to the blog posts you use as sources.
40+
PROMPT
4241
)
4342
);
4443

demo/src/Mcp/ResourceTemplates/CurrentTimeResourceTemplate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class CurrentTimeResourceTemplate
2222
public function getTimeByTimezone(string $timezone): array
2323
{
2424
try {
25-
$time = new \DateTime('now', new \DateTimeZone($timezone))->format('Y-m-d H:i:s T');
25+
$time = (new \DateTime('now', new \DateTimeZone($timezone)))->format('Y-m-d H:i:s T');
2626
} catch (\Exception $e) {
2727
$time = 'Invalid timezone: '.$timezone;
2828
}

demo/src/Mcp/Resources/CurrentTimeResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function getCurrentTimeResource(): array
2424
return [
2525
'uri' => 'time://current',
2626
'mimeType' => 'text/plain',
27-
'text' => new \DateTime('now')->format('Y-m-d H:i:s T'),
27+
'text' => (new \DateTime('now'))->format('Y-m-d H:i:s T'),
2828
];
2929
}
3030
}

demo/src/Mcp/Tools/CurrentTimeTool.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ public function getCurrentTime(string $format = 'Y-m-d H:i:s'): string
3434
{
3535
$this->logger->info('CurrentTimeTool called', ['format' => $format]);
3636

37-
return new \DateTime('now', new \DateTimeZone('UTC'))->format($format);
37+
return (new \DateTime('now', new \DateTimeZone('UTC')))->format($format);
3838
}
3939
}

demo/tests/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@
1919
if (file_exists(dirname(__DIR__).'/config/bootstrap.php')) {
2020
require dirname(__DIR__).'/config/bootstrap.php';
2121
} elseif (method_exists(Dotenv::class, 'bootEnv')) {
22-
new Dotenv()->bootEnv(dirname(__DIR__).'/.env');
22+
(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
2323
}

0 commit comments

Comments
 (0)