AIToolCallPart

data class AIToolCallPart(val id: String, val name: String, val displayTitle: String? = null, val status: AIToolCallPart.Status, val executor: AIToolCallPart.Executor = Executor.Server, val targetUserId: String? = null, val targetClientId: String? = null, val arguments: String? = null, val summary: String? = null, val durationMs: Int? = null, val approval: AIToolApproval? = null, val authorization: AIToolAuthorization? = null)

A tool the agent called, run by the agent's backend or by a person's device.

Parameters

id

The model provider's tool-call ID. A device's result is matched against it.

name

The tool's name, as the agent declared it.

displayTitle

What the call is doing, in words for people, such as "Checking your location".

status

Where the call is. Defaults to Status.Running when the agent sends none.

executor

Who runs the tool. Defaults to Executor.Server when the agent sends none.

targetUserId

The person whose device must run a client tool.

targetClientId

The install that must run a client tool, from the custom data of the person's triggering message.

arguments

The call's arguments as JSON text with sorted keys, present for client tools, which need them to run. Every channel member can see them.

summary

A short, shareable outcome, such as "Found your location".

durationMs

How long the call took, in milliseconds.

approval

What the call asks the person it waits for before it runs, and how they answered, when its tool asks first.

authorization

The sign-in the call waits for the person to finish before it runs, and how it ended, when it needs their account at a provider.

Constructors

Link copied to clipboard
constructor(id: String, name: String, displayTitle: String? = null, status: AIToolCallPart.Status, executor: AIToolCallPart.Executor = Executor.Server, targetUserId: String? = null, targetClientId: String? = null, arguments: String? = null, summary: String? = null, durationMs: Int? = null, approval: AIToolApproval? = null, authorization: AIToolAuthorization? = null)

Types

Link copied to clipboard
value class Executor(val rawValue: String)

Who runs a tool. An open set: compare against the executors you know.

Link copied to clipboard
value class Status(val rawValue: String)

Where a tool call is. An open set: compare against the statuses you know, and treat the rest as still in progress.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

How long the call took, in seconds.

Link copied to clipboard
Link copied to clipboard
val id: String
Link copied to clipboard

Whether the person declined the call, or the sign-in it waited for, so it never ran.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun isAwaiting(userId: String, clientId: String): Boolean

Whether this call is waiting for this device: a client tool, still awaiting its result, targeted at this person and this install.

Link copied to clipboard
fun isAwaitingApproval(userId: String, clientId: String): Boolean

Whether this call is waiting for this person to allow it, on this device: still awaiting approval, targeted at this person, and at this install when it names one (a client tool does; a server tool's question may be answered from any of their devices).

Link copied to clipboard

Whether this call is waiting for this person to sign in at a provider it needs: still awaiting authorization, with a sign-in, and targeted at this person. They may sign in from any of their devices.