fastmind 0.2.2__tar.gz → 0.2.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastmind
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: A lightweight, event-driven multi-agent framework for embodied AI systems
5
5
  Project-URL: Homepage, https://github.com/kandada/fastmind
6
6
  Project-URL: Documentation, https://github.com/kandada/fastmind#readme
@@ -1,6 +1,6 @@
1
1
  """FastMind - 具身智能多Agent系统框架"""
2
2
 
3
- __version__ = "0.2.1"
3
+ __version__ = "0.2.4"
4
4
 
5
5
  from .core.app import FastMind
6
6
  from .core.graph import Graph
@@ -150,7 +150,7 @@ class FastMindAPI:
150
150
  if not session.is_alive:
151
151
  raise RuntimeError(f"Session '{session_id}' is stopped")
152
152
 
153
- cursor = 0
153
+ cursor = session._event_buffer.tail_cursor
154
154
  while self._running and session.is_alive:
155
155
  try:
156
156
  events = await session._event_buffer.wait(cursor, timeout=1.0)
@@ -96,11 +96,15 @@ class NotifyingQueue:
96
96
 
97
97
  async def get(self):
98
98
  while True:
99
+ self._event.clear()
100
+ events = self._buffer.read(self._cursor)
101
+ if events:
102
+ self._cursor += len(events)
103
+ return events[0]
99
104
  events = self._buffer.read(self._cursor)
100
105
  if events:
101
106
  self._cursor += len(events)
102
107
  return events[0]
103
- self._event.clear()
104
108
  await self._event.wait()
105
109
 
106
110
  def get_nowait(self):
@@ -262,10 +266,12 @@ class Session:
262
266
 
263
267
  async def wait_for_output(self, timeout: Optional[float] = None) -> Optional[Event]:
264
268
  """等待输出事件(阻塞直到有输出或超时)"""
265
- if not self.output_queue.empty():
269
+ self._output_event.clear()
270
+ try:
266
271
  return self.output_queue.get_nowait()
272
+ except asyncio.QueueEmpty:
273
+ pass
267
274
 
268
- self._output_event.clear()
269
275
  try:
270
276
  if timeout is None:
271
277
  await self._output_event.wait()
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "fastmind"
7
- version = "0.2.2"
7
+ version = "0.2.4"
8
8
  description = "A lightweight, event-driven multi-agent framework for embodied AI systems"
9
9
  readme = "fastmind/README.md"
10
10
  requires-python = ">=3.10"
File without changes
File without changes
File without changes
File without changes
File without changes