Comment by maltalex

10 hours ago

This is a very promising idea - a model that takes arbitrary text input (which can be a complex json), plus a set of questions (yes/no, multiple-choice, or score) and quickly (milliseconds) and cheaply ($0.042/MTok) answers those questions.

Unfortunately, none of this is explained in the announcement, but the documentation [0] is pretty good.

[0]: https://docs.typesafe.ai/concepts/how-to-build-with-system-o...

API example[0] makes it clear how it'd be used:

  from typesafe_sdk import Choice, Noul, Score, TypeSafeClient
  
  with TypeSafeClient() as client:
      response = client.system_one(
          state={"document": "I was charged twice. Please fix this ASAP."},
          questions={
              "billing": Noul(instructions="Is this ticket about billing?"),
              "tone": Choice(
                  instructions="What is the customer's tone?",
                  criteria={"calm": None, "frustrated": None, "angry": None},
              ),
              "urgency": Score(
                  instructions="How urgent is this ticket?",
                  criteria=["can wait", "this week", "today"],
              ),
          },
      )
  
  print(response.nouls["billing"].noul)
  print(response.choices["tone"].choice)
  print(response.scores["urgency"].score)

[0]: https://docs.typesafe.ai/sdk/python