Enumerations
The kinds of Smarter Application Manifest (SAM), and their icons in the web console.
SAMKinds is the single definition of which kinds exist, and of the order in which manifests
of several kinds are applied (SAMKinds.apply_order()). It is defined in the
smarter-types package, which the platform and its Python
SDK share, and is re-exported here. To add a kind, add it to SAMKinds in smarter-types first,
with its place in the apply order, then give it an icon in SAM_KIND_ICONS.
- class smarter.apps.api.v1.manifests.enum.SAMKinds(*values)[source]
Bases:
SmarterEnumAbstractEvery Smarter Application Manifest (SAM) kind, as it appears in a manifest’s
kind.Each value is the name of a kind of resource that a manifest declares, and that the platform validates, applies and routes to the kind’s broker. The members’ names are the kinds’ names in upper snake case, except that a static plugin’s kind is
Plugin, and an api key’s isSmarterAuthToken.from smarter_types import SAMKinds SAMKinds.LLM_CLIENT.value # "LLMClient" SAMKinds("Secret") is SAMKinds.SECRET # True SAMKinds.str_to_kind("sqlplugin") # "SqlPlugin"
A new kind is added here first, with a deliberate place in
apply_order(), and the tests fail until it has one.- ACCOUNT = 'Account'
the owner of every other resource.
- Type:
An account
- API_CONNECTION = 'ApiConnection'
The url and credentials of a web api, which ApiPlugins call.
- API_PLUGIN = 'ApiPlugin'
A plugin that calls a web api through an ApiConnection.
- AUTH_TOKEN = 'SmarterAuthToken'
A Smarter api key.
- BUDGET = 'Budget'
Spending limits, enforced on the resources that it lists.
- CUSTOM_DOMAIN = 'CustomDomain'
A domain that serves LLMClients.
- GUARDRAIL = 'Guardrail'
Rules that an LLMClient’s prompts and responses are checked against.
- IMAGE_SEARCH_PLUGIN = 'ImageSearchPlugin'
A plugin that searches for images.
Experimental.
- LLM_CLIENT = 'LLMClient'
its provider, model, system prompt, tools and guardrails.
- Type:
An LLM application
- LLM_HOST = 'LLMHost'
A self-hosted model.
- LLM_HOST_COMPUTE = 'LLMHostCompute'
A kind of node, and its node group, that LLMHosts run on.
- MCP_CLIENT = 'MCPClient'
A connection to an MCP server, whose tools LLMClients may call.
- ORCHESTRATOR = 'Orchestrator'
A workflow of LLMClients.
- PROMPT = 'Prompt'
A chat session with an LLMClient.
- PROVIDER = 'Provider'
An LLM provider, and the Secret that holds its api key.
- PROXY = 'Proxy'
A proxy to an LLM provider’s own api.
- SECRET = 'Secret'
An encrypted value, such as a password or an api key, that other resources name.
- SKILL_PLUGIN = 'SkillPlugin'
instructions and files that it loads when it needs them.
- Type:
A plugin that gives the LLM a skill
- SQL_CONNECTION = 'SqlConnection'
The address and credentials of a database, which SqlPlugins query.
- SQL_PLUGIN = 'SqlPlugin'
A plugin that queries a database through a SqlConnection.
- STATIC_PLUGIN = 'Plugin'
a tool whose results are fixed in its manifest.
- Type:
A static plugin
- USER = 'User'
A user, a member of an account.
- VECTORSEARCH = 'Vectorsearch'
A search of a Vectorstore.
- VECTORSTORE = 'Vectorstore'
A vector database, and the provider of its embeddings.
- WEBSEARCH_PLUGIN = 'WebsearchPlugin'
A plugin that searches the web.
Experimental.
- classmethod apply_order()[source]
Return the order in which to apply manifests: each kind after the kinds that its manifests may name.
SAM resources refer to one another by name. A SqlPlugin’s
spec.connectionis the name of a SqlConnection, and a SqlConnection’spasswordis the name of a Secret. A broker resolves each name when it applies the manifest, so the resource that is named must already exist. A set of manifests, e.g. a project such as Stackademy, can only be applied in an order where every resource comes after the resources that it names. This is that order, for every kind. It is part of the definition of SAM: a new kind needs a deliberate place in it, and the tests fail until it has one.The order, kind by kind, and why:
Account. Every other resource belongs to an account, so the account comes first. It names nothing.
Secret. A Secret holds a password or an api key, and names nothing: it belongs to the user who applies it, not to a User that the manifests declare. Nearly everything after it may name a Secret: Users (
spec.config.passwordSecret), Providers, Proxies, LLMHosts, Connections, MCPClients, Vectorsearches and the search plugins. So it comes before all of them.User. A user is a member of the accounts that
spec.accountslists, and itsspec.config.passwordSecretnames a Secret.SmarterAuthToken. An api key’s
spec.usernamenames its User. It comes before the LLMClients, whosespec.apiKeymay name one.Provider. An LLM provider names the Secret that holds its api key. LLMClients, Guardrails, Proxies and Vectorstores name a Provider, so it comes before them.
Proxy.
spec.providernames a Provider, andspec.apiKeya Secret.LLMHostCompute. A kind of node, and its node group. It names nothing, but an LLMHost’s
spec.computenames one.LLMHost. A self-hosted model.
spec.computenames an LLMHostCompute, and itstokenSecretandapiKeySecretname Secrets.SqlConnection.
passwordandproxyPasswordname Secrets. SqlPlugins name it.ApiConnection.
apiKeyandproxyPasswordname Secrets. ApiPlugins name it.Guardrail.
spec.config.providernames the Provider that its semantic, moderation and llm_judge strategies call. LLMClients name it inspec.guardrails.Vectorstore.
spec.providernames the Provider of its embeddings, and its database may name a Secret.Vectorsearch.
vectorstore_namenames a Vectorstore, so it comes after them, andauth_secret_namenames a Secret.MCPClient.
credentialsnames a Secret. LLMClients name it inspec.mcpClients.The plugins: Plugin, SqlPlugin, ApiPlugin, SkillPlugin, WebsearchPlugin and ImageSearchPlugin. A SqlPlugin’s
spec.connectionnames a SqlConnection, an ApiPlugin’s an ApiConnection, and a WebsearchPlugin’s and an ImageSearchPlugin’sapiKeya Secret. A static Plugin and a SkillPlugin name nothing. All of them come after the Connections and before the LLMClients, whosespec.pluginsnames them.CustomDomain. A domain that serves LLMClients. It names nothing, but an LLMClient’s
customDomainnames its domain, so it comes before them.LLMClient. It names the most kinds: a Provider, and its Plugins, Guardrails, MCPClients, CustomDomain and SmarterAuthToken. It comes after all of them.
Prompt. A chat session, whose
spec.llmclientnames the LLMClient that it talks to.Orchestrator. Each of
spec.config.harnessesnames an LLMClient, byllmClientName.Budget. Last, because
spec.resourcescan name nearly any kind of resource: Accounts, Users, Connections, LLMClients, LLMHosts, LLMHostComputes, MCPClients, Orchestrators, Providers, Proxies, Vectorsearches and every kind of plugin. Applied any earlier, a Budget could name a resource that doesn’t exist yet.
Kinds that name nothing in common (e.g. the plugins among themselves) may be applied in any order.
apply_rank()gives each kind’s position, and a kind that is not listed, i.e. not a SAM kind, is applied last:sorted(manifests, key=lambda m: SAMKinds.apply_rank(m["kind"]))
- classmethod apply_rank(kind)[source]
Return the position of a kind in
apply_order(), to sort manifests by.SAMKinds.apply_rank(SAMKinds.SECRET) < SAMKinds.apply_rank("SqlConnection") # True SAMKinds.apply_rank("NoSuchKind") == len(SAMKinds.apply_order()) # True: applied last
- Parameters:
kind (
str|SAMKinds) – The kind, as a member or its value, in any case.- Returns:
The kind’s position, or the length of
apply_order()for a kind that isn’t a SAM kind, so that it is applied last.- Return type:
- classmethod plural(kind)[source]
Return the plural of a kind, pluralizing only its final CamelCase word.
SAMKinds.plural(SAMKinds.API_CONNECTION) # "ApiConnections" SAMKinds.plural("vectorsearch") # "Vectorsearches"
- smarter.apps.api.v1.manifests.enum.SAM_KIND_ICONS: dict[str, str] = {'Account': 'bank', 'ApiConnection': 'router', 'ApiPlugin': 'code', 'Budget': 'wallet', 'CustomDomain': 'share', 'Guardrail': 'shield-tick', 'ImageSearchPlugin': 'picture', 'LLMClient': 'artificial-intelligence', 'LLMHost': 'technology-4', 'LLMHostCompute': 'cube-3', 'MCPClient': 'switch', 'Orchestrator': 'category', 'Plugin': 'document', 'Prompt': 'message-text-2', 'Provider': 'cloud', 'Proxy': 'exit-right-corner', 'Secret': 'lock-2', 'SkillPlugin': 'wrench', 'SmarterAuthToken': 'key', 'SqlConnection': 'data', 'SqlPlugin': 'file-sheet', 'User': 'profile-circle', 'Vectorsearch': 'filter-search', 'Vectorstore': 'cube-2', 'WebsearchPlugin': 'magnifier'}
the name of a Keen Icons.
icon, without its
ki-prefix, which the console’s global stylesheet provides, e.g.<i class="ki-outline ki-lock-2"></i>for a Secret. Each kind has its own. Seesam_kind_icon().{ 'Account': 'bank', 'ApiConnection': 'router', 'ApiPlugin': 'code', 'Budget': 'wallet', 'CustomDomain': 'share', 'Guardrail': 'shield-tick', 'ImageSearchPlugin': 'picture', 'LLMClient': 'artificial-intelligence', 'LLMHost': 'technology-4', 'LLMHostCompute': 'cube-3', 'MCPClient': 'switch', 'Orchestrator': 'category', 'Plugin': 'document', 'Prompt': 'message-text-2', 'Provider': 'cloud', 'Proxy': 'exit-right-corner', 'Secret': 'lock-2', 'SkillPlugin': 'wrench', 'SmarterAuthToken': 'key', 'SqlConnection': 'data', 'SqlPlugin': 'file-sheet', 'User': 'profile-circle', 'Vectorsearch': 'filter-search', 'Vectorstore': 'cube-2', 'WebsearchPlugin': 'magnifier', }
- Type:
The icon of each SAM kind in the web console
- smarter.apps.api.v1.manifests.enum.SAM_KIND_ICON_DEFAULT = 'abstract-26'
The icon of a kind that has none of its own in
SAM_KIND_ICONS, e.g. an Extension, which isn’t a SAM kind.
- smarter.apps.api.v1.manifests.enum.sam_kind_icon(kind)[source]
Return the web console’s icon of a kind of resource, e.g. for the cards of an LLMClient’s architecture.
The icon is a Keen Icons name, without its
ki-prefix, which the web console’s global stylesheet provides.sam_kind_icon(SAMKinds.SECRET) # "lock-2", i.e. <i class="ki-outline ki-lock-2"></i> sam_kind_icon("sqlplugin") # "file-sheet" sam_kind_icon("Extension") # "abstract-26", the default: an Extension isn't a SAM kind
- Parameters:
kind (
str|SAMKinds) – The kind, as a member or its value, in any case.- Returns:
The icon’s name, or
SAM_KIND_ICON_DEFAULTfor a kind that isn’t a SAM kind.- Return type: