trait RemembersConversations

Properties

protected string|null $conversationId
protected object|null $conversationUser

Methods

forParticipant(object $participant)

Start a new conversation for the given participant.

forUser(object $user)

Start a new conversation for the given user.

continue(string $conversationId, object|null $as = null)

Continue an existing conversation, optionally as the given participant.

continueOrStart(string|null $conversationId, object $as)

Continue the given conversation for the participant, or start a new one when there is none.

continueLastConversation(object $as)

Continue the given participant's last conversation with this agent.

iterable
messages()

Get the list of messages comprising the conversation so far.

int
maxConversationMessages()

Get the maximum number of conversation messages to include in context.

string|null
currentConversation()

Get the UUID for the current conversation, if applicable.

bool
hasConversationParticipant()

Determine if the conversation has a participant and is thus being remembered.

object|null
conversationParticipant()

Get the participant having the current conversation.

Details

at line 19
RemembersConversations forParticipant(object $participant)

Start a new conversation for the given participant.

Parameters

object $participant

Return Value

RemembersConversations

at line 30
RemembersConversations forUser(object $user)

Start a new conversation for the given user.

Parameters

object $user

Return Value

RemembersConversations

at line 38
RemembersConversations continue(string $conversationId, object|null $as = null)

Continue an existing conversation, optionally as the given participant.

Parameters

string $conversationId
object|null $as

Return Value

RemembersConversations

at line 49
RemembersConversations continueOrStart(string|null $conversationId, object $as)

Continue the given conversation for the participant, or start a new one when there is none.

Parameters

string|null $conversationId
object $as

Return Value

RemembersConversations

at line 59
RemembersConversations continueLastConversation(object $as)

Continue the given participant's last conversation with this agent.

Parameters

object $as

Return Value

RemembersConversations

at line 72
iterable messages()

Get the list of messages comprising the conversation so far.

Return Value

iterable

at line 88
protected int maxConversationMessages()

Get the maximum number of conversation messages to include in context.

Return Value

int

at line 96
string|null currentConversation()

Get the UUID for the current conversation, if applicable.

Return Value

string|null

at line 104
bool hasConversationParticipant()

Determine if the conversation has a participant and is thus being remembered.

Return Value

bool

at line 112
object|null conversationParticipant()

Get the participant having the current conversation.

Return Value

object|null