logoalt Hacker News

maltalexyesterday at 12:18 AM2 repliesview on HN

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...


Replies

18alyesterday at 7:09 AM

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
leobuskinyesterday at 10:51 AM

An example with manual combinatorial exclusion in “not_for” field made me cry, this is a wild hybrid of code logic, textual definitions, and AI blackbox. It’s a cool idea, but the “glue” layer is too boilerplate-ish