6
6
"""
7
7
from dataclasses import dataclass
8
8
from http import HTTPStatus
9
- from typing import Dict , List
9
+ from typing import Dict , List , Optional
10
10
11
11
from dashscope .api_entities .dashscope_response import (DashScopeAPIResponse ,
12
12
DictMixin )
@@ -105,6 +105,50 @@ def __init__(self,
105
105
page_number = page_number ,
106
106
** kwargs )
107
107
108
+ @dataclass (init = False )
109
+ class WorkflowMessage (DictMixin ):
110
+ node_id : str
111
+ node_name : str
112
+ node_type : str
113
+ node_status : str
114
+ node_is_completed : str
115
+ node_msg_seq_id : int
116
+ message : str
117
+
118
+ class Message (DictMixin ):
119
+ role : str
120
+ content : str
121
+
122
+ def __init__ (self ,
123
+ node_id : str = None ,
124
+ node_name : str = None ,
125
+ node_type : str = None ,
126
+ node_status : str = None ,
127
+ node_is_completed : str = None ,
128
+ node_msg_seq_id : int = None ,
129
+ message : Message = None ,
130
+ ** kwargs ):
131
+ """ Workflow message.
132
+
133
+ Args:
134
+ node_id (str, optional): .
135
+ node_name (str, optional): .
136
+ node_type (str, optional): .
137
+ node_status (str, optional): .
138
+ node_is_completed (str, optional): .
139
+ node_msg_seq_id (int, optional): .
140
+ message (Message, optional): .
141
+ """
142
+
143
+ super ().__init__ (node_id = node_id ,
144
+ node_name = node_name ,
145
+ node_type = node_type ,
146
+ node_status = node_status ,
147
+ node_is_completed = node_is_completed ,
148
+ node_msg_seq_id = node_msg_seq_id ,
149
+ message = message ,
150
+ ** kwargs )
151
+
108
152
109
153
@dataclass (init = False )
110
154
class ApplicationOutput (DictMixin ):
@@ -113,13 +157,15 @@ class ApplicationOutput(DictMixin):
113
157
session_id : str
114
158
thoughts : List [ApplicationThought ]
115
159
doc_references : List [ApplicationDocReference ]
160
+ workflow_message : WorkflowMessage
116
161
117
162
def __init__ (self ,
118
163
text : str = None ,
119
164
finish_reason : str = None ,
120
165
session_id : str = None ,
121
166
thoughts : List [ApplicationThought ] = None ,
122
167
doc_references : List [ApplicationDocReference ] = None ,
168
+ workflow_message : WorkflowMessage = None ,
123
169
** kwargs ):
124
170
125
171
ths = None
@@ -139,6 +185,7 @@ def __init__(self,
139
185
session_id = session_id ,
140
186
thoughts = ths ,
141
187
doc_references = refs ,
188
+ workflow_message = workflow_message ,
142
189
** kwargs )
143
190
144
191
0 commit comments