sshh12 / llm_convo

Use ChatGPT over Twilio to create an AI phone agent (works for incoming or outgoing calls).
MIT License
98 stars 19 forks source link

Help setting this up on webserver. #5

Open Stacey940 opened 1 year ago

Stacey940 commented 1 year ago

Hello,

I am currently attempting to host this on a web server, but I have encountered some difficulties in getting it to work properly. Would it be possible for you to provide an example script or instructions on how to set this up on a web server? I am able to run the application, but I am experiencing issues with WebSocket functionality. Specifically, I am attempting to run this as a Flask application.

Thank you for your assistance.

sshh12 commented 12 months ago

Hey @Stacey940 if you are trying to integrate this into an existing flask server that could be do-able but will require some minor modifications.

I think you could try changing:

class TwilioServer:
    def __init__(self, remote_host: str, port: int, static_dir: str):
        self.app = Flask(__name__)

to something like

class TwilioServer:
    def __init__(self, remote_host: str, port: int, static_dir: str, existing_flask_app):
        self.app = existing_flask_app

# create app in your existing application
TwilioServer(..., existing_flask_app=app)