ToolsBuilder

DSL builder for collecting KoryTool instances.

Use koryTools as the entry point to build a list of tools.

Samples

// Create tool instance.
val getWeatherTool = TestWeatherTool()

// Create koryTools
val tools = koryTools {
    tool(getWeatherTool) // Add getWeatherTool.
}

// Add tools to request.
val requestWithKoryChat = koryChat(model = "gpt-5.6-sol") {
    user("Hello, what's the weather like in London?")
}.asChatRequest(
    tools = tools
)

// Or with request.
val requestWithKoryRequest = koryChatRequest {
    registerTools(tools)

    chat(model = "gpt-5.6-sol") {
        user("Hello, what's the weather like in London?")
    }
}

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
fun mcp(tool: MCPTool)
Link copied to clipboard
fun mcpTools(vararg tools: MCPTool)
Link copied to clipboard
fun tool(tool: KoryTool<*, *>)

Registers a tool.

Link copied to clipboard
fun tools(tools: Collection<KoryTool<*, *>>)

Registers collection of the KoryTool.

fun tools(vararg tools: KoryTool<*, *>)

Registers a tools.