Reference
Function Context

Function Context

This is an object that represents the current context in which the function is being executed.

Properties

args object

The arguments with which a function is to be run. This is typically present when the function is invoked by an AI character (ON_CHARACTER_CALL) or by a message of type FUNCTION_CALL being sent to an AI character.


character Character

The character for which this function was created.


conversation Conversation optional

The conversation within which this function was invoked. This is optional as functions can be invoked outside of a conversation.


formData object

The data got from the UI form that called the function.


function Function

A reference to the function being invoked.


trigger { name: FunctionTrigger; payload?: string } optional

An object contain the name of the trigger that triggered the invocation of the function and whatever payload may have come with the trigger.


user User optional

The logged-in user.


© 2024 ProteusAI. All rights reserved