Smarter Python SDK

The Smarter Python SDK is the official Python library of the Smarter API. It is to Smarter what the openai package is to the OpenAI API: one pip install gives your Python software typed, complete access to your own Smarter platform, whether it runs on your laptop or on Kubernetes. It covers every resource kind through the same manifest API as the Smarter CLI, prompts and streamed chats with LLMClients, each resource’s own actions, and typed Pydantic models of every manifest kind and of the platform’s API contracts.

pip install smarter-api
from smarter import Smarter

client = Smarter()  # SMARTER_API_KEY, or the smarter cli's ~/.smarter/config.yaml

llmclient = client.llm_clients.find("customer_support")
print(client.llm_clients.prompt(llmclient.id, "Where is my order #1234?").text)

The SDK has its own documentation site, with its user guide, API reference and architecture decisions: docs.smarter-python.smarter.sh.

The package is smarter-api on PyPI, and its import name is smarter. Its source is github.com/smarter-sh/smarter-python. It takes the list of manifest kinds and the journal’s enumerations from the same package as the platform, smarter-types, so the two always agree.