meshagent-livekit 0.0.22__py3-none-any.whl → 0.0.24__py3-none-any.whl

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 meshagent-livekit might be problematic. Click here for more details.

@@ -9,6 +9,8 @@ from meshagent.tools import ToolContext, Toolkit
9
9
  from livekit.agents import Agent, AgentSession
10
10
  from livekit.agents.llm import RawFunctionTool, ToolError, function_tool
11
11
 
12
+ from openai import AsyncOpenAI
13
+
12
14
  from livekit.agents import BackgroundAudioPlayer, AudioConfig, BuiltinAudioClip
13
15
 
14
16
  from typing import Annotated
@@ -290,15 +292,35 @@ class Voicebot(SingleRoomAgent):
290
292
  # allow_interruptions=True
291
293
  #)
292
294
 
293
- def create_session(self) -> AgentSession:
295
+ def create_session(self, *, context: ToolContext) -> AgentSession:
296
+
297
+ token : str = context.room.protocol.token
298
+ url : str = context.room.room_url
299
+
300
+ room_proxy_url = f"{url}/v1"
301
+
302
+ oaiclient = AsyncOpenAI(
303
+ api_key=token,
304
+ base_url=room_proxy_url,
305
+ default_headers={
306
+ "Meshagent-Session" : context.room.session_id
307
+ }
308
+ )
294
309
 
295
310
  session = AgentSession(
296
311
  max_tool_steps=50,
297
312
  allow_interruptions=True,
298
313
  vad=silero.VAD.load(),
299
- stt=openai.STT(),
300
- tts=openai.TTS(voice="echo"),
301
- llm=openai.LLM(),
314
+ stt=openai.STT(
315
+ client=oaiclient
316
+ ),
317
+ tts=openai.TTS(
318
+ client=oaiclient,
319
+ voice="echo"
320
+ ),
321
+ llm=openai.LLM(
322
+ client=oaiclient
323
+ ),
302
324
  #turn_detection=MultilingualModel(),
303
325
 
304
326
  )
@@ -311,13 +333,15 @@ class Voicebot(SingleRoomAgent):
311
333
 
312
334
  logger.info("starting voice agent")
313
335
 
314
- session = self.create_session()
315
-
316
- agent = await self.create_agent(context=ToolContext(
336
+ context = ToolContext(
317
337
  room=self.room,
318
338
  caller=self.room.local_participant,
319
339
  on_behalf_of=participant
320
- ), session=session)
340
+ )
341
+
342
+ session = self.create_session(context=context)
343
+
344
+ agent = await self.create_agent(context=context, session=session)
321
345
 
322
346
  background_audio = BackgroundAudioPlayer(
323
347
  thinking_sound=[
@@ -1 +1 @@
1
- __version__ = "0.0.22"
1
+ __version__ = "0.0.24"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshagent-livekit
3
- Version: 0.0.22
3
+ Version: 0.0.24
4
4
  Summary: Livekit support for Meshagent
5
5
  License-Expression: Apache-2.0
6
6
  Project-URL: Documentation, https://docs.meshagent.com
@@ -20,8 +20,8 @@ Requires-Dist: livekit-plugins-elevenlabs~=1.0.19
20
20
  Requires-Dist: livekit-plugins-playai~=1.0.19
21
21
  Requires-Dist: livekit-plugins-silero~=1.0.19
22
22
  Requires-Dist: livekit-plugins-turn-detector~=1.0.19
23
- Requires-Dist: meshagent-api~=0.0.22
24
- Requires-Dist: meshagent-tools~=0.0.22
23
+ Requires-Dist: meshagent-api~=0.0.24
24
+ Requires-Dist: meshagent-tools~=0.0.24
25
25
  Dynamic: license-file
26
26
 
27
27
  ### Meshagent LiveKit
@@ -1,12 +1,12 @@
1
1
  meshagent/livekit/__init__.py,sha256=8zLGg-DfQhnDl2Ky0n-zXpN-8e-g7iR0AcaI4l4Vvpk,32
2
2
  meshagent/livekit/livekit_protocol.py,sha256=K9yP-qpxag5_7TXlKjFEx3cOJJJpYI_z6zGzFHoN1Hs,1421
3
3
  meshagent/livekit/livekit_protocol_test.py,sha256=n_ZQjt7n4u7TM7eENzH8L0tw8LvypS_JHF_PuJ2o6h4,2836
4
- meshagent/livekit/version.py,sha256=NoiGDztYD4fsDDnfSPiSzRkknkNHhFUtKZj0mhQiTYM,22
4
+ meshagent/livekit/version.py,sha256=sE45w-zCTIpVQyXYRbP5E390wIU6bNzRFuAh6ySoc1w,22
5
5
  meshagent/livekit/agents/transcriber.py,sha256=Dq1Ijx4gmA-0jQGM-f3w7X-JIZpkRCFDxWae9AOwz-k,12290
6
- meshagent/livekit/agents/voice.py,sha256=uVpm-YeP1oXkg6gk1zFSwVEdp5XGQVimgs3DdNjEpbg,11230
6
+ meshagent/livekit/agents/voice.py,sha256=O6iCfK5EjZuf6U5GNyOIRdIIHAXOpD2tTP6AB90JjMc,11855
7
7
  meshagent/livekit/tools/speech.py,sha256=UMhdHhTo04xdzHhvvCeTayT_YT86dzx4ZERRF18C0-o,10188
8
- meshagent_livekit-0.0.22.dist-info/licenses/LICENSE,sha256=eTt0SPW-sVNdkZe9PS_S8WfCIyLjRXRl7sUBWdlteFg,10254
9
- meshagent_livekit-0.0.22.dist-info/METADATA,sha256=EzBhdv0WN7-9X54tnrjXVSEK_QJEa8FjFSSrEdUaUaY,952
10
- meshagent_livekit-0.0.22.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
11
- meshagent_livekit-0.0.22.dist-info/top_level.txt,sha256=GlcXnHtRP6m7zlG3Df04M35OsHtNXy_DY09oFwWrH74,10
12
- meshagent_livekit-0.0.22.dist-info/RECORD,,
8
+ meshagent_livekit-0.0.24.dist-info/licenses/LICENSE,sha256=eTt0SPW-sVNdkZe9PS_S8WfCIyLjRXRl7sUBWdlteFg,10254
9
+ meshagent_livekit-0.0.24.dist-info/METADATA,sha256=jBWL2JJsNZRIPwde6qpTfSnuhAyJtHQykAguOrv6xZ4,952
10
+ meshagent_livekit-0.0.24.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
11
+ meshagent_livekit-0.0.24.dist-info/top_level.txt,sha256=GlcXnHtRP6m7zlG3Df04M35OsHtNXy_DY09oFwWrH74,10
12
+ meshagent_livekit-0.0.24.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.4.0)
2
+ Generator: setuptools (80.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5