4848
4949use rustapi_rs:: prelude:: * ;
5050use rustapi_rs:: toon:: { AcceptHeader , LlmResponse , Toon } ;
51+ use rustapi_openapi:: Schema ;
5152use std:: collections:: HashMap ;
52- use utoipa:: ToSchema ;
5353
5454// --- Data Models ---
5555
56- #[ derive( Debug , Clone , Serialize , Deserialize , ToSchema ) ]
56+ #[ derive( Debug , Clone , Serialize , Deserialize , Schema ) ]
5757struct Tool {
5858 name : String ,
5959 description : String ,
6060 input_schema : ToolSchema ,
6161}
6262
63- #[ derive( Debug , Clone , Serialize , Deserialize , ToSchema ) ]
63+ #[ derive( Debug , Clone , Serialize , Deserialize , Schema ) ]
6464struct ToolSchema {
6565 #[ serde( rename = "type" ) ]
6666 schema_type : String ,
6767 properties : HashMap < String , PropertySchema > ,
6868 required : Vec < String > ,
6969}
7070
71- #[ derive( Debug , Clone , Serialize , Deserialize , ToSchema ) ]
71+ #[ derive( Debug , Clone , Serialize , Deserialize , Schema ) ]
7272struct PropertySchema {
7373 #[ serde( rename = "type" ) ]
7474 prop_type : String ,
@@ -77,47 +77,47 @@ struct PropertySchema {
7777 enum_values : Option < Vec < String > > ,
7878}
7979
80- #[ derive( Debug , Clone , Serialize , Deserialize , ToSchema ) ]
80+ #[ derive( Debug , Clone , Serialize , Deserialize , Schema ) ]
8181struct ToolsListResponse {
8282 tools : Vec < Tool > ,
8383}
8484
85- #[ derive( Debug , Deserialize , ToSchema ) ]
85+ #[ derive( Debug , Deserialize , Schema ) ]
8686struct ToolExecuteRequest {
8787 tool : String ,
8888 arguments : HashMap < String , String > , // Simplified to String instead of serde_json::Value
8989}
9090
91- #[ derive( Debug , Clone , Serialize , ToSchema ) ]
91+ #[ derive( Debug , Clone , Serialize , Schema ) ]
9292struct ToolExecuteResponse {
9393 success : bool ,
9494 result : String ,
9595 #[ serde( skip_serializing_if = "Option::is_none" ) ]
9696 error : Option < String > ,
9797}
9898
99- #[ derive( Debug , Clone , Serialize , Deserialize , ToSchema ) ]
99+ #[ derive( Debug , Clone , Serialize , Deserialize , Schema ) ]
100100struct Resource {
101101 uri : String ,
102102 name : String ,
103103 description : String ,
104104 mime_type : String ,
105105}
106106
107- #[ derive( Debug , Clone , Serialize , Deserialize , ToSchema ) ]
107+ #[ derive( Debug , Clone , Serialize , Deserialize , Schema ) ]
108108struct ResourcesListResponse {
109109 resources : Vec < Resource > ,
110110}
111111
112- #[ derive( Debug , Clone , Serialize , ToSchema ) ]
112+ #[ derive( Debug , Clone , Serialize , Schema ) ]
113113struct ServerInfo {
114114 name : String ,
115115 version : String ,
116116 protocol_version : String ,
117117 capabilities : Capabilities ,
118118}
119119
120- #[ derive( Debug , Clone , Serialize , ToSchema ) ]
120+ #[ derive( Debug , Clone , Serialize , Schema ) ]
121121struct Capabilities {
122122 tools : bool ,
123123 resources : bool ,
0 commit comments