manage.py deploy_chatbot

This module is used to deploy a customer API.

class smarter.apps.chatbot.management.commands.deploy_chatbot.Command(*args, **kwargs)[source]

Bases: SmarterCommand

Deploy a customer API. Provide either an account number or a company name. Deploys to a URL of the form [user-defined-subdomain].####-####-####.api.example.com/chatbot/

add_arguments(parser)[source]

Add arguments to the command.

handle(*args, **options)[source]

Deploy a customer-facing chatbot API for a Smarter account.

This management command enables administrators to deploy a chatbot for a specific account, identified either by its account number or company name. The chatbot is deployed to a URL structured as [subdomain].[account-number].api.example.com/chatbot/.

The deployment process checks for the existence of the specified account and chatbot, verifies DNS status, and initiates deployment either synchronously (foreground) or asynchronously (background Celery task).

Usage: - Specify the account using either --account_number or --company_name. - Provide the chatbot’s name (subdomain) via --name. - Optionally use --foreground to run the deployment synchronously.

Deployment Steps: - Retrieve the account by account number or company name. - Locate the chatbot by name within the account. - If the chatbot is already deployed and DNS is verified, report success. - Otherwise, deploy the chatbot using the appropriate method. - Output progress and completion messages.

This command streamlines the process of making chatbots available to end users, ensuring proper DNS verification and deployment status.