@@ -27,16 +27,28 @@ int main()
2727 resources::ResourceManager resource_mgr;
2828
2929 // Register some sample resources
30- resources::Resource doc1{Id{" file://docs/readme.txt" }, resources::Kind::File,
31- Json{{" description" , " Project README" }, {" size" , 1024 }}};
30+ resources::Resource doc1;
31+ doc1.uri = " file://docs/readme.txt" ;
32+ doc1.name = " readme.txt" ;
33+ doc1.id = Id{" file://docs/readme.txt" };
34+ doc1.kind = resources::Kind::File;
35+ doc1.metadata = Json{{" description" , " Project README" }, {" size" , 1024 }};
3236 resource_mgr.register_resource (doc1);
3337
34- resources::Resource doc2{Id{" file://docs/api.txt" }, resources::Kind::File,
35- Json{{" description" , " API Documentation" }, {" size" , 2048 }}};
38+ resources::Resource doc2;
39+ doc2.uri = " file://docs/api.txt" ;
40+ doc2.name = " api.txt" ;
41+ doc2.id = Id{" file://docs/api.txt" };
42+ doc2.kind = resources::Kind::File;
43+ doc2.metadata = Json{{" description" , " API Documentation" }, {" size" , 2048 }};
3644 resource_mgr.register_resource (doc2);
3745
38- resources::Resource config{Id{" config://app.json" }, resources::Kind::Json,
39- Json{{" description" , " Application config" }}};
46+ resources::Resource config;
47+ config.uri = " config://app.json" ;
48+ config.name = " app.json" ;
49+ config.id = Id{" config://app.json" };
50+ config.kind = resources::Kind::Json;
51+ config.metadata = Json{{" description" , " Application config" }};
4052 resource_mgr.register_resource (config);
4153
4254 // ============================================================================
@@ -71,9 +83,9 @@ int main()
7183 std::cout << " \n 2. Listing Prompts:\n " ;
7284 std::cout << " " << std::string (40 , ' -' ) << " \n " ;
7385 auto prompts = ctx.list_prompts ();
74- for (const auto & [name, prompt] : prompts)
86+ for (const auto & prompt : prompts)
7587 {
76- std::cout << " - Name: " << name << " \n " ;
88+ std::cout << " - Name: " << prompt. name << " \n " ;
7789 std::cout << " Template: " << prompt.template_string () << " \n\n " ;
7890 }
7991
0 commit comments