ToolCall

sealed class ToolCall

Wraps a tool call by ChatGPT. You should check the type of the tool call, and handle the request. For example, if the type is Tool.Type.FUNCTION, you should call the function and return the result.

When making subsequent requests to chat completions, you should make sure to pass the message that contained this tool call, and the result of the tool call.

Inheritors

Properties

Link copied to clipboard
abstract val id: String

The id of this call. You should use this to construct a com.cjcrafter.openai.chat.ChatUser.TOOL message.

Link copied to clipboard
abstract val type: Tool.Type

The type of tool call.