File tree 1 file changed +4
-2
lines changed
libs/partners/deepseek/langchain_deepseek
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -255,12 +255,14 @@ def _convert_chunk_to_generation_chunk(
255
255
if (choices := chunk .get ("choices" )) and generation_chunk :
256
256
top = choices [0 ]
257
257
if isinstance (generation_chunk .message , AIMessageChunk ):
258
- if reasoning_content := top .get ("delta" , {}).get ("reasoning_content" ):
258
+ if (
259
+ reasoning_content := top .get ("delta" , {}).get ("reasoning_content" )
260
+ ) is not None :
259
261
generation_chunk .message .additional_kwargs ["reasoning_content" ] = (
260
262
reasoning_content
261
263
)
262
264
# Handle use via OpenRouter
263
- elif reasoning := top .get ("delta" , {}).get ("reasoning" ):
265
+ elif ( reasoning := top .get ("delta" , {}).get ("reasoning" )) is not None :
264
266
generation_chunk .message .additional_kwargs ["reasoning_content" ] = (
265
267
reasoning
266
268
)
You can’t perform that action at this time.
0 commit comments