ans123's picture
Initial upload from Colab
ef1ad9e verified

ai-service

This microservice handles everything related to ai service.

Installation

  1. Clone this repository to your local machine:

    git clone [email protected]:miralabsai/ai-service.git
    
  2. Navigate to the project directory:

    cd ai-service
    
  3. Create a virtual environment (recommended) using venv or virtualenv:

    # Using venv
    python -m venv venv
    
    # Activate the virtual environment
    source ./venv/Scripts/activate
    
  4. Install the required dependencies:

    pip install -r requirements.txt
    

Setting up Environment Variables

  1. Copy the .env.example file to create a new .env file:

    cp .env.example .env
    
  2. Edit the .env file and provide appropriate values for the environment variables.

Running the service

To run the service, use the following command:

python -m uvicorn app.main:app --reload --port 5001

This will start the server on http://localhost:5001.

You can now access the Swagger UI for interactive documentation at http://localhost:5001/docs.

You can connect to the AI chat agent websocket at http://localhost:5001/ws.

Websocket input structure

{user_input: "input"}