import os
from typesafe_sdk import Choice, Noul, TypeSafeClient
client = TypeSafeClient(
api_key=os.environ["BESPOKE_API_KEY"],
base_url="https://api.bespokelabs.ai",
model="nimble-latest",
)
response = client.system_one(
"The customer was charged twice and asks for a refund. The service still works.",
{
"refund": Noul(instructions="Does the customer request a refund?"),
"department": Choice(
instructions="Which department should handle this request?",
criteria={
"billing": "Charges, payments and refunds",
"technical": "Software bugs and outages",
},
),
},
)
print(response.answers)