InworldPacket
Module: Inworld.AI. Namespace: Inworld.Packet.
This is the base class for packets sending and receiving from Inworld runtime server.
Variables
Variables | Description |
---|---|
timestamp | The timestamp of the packet. |
type | The type of the packet. |
packetId | The PacketId of the packet. |
routing | The Routing of the packet. |
Properties
Properties | Description |
---|---|
ToJson | Generates the string of json to send to the Inworld server. |
Source | Gets the SourceType of the source. |
Target | Gets the SourceType of the target. |
IsBroadCast | Returns if this packet is broadcasting (targets multiple characters). |
SourceName | Returns the agent ID of the source. |
TargetName | Returns the agent ID of the target. |
API
Function | Description | Parameters |
---|---|---|
IsSource | Check if the agentID is in the source. | agentID: target agent ID. |
IsTarget | Check if the agentID is in the target. | agentID: target agent ID. |
Contains | Check if the agentID is either in the target list. | agentID: target agent ID. |
IsRelated | Check if the agentID is either in the target list, is the target, or is the source. | agentID: target agent ID. |
Related Classes
Source
Module: Inworld.AI. Namespace: Inworld.Packet.
This class defines the format of the sender or the receiver.
Variables | Description |
---|---|
type | An enumeration that determines whether this source is a player or a character. |
name | The name of the source. If it's a player, this value should be PLAYER ; if it's a character, its value should be the agentID of the character. |
Routing
Module: Inworld.AI. Namespace: Inworld.Packet.
This class determines the flow of the packet.
Variables | Description |
---|---|
source | The Source that sent this packet. |
target | The Source that received this packet. |
targets | The list of the Sources that received this packet. |
PacketId
Module: Inworld.AI. Namespace: Inworld.Packet.
The PacketId
class encapsulates identifiers used to manage different aspects of interactions within the system. These identifiers help track and organize communication between components.
Variables | Description |
---|---|
packetId | A unique ID assigned to each packet, distinguishing it from others. |
utteranceId | Represents an individual sentence or unit of communication within a conversation. Each utterance may encompass various types of behavior, such as text messages, emotion changes, audio data, and more. |
interactionId | Refers to a group of related sentences that are part of a larger interaction. An interaction may consist of multiple utterances. |
correlationId | Used in callback for server packets. |
Properties | Description |
---|---|
ToString | Gets a formatted string that combines the packet's status, interaction ID, utterance ID, and packet ID. The format is $"{Status} I: {interactionId} U: {utteranceId} P: {packetId}" |
Status | Gets or sets the status of the packet. The status represents the current state or condition of the packet. |