Interface ToolCallValidator
- All Known Implementing Classes:
DefaultToolCallValidator
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Strategy interface for validating tool calls.
This interface allows different validation strategies to be applied
based on the context (sync vs streaming, different finish reasons, etc.).
- Since:
- 2026/01/13
- Author:
- gccszs
-
Method Summary
Modifier and TypeMethodDescriptionvalidate(List<DashScopeApiSpec.ChatCompletionMessage.ToolCall> toolCalls, DashScopeApiSpec.ChatCompletionFinishReason finishReason) Validates and filters tool calls, removing invalid ones.
-
Method Details
-
validate
List<DashScopeApiSpec.ChatCompletionMessage.ToolCall> validate(List<DashScopeApiSpec.ChatCompletionMessage.ToolCall> toolCalls, DashScopeApiSpec.ChatCompletionFinishReason finishReason) Validates and filters tool calls, removing invalid ones.- Parameters:
toolCalls- the list of tool calls to validatefinishReason- the finish reason from the LLM response- Returns:
- a list of valid tool calls
-