-**--bucket_name**: The name of the S3 bucket containing the PDF files.
-**--endpoint**: Endpoint for the vector database.
-**--index_name**: The index_name where to store the embeddings in the collection.
-**--local_path**: local_path
-**[YourBucketName]**: The name of the S3 bucket containing the PDF files.
-**[YourVectorDBEndpoint]**: Endpoint for the vector database.
-**[Index_name]**: The index_name where to store the embeddings in the collection.
-**[local_path]**: local_path
The main.py script will:
...
...
@@ -61,25 +61,46 @@ The main.py script will:
## Part 2:
### Set up environment
### Step 1: Preparation
Before deploying the chatbot on an EC2 instance, complete the following preliminary steps:
Install required python libraries listed in the 'requirements.txt':
1. Create a Key Pair: This key pair will be used for SSH access to your EC2 instance whe you need it.
`pip3 install -r requirements.txt`
2. Create a Security Group: Define rules to allow the instance to be accessible externally. The security group should include the following rules:
- For inbound rules: you need to allow SSH traffic, HTTP/HTTPs trafic and 8501 for streamlit.
- Outbound Rules: Allow all traffic.
* Prepare config.ini:
Ensure your config.ini file includes your AWS credentials (aws_access_key_id, aws_secret_access_key, region), with the region set to 'us-east-1'. Also, include the endpoint and index_name for the OpenSearch service established earlier.
### Step 2: Launching the Instance
Utilize the provided create_instance.py script to deploy your EC2 instance with the essential startup configurations. Before executing this, adjust Security Group and Key Pair already created in the first step.
In the `ec2.create_instance` we have the following parameters:
### Step 1: Create VM
- ImageId: `ami-03a1012f7ddc87219`, this is a custom Amazon Machine Image (AMI) that contains all the configurations and dependencies required for the chatbot application.
- UserData: is used to run script after the instance starts. The script will put the credentials in the instance so that the instance can aceess other services in AWS, and the endpoint for the Vector DB, index name. Then the script will run the application.
## Step 2: Running the app
This is the script:
Launch the Streamlit application which interacts with the Vector Store , LLM for embeddings and LLM for text generation: