videosdk-plugins-openai 0.0.8__tar.gz → 0.0.16__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.

Potentially problematic release.


This version of videosdk-plugins-openai might be problematic. Click here for more details.

@@ -0,0 +1,18 @@
1
+ myenv/
2
+ venv/
3
+ env/
4
+ __pycache__/
5
+
6
+ .env
7
+ .env.local
8
+ test_env/
9
+ dist/
10
+ .DS_Store
11
+
12
+ node_modules/
13
+ credentials.json
14
+ .Python
15
+ build/
16
+ eggs/
17
+ sdist/
18
+ wheels/
@@ -1,8 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: videosdk-plugins-openai
3
- Version: 0.0.8
3
+ Version: 0.0.16
4
4
  Summary: VideoSDK Agent Framework plugin for OpenAI services
5
5
  Author: videosdk
6
+ License-Expression: Apache-2.0
6
7
  Keywords: ai,audio,openai,video,videosdk
7
8
  Classifier: Development Status :: 4 - Beta
8
9
  Classifier: Intended Audience :: Developers
@@ -12,7 +13,7 @@ Classifier: Topic :: Multimedia :: Video
12
13
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
13
14
  Requires-Python: >=3.11
14
15
  Requires-Dist: openai[realtime]>=1.68.2
15
- Requires-Dist: videosdk-agents>=0.0.12
16
+ Requires-Dist: videosdk-agents>=0.0.16
16
17
  Description-Content-Type: text/markdown
17
18
 
18
19
  VideoSDK OpenAI Plugin
@@ -7,6 +7,7 @@ name = "videosdk-plugins-openai"
7
7
  dynamic = ["version"]
8
8
  description = "VideoSDK Agent Framework plugin for OpenAI services"
9
9
  readme = "README.md"
10
+ license = "Apache-2.0"
10
11
  requires-python = ">=3.11"
11
12
  authors = [{ name = "videosdk"}]
12
13
  keywords = ["video", "audio", "ai", "openai", "videosdk"]
@@ -20,7 +21,7 @@ classifiers = [
20
21
  "Topic :: Scientific/Engineering :: Artificial Intelligence",
21
22
  ]
22
23
  dependencies = [
23
- "videosdk-agents>=0.0.12",
24
+ "videosdk-agents>=0.0.16",
24
25
  "openai[realtime]>=1.68.2",
25
26
  ]
26
27
 
@@ -131,9 +131,6 @@ class OpenAIRealtime(RealtimeBaseModel[OpenAIEventTypes]):
131
131
  self.audio_track: Optional[CustomAudioStreamTrack] = None
132
132
  self._formatted_tools: Optional[List[Dict[str, Any]]] = None
133
133
  self.config: OpenAIRealtimeConfig = config or OpenAIRealtimeConfig()
134
- # global_event_emitter.on("instructions_updated", self._handle_instructions_updated)
135
- # global_event_emitter.on("tools_updated", self._handle_tools_updated)
136
-
137
134
  self.input_sample_rate = 48000
138
135
  self.target_sample_rate = 16000
139
136
 
@@ -207,7 +204,6 @@ class OpenAIRealtime(RealtimeBaseModel[OpenAIEventTypes]):
207
204
  if not self._session:
208
205
  raise RuntimeError("No active WebSocket session")
209
206
 
210
- # Create response event
211
207
  response_event = {
212
208
  "type": "response.create",
213
209
  "event_id": str(uuid.uuid4()),
@@ -219,18 +215,8 @@ class OpenAIRealtime(RealtimeBaseModel[OpenAIEventTypes]):
219
215
  }
220
216
  }
221
217
 
222
- # Send the event through our message queue
223
218
  await self.send_event(response_event)
224
-
225
- # session_update = {
226
- # "type": "session.update",
227
- # "session": {
228
- # "instructions": self._instructions
229
- # }
230
- # }
231
-
232
- # await self.send_event(session_update)
233
-
219
+
234
220
  async def _handle_websocket(self, session: OpenAISession) -> None:
235
221
  """Start WebSocket send/receive tasks"""
236
222
  session.tasks.extend([
@@ -412,8 +398,6 @@ class OpenAIRealtime(RealtimeBaseModel[OpenAIEventTypes]):
412
398
 
413
399
  async def _handle_input_audio_transcription_completed(self, data: dict) -> None:
414
400
  """Handle input audio transcription completion"""
415
- # if "transcript" in data:
416
- # self.emit("transcription_event", {"text": data["transcript"]})
417
401
 
418
402
  async def _handle_response_done(self, data: dict) -> None:
419
403
  """Handle response completion"""
@@ -442,7 +426,6 @@ class OpenAIRealtime(RealtimeBaseModel[OpenAIEventTypes]):
442
426
  except (asyncio.CancelledError, asyncio.TimeoutError):
443
427
  pass
444
428
 
445
- # Close WebSocket
446
429
  if not session.ws.closed:
447
430
  try:
448
431
  await session.ws.close()
@@ -472,7 +455,6 @@ class OpenAIRealtime(RealtimeBaseModel[OpenAIEventTypes]):
472
455
  if not self._session:
473
456
  return
474
457
 
475
- # Conditionally set turn detection and audio transcription based on modalities
476
458
  turn_detection = None
477
459
  input_audio_transcription = None
478
460
 
@@ -501,7 +483,6 @@ class OpenAIRealtime(RealtimeBaseModel[OpenAIEventTypes]):
501
483
  }
502
484
  }
503
485
 
504
- # Only add audio-related configurations if audio modality is enabled
505
486
  if "audio" in self.config.modalities:
506
487
  session_update["session"]["voice"] = self.config.voice
507
488
  session_update["session"]["input_audio_format"] = DEFAULT_INPUT_AUDIO_FORMAT
@@ -533,10 +514,6 @@ class OpenAIRealtime(RealtimeBaseModel[OpenAIEventTypes]):
533
514
  new_url = urlunparse((parsed_url.scheme, parsed_url.netloc, path, "", new_query, ""))
534
515
 
535
516
  return new_url
536
-
537
- def _handle_instructions_updated(self, data: Dict[str, Any]) -> None:
538
- """Handle instructions_updated event"""
539
- self._instructions = data.get("instructions")
540
517
 
541
518
  def _format_tools_for_session(self, tools: List[FunctionTool]) -> List[Dict[str, Any]]:
542
519
  """Format tools for OpenAI session update"""
@@ -554,13 +531,6 @@ class OpenAIRealtime(RealtimeBaseModel[OpenAIEventTypes]):
554
531
 
555
532
  return oai_tools
556
533
 
557
- def _handle_tools_updated(self, data: Dict[str, Any]) -> None:
558
- """Handle tools_updated event"""
559
- tools = data.get("tools", [])
560
- self._tools = tools
561
- self.tools_formatted = self._format_tools_for_session(tools)
562
- self._formatted_tools = self.tools_formatted
563
-
564
534
  async def send_text_message(self, message: str) -> None:
565
535
  """Send a text message to the OpenAI realtime API"""
566
536
  if not self._session:
@@ -0,0 +1 @@
1
+ __version__ = "0.0.16"
@@ -1,10 +0,0 @@
1
- myenv/
2
- venv/
3
- env/
4
- __pycache__
5
-
6
- .env
7
- .env.local
8
- test_env/
9
- dist/
10
- .DS_Store
@@ -1 +0,0 @@
1
- __version__ = "0.0.8"