Class GPTToolCall
- java.lang.Object
-
- com.composum.ai.backend.base.service.chat.GPTToolCall
-
public class GPTToolCall extends Object
Represents a tool call generated by the model in a chat completion response. This can be a function call with specific arguments.
-
-
Constructor Summary
Constructors Constructor Description GPTToolCall(String id, String type, GPTFunctionCallDetails function)
Creates the object
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
GPTFunctionCallDetails
getFunction()
The function being called by the model, including its name and arguments.String
getId()
The ID of the tool call.String
getType()
The type of the tool, currently only "function" is supported.int
hashCode()
GPTToolCall
mergeDelta(GPTToolCall other)
When streaming, this merges the delta received during the stream.static List<GPTToolCall>
mergeDelta(List<GPTToolCall> calls1, List<GPTToolCall> calls2)
When streaming, this merges the delta received during the stream.String
toString()
String representation for debugging.
-
-
-
Constructor Detail
-
GPTToolCall
public GPTToolCall(String id, String type, GPTFunctionCallDetails function)
Creates the object- Parameters:
id
- The ID of the tool call.type
- The type of the tool, currently only "function" is supported.function
- The function being called by the model, including its name and arguments.
-
-
Method Detail
-
getId
public String getId()
The ID of the tool call.
-
getType
public String getType()
The type of the tool, currently only "function" is supported.
-
getFunction
public GPTFunctionCallDetails getFunction()
The function being called by the model, including its name and arguments.
-
toString
public String toString()
String representation for debugging.
-
mergeDelta
public GPTToolCall mergeDelta(@Nullable GPTToolCall other)
When streaming, this merges the delta received during the stream.
-
mergeDelta
@Nullable public static List<GPTToolCall> mergeDelta(@Nullable List<GPTToolCall> calls1, @Nullable List<GPTToolCall> calls2)
When streaming, this merges the delta received during the stream.
-
-