ojin-client 0.1.7.dev3__tar.gz → 0.1.7.dev4__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: ojin-client
3
- Version: 0.1.7.dev3
3
+ Version: 0.1.7.dev4
4
4
  Summary: Ojin platform services
5
5
  Author: Journee
6
6
  License: Apache-2.0
@@ -86,7 +86,8 @@ class OjinPersonaClient(IOjinPersonaClient):
86
86
  self._running = False
87
87
  self._receive_task: Optional[asyncio.Task] = None
88
88
  self._inference_server_ready: bool = False
89
- self._cancelled = False
89
+ self._cancelled: bool = False
90
+ self._cancelled_interaction_id: str | None = None
90
91
 
91
92
  async def connect(self) -> None:
92
93
  """Establish WebSocket connection and authenticate with the service."""
@@ -187,6 +188,10 @@ class OjinPersonaClient(IOjinPersonaClient):
187
188
  is_final_response=interaction_server_response.payload.is_final_response,
188
189
  )
189
190
  logger.debug("Received InteractionResponse for id %s", interaction_response.interaction_id)
191
+
192
+ if interaction_response.interaction_id == self._cancelled_interaction_id:
193
+ logger.warning("Message From old interaction")
194
+ return
190
195
  await self._message_queue.put(interaction_response)
191
196
  return
192
197
  except Exception as e:
@@ -274,6 +279,7 @@ class OjinPersonaClient(IOjinPersonaClient):
274
279
 
275
280
 
276
281
  self._cancelled = False
282
+ self._cancelled_interaction_id = message.interaction_id
277
283
 
278
284
  return
279
285
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ojin-client
3
- Version: 0.1.7.dev3
3
+ Version: 0.1.7.dev4
4
4
  Summary: Ojin platform services
5
5
  Author: Journee
6
6
  License: Apache-2.0
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ojin-client"
3
- version = "0.1.7dev3"
3
+ version = "0.1.7dev4"
4
4
  description = "Ojin platform services"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"