Class DeepSeekStreamFunctionCallingHelper
java.lang.Object
org.springframework.ai.deepseek.api.DeepSeekStreamFunctionCallingHelper
Helper class to support Streaming function calling. It can merge the streamed
ChatCompletionChunk in case of function calling message.
- Author:
- Geng Rong, Sun Yuhan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisStreamingToolFunctionCall(@Nullable DeepSeekApi.ChatCompletionChunk chatCompletion) booleanisStreamingToolFunctionCallFinish(@Nullable DeepSeekApi.ChatCompletionChunk chatCompletion) merge(@Nullable DeepSeekApi.ChatCompletionChunk previous, DeepSeekApi.ChatCompletionChunk current)
-
Constructor Details
-
DeepSeekStreamFunctionCallingHelper
public DeepSeekStreamFunctionCallingHelper()
-
-
Method Details
-
merge
public DeepSeekApi.ChatCompletionChunk merge(@Nullable DeepSeekApi.ChatCompletionChunk previous, DeepSeekApi.ChatCompletionChunk current) -
isStreamingToolFunctionCall
public boolean isStreamingToolFunctionCall(@Nullable DeepSeekApi.ChatCompletionChunk chatCompletion) - Parameters:
chatCompletion- the ChatCompletionChunk to check- Returns:
- true if the ChatCompletionChunk is a streaming tool function call.
-
isStreamingToolFunctionCallFinish
public boolean isStreamingToolFunctionCallFinish(@Nullable DeepSeekApi.ChatCompletionChunk chatCompletion) - Parameters:
chatCompletion- the ChatCompletionChunk to check- Returns:
- true if the ChatCompletionChunk is a streaming tool function call and it is the last one.
-