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 ChatCompletionFunctionCallDetailsgetFunction()StringgetId()intgetIndex()StringgetType()static List<ChatCompletionToolCall>make(List<GPTToolCall> toolCalls)voidmergeDelta(ChatCompletionToolCall other)static List<ChatCompletionToolCall>mergeDelta(List<ChatCompletionToolCall> calls1, List<ChatCompletionToolCall> calls2)voidsetFunction(ChatCompletionFunctionCallDetails function)voidsetId(String id)voidsetIndex(int index)voidsetType(String type)GPTToolCalltoGptToolCall()static List<GPTToolCall>toGptToolCallList(List<ChatCompletionToolCall> list)Turns the list into aGPTToolCalllist 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 aGPTToolCalllist observing thegetIndex().
-
make
public static List<ChatCompletionToolCall> make(List<GPTToolCall> toolCalls)
-
-