@@ -43,6 +43,7 @@ def _create_openai_llm(
4343 max_tokens : int | None ,
4444 agenthub_config : str ,
4545 byo_connection_id : str | None = None ,
46+ trace_context_extra_baggage : list [str ] | None = None ,
4647 ** kwargs : Any ,
4748) -> BaseChatModel :
4849 """Create UiPathChatOpenAI for OpenAI models via LLMGateway."""
@@ -63,6 +64,7 @@ def _create_openai_llm(
6364 api_version = azure_open_ai_latest_api_version ,
6465 agenthub_config = agenthub_config ,
6566 byo_connection_id = byo_connection_id ,
67+ trace_context_extra_baggage = trace_context_extra_baggage ,
6668 output_version = "v1" ,
6769 ** sampling_kwargs ,
6870 ** kwargs ,
@@ -75,6 +77,7 @@ def _create_openai_llm(
7577 api_version = azure_open_ai_latest_api_version ,
7678 agenthub_config = agenthub_config ,
7779 byo_connection_id = byo_connection_id ,
80+ trace_context_extra_baggage = trace_context_extra_baggage ,
7881 output_version = "v1" ,
7982 ** sampling_kwargs ,
8083 ** kwargs ,
@@ -90,6 +93,7 @@ def _create_bedrock_llm(
9093 max_tokens : int | None ,
9194 agenthub_config : str ,
9295 byo_connection_id : str | None = None ,
96+ trace_context_extra_baggage : list [str ] | None = None ,
9397 ** kwargs : Any ,
9498) -> BaseChatModel :
9599 """Create UiPathChatBedrockConverse for Claude models via LLMGateway."""
@@ -109,6 +113,7 @@ def _create_bedrock_llm(
109113 max_tokens = max_tokens ,
110114 agenthub_config = agenthub_config ,
111115 byo_connection_id = byo_connection_id ,
116+ trace_context_extra_baggage = trace_context_extra_baggage ,
112117 output_version = "v1" ,
113118 ** sampling_kwargs ,
114119 ** kwargs ,
@@ -119,6 +124,7 @@ def _create_bedrock_llm(
119124 max_tokens = max_tokens ,
120125 agenthub_config = agenthub_config ,
121126 byo_connection_id = byo_connection_id ,
127+ trace_context_extra_baggage = trace_context_extra_baggage ,
122128 output_version = "v1" ,
123129 ** sampling_kwargs ,
124130 ** kwargs ,
@@ -134,6 +140,7 @@ def _create_vertex_llm(
134140 max_tokens : int | None ,
135141 agenthub_config : str ,
136142 byo_connection_id : str | None = None ,
143+ trace_context_extra_baggage : list [str ] | None = None ,
137144 ** kwargs : Any ,
138145) -> BaseChatModel :
139146 """Create UiPathChatVertex for Gemini models via LLMGateway."""
@@ -150,6 +157,7 @@ def _create_vertex_llm(
150157 max_tokens = max_tokens ,
151158 agenthub_config = agenthub_config ,
152159 byo_connection_id = byo_connection_id ,
160+ trace_context_extra_baggage = trace_context_extra_baggage ,
153161 output_version = "v1" ,
154162 ** sampling_kwargs ,
155163 ** kwargs ,
@@ -248,6 +256,7 @@ def get_chat_model(
248256 max_tokens : int | None ,
249257 agenthub_config : str ,
250258 byo_connection_id : str | None = None ,
259+ trace_context_extra_baggage : list [str ] | None = None ,
251260 ** kwargs : Any ,
252261) -> BaseChatModel :
253262 """Create and configure LLM instance using LLMGateway API.
@@ -272,7 +281,8 @@ def get_chat_model(
272281 effective_temperature ,
273282 max_tokens ,
274283 agenthub_config ,
275- byo_connection_id ,
284+ byo_connection_id = byo_connection_id ,
285+ trace_context_extra_baggage = trace_context_extra_baggage ,
276286 ** kwargs ,
277287 )
278288 case LLMProvider .BEDROCK :
@@ -282,7 +292,8 @@ def get_chat_model(
282292 effective_temperature ,
283293 max_tokens ,
284294 agenthub_config ,
285- byo_connection_id ,
295+ byo_connection_id = byo_connection_id ,
296+ trace_context_extra_baggage = trace_context_extra_baggage ,
286297 ** kwargs ,
287298 )
288299 case LLMProvider .VERTEX :
@@ -292,6 +303,7 @@ def get_chat_model(
292303 effective_temperature ,
293304 max_tokens ,
294305 agenthub_config ,
295- byo_connection_id ,
306+ byo_connection_id = byo_connection_id ,
307+ trace_context_extra_baggage = trace_context_extra_baggage ,
296308 ** kwargs ,
297309 )
0 commit comments