Add a button that opens a modal for submitting user feedback. Alternatively, set up a chatbot widget that includes all information about the platform functionality and connect it to AirTable or Slack.
Develop API endpoints to allow external apps to integrate with our platform (generate API key (use Firebase Auth custom tokens), create new session (same as POST /session), send message - the same as POST /message but accepting an API key).
Implement API key management for secure and controlled access.
Create detailed API documentation and guidelines for third-party developers.
In the WriteAndSaveProgram skill, we utilize the agency_id to construct a directory path for each agency. However, this is a bad practice and we need a persistent solution. We should establish an external storage solution for each user. Using S3-compliant storage and creating a bucket would be a viable approach.
To integrate S3 storage into our FastAPI application, we can follow these steps:
[us] Choose an S3 Storage Provider: Since we've deployed the app on Heroku, supporting Amazon S3 for storage would be a straightforward choice due to its broad support, scalability, and integration with Heroku.
[end user] Set Up the S3 Bucket: Set up an S3 bucket in our preferred region. Ensure the bucket policy and IAM roles are set up accordingly to allow programmatic access.
[us] Install Boto3: Boto3 is the Amazon Web Services (AWS) SDK for Python, which allows Python developers to write software that uses services like Amazon S3.
[end user] Configure Access Credentials: End users need to securely store their access credentials (such as AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY) in user variables.
[us] Modify the Current File Handling Logic: We currently have the WriteAndSaveProgram skill in /backend/custom_skills/write_and_save_program.py that manages file writing locally. We'll replace the logic in the File class's run method with code to upload files to S3. Here's a basic example of how we might upload files to S3:
importboto3frombotocore.exceptionsimportNoCredentialsErrordefupload_to_s3(bucket_name, file_name, body):
s3=boto3.client('s3')
try:
s3.put_object(Bucket=bucket_name, Key=file_name, Body=body)
print(f"File {file_name} uploaded to {bucket_name}")
exceptNoCredentialsError:
print("Credentials not available")
# In the File class's run method, replace the file writing logic with:upload_to_s3("bucket_name", self.file_name, self.body)
[us] Test the Integration: Before deploying the changes to production, ensure we've tested the S3 integration locally and on a staging environment to confirm that files are being uploaded correctly, and our application can retrieve them as needed.
[us] Update Documentation: Reflect these changes in both the main README.md and the backend's README.md, specifying the requirement for S3 storage and environment variables setup.
Fix a bug when after ~30 seconds of waiting the message is never returned in the UI.
After 30 seconds, set an interval to poll the get /message/list endpoint for the messages