Skip to content
System One

typesafe-sdk-python (official Python SDK)

Official Python client for the TypeSafe System One API, published to PyPI as typesafe-sdk with sync (TypeSafeClient) and async (AsyncTypeSafeClient) clients.

typesafe-ai/typesafe-sdk-python on GitHub

Stars
219
Forks
30
Language
Python
License
MIT
Last push
21 Sep 2026

Read from GitHub on . Counts change daily.

This is TypeSafe’s own Python client for the System One API, published to PyPI as typesafe-sdk, with a synchronous TypeSafeClient and an async AsyncTypeSafeClient. After setting TYPESAFE_API_KEY, a system_one call passes a state, such as a support ticket, and a dict of typed questions, and gets back typed answers grouped by question type.

The README’s quickstart sends one ticket with a choice question, “What is this ticket about?”, over billing, technical and other, then reads response.choices["category"].choice. An example in the async client’s source adds a noul (yes/no) question and checks that its answer is a probability between 0 and 1 and that the choice answer is one of the offered options. The README is short and points to TypeSafe’s SDK docs for the rest.

How it uses Jev

async def main() -> None:
    async with AsyncTypeSafeClient() as client:
        result = await client.system_one(
            state="I was charged twice. Please help.",
            questions={
                "billing": Noul(instructions="Is this about billing?"),
                "tone": Choice(
                    instructions="What is the tone?",
                    criteria={"calm": None, "angry": None},
                ),
            },
        )
        assert 0 <= result.nouls["billing"].noul <= 1
        assert result.choices["tone"].choice in {"calm", "angry"}

View in src/typesafe_sdk/_core/client/aio/client.py

Open on GitHub

PrimitivesChoiceScoreNoul

More like this

Keep browsing