jev-latest NoulChoiceScore
How to run jev-latest Ask multiple questions together
Description
TypeSafe’s combined primitives example: noul, choice, and score against the same ticket.
Copy
from typesafe_sdk import Choice, Noul, Score, TypeSafeClient
with TypeSafeClient(model="jev-latest") as client:
result = client.system_one(
state={
"ticket_message": "My flight was cancelled. Can I get a refund?",
"refund_policy": "Cancelled flights are eligible for a full refund."
},
questions={
"refund_requested": Noul(
instructions="Does `ticket_message` request a refund?",
),
"request_type": Choice(
instructions="What is the main request in `ticket_message`?",
criteria={
"refund": "The customer wants money returned.",
"rebooking": "The customer wants a replacement flight.",
"information": "The customer is asking for information only."
},
),
"frustration": Score(
instructions="How frustrated does the customer appear in `ticket_message`?",
criteria=[
"Calm and neutral.",
"Concerned but civil.",
"Very angry or using strong language."
],
)
},
)
Worked example
Illustrative for this sample state, not a live run
Sample state
{
"ticket_message": "My flight was cancelled. Can I get a refund?",
"refund_policy": "Cancelled flights are eligible for a full refund."
} Noul
refund_requestedDoes `ticket_message` request a refund?
The vendor docs do not publish a sample answer for this question.
Choice
request_typeWhat is the main request in `ticket_message`?
The vendor docs do not publish a sample answer for this question.
Score
frustrationHow frustrated does the customer appear in `ticket_message`?
The vendor docs do not publish a sample answer for this question.
What you might do next
Send every question that uses the same state in one request. Print `refund_requested.noul`, `request_type.choice`, and `frustration.score`, then compose the decision in code.
Tags
combinedreturns