Client ====== .. This page is generated by smarter-nodejs's scripts/generate-reference.ts. Do not edit it. The client, ``new Smarter({...})``, and its options. See :doc:`../configuration`. .. js:class:: Smarter(options) A client of a Smarter platform's api. The client's properties group the api's operations: - ``Smarter.manifests``: apply, validate, get, describe, delete, deploy, undeploy and logs, for any kind - ``Smarter.llmClients``: LLMClients, and prompting and chatting with them - ``Smarter.guardrails``, ``Smarter.mcpClients``, ``Smarter.vectorstores``, ``Smarter.llmHosts``, ``Smarter.secrets``, ``Smarter.plugins``, ``Smarter.orchestrators``, ``Smarter.vectorsearches`` - ``Smarter.accounts`` (and ``accounts.users``, ``accounts.contacts`` and ``accounts.userProfiles``) - ``Smarter.history``, ``Smarter.journal``, ``Smarter.providers``, ``Smarter.proxies`` - ``Smarter.whoami``, ``Smarter.version``, ``Smarter.status`` and ``Smarter.kinds`` A client holds no open connections of its own: there is nothing to close. :param options: The api key, base url, environment, timeout (seconds), retries, headers, ``fetch`` and logging. :type options: SmarterOptions :throws SmarterConfigurationError: If no api key is found, or an option or environment variable is invalid. .. js:attribute:: accounts Accounts, and their users and contacts. :type: Accounts .. js:attribute:: config The client's resolved configuration, without its api key. :type: Omit .. js:attribute:: guardrails Guardrails. :type: Guardrails .. js:attribute:: history The history of chat sessions, tool calls and plugin uses. :type: PromptHistory .. js:attribute:: http The http transport, for endpoints that the SDK does not wrap. :type: SmarterHttpClient .. js:attribute:: journal The Smarter Journal. Superusers only. :type: Journal .. js:attribute:: llmClients LLMClients. :type: LLMClients .. js:attribute:: llmHosts LLMHosts. :type: LLMHosts .. js:attribute:: manifests The manifest api, for any resource kind. :type: Manifests .. js:attribute:: mcpClients MCPClients. :type: MCPClients .. js:attribute:: orchestrators Orchestrators. :type: Orchestrators .. js:attribute:: plugins Plugins. :type: Plugins .. js:attribute:: providers LLM providers and their models. :type: Providers .. js:attribute:: proxies Proxies to LLM providers' own apis. :type: Proxies .. js:attribute:: secrets Secrets. :type: Secrets .. js:attribute:: vectorsearches Vectorsearches. :type: Vectorsearches .. js:attribute:: vectorstores Vectorstores. :type: Vectorstores .. js:attribute:: apiKey The api key, e.g. to use a proxy with a provider's own SDK. :type: string .. js:attribute:: baseUrl The api's base url, e.g. ``https://platform.smarter.sh/api/v1/``. :type: string .. js:method:: [custom]() How ``console.log`` and ``util.inspect`` show the client: without its api key. :rtype: string .. js:method:: kinds(options?) The resource kinds that the platform supports, and which of them can be deployed. :param options: Per-request options. :type options: RequestOptions | undefined :returns: The kinds. :rtype: Promise .. js:method:: status(options?) The state of the platform's infrastructure and compute. :param options: Per-request options. :type options: RequestOptions | undefined :returns: The status. :rtype: Promise .. js:method:: toJSON() The client as JSON, with its api key masked. :returns: The base url and the masked api key. :rtype: object .. js:method:: toString() :returns: e.g. ``Smarter(baseUrl="https://platform.smarter.sh/api/v1/", apiKey="****5150")``. :rtype: string .. js:method:: version(options?) The platform's version, and the versions of its main Python packages. :param options: Per-request options. :type options: RequestOptions | undefined :returns: The versions. :rtype: Promise .. js:method:: whoami(options?) The owner of the api key: the user, their account, and the platform's environment. :param options: Per-request options. :type options: RequestOptions | undefined :returns: The owner. :rtype: Promise .. js:data:: VERSION The SDK's version. :type: "0.0.0" .. js:class:: SmarterOptions The options of a ``Smarter`` client. Every option is optional: see ``src/core/config.ts`` for where each is looked up. Extends ``ConfigOptions``, and has its methods. .. js:attribute:: defaultHeaders Headers to add to every request. :type: Record .. js:attribute:: fetch The ``fetch`` to send requests with, e.g. one with a proxy agent. The global ``fetch`` by default. :type: Fetch .. js:attribute:: logger Where to log: ``console``, or any logger with ``debug``, ``info``, ``warn`` and ``error`` methods. :type: SmarterLogger .. js:attribute:: logLevel How much to log, instead of ``SMARTER_LOG``. Nothing is logged by default. :type: SmarterLogLevel