Skip to main content

InworldNetworkPacket

Module: Inworld.AI. Namespace: Inworld.Packet. inherited from InworldPacket

In the runtime environment, data is transmitted through JSON strings. It is necessary to determine the specific type of packet that is being received. To address this, the InworldNetworkPacket class has been introduced. This class acts as the initial filter for incoming packets and is responsible for categorizing and distributing them to their respective classes based on their type.

VariablesDescription
textThe TextEvent encapsulated within the packet, if exists.
controlThe ControlEvent encapsulated within the packet, if exists.
dataChunkThe DataChunk encapsulated within the packet, if exists.
gestureThe GestureEvent encapsulated within the packet, if exists.
customThe CustomEvent (triggers) encapsulated within the packet, if exists.
mutationThe MutationEvent (interruptions) encapsulated within the packet, if exists.
emotionThe EmotionEvent encapsulated within the packet, if exists.
actionThe ActionEvent encapsulated within the packet, if exists.
debugInfoThe RelationEvent encapsulated within the packet, if exists.
PropertiesDescription
PacketReturns the InworldPacket with the correct type by checking the data.
TypeReturns the actual type of the InworldPacket by checking the data.

InworldError

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

VariablesDescription
codeThe error code returned from the Inworld server.
messageThe detailed string of the error message.
detailsA list of InworldErrorData objects returned from the Inworld server.
PropertiesDescription
IsValidReturns whether this error is valid or not.
RetryTypeReturns an instruction ReconnectType to the client from the server about wha the server expects the client to do.
ErrorTypeReturns the ErrorType received from the Inworld server.

InworldErrorData

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

VariablesDescription
errorTypeThe ErrorType received from the Inworld server.
reconnectTypeAn instruction ReconnectType to the client from the server about wha the server expects the client to do.
reconnectTimeIdentify when is allowed to reconnect.
maxRetriesThe max retry times allowed from the InworldError.

NetworkPacketResponse

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

The NetworkPacketResponse class serves as a container for the InworldNetworkPacket received from websockets, facilitating efficient data handling and processing within the Inworld environment.

VariablesDescription
resultThe InworldNetworkPacket received from the websocket.
errorThe InworldError received from the websocket.