livekit-agents 0.5.dev0__tar.gz → 0.5.dev2__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 (56) hide show
  1. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/PKG-INFO +2 -1
  2. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/ipc/job_main.py +30 -19
  3. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/version.py +1 -1
  4. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit_agents.egg-info/PKG-INFO +2 -1
  5. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit_agents.egg-info/requires.txt +1 -0
  6. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/setup.py +1 -0
  7. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/README.md +0 -0
  8. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/__init__.py +0 -0
  9. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/aio/__init__.py +0 -0
  10. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/aio/channel.py +0 -0
  11. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/aio/debug.py +0 -0
  12. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/aio/interval.py +0 -0
  13. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/aio/select.py +0 -0
  14. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/aio/sleep.py +0 -0
  15. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/aio/wait_group.py +0 -0
  16. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/apipe.py +0 -0
  17. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/cli/__init__.py +0 -0
  18. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/cli/cli.py +0 -0
  19. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/cli/log.py +0 -0
  20. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/cli/protocol.py +0 -0
  21. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/cli/watcher.py +0 -0
  22. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/codecs/__init__.py +0 -0
  23. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/codecs/mp3.py +0 -0
  24. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/consts.py +0 -0
  25. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/exceptions.py +0 -0
  26. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/http_server.py +0 -0
  27. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/ipc/__init__.py +0 -0
  28. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/ipc/consts.py +0 -0
  29. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/ipc/job_process.py +0 -0
  30. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/ipc/protocol.py +0 -0
  31. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/ipc_enc.py +0 -0
  32. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/job_context.py +0 -0
  33. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/job_request.py +0 -0
  34. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/llm/__init__.py +0 -0
  35. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/llm/function_context.py +0 -0
  36. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/llm/llm.py +0 -0
  37. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/log.py +0 -0
  38. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/plugin.py +0 -0
  39. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/py.typed +0 -0
  40. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/stt/__init__.py +0 -0
  41. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/stt/stream_adapter.py +0 -0
  42. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/stt/stt.py +0 -0
  43. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/tokenize/__init__.py +0 -0
  44. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/tokenize/sentence_tokenizer.py +0 -0
  45. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/tts/__init__.py +0 -0
  46. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/tts/stream_adapter.py +0 -0
  47. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/tts/tts.py +0 -0
  48. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/utils.py +0 -0
  49. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/vad.py +0 -0
  50. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/voice_assistant.py +0 -0
  51. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit/agents/worker.py +0 -0
  52. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit_agents.egg-info/SOURCES.txt +0 -0
  53. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit_agents.egg-info/dependency_links.txt +0 -0
  54. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/livekit_agents.egg-info/top_level.txt +0 -0
  55. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/pyproject.toml +0 -0
  56. {livekit-agents-0.5.dev0 → livekit-agents-0.5.dev2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: livekit-agents
3
- Version: 0.5.dev0
3
+ Version: 0.5.dev2
4
4
  Summary: LiveKit Python Agents
5
5
  Home-page: https://github.com/livekit/agents
6
6
  License: Apache-2.0
@@ -29,6 +29,7 @@ Requires-Dist: python-json-logger~=2.0
29
29
  Requires-Dist: attrs~=23.0
30
30
  Requires-Dist: watchfiles~=0.21
31
31
  Requires-Dist: colorlog~=6.0
32
+ Requires-Dist: psutil~=5.9
32
33
  Provides-Extra: codecs
33
34
  Requires-Dist: av>=11.0.0; extra == "codecs"
34
35
 
@@ -37,24 +37,7 @@ async def _start(
37
37
  close_tx, close_rx = aio.channel() # used by the JobContext to signal shutdown
38
38
 
39
39
  auto_subscribe = args.accept_data.auto_subscribe
40
- opts = rtc.RoomOptions(auto_subscribe=True)
41
- if auto_subscribe != AutoSubscribe.SUBSCRIBE_ALL:
42
- opts.auto_subscribe = False
43
-
44
- def on_track_published(pub: rtc.RemoteTrackPublication, *_):
45
- if (
46
- pub.kind == rtc.TrackKind.KIND_AUDIO
47
- and auto_subscribe == AutoSubscribe.AUDIO_ONLY
48
- ):
49
- pub.set_subscribed(True)
50
- elif (
51
- pub.kind == rtc.TrackKind.KIND_VIDEO
52
- and auto_subscribe == AutoSubscribe.VIDEO_ONLY
53
- ):
54
- pub.set_subscribed(True)
55
-
56
- if auto_subscribe != AutoSubscribe.SUBSCRIBE_NONE:
57
- room.on("track_published", on_track_published)
40
+ opts = rtc.RoomOptions(auto_subscribe=auto_subscribe == AutoSubscribe.SUBSCRIBE_ALL)
58
41
 
59
42
  cnt = room.connect(args.url, args.token, options=opts)
60
43
  start_req: protocol.StartJobRequest | None = None
@@ -64,6 +47,34 @@ async def _start(
64
47
  async def _start_if_valid():
65
48
  nonlocal usertask
66
49
  if start_req and room.isconnected():
50
+
51
+ def on_track_published(pub: rtc.RemoteTrackPublication, *_):
52
+ if (
53
+ pub.kind == rtc.TrackKind.KIND_AUDIO
54
+ and auto_subscribe == AutoSubscribe.AUDIO_ONLY
55
+ ):
56
+ pub.set_subscribed(True)
57
+ elif (
58
+ pub.kind == rtc.TrackKind.KIND_VIDEO
59
+ and auto_subscribe == AutoSubscribe.VIDEO_ONLY
60
+ ):
61
+ pub.set_subscribed(True)
62
+
63
+ if auto_subscribe != AutoSubscribe.SUBSCRIBE_NONE:
64
+ room.on("track_published", on_track_published)
65
+
66
+ for participant in room.participants.values():
67
+ for track_pub in participant.tracks.values():
68
+ if (
69
+ track_pub.kind == rtc.TrackKind.KIND_AUDIO
70
+ and auto_subscribe == AutoSubscribe.AUDIO_ONLY
71
+ ):
72
+ track_pub.set_subscribed(True)
73
+ elif (
74
+ track_pub.kind == rtc.TrackKind.KIND_VIDEO
75
+ and auto_subscribe == AutoSubscribe.VIDEO_ONLY
76
+ ):
77
+ track_pub.set_subscribed(True)
67
78
  # start the job
68
79
  await pipe.write(protocol.StartJobResponse())
69
80
 
@@ -72,7 +83,7 @@ async def _start(
72
83
  start_req.job,
73
84
  room,
74
85
  )
75
- usertask = asyncio.create_task(args.accept_data.target(ctx))
86
+ usertask = asyncio.create_task(args.accept_data.entry(ctx))
76
87
 
77
88
  async with contextlib.aclosing(aio.select([pipe, cnt, close_rx])) as select:
78
89
  while True:
@@ -12,4 +12,4 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- __version__ = "0.5.dev0"
15
+ __version__ = "0.5.dev2"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: livekit-agents
3
- Version: 0.5.dev0
3
+ Version: 0.5.dev2
4
4
  Summary: LiveKit Python Agents
5
5
  Home-page: https://github.com/livekit/agents
6
6
  License: Apache-2.0
@@ -29,6 +29,7 @@ Requires-Dist: python-json-logger~=2.0
29
29
  Requires-Dist: attrs~=23.0
30
30
  Requires-Dist: watchfiles~=0.21
31
31
  Requires-Dist: colorlog~=6.0
32
+ Requires-Dist: psutil~=5.9
32
33
  Provides-Extra: codecs
33
34
  Requires-Dist: av>=11.0.0; extra == "codecs"
34
35
 
@@ -8,6 +8,7 @@ python-json-logger~=2.0
8
8
  attrs~=23.0
9
9
  watchfiles~=0.21
10
10
  colorlog~=6.0
11
+ psutil~=5.9
11
12
 
12
13
  [codecs]
13
14
  av>=11.0.0
@@ -57,6 +57,7 @@ setuptools.setup(
57
57
  "attrs~=23.0",
58
58
  "watchfiles~=0.21",
59
59
  "colorlog~=6.0",
60
+ "psutil~=5.9",
60
61
  ],
61
62
  extras_require={
62
63
  "codecs": ["av>=11.0.0"],