Agent
public struct Agent : Equatable, Sendable
Represents all info about an agent.
-
The id of the agent.
Declaration
Swift
public let id: Int -
The first name of the agent, or
nilwhen the backend omits or hides this field.Declaration
Swift
public let firstName: String? -
The surname of the agent, or
nilwhen the backend omits or hides this field.Declaration
Swift
public let surname: String? -
The nickname of the agent.
Declaration
Swift
public let nickname: String? -
Whether the agent is a bot, or
nilwhen the backend omits or hides this field.Declaration
Swift
public let isBotUser: Bool? -
Whether the agent is for automated surveys, or
nilwhen the backend omits or hides this field.Declaration
Swift
public let isSurveyUser: Bool? -
The URL for the profile photo of the agent, or
nilwhen unavailable or hidden by the backend.Declaration
Swift
public let imageUrl: String?
-
Creates an
Agentvalue, typically when synthesising agents for tests, previews, or mocks.Production code receives
Agentvalues from the SDK onChatThreads and inagentTyping(isTyping:agent:threadId:)events.Declaration
Swift
public init( id: Int, firstName: String? = nil, surname: String? = nil, nickname: String? = nil, isBotUser: Bool? = nil, isSurveyUser: Bool? = nil, imageUrl: String? = nil )Parameters
idBackend identifier for the agent.
firstNameAgent’s first name;
nilwhen omitted or hidden by the backend.surnameAgent’s surname;
nilwhen omitted or hidden by the backend.nicknameOptional display nickname; UI typically prefers this over
firstName surname.isBotUsertrueif the agent is an automated bot;nilwhen omitted or hidden by the backend.isSurveyUsertrueif the agent represents an automated survey flow;nilwhen omitted or hidden by the backend.imageUrlURL of the agent’s profile photo;
nilwhen unavailable or hidden.
View on GitHub