neuro-simulator 0.1.2__tar.gz → 0.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/PKG-INFO +1 -1
  2. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator/agent/core.py +28 -5
  3. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator/agent/memory/manager.py +11 -35
  4. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator.egg-info/PKG-INFO +1 -1
  5. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/pyproject.toml +1 -1
  6. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/README.md +0 -0
  7. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator/__init__.py +0 -0
  8. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator/agent/__init__.py +0 -0
  9. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator/agent/api.py +0 -0
  10. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator/agent/llm.py +0 -0
  11. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator/agent/memory/__init__.py +0 -0
  12. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator/agent/memory.py +0 -0
  13. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator/agent/tools/__init__.py +0 -0
  14. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator/agent/tools/core.py +0 -0
  15. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator/agent/tools.py +0 -0
  16. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator/audio_synthesis.py +0 -0
  17. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator/builtin_agent.py +0 -0
  18. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator/chatbot.py +0 -0
  19. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator/cli.py +0 -0
  20. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator/config.py +0 -0
  21. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator/config.yaml.example +0 -0
  22. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator/letta.py +0 -0
  23. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator/log_handler.py +0 -0
  24. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator/main.py +0 -0
  25. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator/media/neuro_start.mp4 +0 -0
  26. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator/process_manager.py +0 -0
  27. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator/shared_state.py +0 -0
  28. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator/stream_chat.py +0 -0
  29. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator/stream_manager.py +0 -0
  30. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator/websocket_manager.py +0 -0
  31. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator.egg-info/SOURCES.txt +0 -0
  32. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator.egg-info/dependency_links.txt +0 -0
  33. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator.egg-info/entry_points.txt +0 -0
  34. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator.egg-info/requires.txt +0 -0
  35. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/neuro_simulator.egg-info/top_level.txt +0 -0
  36. {neuro_simulator-0.1.2 → neuro_simulator-0.1.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: neuro_simulator
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Neuro Simulator Server
5
5
  Author-email: Moha-Master <hongkongreporter@outlook.com>
6
6
  License-Expression: MIT
@@ -149,12 +149,34 @@ Always think about whether you need to use tools before responding.
149
149
 
150
150
  IMPORTANT GUIDELINES:
151
151
  - Be creative and engaging in your responses
152
- - Avoid repeating the same phrases or ideas from your last response: "{last_response}" (if available)
153
152
  - Keep responses concise and conversational
154
153
  - Maintain your character's personality
154
+ - Pay close attention to the conversation history in the context to understand the flow of the dialogue
155
+ - Respond to the most recent user messages while considering the overall context of the conversation
155
156
 
156
- User messages:
157
+ === YOUR SPEAK HISTORY ===
157
158
  """
159
+
160
+ # Add assistant's recent responses to the prompt
161
+ # Get the recent context and extract speak results from llm_interaction entries
162
+ recent_context = await self.memory_manager.get_recent_context(100) # Get more entries to filter
163
+ assistant_responses = []
164
+
165
+ # Filter for llm_interaction entries with role: "assistant" and extract speak results
166
+ for entry in reversed(recent_context): # Reverse to get newest first
167
+ if entry.get("type") == "llm_interaction" and entry.get("role") == "assistant":
168
+ tool_executions = entry.get("tool_executions", [])
169
+ for tool_execution in tool_executions:
170
+ if tool_execution.get("name") == "speak":
171
+ result = tool_execution.get("result")
172
+ if result:
173
+ assistant_responses.append(result)
174
+
175
+ # Add up to 64 most recent assistant responses
176
+ for i, response in enumerate(assistant_responses[:64]):
177
+ prompt += f"{i+1}. {response}\n"
178
+
179
+ prompt += f"\nUser messages to respond to:\n"
158
180
 
159
181
  for msg in messages:
160
182
  prompt += f"{msg['username']}: {msg['text']}\n"
@@ -273,9 +295,10 @@ User messages:
273
295
  else:
274
296
  agent_logger.warning(f"Failed to parse tool call from incomplete JSON block: {json_buffer}")
275
297
 
276
- # If we have a final response, add it to context
277
- if processing_result["final_response"]:
278
- await self.memory_manager.add_context_entry("assistant", processing_result["final_response"])
298
+ # If we have a final response, we don't need to add it to context here
299
+ # because add_detailed_context_entry will add a short entry for us
300
+ # if processing_result["final_response"]:
301
+ # await self.memory_manager.add_context_entry("assistant", processing_result["final_response"])
279
302
 
280
303
  # Update the detailed context entry with final LLM interaction details
281
304
  await self.memory_manager.add_detailed_context_entry(
@@ -143,10 +143,6 @@ class MemoryManager:
143
143
  }
144
144
  self.context_history.append(entry)
145
145
 
146
- # Keep only last 20 context entries (10 rounds)
147
- if len(self.context_history) > 20:
148
- self.context_history = self.context_history[-20:]
149
-
150
146
  await self._save_context()
151
147
 
152
148
  async def add_detailed_context_entry(self, input_messages: List[Dict[str, str]],
@@ -185,18 +181,12 @@ class MemoryManager:
185
181
  }
186
182
  self.context_history.append(entry)
187
183
 
188
- # Keep only last 20 context entries
189
- if len(self.context_history) > 20:
190
- self.context_history = self.context_history[-20:]
191
-
192
184
  await self._save_context()
193
185
  return entry["id"]
194
186
 
195
- async def get_recent_context(self, rounds: int = 5) -> List[Dict[str, Any]]:
196
- """Get recent context (default: last 5 rounds, 10 entries)"""
197
- # Each round consists of user message and assistant response
198
- entries_needed = rounds * 2
199
- return self.context_history[-entries_needed:] if self.context_history else []
187
+ async def get_recent_context(self, entries: int = 10) -> List[Dict[str, Any]]:
188
+ """Get recent context entries"""
189
+ return self.context_history[-entries:] if self.context_history else []
200
190
 
201
191
  async def get_detailed_context_history(self) -> List[Dict[str, Any]]:
202
192
  """Get the full detailed context history"""
@@ -206,9 +196,15 @@ class MemoryManager:
206
196
  """Get the last response from the agent"""
207
197
  for entry in reversed(self.context_history):
208
198
  if entry.get("role") == "assistant":
209
- return entry.get("content")
199
+ content = entry.get("content")
200
+ # Skip placeholder responses
201
+ if content and content != "Processing started":
202
+ return content
210
203
  elif entry.get("type") == "llm_interaction":
211
- return entry.get("final_response")
204
+ final_response = entry.get("final_response")
205
+ # Skip placeholder responses
206
+ if final_response and final_response != "Processing started" and final_response != "Prompt sent to LLM" and final_response != "LLM response received":
207
+ return final_response
212
208
  return None
213
209
 
214
210
  async def reset_context(self):
@@ -259,26 +255,6 @@ class MemoryManager:
259
255
  for item in block["content"]:
260
256
  context_parts.append(f" - {item}")
261
257
 
262
- # Add context (recent conversation history)
263
- context_parts.append("\n=== CONTEXT (Recent Conversation) ===")
264
- recent_context = await self.get_recent_context(5)
265
- for i, entry in enumerate(recent_context):
266
- # Handle entries with and without 'role' field
267
- if "role" in entry:
268
- role_display = "User" if entry["role"] == "user" else "Assistant"
269
- content = entry.get('content', entry.get('final_response', 'Unknown entry'))
270
- context_parts.append(f"{i+1}. [{role_display}] {content}")
271
- elif "type" in entry and entry["type"] == "llm_interaction":
272
- # For detailed LLM interaction entries with role: assistant
273
- if entry.get("role") == "assistant":
274
- context_parts.append(f"{i+1}. [Assistant] {entry.get('final_response', 'Processing step')}")
275
- else:
276
- # For other llm_interaction entries without role
277
- context_parts.append(f"{i+1}. [System] {entry.get('final_response', 'Processing step')}")
278
- else:
279
- # Default fallback
280
- context_parts.append(f"{i+1}. [System] {entry.get('content', 'Unknown entry')}")
281
-
282
258
  # Add temp memory (only for temporary state, not dialog history)
283
259
  if self.temp_memory:
284
260
  context_parts.append("\n=== TEMP MEMORY (Processing State) ===")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: neuro_simulator
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Neuro Simulator Server
5
5
  Author-email: Moha-Master <hongkongreporter@outlook.com>
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "neuro_simulator"
7
- version = "0.1.2"
7
+ version = "0.1.3"
8
8
  description = "Neuro Simulator Server"
9
9
  readme = "README.md"
10
10
  authors = [{ name = "Moha-Master", email = "hongkongreporter@outlook.com" }]