initialize_account

Management command to initialize the Smarter platform or accounts.

This module defines the Django management command initialize_account for the Smarter platform. It provides functionality to:

  • Initialize the entire Smarter platform with minimal required resources.

  • Initialize a single account, including:

    1. Creating an Account object.

    2. Creating, updating, or validating an admin user for the Account.

    3. Applying example manifests from GitHub.

    4. Adding plugin examples.

    5. Deploying builtin LLM clients.

    6. Creating StackAcademy (AI resource) examples.

It also supports initializing all existing accounts to update their shared AI resources.

Command-line Arguments

  • --account_number: The account number that will own the remote API connection.

  • --username: Username for the admin account for this Account.

  • --email: Email address of the account admin user (fallback is <username>@<root_domain>).

  • --password: Password for the account admin user (prompted if not supplied).

  • --company_name: Name of the company for the Account.

  • --all: If provided, initializes resources for all existing accounts.

Typical usage is for system administrators to initialize platform resources or bootstrap new accounts on the Smarter platform.

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

Bases: SmarterCommand

Django manage.py initialize_platform command.

Initialize the Smarter platform. Creates the minimal resources necessary to start using Smarter.

add_arguments(parser)[source]

Add arguments to the command.

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

Initialize the Smarter platform.

Creates the minimal resources necessary to start using Smarter.

  1. Create the Account.

  2. Create an admin user for the Account.

  3. Apply example manifests from GitHub.

  4. Add plugin examples.

  5. Deploy builtin example llm_clients.

  6. Create StackAcademy AI resources.

initialize_account(account_number, username, email, password, company_name)[source]

Initialize a single account with the provided information.

Optionally creates or updates an account admin user with the provided username, email, and password. Creates a collection of shared AI resources that are owned by the account admin user.

  1. Create the Account.

  2. Create an admin user for the Account.

  3. Apply example manifests from GitHub.

  4. Add plugin examples.

  5. Deploy builtin example llm_clients.

  6. Create StackAcademy AI resources.

Note

The typical use case is to pass the Smarter admin username (and no password) such that the shared AI resources are owned by the Smarter admin user. This removes some of the AI resource dependencies on the account, such as Connections and Secrets for some of the shared AI resources.

Return type:

bool

initialize_all_accounts()[source]

Initialize all EXISTING accounts.

This is useful for ensuring that all accounts have the the most recent versions of shared AI resources.

Return type:

bool