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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisStreamingToolFunctionCall(DeepSeekApi.ChatCompletionChunk chatCompletion) booleanisStreamingToolFunctionCallFinish(DeepSeekApi.ChatCompletionChunk chatCompletion) merge(DeepSeekApi.ChatCompletionChunk previous, DeepSeekApi.ChatCompletionChunk current)
-
Constructor Details
-
DeepSeekStreamFunctionCallingHelper
public DeepSeekStreamFunctionCallingHelper()
-
-
Method Details
-
merge
public DeepSeekApi.ChatCompletionChunk merge(DeepSeekApi.ChatCompletionChunk previous, DeepSeekApi.ChatCompletionChunk current) -
isStreamingToolFunctionCall
- Parameters:
chatCompletion- the ChatCompletionChunk to check- Returns:
- true if the ChatCompletionChunk is a streaming tool function call.
-
isStreamingToolFunctionCallFinish
- Parameters:
chatCompletion- the ChatCompletionChunk to check- Returns:
- true if the ChatCompletionChunk is a streaming tool function call and it is the last one.
-