@@ -191,16 +191,6 @@ impl From<services::user::ports::UserSettingsContent> for UserSettingsContent {
191191 }
192192}
193193
194- /// User settings response
195- #[ derive( Debug , Serialize , Deserialize , ToSchema ) ]
196- pub struct UserSettingsResponse {
197- /// User ID
198- pub user_id : UserId ,
199- /// Settings content (serialized as "settings")
200- #[ serde( rename = "settings" ) ]
201- pub content : UserSettingsContent ,
202- }
203-
204194/// User settings update request
205195#[ derive( Debug , Serialize , Deserialize , ToSchema ) ]
206196pub struct UpdateUserSettingsRequest {
@@ -251,6 +241,124 @@ impl UpdateUserSettingsPartiallyRequest {
251241 }
252242}
253243
244+ /// User settings response
245+ #[ derive( Debug , Serialize , Deserialize , ToSchema ) ]
246+ pub struct UserSettingsResponse {
247+ /// User ID
248+ pub user_id : UserId ,
249+ /// Settings content (serialized as "settings")
250+ #[ serde( rename = "settings" ) ]
251+ pub content : UserSettingsContent ,
252+ }
253+
254+ /// Model settings content for API responses
255+ #[ derive( Debug , Serialize , Deserialize , ToSchema ) ]
256+ pub struct ModelSettings {
257+ /// Whether models are public (visible/usable in responses)
258+ pub public : bool ,
259+ /// Optional system-level system prompt for this model
260+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
261+ pub system_prompt : Option < String > ,
262+ }
263+
264+ impl From < services:: model:: ports:: ModelSettings > for ModelSettings {
265+ fn from ( content : services:: model:: ports:: ModelSettings ) -> Self {
266+ Self {
267+ public : content. public ,
268+ system_prompt : content. system_prompt ,
269+ }
270+ }
271+ }
272+
273+ impl From < ModelSettings > for services:: model:: ports:: ModelSettings {
274+ fn from ( content : ModelSettings ) -> Self {
275+ Self {
276+ public : content. public ,
277+ system_prompt : content. system_prompt ,
278+ }
279+ }
280+ }
281+
282+ /// Partial model settings for API requests
283+ #[ derive( Debug , Serialize , Deserialize , ToSchema ) ]
284+ pub struct PartialModelSettings {
285+ /// Whether models are public (visible/usable in responses)
286+ pub public : Option < bool > ,
287+ /// Optional system-level system prompt for this model
288+ pub system_prompt : Option < String > ,
289+ }
290+
291+ impl From < services:: model:: ports:: PartialModelSettings > for PartialModelSettings {
292+ fn from ( content : services:: model:: ports:: PartialModelSettings ) -> Self {
293+ Self {
294+ public : content. public ,
295+ system_prompt : content. system_prompt ,
296+ }
297+ }
298+ }
299+
300+ impl From < PartialModelSettings > for services:: model:: ports:: PartialModelSettings {
301+ fn from ( content : PartialModelSettings ) -> Self {
302+ Self {
303+ public : content. public ,
304+ system_prompt : content. system_prompt ,
305+ }
306+ }
307+ }
308+
309+ /// Complete model response
310+ #[ derive( Debug , Serialize , Deserialize , ToSchema ) ]
311+ pub struct ModelResponse {
312+ /// External model identifier (e.g. "gpt-4.1")
313+ pub model_id : String ,
314+ /// Settings stored for this model
315+ pub settings : ModelSettings ,
316+ }
317+
318+ impl From < services:: model:: ports:: Model > for ModelResponse {
319+ fn from ( model : services:: model:: ports:: Model ) -> Self {
320+ Self {
321+ model_id : model. model_id ,
322+ settings : model. settings . into ( ) ,
323+ }
324+ }
325+ }
326+
327+ /// Model upsert request
328+ #[ derive( Debug , Serialize , Deserialize , ToSchema ) ]
329+ pub struct UpsertModelsRequest {
330+ pub settings : ModelSettings ,
331+ }
332+
333+ /// Model settings update request (partial update)
334+ #[ derive( Debug , Serialize , Deserialize , ToSchema ) ]
335+ pub struct UpdateModelRequest {
336+ pub settings : Option < PartialModelSettings > ,
337+ }
338+
339+ /// Batch model upsert request
340+ ///
341+ /// Maps model_id to partial settings to update.
342+ /// Example: { "gpt-4": { "public": true }, "gpt-3.5": { "public": false, "system_prompt": "..." } }
343+ #[ derive( Debug , Serialize , Deserialize , ToSchema ) ]
344+ pub struct BatchUpsertModelsRequest {
345+ #[ serde( flatten) ]
346+ pub models : std:: collections:: HashMap < String , PartialModelSettings > ,
347+ }
348+
349+ /// Model list response with pagination
350+ #[ derive( Debug , Serialize , Deserialize , ToSchema ) ]
351+ pub struct ModelListResponse {
352+ /// List of models
353+ pub models : Vec < ModelResponse > ,
354+ /// Maximum number of items returned
355+ pub limit : i64 ,
356+ /// Number of items skipped
357+ pub offset : i64 ,
358+ /// Total number of models
359+ pub total : i64 ,
360+ }
361+
254362/// Paginated user list response
255363#[ derive( Debug , Serialize , Deserialize , ToSchema ) ]
256364pub struct UserListResponse {
@@ -264,6 +372,54 @@ pub struct UserListResponse {
264372 pub total : u64 ,
265373}
266374
375+ /// System configs response
376+ #[ derive( Debug , Serialize , Deserialize , ToSchema ) ]
377+ pub struct SystemConfigsResponse {
378+ /// Default model identifier to use when not specified
379+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
380+ pub default_model : Option < String > ,
381+ }
382+
383+ impl From < services:: system_configs:: ports:: SystemConfigs > for SystemConfigsResponse {
384+ fn from ( config : services:: system_configs:: ports:: SystemConfigs ) -> Self {
385+ Self {
386+ default_model : config. default_model ,
387+ }
388+ }
389+ }
390+
391+ /// System configs upsert request (full replace)
392+ #[ derive( Debug , Serialize , Deserialize , ToSchema ) ]
393+ pub struct UpsertSystemConfigsRequest {
394+ /// Default model identifier to use when not specified
395+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
396+ pub default_model : Option < String > ,
397+ }
398+
399+ impl From < UpsertSystemConfigsRequest > for services:: system_configs:: ports:: SystemConfigs {
400+ fn from ( req : UpsertSystemConfigsRequest ) -> Self {
401+ services:: system_configs:: ports:: SystemConfigs {
402+ default_model : req. default_model ,
403+ }
404+ }
405+ }
406+
407+ /// System configs update request (partial)
408+ #[ derive( Debug , Serialize , Deserialize , ToSchema ) ]
409+ pub struct UpdateSystemConfigsRequest {
410+ /// Default model identifier to use when not specified
411+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
412+ pub default_model : Option < String > ,
413+ }
414+
415+ impl From < UpdateSystemConfigsRequest > for services:: system_configs:: ports:: PartialSystemConfigs {
416+ fn from ( req : UpdateSystemConfigsRequest ) -> Self {
417+ services:: system_configs:: ports:: PartialSystemConfigs {
418+ default_model : req. default_model ,
419+ }
420+ }
421+ }
422+
267423/// File list response with pagination
268424#[ derive( Debug , Serialize , Deserialize , ToSchema ) ]
269425pub struct FileListResponse {
0 commit comments