Class ChatCompletionToolCall
- java.lang.Object
-
- com.composum.ai.backend.base.service.chat.impl.chatmodel.ChatCompletionToolCall
-
public class ChatCompletionToolCall 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 ChatCompletionToolCall()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ChatCompletionFunctionCallDetails
getFunction()
String
getId()
int
getIndex()
String
getType()
static List<ChatCompletionToolCall>
make(List<GPTToolCall> toolCalls)
void
mergeDelta(ChatCompletionToolCall other)
static List<ChatCompletionToolCall>
mergeDelta(List<ChatCompletionToolCall> calls1, List<ChatCompletionToolCall> calls2)
void
setFunction(ChatCompletionFunctionCallDetails function)
void
setId(String id)
void
setIndex(int index)
void
setType(String type)
GPTToolCall
toGptToolCall()
static List<GPTToolCall>
toGptToolCallList(List<ChatCompletionToolCall> list)
Turns the list into aGPTToolCall
list observing thegetIndex()
.
-
-
-
Method Detail
-
getId
public String getId()
-
setId
public void setId(String id)
-
getIndex
public int getIndex()
-
setIndex
public void setIndex(int index)
-
getType
public String getType()
-
setType
public void setType(String type)
-
getFunction
public ChatCompletionFunctionCallDetails getFunction()
-
setFunction
public void setFunction(ChatCompletionFunctionCallDetails function)
-
mergeDelta
@Nullable public static List<ChatCompletionToolCall> mergeDelta(@Nullable List<ChatCompletionToolCall> calls1, @Nullable List<ChatCompletionToolCall> calls2)
-
mergeDelta
public void mergeDelta(@Nullable ChatCompletionToolCall other)
-
toGptToolCall
@Nonnull public GPTToolCall toGptToolCall()
-
toGptToolCallList
@Nullable public static List<GPTToolCall> toGptToolCallList(List<ChatCompletionToolCall> list)
Turns the list into aGPTToolCall
list observing thegetIndex()
.
-
make
public static List<ChatCompletionToolCall> make(List<GPTToolCall> toolCalls)
-
-