Question
Namespace: TypeSafe.AI.Sdk
public abstract class QuestionA TypeSafe question identified by its type field.
Inheritance: object
Derived: BoxQuestion, ChoiceQuestion, NoulQuestion, ScoreQuestion
Properties
Section titled “Properties”Instructions
Section titled “Instructions”public object? Instructions { get; }The question as text, a JSON object, or an array. Omitted when the builder was not given
instructions (except NoulCriteria), which defaults to null).
Value: object
public abstract string Type { get; }Question type: noul, choice, score, or box.
Value: string
Methods
Section titled “Methods”Box(object?)
Section titled “Box(object?)”public static BoxQuestion Box(object? instructions = null)Create a question that locates what its instructions describe in the request’s image.
Mirrors JS box(). Use the jev-preview model for box questions.
Parameters
| Name | Type | Description |
|---|---|---|
instructions |
object | What to locate, as text, an asset, a JSON object or array; defaults to null. |
Returns: BoxQuestion
Choice(object?, Dictionary<string, object?>)
Section titled “Choice(object?, Dictionary<string, object?>)”public static ChoiceQuestion Choice(object? instructions, Dictionary<string, object?> criteria)Create a question that selects between named alternatives.
Mirrors JS choice().
Parameters
| Name | Type | Description |
|---|---|---|
instructions |
object | The question as text, a JSON object or array, or null. |
criteria |
Dictionary<string, object> | Labels mapped to descriptions, or null for undescribed labels. |
Returns: ChoiceQuestion
Choice(object?, IReadOnlyDictionary<string, object?>)
Section titled “Choice(object?, IReadOnlyDictionary<string, object?>)”public static ChoiceQuestion Choice(object? instructions, IReadOnlyDictionary<string, object?> criteria)Create a question that selects between named alternatives.
Mirrors JS choice().
Parameters
| Name | Type | Description |
|---|---|---|
instructions |
object | The question as text, a JSON object or array, or null. |
criteria |
IReadOnlyDictionary<string, object> | Labels mapped to descriptions, or null for undescribed labels. |
Returns: ChoiceQuestion
Choice(object?, params (string Label, object? Description)[])
Section titled “Choice(object?, params (string Label, object? Description)[])”public static ChoiceQuestion Choice(object? instructions, params (string Label, object? Description)[] criteria)Create a question that selects between named alternatives, from label/description pairs. Duplicate labels throw. Pass a dictionary when you already have a map.
Parameters
| Name | Type | Description |
|---|---|---|
instructions |
object | |
criteria |
(string Label, object Description)[] |
Returns: ChoiceQuestion
Map(params (string Name, Question Question)[])
Section titled “Map(params (string Name, Question Question)[])”public static Dictionary<string, Question> Map(params (string Name, Question Question)[] questions)Build a name → question map from labeled pairs. Duplicate names throw.
Use this when you need a dictionary (for example Questions,
or a model / cancellation token on the dictionary SystemOneAsync overload).
Parameters
| Name | Type | Description |
|---|---|---|
questions |
(string Name, Question Question)[] |
Returns: Dictionary<string, Question>
Noul(object?, NoulCriteria?)
Section titled “Noul(object?, NoulCriteria?)”public static NoulQuestion Noul(object? instructions = null, NoulCriteria? criteria = null)Create a yes/no question with optional descriptions for either outcome.
Mirrors JS noul().
Parameters
| Name | Type | Description |
|---|---|---|
instructions |
object | The question as text, a JSON object or array; defaults to null. |
criteria |
NoulCriteria | Optional descriptions of the yes and no outcomes. |
Returns: NoulQuestion
Noul(object?, NoulCriteria?, bool)
Section titled “Noul(object?, NoulCriteria?, bool)”public static NoulQuestion Noul(object? instructions, NoulCriteria? criteria, bool includeCriteria)Create a yes/no question, including an explicit null criteria value on the wire.
Parameters
| Name | Type | Description |
|---|---|---|
instructions |
object | |
criteria |
NoulCriteria | |
includeCriteria |
bool |
Returns: NoulQuestion
Score(object?, IReadOnlyList<object?>)
Section titled “Score(object?, IReadOnlyList<object?>)”public static ScoreQuestion Score(object? instructions, IReadOnlyList<object?> criteria)Create a score question using an ordered rubric.
Mirrors JS score().
Parameters
| Name | Type | Description |
|---|---|---|
instructions |
object | The question as text, a JSON object or array, or null. |
criteria |
IReadOnlyList<object> | At least two descriptions indexed by score from zero; entries may be null. |
Returns: ScoreQuestion
Score(object?, params object?[])
Section titled “Score(object?, params object?[])”public static ScoreQuestion Score(object? instructions, params object?[] criteria)Create a score question using an ordered rubric.
Mirrors JS score().
Parameters
| Name | Type | Description |
|---|---|---|
instructions |
object | The question as text, a JSON object or array, or null. |
criteria |
object[] | At least two descriptions indexed by score from zero; entries may be null. |
Returns: ScoreQuestion
Validate(IReadOnlyDictionary<string, Question>)
Section titled “Validate(IReadOnlyDictionary<string, Question>)”public static void Validate(IReadOnlyDictionary<string, Question> questions)Reject empty question sets and score questions without a list of at least two criteria.
Parameters
| Name | Type | Description |
|---|---|---|
questions |
IReadOnlyDictionary<string, Question> |
MIT · Copyright (c) Dario Kondratiuk. · not affiliated with TypeSafe beyond being a client of the public API