@@ -279,11 +279,13 @@ async def fake_acompletion(**kwargs: Any):
279279 ("openrouter/deepseek/deepseek-v4-pro" , "openrouter" ),
280280 ],
281281)
282+ @pytest .mark .parametrize ("declare_tools" , [True , False ], ids = ["declared" , "omitted" ])
282283@pytest .mark .asyncio
283284async def test_chat_replays_empty_reasoning_for_deepseek_v4_tool_calls (
284285 monkeypatch : pytest .MonkeyPatch ,
285286 model : str ,
286287 provider_name : str ,
288+ declare_tools : bool ,
287289) -> None :
288290 captured : dict [str , Any ] = {}
289291
@@ -307,17 +309,19 @@ async def fake_acompletion(**kwargs: Any):
307309 },
308310 {"role" : "tool" , "content" : "done" , "tool_call_id" : "call_1" },
309311 ]
310- tools = [{"type" : "function" , "function" : {"name" : "probe" , "parameters" : {}}}]
312+ tools = [{"type" : "function" , "function" : {"name" : "probe" , "parameters" : {}}}] if declare_tools else None
311313 provider = LiteLLMProvider (api_key = "test-key" , provider_name = provider_name , default_model = model )
312314
313315 await provider .chat (messages = messages , tools = tools )
314316
315317 assert captured ["messages" ][0 ]["reasoning_content" ] == ""
316318
317319
320+ @pytest .mark .parametrize ("declare_tools" , [True , False ], ids = ["declared" , "omitted" ])
318321@pytest .mark .asyncio
319322async def test_chat_stream_replays_empty_reasoning_for_deepseek_v4_tool_calls (
320323 monkeypatch : pytest .MonkeyPatch ,
324+ declare_tools : bool ,
321325) -> None :
322326 captured : dict [str , Any ] = {}
323327
@@ -328,7 +332,7 @@ async def fake_acompletion(**kwargs: Any):
328332 monkeypatch .setattr ("raven.providers.litellm_provider.acompletion" , fake_acompletion )
329333
330334 messages = [{"role" : "assistant" , "content" : "" , "tool_calls" : [{"id" : "call_1" }]}]
331- tools = [{"type" : "function" , "function" : {"name" : "probe" , "parameters" : {}}}]
335+ tools = [{"type" : "function" , "function" : {"name" : "probe" , "parameters" : {}}}] if declare_tools else None
332336 provider = LiteLLMProvider (
333337 api_key = "test-key" ,
334338 provider_name = "deepseek" ,
0 commit comments