Antworten und Ergebnisse
Lies die Antworten, Konfidenzwerte, Token-Nutzung und verfügbaren Modelle, die von der TypeSafe API zurückgegeben werden.
Antwort
typesafe_sdk.SystemOneResponse
pydantic-model
Basisklasse: Response
Antworten, gruppiert nach Fragetyp, mit Modell- und Nutzungsmetadaten.
Siehe System One für Details.
JSON-Schema anzeigen:
Details {
"$defs" : {
"ChoiceAnswer" : {
"description" : "A selected label and its probabilities. \n\n See the [choice primitive](../../../../primitives/choice) for details." ,
"properties" : {
"type" : {
"const" : "choice" ,
"default" : "choice" ,
"title" : "Type" ,
"type" : "string"
},
"choice" : {
"description" : "The name of the choice with the highest probability among the question's criteria." ,
"examples" : [
"angry"
],
"title" : "Choice" ,
"type" : "string"
},
"confidence" : {
"description" : "Confidence in the selected choice, from 0 to 1. Higher values indicate greater certainty; use lower values to flag uncertain selections for review." ,
"examples" : [
0.9
],
"title" : "Confidence" ,
"type" : "number"
},
"probabilities" : {
"additionalProperties" : {
"type" : "number"
},
"description" : "Probability of each choice in criteria, keyed by choice name, from 0 to 1. Shows how likely the alternatives are; values sum to approximately 1." ,
"examples" : [
{
"angry" : 0.8 ,
"calm" : 0.1 ,
"excited" : 0.1
}
],
"title" : "Probabilities" ,
"type" : "object"
}
},
"required" : [
"choice" ,
"confidence" ,
"probabilities"
],
"title" : "ChoiceAnswer" ,
"type" : "object"
},
"NoulAnswer" : {
"description" : "A yes/no answer. \n\n See the [noul primitive](../../../../primitives/noul) for details." ,
"properties" : {
"type" : {
"const" : "noul" ,
"default" : "noul" ,
"title" : "Type" ,
"type" : "string"
},
"noul" : {
"description" : "Probability of a yes answer or a true statement, from 0 to 1. Values near 1 favor yes or true, values near 0 favor no or false, and values near 0.5 indicate uncertainty." ,
"examples" : [
0.98
],
"title" : "Noul" ,
"type" : "number"
}
},
"required" : [
"noul"
],
"title" : "NoulAnswer" ,
"type" : "object"
},
"ScoreAnswer" : {
"description" : "An expected score with its rubric and probabilities. \n\n See the [score primitive](../../../../primitives/score) for details." ,
"properties" : {
"type" : {
"const" : "score" ,
"default" : "score" ,
"title" : "Type" ,
"type" : "string"
},
"score" : {
"description" : "Expected score: the probability-weighted average of the rubric levels. May fall between integer levels." ,
"examples" : [
1.7
],
"title" : "Score" ,
"type" : "number"
},
"confidence" : {
"description" : "Confidence in the score, from 0 to 1. Higher values indicate greater certainty; use lower values to flag uncertain ratings for review." ,
"examples" : [
0.9
],
"title" : "Confidence" ,
"type" : "number"
},
"legend" : {
"additionalProperties" : {
"anyOf" : [
{
"type" : "string"
},
{
"additionalProperties" : true ,
"type" : "object"
},
{
"items" : {},
"type" : "array"
}
]
},
"title" : "Legend" ,
"type" : "object"
},
"probabilities" : {
"additionalProperties" : {
"type" : "number"
},
"title" : "Probabilities" ,
"type" : "object"
}
},
"required" : [
"score" ,
"confidence" ,
"legend" ,
"probabilities"
],
"title" : "ScoreAnswer" ,
"type" : "object"
},
"Usage" : {
"description" : "Token counts for a request, when reported by the API." ,
"properties" : {
"input_tokens" : {
"anyOf" : [
{
"type" : "integer"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Input Tokens"
},
"output_tokens" : {
"anyOf" : [
{
"type" : "integer"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Output Tokens"
}
},
"title" : "Usage" ,
"type" : "object"
}
},
"description" : "Answers grouped by question type with model and usage metadata. \n\n See [System One](../../../../concepts/system-one) for details." ,
"properties" : {
"model" : {
"title" : "Model" ,
"type" : "string"
},
"usage" : {
"$ref" : "#/$defs/Usage"
},
"answers" : {
"additionalProperties" : {
"discriminator" : {
"mapping" : {
"choice" : "#/$defs/ChoiceAnswer" ,
"noul" : "#/$defs/NoulAnswer" ,
"score" : "#/$defs/ScoreAnswer"
},
"propertyName" : "type"
},
"oneOf" : [
{
"$ref" : "#/$defs/NoulAnswer"
},
{
"$ref" : "#/$defs/ChoiceAnswer"
},
{
"$ref" : "#/$defs/ScoreAnswer"
}
]
},
"title" : "Answers" ,
"type" : "object"
}
},
"required" : [
"model" ,
"usage"
],
"title" : "SystemOneResponse" ,
"type" : "object"
}
Konfiguration:
extra: ignore
frozen: True
strict: True
Felder:
request_id
cached property
request_id : str
Der Antwortheader x-typesafe-request-id.
raw_http_response
property
raw_http_response: httpx2.Response
Die zugrunde liegende httpx2.Response, die Status, Header und Body bereitstellt.
model_config
class-attribute instance-attribute
model_config = ConfigDict(
extra = "ignore" , frozen = True , strict = True
)
model
pydantic-field
model : str
Das zum Beantworten der Anfrage verwendete Modell.
usage
pydantic-field
usage : Usage
Token-Nutzung für die Anfrage.
answers
pydantic-field
answers : dict [ str , Answer ]
Alle Antwortobjekte, indiziert nach dem Fragenamen.
nouls
cached property
nouls : dict [ str , NoulAnswer ]
Ja/Nein-Antworten, indiziert nach dem Fragenamen.
choices
cached property
choices : dict [ str , ChoiceAnswer ]
choice-Antworten, indiziert nach dem Fragenamen.
scores
cached property
scores : dict [ str , ScoreAnswer ]
score-Antworten, indiziert nach dem Fragenamen.
typesafe_sdk.Usage
pydantic-model
Basisklasse: wire.Usage
Token-Zählungen für eine Anfrage, sofern von der API gemeldet.
JSON-Schema anzeigen:
Details {
"description" : "Token counts for a request, when reported by the API." ,
"properties" : {
"input_tokens" : {
"anyOf" : [
{
"type" : "integer"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Input Tokens"
},
"output_tokens" : {
"anyOf" : [
{
"type" : "integer"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Output Tokens"
}
},
"title" : "Usage" ,
"type" : "object"
}
Konfiguration:
extra: ignore
frozen: True
strict: True
Felder:
model_config
class-attribute instance-attribute
model_config = ConfigDict(
extra = "ignore" , frozen = True , strict = True
)
input_tokens
pydantic-field
input_tokens : int | None = None
Anzahl der verwendeten Eingabe-Tokens oder None, wenn die API sie nicht gemeldet hat.
output_tokens
pydantic-field
output_tokens : int | None = None
Anzahl der verwendeten Ausgabe-Tokens oder None, wenn die API sie nicht gemeldet hat.
Antworten
typesafe_sdk.NoulAnswer
pydantic-model
Basisklasse: wire.NoulAnswer
Eine Ja/Nein-Antwort.
Siehe das noul-Primitiv für Details.
JSON-Schema anzeigen:
Details {
"description" : "A yes/no answer. \n\n See the [noul primitive](../../../../primitives/noul) for details." ,
"properties" : {
"type" : {
"const" : "noul" ,
"default" : "noul" ,
"title" : "Type" ,
"type" : "string"
},
"noul" : {
"description" : "Probability of a yes answer or a true statement, from 0 to 1. Values near 1 favor yes or true, values near 0 favor no or false, and values near 0.5 indicate uncertainty." ,
"examples" : [
0.98
],
"title" : "Noul" ,
"type" : "number"
}
},
"required" : [
"noul"
],
"title" : "NoulAnswer" ,
"type" : "object"
}
Konfiguration:
extra: ignore
frozen: True
strict: True
Felder:
noul
pydantic-field
noul : float
Wahrscheinlichkeit einer Ja-Antwort oder einer wahren Aussage, von 0 bis 1. Werte nahe 1 begünstigen Ja oder wahr, Werte nahe 0 begünstigen Nein oder falsch, und Werte nahe 0,5 deuten auf Unsicherheit hin.
model_config
class-attribute instance-attribute
model_config = ConfigDict(
extra = "ignore" , frozen = True , strict = True
)
typesafe_sdk.ChoiceAnswer
pydantic-model
Basisklasse: wire.ChoiceAnswer
Ein ausgewähltes Label und seine Wahrscheinlichkeiten.
Siehe das choice-Primitiv für Details.
JSON-Schema anzeigen:
Details {
"description" : "A selected label and its probabilities. \n\n See the [choice primitive](../../../../primitives/choice) for details." ,
"properties" : {
"type" : {
"const" : "choice" ,
"default" : "choice" ,
"title" : "Type" ,
"type" : "string"
},
"choice" : {
"description" : "The name of the choice with the highest probability among the question's criteria." ,
"examples" : [
"angry"
],
"title" : "Choice" ,
"type" : "string"
},
"confidence" : {
"description" : "Confidence in the selected choice, from 0 to 1. Higher values indicate greater certainty; use lower values to flag uncertain selections for review." ,
"examples" : [
0.9
],
"title" : "Confidence" ,
"type" : "number"
},
"probabilities" : {
"additionalProperties" : {
"type" : "number"
},
"description" : "Probability of each choice in criteria, keyed by choice name, from 0 to 1. Shows how likely the alternatives are; values sum to approximately 1." ,
"examples" : [
{
"angry" : 0.8 ,
"calm" : 0.1 ,
"excited" : 0.1
}
],
"title" : "Probabilities" ,
"type" : "object"
}
},
"required" : [
"choice" ,
"confidence" ,
"probabilities"
],
"title" : "ChoiceAnswer" ,
"type" : "object"
}
Konfiguration:
extra: ignore
frozen: True
strict: True
Felder:
choice
pydantic-field
choice : str
Der Name der choice mit der höchsten Wahrscheinlichkeit unter den criteria der Frage.
confidence
pydantic-field
confidence : float
Konfidenz in die ausgewählte choice, von 0 bis 1. Höhere Werte bedeuten größere Sicherheit; verwende niedrigere Werte, um unsichere Auswahlen zur Prüfung zu markieren.
probabilities
pydantic-field
probabilities : dict [ str , float ]
Wahrscheinlichkeit jeder choice in criteria, indiziert nach dem choice-Namen, von 0 bis 1. Zeigt, wie wahrscheinlich die Alternativen sind; die Werte summieren sich auf ungefähr 1.
model_config
class-attribute instance-attribute
model_config = ConfigDict(
extra = "ignore" , frozen = True , strict = True
)
typesafe_sdk.ScoreAnswer
pydantic-model
Basisklasse: wire.ScoreAnswer
Ein erwarteter Score mit seiner Rubrik und seinen Wahrscheinlichkeiten.
Siehe das score-Primitiv für Details.
JSON-Schema anzeigen:
Details {
"description" : "An expected score with its rubric and probabilities. \n\n See the [score primitive](../../../../primitives/score) for details." ,
"properties" : {
"type" : {
"const" : "score" ,
"default" : "score" ,
"title" : "Type" ,
"type" : "string"
},
"score" : {
"description" : "Expected score: the probability-weighted average of the rubric levels. May fall between integer levels." ,
"examples" : [
1.7
],
"title" : "Score" ,
"type" : "number"
},
"confidence" : {
"description" : "Confidence in the score, from 0 to 1. Higher values indicate greater certainty; use lower values to flag uncertain ratings for review." ,
"examples" : [
0.9
],
"title" : "Confidence" ,
"type" : "number"
},
"legend" : {
"additionalProperties" : {
"anyOf" : [
{
"type" : "string"
},
{
"additionalProperties" : true ,
"type" : "object"
},
{
"items" : {},
"type" : "array"
}
]
},
"title" : "Legend" ,
"type" : "object"
},
"probabilities" : {
"additionalProperties" : {
"type" : "number"
},
"title" : "Probabilities" ,
"type" : "object"
}
},
"required" : [
"score" ,
"confidence" ,
"legend" ,
"probabilities"
],
"title" : "ScoreAnswer" ,
"type" : "object"
}
Konfiguration:
extra: ignore
frozen: True
strict: True
Felder:
score
pydantic-field
score : float
Erwarteter Score: der wahrscheinlichkeitsgewichtete Durchschnitt der Rubrikstufen. Kann zwischen ganzzahligen Stufen liegen.
confidence
pydantic-field
confidence : float
Konfidenz in den Score, von 0 bis 1. Höhere Werte bedeuten größere Sicherheit; verwende niedrigere Werte, um unsichere Bewertungen zur Prüfung zu markieren.
model_config
class-attribute instance-attribute
model_config = ConfigDict(
extra = "ignore" , frozen = True , strict = True
)
legend
pydantic-field
legend : dict [
int , str | dict [ str , Any ] | list [ Any ]
]
Rubrikbeschreibungen, indiziert nach ganzzahligem Score.
probabilities
pydantic-field
probabilities : dict [ int , float ]
Wahrscheinlichkeiten, indiziert nach ganzzahligem Score.
typesafe_sdk.Answer
module-attribute
Answer : TypeAlias = Annotated [
NoulAnswer | ChoiceAnswer | ScoreAnswer ,
Field ( discriminator = "type" ),
]
Eine Antwort auf eine einzelne Frage, identifiziert durch ihren type.
Verfügbare Modelle
typesafe_sdk.ListModelsResponse
pydantic-model
Basisklasse: Response
Die für das Konto verfügbaren Modelle.
JSON-Schema anzeigen:
Details {
"$defs" : {
"ModelMetadata" : {
"description" : "Metadata describing a single available model." ,
"properties" : {
"name" : {
"title" : "Name" ,
"type" : "string"
},
"description" : {
"title" : "Description" ,
"type" : "string"
},
"release_date" : {
"title" : "Release Date" ,
"type" : "string"
}
},
"required" : [
"name" ,
"description" ,
"release_date"
],
"title" : "ModelMetadata" ,
"type" : "object"
}
},
"description" : "The models available to the account." ,
"properties" : {
"models" : {
"items" : {
"$ref" : "#/$defs/ModelMetadata"
},
"title" : "Models" ,
"type" : "array"
}
},
"required" : [
"models"
],
"title" : "ListModelsResponse" ,
"type" : "object"
}
Felder:
request_id
cached property
request_id : str
Der Antwortheader x-typesafe-request-id.
raw_http_response
property
raw_http_response: httpx2.Response
Die zugrunde liegende httpx2.Response, die Status, Header und Body bereitstellt.
model_config
class-attribute instance-attribute
model_config = ConfigDict(
extra = "ignore" , frozen = True , strict = True
)
models
pydantic-field
models : tuple [ ModelMetadata , ... ]
Die verfügbaren Modelle.
typesafe_sdk.ModelMetadata
pydantic-model
Basisklasse: Schema
Metadaten, die ein einzelnes verfügbares Modell beschreiben.
JSON-Schema anzeigen:
Details {
"description" : "Metadata describing a single available model." ,
"properties" : {
"name" : {
"title" : "Name" ,
"type" : "string"
},
"description" : {
"title" : "Description" ,
"type" : "string"
},
"release_date" : {
"title" : "Release Date" ,
"type" : "string"
}
},
"required" : [
"name" ,
"description" ,
"release_date"
],
"title" : "ModelMetadata" ,
"type" : "object"
}
Felder:
name
pydantic-field
name : str
Modellname oder Alias, der vom model-Feld einer Anfrage akzeptiert wird.
description
pydantic-field
description : str
Von Menschen lesbare Beschreibung des Modells und seiner Fähigkeiten.
release_date
pydantic-field
release_date : str
Veröffentlichungsdatum des Modells, formatiert als YYYY-MM-DD.