Skip to content

Instantly share code, notes, and snippets.

@lgastako
Created September 22, 2026 06:43
Show Gist options
  • Select an option

  • Save lgastako/2bf734558e1cd78c47b2ee9638ad48cb to your computer and use it in GitHub Desktop.

Select an option

Save lgastako/2bf734558e1cd78c47b2ee9638ad48cb to your computer and use it in GitHub Desktop.
import sys
from typesafe_sdk import Choice, Noul, Score, TypeSafeClient
def main():
if len(sys.argv) != 2:
print("Need one args: observed text.")
sys.exit(-1)
q = "What percentage of this text is written by AI?"
_, o = sys.argv
print(f"question: {q}")
print(f"observation: {o}")
with TypeSafeClient() as client:
response = client.system_one(
state=o,
questions={
"ai_pct": Choice(
instructions=q,
criteria={
"none": "0% or close to it.",
"little": "less than 20%",
"some": "20-60%",
"a lot": "60-80%",
"most": "80%-95%",
"all": "100%"
}
)
}
)
print(response)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment