ojin-client 0.1.7.dev7__tar.gz → 0.1.7.dev9__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.
- {ojin_client-0.1.7.dev7 → ojin_client-0.1.7.dev9}/PKG-INFO +1 -1
- {ojin_client-0.1.7.dev7 → ojin_client-0.1.7.dev9}/ojin/ojin_persona_client.py +8 -6
- {ojin_client-0.1.7.dev7 → ojin_client-0.1.7.dev9}/ojin_client.egg-info/PKG-INFO +1 -1
- {ojin_client-0.1.7.dev7 → ojin_client-0.1.7.dev9}/pyproject.toml +1 -1
- {ojin_client-0.1.7.dev7 → ojin_client-0.1.7.dev9}/README.md +0 -0
- {ojin_client-0.1.7.dev7 → ojin_client-0.1.7.dev9}/ojin/__init__.py +0 -0
- {ojin_client-0.1.7.dev7 → ojin_client-0.1.7.dev9}/ojin/cacert.pem +0 -0
- {ojin_client-0.1.7.dev7 → ojin_client-0.1.7.dev9}/ojin/entities/interaction_messages.py +0 -0
- {ojin_client-0.1.7.dev7 → ojin_client-0.1.7.dev9}/ojin/entities/session_messages.py +0 -0
- {ojin_client-0.1.7.dev7 → ojin_client-0.1.7.dev9}/ojin/ojin_persona_messages.py +0 -0
- {ojin_client-0.1.7.dev7 → ojin_client-0.1.7.dev9}/ojin_client.egg-info/SOURCES.txt +0 -0
- {ojin_client-0.1.7.dev7 → ojin_client-0.1.7.dev9}/ojin_client.egg-info/dependency_links.txt +0 -0
- {ojin_client-0.1.7.dev7 → ojin_client-0.1.7.dev9}/ojin_client.egg-info/requires.txt +0 -0
- {ojin_client-0.1.7.dev7 → ojin_client-0.1.7.dev9}/ojin_client.egg-info/top_level.txt +0 -0
- {ojin_client-0.1.7.dev7 → ojin_client-0.1.7.dev9}/setup.cfg +0 -0
|
@@ -87,7 +87,7 @@ class OjinPersonaClient(IOjinPersonaClient):
|
|
|
87
87
|
self._receive_task: Optional[asyncio.Task] = None
|
|
88
88
|
self._inference_server_ready: bool = False
|
|
89
89
|
self._cancelled: bool = False
|
|
90
|
-
self.
|
|
90
|
+
self._active_interaction_id: str | None = None
|
|
91
91
|
self._split_audio_task: Optional[asyncio.Task] = None
|
|
92
92
|
self._audio_queue: asyncio.Queue[OjinPersonaInteractionInputMessage] = asyncio.Queue()
|
|
93
93
|
|
|
@@ -135,7 +135,7 @@ class OjinPersonaClient(IOjinPersonaClient):
|
|
|
135
135
|
pass
|
|
136
136
|
|
|
137
137
|
self._running = False
|
|
138
|
-
self.
|
|
138
|
+
self._active_interaction_id = None
|
|
139
139
|
|
|
140
140
|
if self._ws:
|
|
141
141
|
try:
|
|
@@ -200,8 +200,9 @@ class OjinPersonaClient(IOjinPersonaClient):
|
|
|
200
200
|
)
|
|
201
201
|
logger.debug("Received InteractionResponse for id %s", interaction_response.interaction_id)
|
|
202
202
|
|
|
203
|
-
|
|
204
|
-
|
|
203
|
+
# TODO: Possibly want to delete
|
|
204
|
+
if interaction_response.interaction_id != self._active_interaction_id:
|
|
205
|
+
logger.warning("Message From other interaction")
|
|
205
206
|
return
|
|
206
207
|
await self._message_queue.put(interaction_response)
|
|
207
208
|
return
|
|
@@ -305,7 +306,7 @@ class OjinPersonaClient(IOjinPersonaClient):
|
|
|
305
306
|
|
|
306
307
|
if isinstance(message, StartInteractionMessage):
|
|
307
308
|
interaction_id = str(uuid.uuid4())
|
|
308
|
-
self.
|
|
309
|
+
self._active_interaction_id = interaction_id
|
|
309
310
|
logger.info("Generate UUID %s", interaction_id)
|
|
310
311
|
interaction_response = StartInteractionResponseMessage(
|
|
311
312
|
interaction_id=interaction_id
|
|
@@ -318,7 +319,7 @@ class OjinPersonaClient(IOjinPersonaClient):
|
|
|
318
319
|
if isinstance(message, OjinPersonaInteractionInputMessage):
|
|
319
320
|
logger.info("InteractionMessage")
|
|
320
321
|
logger.info(f"Message sent {message.interaction_id}")
|
|
321
|
-
if message.interaction_id != self.
|
|
322
|
+
if message.interaction_id != self._active_interaction_id:
|
|
322
323
|
return
|
|
323
324
|
|
|
324
325
|
if not message.audio_int16_bytes:
|
|
@@ -373,6 +374,7 @@ class OjinPersonaClient(IOjinPersonaClient):
|
|
|
373
374
|
try:
|
|
374
375
|
message_audio = self._audio_queue.get_nowait()
|
|
375
376
|
except asyncio.QueueEmpty:
|
|
377
|
+
await asyncio.sleep(0.01)
|
|
376
378
|
continue
|
|
377
379
|
|
|
378
380
|
max_chunk_size = 3200 * 2
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|