@@ -38,6 +38,15 @@ def get_request_body_api():
3838 }
3939 )
4040
41+ @staticmethod
42+ def get_response_body_api ():
43+ return openapi .Schema (
44+ type = openapi .TYPE_STRING ,
45+ title = _ ("Application authentication token" ),
46+ description = _ ("Application authentication token" ),
47+ default = "token"
48+ )
49+
4150 @staticmethod
4251 def get_response_body_api ():
4352 return openapi .Schema (
@@ -133,6 +142,27 @@ def get_request_body_api():
133142 }
134143 )
135144
145+ @staticmethod
146+ def get_response_body_api ():
147+ return openapi .Schema (
148+ type = openapi .TYPE_OBJECT ,
149+ properties = {
150+ 'id' : openapi .Schema (type = openapi .TYPE_STRING , title = _ ("Primary key id" ),
151+ description = _ ("Primary key id" )),
152+ 'secret_key' : openapi .Schema (type = openapi .TYPE_STRING , title = _ ("Secret key" ),
153+ description = _ ("Secret key" )),
154+ 'is_active' : openapi .Schema (type = openapi .TYPE_BOOLEAN , title = _ ("Is activation" ),
155+ description = _ ("Is activation" )),
156+ 'application_id' : openapi .Schema (type = openapi .TYPE_STRING , title = _ ("Application ID" ),
157+ description = _ ("Application ID" )),
158+ 'allow_cross_domain' : openapi .Schema (type = openapi .TYPE_BOOLEAN ,
159+ title = _ ("Is cross-domain allowed" ),
160+ description = _ ("Is cross-domain allowed" )),
161+ 'cross_domain_list' : openapi .Schema (type = openapi .TYPE_ARRAY , title = _ ('Cross-domain list' ),
162+ items = openapi .Schema (type = openapi .TYPE_STRING ))
163+ }
164+ )
165+
136166 class AccessToken (ApiMixin ):
137167 @staticmethod
138168 def get_request_params_api ():
@@ -171,6 +201,37 @@ def get_request_body_api():
171201 }
172202 )
173203
204+ @staticmethod
205+ def get_response_body_api ():
206+ return openapi .Schema (
207+ type = openapi .TYPE_OBJECT ,
208+ required = [],
209+ properties = {
210+ 'id' : openapi .Schema (type = openapi .TYPE_STRING , title = _ ("Primary key id" ),
211+ description = _ ("Primary key id" )),
212+ 'access_token' : openapi .Schema (type = openapi .TYPE_STRING , title = _ ("Access Token" ),
213+ description = _ ("Access Token" )),
214+ 'access_token_reset' : openapi .Schema (type = openapi .TYPE_BOOLEAN , title = _ ("Reset Token" ),
215+ description = _ ("Reset Token" )),
216+
217+ 'is_active' : openapi .Schema (type = openapi .TYPE_BOOLEAN , title = _ ("Is activation" ),
218+ description = _ ("Is activation" )),
219+ 'access_num' : openapi .Schema (type = openapi .TYPE_NUMBER , title = _ ("Number of visits" ),
220+ description = _ ("Number of visits" )),
221+ 'white_active' : openapi .Schema (type = openapi .TYPE_BOOLEAN , title = _ ("Whether to enable whitelist" ),
222+ description = _ ("Whether to enable whitelist" )),
223+ 'white_list' : openapi .Schema (type = openapi .TYPE_ARRAY ,
224+ items = openapi .Schema (type = openapi .TYPE_STRING ), title = _ ("Whitelist" ),
225+ description = _ ("Whitelist" )),
226+ 'show_source' : openapi .Schema (type = openapi .TYPE_BOOLEAN ,
227+ title = _ ("Whether to display knowledge sources" ),
228+ description = _ ("Whether to display knowledge sources" )),
229+ 'language' : openapi .Schema (type = openapi .TYPE_STRING ,
230+ title = _ ("language" ),
231+ description = _ ("language" ))
232+ }
233+ )
234+
174235 class Edit (ApiMixin ):
175236 @staticmethod
176237 def get_request_body_api ():
@@ -379,6 +440,56 @@ def get_request_body_api():
379440 }
380441 )
381442
443+ @staticmethod
444+ def get_response_body_api ():
445+ return openapi .Schema (
446+ type = openapi .TYPE_OBJECT ,
447+ required = ['id' , 'name' , 'desc' , 'model_id' , 'dialogue_number' , 'dataset_setting' , 'model_setting' ,
448+ 'problem_optimization' , 'stt_model_enable' , 'stt_model_enable' , 'tts_type' ,
449+ 'work_flow' ],
450+ properties = {
451+ 'id' : openapi .Schema (type = openapi .TYPE_STRING , title = _ ("Primary key id" ),
452+ description = _ ("Primary key id" )),
453+ 'name' : openapi .Schema (type = openapi .TYPE_STRING , title = _ ("Application Name" ),
454+ description = _ ("Application Name" )),
455+ 'desc' : openapi .Schema (type = openapi .TYPE_STRING , title = _ ("Application Description" ),
456+ description = _ ("Application Description" )),
457+ 'model_id' : openapi .Schema (type = openapi .TYPE_STRING , title = _ ("Model id" ),
458+ description = _ ("Model id" )),
459+ "dialogue_number" : openapi .Schema (type = openapi .TYPE_NUMBER ,
460+ title = _ ("Number of multi-round conversations" ),
461+ description = _ ("Number of multi-round conversations" )),
462+ 'prologue' : openapi .Schema (type = openapi .TYPE_STRING , title = _ ("Opening remarks" ),
463+ description = _ ("Opening remarks" )),
464+ 'dataset_id_list' : openapi .Schema (type = openapi .TYPE_ARRAY ,
465+ items = openapi .Schema (type = openapi .TYPE_STRING ),
466+ title = _ ("List of associated knowledge base IDs" ),
467+ description = _ ("List of associated knowledge base IDs" )),
468+ 'dataset_setting' : ApplicationApi .DatasetSetting .get_request_body_api (),
469+ 'model_setting' : ApplicationApi .ModelSetting .get_request_body_api (),
470+ 'problem_optimization' : openapi .Schema (type = openapi .TYPE_BOOLEAN , title = _ ("Problem Optimization" ),
471+ description = _ ("Problem Optimization" ), default = True ),
472+ 'type' : openapi .Schema (type = openapi .TYPE_STRING , title = _ ("Application Type" ),
473+ description = _ ("Application Type SIMPLE | WORK_FLOW" )),
474+ 'problem_optimization_prompt' : openapi .Schema (type = openapi .TYPE_STRING ,
475+ title = _ ('Question optimization tips' ),
476+ description = _ ("Question optimization tips" ),
477+ default = _ (
478+ "() contains the user's question. Answer the guessed user's question based on the context ({question}) Requirement: Output a complete question and put it in the <data></data> tag" )),
479+ 'tts_model_id' : openapi .Schema (type = openapi .TYPE_STRING , title = _ ("Text-to-speech model ID" ),
480+ description = _ ("Text-to-speech model ID" )),
481+ 'stt_model_id' : openapi .Schema (type = openapi .TYPE_STRING , title = _ ("Speech-to-text model id" ),
482+ description = _ ("Speech-to-text model id" )),
483+ 'stt_model_enable' : openapi .Schema (type = openapi .TYPE_STRING , title = _ ("Is speech-to-text enabled" ),
484+ description = _ ("Is speech-to-text enabled" )),
485+ 'tts_model_enable' : openapi .Schema (type = openapi .TYPE_STRING , title = _ ("Is text-to-speech enabled" ),
486+ description = _ ("Is text-to-speech enabled" )),
487+ 'tts_type' : openapi .Schema (type = openapi .TYPE_STRING , title = _ ("Text-to-speech type" ),
488+ description = _ ("Text-to-speech type" )),
489+ 'work_flow' : ApplicationApi .WorkFlow .get_request_body_api (),
490+ }
491+ )
492+
382493 class Query (ApiMixin ):
383494 @staticmethod
384495 def get_request_params_api ():
0 commit comments