@@ -74,6 +74,9 @@ def add(
7474 )
7575 if msg .content_parts is None :
7676 msg .content_parts = []
77+ else :
78+ # Sequence is immutable, so re-initialize as a list to append
79+ msg .content_parts = list (msg .content_parts )
7780 msg .content_parts .append (new_cp )
7881 existing = new_cp
7982
@@ -93,6 +96,8 @@ def add(
9396 )
9497 if msg .content_parts is None :
9598 msg .content_parts = []
99+ else :
100+ msg .content_parts = list (msg .content_parts )
96101 msg .content_parts .append (new_cp )
97102 existing = new_cp
98103
@@ -129,6 +134,8 @@ def add(
129134 )
130135 if msg .tool_calls is None :
131136 msg .tool_calls = []
137+ else :
138+ msg .tool_calls = list (msg .tool_calls )
132139 msg .tool_calls .append (new_tc )
133140 existing_tool_call = new_tc
134141 else :
@@ -152,6 +159,8 @@ def add(
152159 )
153160 if msg .tool_calls is None :
154161 msg .tool_calls = []
162+ else :
163+ msg .tool_calls = list (msg .tool_calls )
155164 msg .tool_calls .append (existing_tool_call )
156165
157166 existing_tool_call .result = UiPathConversationToolCallResult (
@@ -190,6 +199,7 @@ def get_user_message(user_text: str) -> UiPathConversationMessage:
190199 content_part_id = str (uuid4 ()),
191200 mime_type = "text/plain" ,
192201 data = UiPathInlineValue (inline = user_text ),
202+ citations = [],
193203 created_at = timestamp ,
194204 updated_at = timestamp ,
195205 )
0 commit comments