livekit-agents 0.5.dev1__tar.gz → 0.5.dev3__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.dev1 → livekit-agents-0.5.dev3}/PKG-INFO +1 -1
  2. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/cli/log.py +2 -1
  3. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/ipc/job_main.py +30 -19
  4. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/version.py +1 -1
  5. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit_agents.egg-info/PKG-INFO +1 -1
  6. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/README.md +0 -0
  7. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/__init__.py +0 -0
  8. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/aio/__init__.py +0 -0
  9. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/aio/channel.py +0 -0
  10. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/aio/debug.py +0 -0
  11. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/aio/interval.py +0 -0
  12. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/aio/select.py +0 -0
  13. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/aio/sleep.py +0 -0
  14. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/aio/wait_group.py +0 -0
  15. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/apipe.py +0 -0
  16. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/cli/__init__.py +0 -0
  17. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/cli/cli.py +0 -0
  18. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/cli/protocol.py +0 -0
  19. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/cli/watcher.py +0 -0
  20. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/codecs/__init__.py +0 -0
  21. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/codecs/mp3.py +0 -0
  22. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/consts.py +0 -0
  23. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/exceptions.py +0 -0
  24. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/http_server.py +0 -0
  25. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/ipc/__init__.py +0 -0
  26. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/ipc/consts.py +0 -0
  27. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/ipc/job_process.py +0 -0
  28. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/ipc/protocol.py +0 -0
  29. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/ipc_enc.py +0 -0
  30. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/job_context.py +0 -0
  31. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/job_request.py +0 -0
  32. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/llm/__init__.py +0 -0
  33. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/llm/function_context.py +0 -0
  34. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/llm/llm.py +0 -0
  35. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/log.py +0 -0
  36. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/plugin.py +0 -0
  37. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/py.typed +0 -0
  38. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/stt/__init__.py +0 -0
  39. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/stt/stream_adapter.py +0 -0
  40. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/stt/stt.py +0 -0
  41. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/tokenize/__init__.py +0 -0
  42. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/tokenize/sentence_tokenizer.py +0 -0
  43. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/tts/__init__.py +0 -0
  44. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/tts/stream_adapter.py +0 -0
  45. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/tts/tts.py +0 -0
  46. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/utils.py +0 -0
  47. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/vad.py +0 -0
  48. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/voice_assistant.py +0 -0
  49. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit/agents/worker.py +0 -0
  50. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit_agents.egg-info/SOURCES.txt +0 -0
  51. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit_agents.egg-info/dependency_links.txt +0 -0
  52. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit_agents.egg-info/requires.txt +0 -0
  53. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/livekit_agents.egg-info/top_level.txt +0 -0
  54. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/pyproject.toml +0 -0
  55. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/setup.cfg +0 -0
  56. {livekit-agents-0.5.dev1 → livekit-agents-0.5.dev3}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: livekit-agents
3
- Version: 0.5.dev1
3
+ Version: 0.5.dev3
4
4
  Summary: LiveKit Python Agents
5
5
  Home-page: https://github.com/livekit/agents
6
6
  License: Apache-2.0
@@ -27,7 +27,8 @@ def setup_logging(log_level: str, production: bool = True) -> None:
27
27
  class CustomJsonFormatter(jsonlogger.JsonFormatter):
28
28
  def add_fields(self, log_record, record, message_dict):
29
29
  super().add_fields(log_record, record, message_dict)
30
- log_record.pop("taskName")
30
+ if "taskName" in log_record:
31
+ log_record.pop("taskName")
31
32
  log_record["level"] = record.levelname
32
33
 
33
34
  f = CustomJsonFormatter("%(asctime)s %(level)s %(name)s %(message)s")
@@ -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.dev1"
15
+ __version__ = "0.5.dev3"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: livekit-agents
3
- Version: 0.5.dev1
3
+ Version: 0.5.dev3
4
4
  Summary: LiveKit Python Agents
5
5
  Home-page: https://github.com/livekit/agents
6
6
  License: Apache-2.0