@@ -53,6 +53,85 @@ def get_request_body_api():
53
53
54
54
55
55
class OpenAIChatApi (ApiMixin ):
56
+ @staticmethod
57
+ def get_response_body_api ():
58
+ return openapi .Responses (responses = {
59
+ 200 : openapi .Response (description = _ ('response parameters' ),
60
+ schema = openapi .Schema (type = openapi .TYPE_OBJECT ,
61
+ required = ['id' ,
62
+ 'choices' ],
63
+ properties = {
64
+ 'id' : openapi .Schema (
65
+ type = openapi .TYPE_STRING ,
66
+ title = _ (
67
+ "Conversation ID" )),
68
+ 'choices' : openapi .Schema (
69
+ type = openapi .TYPE_ARRAY ,
70
+ items = openapi .Schema (
71
+ type = openapi .TYPE_OBJECT ,
72
+ required = [
73
+ 'message' ],
74
+ properties = {
75
+ 'finish_reason' : openapi .Schema (
76
+ type = openapi .TYPE_STRING , ),
77
+ 'index' : openapi .Schema (
78
+ type = openapi .TYPE_INTEGER ),
79
+ 'answer_list' : openapi .Schema (
80
+ type = openapi .TYPE_ARRAY ,
81
+ items = openapi .Schema (
82
+ type = openapi .TYPE_OBJECT ,
83
+ required = [
84
+ 'content' ],
85
+ properties = {
86
+ 'content' : openapi .Schema (
87
+ type = openapi .TYPE_STRING ),
88
+ 'view_type' : openapi .Schema (
89
+ type = openapi .TYPE_STRING ),
90
+ 'runtime_node_id' : openapi .Schema (
91
+ type = openapi .TYPE_STRING ),
92
+ 'chat_record_id' : openapi .Schema (
93
+ type = openapi .TYPE_STRING ),
94
+ 'reasoning_content' : openapi .Schema (
95
+ type = openapi .TYPE_STRING ),
96
+ }
97
+ )),
98
+ 'message' : openapi .Schema (
99
+ type = openapi .TYPE_OBJECT ,
100
+ required = [
101
+ 'content' ],
102
+ properties = {
103
+ 'content' : openapi .Schema (
104
+ type = openapi .TYPE_STRING ),
105
+ 'role' : openapi .Schema (
106
+ type = openapi .TYPE_STRING )
107
+
108
+ }),
109
+
110
+ }
111
+ )),
112
+ 'created' : openapi .Schema (
113
+ type = openapi .TYPE_INTEGER ),
114
+ 'model' : openapi .Schema (
115
+ type = openapi .TYPE_STRING ),
116
+ 'object' : openapi .Schema (
117
+ type = openapi .TYPE_STRING ),
118
+ 'usage' : openapi .Schema (
119
+ type = openapi .TYPE_OBJECT ,
120
+ required = [
121
+ 'completion_tokens' ,
122
+ 'prompt_tokens' ,
123
+ 'total_tokens' ],
124
+ properties = {
125
+ 'completion_tokens' : openapi .Schema (
126
+ type = openapi .TYPE_INTEGER ),
127
+ 'prompt_tokens' : openapi .Schema (
128
+ type = openapi .TYPE_INTEGER ),
129
+ 'total_tokens' : openapi .Schema (
130
+ type = openapi .TYPE_INTEGER )
131
+ })
132
+
133
+ }))})
134
+
56
135
@staticmethod
57
136
def get_request_body_api ():
58
137
return openapi .Schema (type = openapi .TYPE_OBJECT ,
0 commit comments