Management Commands

This module is used to generate seed records for the prompt history models.

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

Bases: SmarterCommand

Django manage.py initialize_providers.py command.

This command is used to create/update the principal Providers that are preloaded on all platforms.

This runs during deployment.

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

Initialize all built-in providers.

initialize_googleai()[source]

Initialize Google AI provider and its models.

initialize_metaai()[source]

Initialize Meta AI provider and its models.

initialize_openai()[source]

Initialize OpenAI provider and its models.

initialize_provider_model(provider, model_name, is_default=False)[source]

Helper function to initialize a single provider model.

initialize_provider_models(provider, bearer_token, default_model)[source]

Initialize models by fetching them from the OpenAI compatible API end point.

Example response:

{
    "object": "list",
    "data": [
        {
            "id": "gpt-4-0613",
            "object": "model",
            "created": 1686588896,
            "owned_by": "openai"
        }
    ]
}
user_profile: UserProfile | None = None