run worker in dev mode
This commit is contained in:
		
							parent
							
								
									3f6ba52a0e
								
							
						
					
					
						commit
						7207add614
					
				| 
						 | 
				
			
			@ -192,7 +192,7 @@ def run(
 | 
			
		|||
                        try:
 | 
			
		||||
                            response = requests.get(url)
 | 
			
		||||
                            if response.status_code == 200:
 | 
			
		||||
                                print("livekit server is running")
 | 
			
		||||
                                continue
 | 
			
		||||
                            else:
 | 
			
		||||
                                print("request failed: ", response.status_code)
 | 
			
		||||
                                break
 | 
			
		||||
| 
						 | 
				
			
			@ -205,7 +205,6 @@ def run(
 | 
			
		|||
                        os.killpg(os.getpgid(process.pid), signal.SIGTERM)
 | 
			
		||||
                    except ProcessLookupError:
 | 
			
		||||
                        pass  # Process group already terminated
 | 
			
		||||
                            
 | 
			
		||||
 | 
			
		||||
            # Start the livekit server
 | 
			
		||||
            if debug:
 | 
			
		||||
| 
						 | 
				
			
			@ -302,8 +301,8 @@ def run(
 | 
			
		|||
                .with_name("You") \
 | 
			
		||||
                .with_grants(api.VideoGrants(
 | 
			
		||||
                    room_join=True,
 | 
			
		||||
                    room=ROOM_NAME,
 | 
			
		||||
            )).to_jwt())
 | 
			
		||||
                    room=ROOM_NAME,))
 | 
			
		||||
                .to_jwt())
 | 
			
		||||
        
 | 
			
		||||
        ### DISPLAY QR CODE
 | 
			
		||||
        if qr:
 | 
			
		||||
| 
						 | 
				
			
			@ -360,8 +359,7 @@ def run(
 | 
			
		|||
                spinner.stop()
 | 
			
		||||
                print(f"\nOpening meet interface at: {meet_url}")
 | 
			
		||||
                webbrowser.open(meet_url)
 | 
			
		||||
            
 | 
			
		||||
            print(f"multimodal flag is: {multimodal}")
 | 
			
		||||
                
 | 
			
		||||
            try:
 | 
			
		||||
                if multimodal:
 | 
			
		||||
                    multimodal_main(url)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,7 +2,6 @@ import asyncio
 | 
			
		|||
import numpy as np
 | 
			
		||||
import sys
 | 
			
		||||
import os
 | 
			
		||||
import threading
 | 
			
		||||
from datetime import datetime
 | 
			
		||||
from typing import Literal, Awaitable
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -25,11 +24,6 @@ load_dotenv()
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
_room_lock = threading.Lock()
 | 
			
		||||
_connected_rooms = set()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
START_MESSAGE = "Hi! You can hold the white circle below to speak to me. Try asking what I can do."
 | 
			
		||||
 | 
			
		||||
# This function is the entrypoint for the agent.
 | 
			
		||||
| 
						 | 
				
			
			@ -449,14 +443,14 @@ def main(livekit_url: str):
 | 
			
		|||
 | 
			
		||||
    # Modify sys.argv to set the path to this file as the first argument
 | 
			
		||||
    # and 'dev' as the second argument
 | 
			
		||||
    sys.argv = [str(__file__), 'start']
 | 
			
		||||
    sys.argv = [str(__file__), 'dev']
 | 
			
		||||
 | 
			
		||||
    # Initialize the worker with the entrypoint
 | 
			
		||||
    cli.run_app(
 | 
			
		||||
        WorkerOptions(
 | 
			
		||||
            entrypoint_fnc=entrypoint, 
 | 
			
		||||
            api_key="devkey", 
 | 
			
		||||
            api_secret="secret", 
 | 
			
		||||
            api_secret="secret",
 | 
			
		||||
            ws_url=livekit_url
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue