Class ToolCall
java.lang.Object
nl.dannyj.mistral.models.completion.tool.ToolCall
Represents a tool call requested by the model as part of an Assistant message.
Based on the 'ToolCall' definition in the Mistral AI API specification.
-
Constructor Summary
ConstructorsConstructorDescriptionToolCall()
ToolCall
(String id, ToolType type, FunctionCall function, int index) Creates a newToolCall
instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
The details of the function to be called.getId()
The unique identifier for this specific tool call.int
getIndex()
The index of the tool call in the list, if multiple calls are made.getType()
The type of the tool being called.int
hashCode()
void
setFunction
(FunctionCall function) The details of the function to be called.void
The unique identifier for this specific tool call.void
setIndex
(int index) The index of the tool call in the list, if multiple calls are made.void
The type of the tool being called.toString()
-
Constructor Details
-
ToolCall
public ToolCall() -
ToolCall
Creates a newToolCall
instance.- Parameters:
id
- The tool call ID.type
- The tool type.function
- The function call details.index
- The index of the tool call.
-
-
Method Details
-
getId
The unique identifier for this specific tool call. This ID is required when sending a response back using a ToolMessage.- Returns:
- The tool call ID, or null if not provided by the API.
-
getType
The type of the tool being called. Currently only 'function' is supported. Defaults to FUNCTION if not specified.- Returns:
- The tool type.
-
getFunction
The details of the function to be called. Required.- Returns:
- The function call details.
-
getIndex
public int getIndex()The index of the tool call in the list, if multiple calls are made. Defaults to 0 if not specified by the API.- Returns:
- The index.
-
setId
The unique identifier for this specific tool call. This ID is required when sending a response back using a ToolMessage.- Parameters:
id
- The tool call ID.
-
setType
The type of the tool being called. Currently only 'function' is supported. Defaults to FUNCTION if not specified.- Parameters:
type
- The tool type.
-
setFunction
The details of the function to be called. Required.- Parameters:
function
- The function call details.
-
setIndex
public void setIndex(int index) The index of the tool call in the list, if multiple calls are made. Defaults to 0 if not specified by the API.- Parameters:
index
- The index of the tool call.
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-