Add missing handler for resource subscribe and unsubscribe (#220)
This commit is contained in:
parent
02e86377e4
commit
2166b38d56
1 changed files with 781 additions and 9 deletions
|
|
@ -9,6 +9,8 @@
|
|||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
ini_set('display_errors', '0');
|
||||
|
||||
require_once dirname(__DIR__, 2).'/vendor/autoload.php';
|
||||
|
||||
use Http\Discovery\Psr17Factory;
|
||||
|
|
@ -51,7 +53,6 @@ $server = Server::builder()
|
|||
->addResource(static fn () => 'This is the content of the static text resource.', 'test://static-text', 'static-text', 'A static text resource for testing')
|
||||
->addResource(static fn () => fopen('data://image/png;base64,'.Elements::TEST_IMAGE_BASE64, 'r'), 'test://static-binary', 'static-binary', 'A static binary resource (image) for testing')
|
||||
->addResourceTemplate([Elements::class, 'resourceTemplate'], 'test://template/{id}/data', 'template', 'A resource template with parameter substitution', 'application/json')
|
||||
// TODO: Handler for resources/subscribe and resources/unsubscribe
|
||||
->addResource(static fn () => 'Watched resource content', 'test://watched-resource', 'watched-resource', 'A resource that can be watched')
|
||||
// Prompts
|
||||
->addPrompt(static fn () => [['role' => 'user', 'content' => 'This is a simple prompt for testing.']], 'test_simple_prompt', 'A simple prompt without arguments')
|
||||
|
|
|
|||
Loading…
Reference in a new issue