55from langchain_core .language_models .chat_models import BaseChatModel
66from langchain_core .messages import AIMessageChunk
77from langchain_tests .integration_tests import ChatModelIntegrationTests , EmbeddingsIntegrationTests
8-
98from uipath_langchain_client .clients .anthropic .chat_models import UiPathChatAnthropic
109from uipath_langchain_client .clients .bedrock .chat_models import (
1110 UiPathChatAnthropicBedrock ,
@@ -66,30 +65,40 @@ def skip_on_specific_configs(
6665 pytest .skip (f"Skipping { test_name } : not relevant" )
6766
6867 # Claude + thinking: tool_choice forces tool use, incompatible with thinking
69- if is_claude and has_thinking and test_name in [
70- "test_structured_few_shot_examples" ,
71- "test_tool_calling" ,
72- "test_tool_calling_async" ,
73- "test_tool_calling_with_no_arguments" ,
74- "test_tool_choice" ,
75- "test_tool_message_error_status" ,
76- "test_bind_runnables_as_tools" ,
77- "test_structured_output" ,
78- "test_structured_output_async" ,
79- "test_structured_output_optional_param" ,
80- "test_structured_output_pydantic_2_v1" ,
81- "test_parallel_and_sequential_tool_calling" ,
82- "test_parallel_and_sequential_tool_calling_async" ,
83- ]:
68+ if (
69+ is_claude
70+ and has_thinking
71+ and test_name
72+ in [
73+ "test_structured_few_shot_examples" ,
74+ "test_tool_calling" ,
75+ "test_tool_calling_async" ,
76+ "test_tool_calling_with_no_arguments" ,
77+ "test_tool_choice" ,
78+ "test_tool_message_error_status" ,
79+ "test_bind_runnables_as_tools" ,
80+ "test_structured_output" ,
81+ "test_structured_output_async" ,
82+ "test_structured_output_optional_param" ,
83+ "test_structured_output_pydantic_2_v1" ,
84+ "test_parallel_and_sequential_tool_calling" ,
85+ "test_parallel_and_sequential_tool_calling_async" ,
86+ ]
87+ ):
8488 pytest .skip (
8589 f"Skipping { test_name } : thinking may not be enabled when tool_choice forces tool use"
8690 )
8791
8892 # Claude + thinking: extended thinking requires specific conversation history
89- if is_claude and has_thinking and test_name in [
90- "test_tool_message_histories_list_content" ,
91- "test_tool_message_histories_string_content" ,
92- ]:
93+ if (
94+ is_claude
95+ and has_thinking
96+ and test_name
97+ in [
98+ "test_tool_message_histories_list_content" ,
99+ "test_tool_message_histories_string_content" ,
100+ ]
101+ ):
93102 pytest .skip (
94103 f"Skipping { test_name } : extended thinking requires a specific conversation history"
95104 )
@@ -113,7 +122,9 @@ def skip_on_specific_configs(
113122 if model_class == UiPathChatAnthropicVertex and test_name in [
114123 "test_double_messages_conversation" ,
115124 ]:
116- pytest .skip (f"Skipping { test_name } : system message must be at beginning of message list" )
125+ pytest .skip (
126+ f"Skipping { test_name } : system message must be at beginning of message list"
127+ )
117128
118129 # UiPathChatAnthropicVertex: agent_loop fails with non_standard content tag
119130 if model_class == UiPathChatAnthropicVertex and test_name in [
@@ -142,23 +153,35 @@ def skip_on_specific_configs(
142153 pytest .skip (f"Skipping { test_name } : currently bugged on Vertex AI" )
143154
144155 # Claude via Vertex/Bedrock (Anthropic SDK): image URL sources not supported
145- if is_claude and model_class in [
146- UiPathChatAnthropicVertex ,
147- UiPathChatAnthropic ,
148- UiPathChatAnthropicBedrock ,
149- UiPathChatBedrock ,
150- ] and test_name in [
151- "test_image_inputs" ,
152- ]:
156+ if (
157+ is_claude
158+ and model_class
159+ in [
160+ UiPathChatAnthropicVertex ,
161+ UiPathChatAnthropic ,
162+ UiPathChatAnthropicBedrock ,
163+ UiPathChatBedrock ,
164+ ]
165+ and test_name
166+ in [
167+ "test_image_inputs" ,
168+ ]
169+ ):
153170 pytest .skip (f"Skipping { test_name } : URL image sources not supported via gateway" )
154171
155172 # Claude via Vertex/Bedrock: PDF/file inputs not supported
156- if is_claude and model_class in [
157- UiPathChatAnthropicVertex ,
158- UiPathChatBedrock ,
159- ] and test_name in [
160- "test_pdf_inputs" ,
161- ]:
173+ if (
174+ is_claude
175+ and model_class
176+ in [
177+ UiPathChatAnthropicVertex ,
178+ UiPathChatBedrock ,
179+ ]
180+ and test_name
181+ in [
182+ "test_pdf_inputs" ,
183+ ]
184+ ):
162185 pytest .skip (f"Skipping { test_name } : file blocks not supported on this client" )
163186
164187 # UiPathChatAnthropicVertex: image/pdf tool message
@@ -185,72 +208,107 @@ def skip_on_specific_configs(
185208 pytest .skip (f"Skipping { test_name } : serialization not supported on Bedrock Converse" )
186209
187210 # Gemini GoogleGenerativeAI: tool_message_histories / tool_message_error_status
188- if model_class == UiPathChatGoogleGenerativeAI and is_gemini_3 and test_name in [
189- "test_tool_message_histories_string_content" ,
190- "test_tool_message_histories_list_content" ,
191- "test_tool_message_error_status" ,
192- ]:
211+ if (
212+ model_class == UiPathChatGoogleGenerativeAI
213+ and is_gemini_3
214+ and test_name
215+ in [
216+ "test_tool_message_histories_string_content" ,
217+ "test_tool_message_histories_list_content" ,
218+ "test_tool_message_error_status" ,
219+ ]
220+ ):
193221 pytest .skip (f"Skipping { test_name } : not supported for Gemini 3 models" )
194222
195223 # Gemini GoogleGenerativeAI: thought signature invalid in multi-turn with thinking
196- if model_class == UiPathChatGoogleGenerativeAI and is_gemini and test_name in [
197- "test_image_tool_message" ,
198- "test_pdf_tool_message" ,
199- ]:
224+ if (
225+ model_class == UiPathChatGoogleGenerativeAI
226+ and is_gemini
227+ and test_name
228+ in [
229+ "test_image_tool_message" ,
230+ "test_pdf_tool_message" ,
231+ ]
232+ ):
200233 pytest .skip (f"Skipping { test_name } : thought signature invalid in multi-turn" )
201234
202235 # Gemini GoogleGenerativeAI: parallel tool calling
203- if model_class == UiPathChatGoogleGenerativeAI and is_gemini and test_name in [
204- "test_parallel_and_sequential_tool_calling" ,
205- "test_parallel_and_sequential_tool_calling_async" ,
206- ]:
236+ if (
237+ model_class == UiPathChatGoogleGenerativeAI
238+ and is_gemini
239+ and test_name
240+ in [
241+ "test_parallel_and_sequential_tool_calling" ,
242+ "test_parallel_and_sequential_tool_calling_async" ,
243+ ]
244+ ):
207245 pytest .skip (f"Skipping { test_name } : not supported for Gemini models" )
208246
209247 # UiPathChat (normalized) + Gemini: tool operations fail
210- if model_class == UiPathChat and is_gemini and test_name in [
211- "test_tool_calling" ,
212- "test_tool_calling_async" ,
213- "test_tool_choice" ,
214- "test_structured_few_shot_examples" ,
215- "test_tool_message_error_status" ,
216- "test_tool_message_histories_list_content" ,
217- "test_tool_message_histories_string_content" ,
218- "test_pdf_inputs" ,
219- "test_image_tool_message" ,
220- "test_pdf_tool_message" ,
221- "test_parallel_and_sequential_tool_calling" ,
222- "test_parallel_and_sequential_tool_calling_async" ,
223- ]:
248+ if (
249+ model_class == UiPathChat
250+ and is_gemini
251+ and test_name
252+ in [
253+ "test_tool_calling" ,
254+ "test_tool_calling_async" ,
255+ "test_tool_choice" ,
256+ "test_structured_few_shot_examples" ,
257+ "test_tool_message_error_status" ,
258+ "test_tool_message_histories_list_content" ,
259+ "test_tool_message_histories_string_content" ,
260+ "test_pdf_inputs" ,
261+ "test_image_tool_message" ,
262+ "test_pdf_tool_message" ,
263+ "test_parallel_and_sequential_tool_calling" ,
264+ "test_parallel_and_sequential_tool_calling_async" ,
265+ ]
266+ ):
224267 pytest .skip (f"Skipping { test_name } : not supported for Gemini on normalized API" )
225268
226269 # UiPathChat (normalized) + Gemini 3: agent_loop
227- if model_class == UiPathChat and is_gemini_3 and test_name in [
228- "test_agent_loop" ,
229- ]:
270+ if (
271+ model_class == UiPathChat
272+ and is_gemini_3
273+ and test_name
274+ in [
275+ "test_agent_loop" ,
276+ ]
277+ ):
230278 pytest .skip (f"Skipping { test_name } : not supported for Gemini 3 on normalized API" )
231279
232280 # UiPathChat (normalized) + Claude via Vertex: structured output / tool calling
233- if model_class == UiPathChat and is_vertex_claude and test_name in [
234- "test_tool_calling" ,
235- "test_tool_calling_async" ,
236- "test_tool_calling_with_no_arguments" ,
237- "test_structured_output" ,
238- "test_structured_output_async" ,
239- "test_structured_output_pydantic_2_v1" ,
240- "test_pdf_inputs" ,
241- "test_image_inputs" ,
242- "test_parallel_and_sequential_tool_calling" ,
243- "test_parallel_and_sequential_tool_calling_async" ,
244- ]:
281+ if (
282+ model_class == UiPathChat
283+ and is_vertex_claude
284+ and test_name
285+ in [
286+ "test_tool_calling" ,
287+ "test_tool_calling_async" ,
288+ "test_tool_calling_with_no_arguments" ,
289+ "test_structured_output" ,
290+ "test_structured_output_async" ,
291+ "test_structured_output_pydantic_2_v1" ,
292+ "test_pdf_inputs" ,
293+ "test_image_inputs" ,
294+ "test_parallel_and_sequential_tool_calling" ,
295+ "test_parallel_and_sequential_tool_calling_async" ,
296+ ]
297+ ):
245298 pytest .skip (f"Skipping { test_name } : not supported for Claude via Vertex on normalized" )
246299
247300 # UiPathChat (normalized) + Claude via Bedrock: image/pdf/parallel
248- if model_class == UiPathChat and "anthropic." in model_name .lower () and test_name in [
249- "test_image_inputs" ,
250- "test_pdf_inputs" ,
251- "test_parallel_and_sequential_tool_calling" ,
252- "test_parallel_and_sequential_tool_calling_async" ,
253- ]:
301+ if (
302+ model_class == UiPathChat
303+ and "anthropic." in model_name .lower ()
304+ and test_name
305+ in [
306+ "test_image_inputs" ,
307+ "test_pdf_inputs" ,
308+ "test_parallel_and_sequential_tool_calling" ,
309+ "test_parallel_and_sequential_tool_calling_async" ,
310+ ]
311+ ):
254312 pytest .skip (f"Skipping { test_name } : not supported for Claude via Bedrock on normalized" )
255313
256314 # GPT-5 / responses_api: stop_sequence not supported
0 commit comments