33from pathlib import Path
44import json
55from datetime import datetime
6- from collections import deque
7- from typing import Dict , Any , List
86
97parent_dir = str (Path (__file__ ).parent .parent )
108sys .path .append (parent_dir )
119
1210from game_sdk .game .agent import Agent , WorkerConfig
13- from game_sdk .game .custom_types import FunctionResult , Function , Argument , FunctionResultStatus
11+ from game_sdk .game .custom_types import FunctionResult
1412from dpsn_plugin_gamesdk .dpsn_plugin import plugin
1513
1614# --- Add Message Handler ---
@@ -20,14 +18,8 @@ def handle_incoming_message(message_data: dict):
2018 topic = message_data .get ('topic' , 'N/A' )
2119 payload = message_data .get ('payload' , '{}' )
2220 timestamp = datetime .now ().strftime ('%Y-%m-%d %H:%M:%S' )
23-
24- # Store the message
25- message_store .add_message (message_data )
26-
2721 print (f"\n --- Message Received ({ timestamp } ) ---" )
2822 print (f"Topic: { topic } " )
29- print (f"Message Count: { message_store .message_count } " )
30-
3123 # Pretty print payload if it's likely JSON/dict
3224 if isinstance (payload , (dict , list )):
3325 print (f"Payload:\n { json .dumps (payload , indent = 2 )} " )
0 commit comments