Journal Enumerations

The enumerations of the Smarter Journal.

The enumerations are defined in the smarter-types package, which the platform and its Python SDK share, and are re-exported here. SmarterJournalThings takes its kinds from SAMKinds, which defines which kinds exist.

class smarter.lib.journal.enum.SmarterJournalCliCommands(*values)[source]

Bases: SmarterEnumAbstract

The commands of the Smarter api’s /api/v1/cli/ endpoints, which the journal records.

command = SmarterJournalCliCommands("apply")
assert command == SmarterJournalCliCommands.APPLY
APPLY = 'apply'
DELETE = 'delete'
DEPLOY = 'deploy'
DESCRIBE = 'describe'
DOCUMENTS = 'documents'
ENABLE_JOURNAL = 'journal'
GET = 'get'
JSON_SCHEMA = 'json_schema'
LOGS = 'logs'
MANIFEST_EXAMPLE = 'example_manifest'
PROMPT = 'prompt'
PROMPT_CONFIG = 'chat_config'
RESOURCES = 'resources'
STATUS = 'status'
UNDEPLOY = 'undeploy'
VALIDATE = 'validate'
VERSION = 'version'
WHOAMI = 'whoami'
classmethod choices()[source]

Return the choices of the platform’s journal model’s command field, as Django expects them.

The list is part of the platform’s database migrations, so it changes only with a migration.

Returns:

(value, label) pairs.

Return type:

list[tuple[str, str]]

classmethod from_url(url)[source]

Return the command of a Smarter api url.

SmarterJournalCliCommands.from_url("http://localhost:9357/api/v1/cli/example_manifest/Account/")
# "example_manifest"
Parameters:

url (str | bytes) – The url.

Returns:

The first slug of the url’s path that is a command, or None for a url that is not an api url, or that has no command.

Return type:

str | None

classmethod past_tense()[source]

Return the past tense of each command, for the messages of journaled responses.

Returns:

The past tense, by command value, e.g. {"apply": "applied", ...}.

Return type:

dict[str, str]

class smarter.lib.journal.enum.SmarterJournalThings(*values)[source]

Bases: SmarterEnumAbstract

The kinds of objects (“things”) that the Smarter Journal records requests about.

Every SAM kind is a thing, with the same value. The one thing that is not a SAM kind is PROMPT_CONFIG, a chat’s configuration, which the platform generates on request.

thing = SmarterJournalThings("Plugin")
assert thing == SmarterJournalThings.STATIC_PLUGIN
assert thing.value == SAMKinds.STATIC_PLUGIN.value
ACCOUNT = 'Account'
API_CONNECTION = 'ApiConnection'
API_PLUGIN = 'ApiPlugin'
AUTH_TOKEN = 'SmarterAuthToken'
BUDGET = 'Budget'
CUSTOM_DOMAIN = 'CustomDomain'
GUARDRAIL = 'Guardrail'
IMAGE_SEARCH_PLUGIN = 'ImageSearchPlugin'
LLMHOST = 'LLMHost'
LLMHOST_COMPUTE = 'LLMHostCompute'
LLM_CLIENT = 'LLMClient'
MCPCLIENT = 'MCPClient'
ORCHESTRATOR = 'Orchestrator'
PROMPT = 'Prompt'
PROMPT_CONFIG = 'ChatConfig'

a JSON object that the platform generates on request.

Not a SAM kind.

Type:

A chat’s configuration

PROVIDER = 'Provider'
PROXY = 'Proxy'
SECRET = 'Secret'
SKILL_PLUGIN = 'SkillPlugin'
SQL_CONNECTION = 'SqlConnection'
SQL_PLUGIN = 'SqlPlugin'
STATIC_PLUGIN = 'Plugin'
USER = 'User'
VECTORSEARCH = 'Vectorsearch'
VECTORSTORE = 'Vectorstore'
WEBSEARCH_PLUGIN = 'WebsearchPlugin'
classmethod choices()[source]

Return the choices of the platform’s journal model’s thing field, as Django expects them.

The list is part of the platform’s database migrations, so it changes only with a migration. It doesn’t have LLMHost or LLMHostCompute.

Returns:

(value, label) pairs.

Return type:

list[tuple[str, str]]