Skip to main content

InworldPacket

Module: Inworld.AI. Namespace: Inworld.Packet.

This is the base class for packets sending and receiving from Inworld runtime server.

Variables

VariablesDescription
timestampThe timestamp of the packet.
typeThe type of the packet.
packetIdThe PacketId of the packet.
routingThe Routing of the packet.

Properties

PropertiesDescription
ToJsonGenerates the string of json to send to the Inworld server.
SourceGets the SourceType of the source.
TargetGets the SourceType of the target.
IsBroadCastReturns if this packet is broadcasting (targets multiple characters).
SourceNameReturns the agent ID of the source.
TargetNameReturns the agent ID of the target.

API

FunctionDescriptionParameters
IsSourceCheck if the agentID is in the source.agentID: target agent ID.
IsTargetCheck if the agentID is in the target.agentID: target agent ID.
ContainsCheck if the agentID is either in the target list.agentID: target agent ID.
IsRelatedCheck if the agentID is either in the target list, is the target, or is the source.agentID: target agent ID.

Source

Module: Inworld.AI. Namespace: Inworld.Packet.

This class defines the format of the sender or the receiver.

VariablesDescription
typeAn enumeration that determines whether this source is a player or a character.
nameThe 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.

VariablesDescription
sourceThe Source that sent this packet.
targetThe Source that received this packet.
targetsThe 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.

VariablesDescription
packetIdA unique ID assigned to each packet, distinguishing it from others.
utteranceIdRepresents 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.
interactionIdRefers to a group of related sentences that are part of a larger interaction. An interaction may consist of multiple utterances.
correlationIdUsed in callback for server packets.
PropertiesDescription
ToStringGets 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}"
StatusGets or sets the status of the packet. The status represents the current state or condition of the packet.