Respostas e resultados
Leia as respostas, as pontuações de confiança, o uso de tokens e os modelos disponíveis que a API do TypeSafe retorna.
Resposta
typesafe_sdk.SystemOneResponse
pydantic-model
Bases: Response
Respostas agrupadas por tipo de pergunta com metadados de modelo e uso.
Consulte System One para obter detalhes.
Mostrar esquema JSON:
Detalhes {
"$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"
}
Configuração:
extra: ignore
frozen: True
strict: True
Campos:
request_id
cached property
request_id : str
O cabeçalho de resposta x-typesafe-request-id.
raw_http_response
property
raw_http_response: httpx2.Response
O httpx2.Response subjacente, que expõe status, cabeçalhos e corpo.
model_config
class-attribute instance-attribute
model_config = ConfigDict(
extra = "ignore" , frozen = True , strict = True
)
model
pydantic-field
model : str
O modelo usado para responder à requisição.
usage
pydantic-field
usage : Usage
Uso de tokens da requisição.
answers
pydantic-field
answers : dict [ str , Answer ]
Todos os objetos de resposta indexados pelo nome da pergunta.
nouls
cached property
nouls : dict [ str , NoulAnswer ]
Respostas de sim/não indexadas pelo nome da pergunta.
choices
cached property
choices : dict [ str , ChoiceAnswer ]
Respostas de choice indexadas pelo nome da pergunta.
scores
cached property
scores : dict [ str , ScoreAnswer ]
Respostas de score indexadas pelo nome da pergunta.
typesafe_sdk.Usage
pydantic-model
Bases: wire.Usage
Contagens de tokens de uma requisição, quando informadas pela API.
Mostrar esquema JSON:
Detalhes {
"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"
}
Configuração:
extra: ignore
frozen: True
strict: True
Campos:
model_config
class-attribute instance-attribute
model_config = ConfigDict(
extra = "ignore" , frozen = True , strict = True
)
input_tokens
pydantic-field
input_tokens : int | None = None
Número de tokens de entrada usados, ou None quando a API não o informou.
output_tokens
pydantic-field
output_tokens : int | None = None
Número de tokens de saída usados, ou None quando a API não o informou.
Respostas
typesafe_sdk.NoulAnswer
pydantic-model
Bases: wire.NoulAnswer
Uma resposta de sim/não.
Consulte a primitiva noul para obter detalhes.
Mostrar esquema JSON:
Detalhes {
"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"
}
Configuração:
extra: ignore
frozen: True
strict: True
Campos:
noul
pydantic-field
noul : float
Probabilidade de uma resposta sim ou de uma afirmação verdadeira, de 0 a 1. Valores próximos de 1 favorecem sim ou verdadeiro, valores próximos de 0 favorecem não ou falso, e valores próximos de 0,5 indicam incerteza.
model_config
class-attribute instance-attribute
model_config = ConfigDict(
extra = "ignore" , frozen = True , strict = True
)
typesafe_sdk.ChoiceAnswer
pydantic-model
Bases: wire.ChoiceAnswer
Um rótulo selecionado e suas probabilidades.
Consulte a primitiva choice para obter detalhes.
Mostrar esquema JSON:
Detalhes {
"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"
}
Configuração:
extra: ignore
frozen: True
strict: True
Campos:
choice
pydantic-field
choice : str
O nome do choice com a maior probabilidade entre os criteria da pergunta.
confidence
pydantic-field
confidence : float
Confiança no choice selecionado, de 0 a 1. Valores mais altos indicam maior certeza; use valores mais baixos para sinalizar seleções incertas para revisão.
probabilities
pydantic-field
probabilities : dict [ str , float ]
Probabilidade de cada choice em criteria, indexada pelo nome do choice, de 0 a 1. Mostra quão prováveis são as alternativas; os valores somam aproximadamente 1.
model_config
class-attribute instance-attribute
model_config = ConfigDict(
extra = "ignore" , frozen = True , strict = True
)
typesafe_sdk.ScoreAnswer
pydantic-model
Bases: wire.ScoreAnswer
Um score esperado com sua rubrica e probabilidades.
Consulte a primitiva score para obter detalhes.
Mostrar esquema JSON:
Detalhes {
"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"
}
Configuração:
extra: ignore
frozen: True
strict: True
Campos:
score
pydantic-field
score : float
Score esperado: a média ponderada pela probabilidade dos níveis da rubrica. Pode ficar entre níveis inteiros.
confidence
pydantic-field
confidence : float
Confiança no score, de 0 a 1. Valores mais altos indicam maior certeza; use valores mais baixos para sinalizar avaliações incertas para revisão.
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 ]
]
Descrições da rubrica indexadas pelo score inteiro.
probabilities
pydantic-field
probabilities : dict [ int , float ]
Probabilidades indexadas pelo score inteiro.
typesafe_sdk.Answer
module-attribute
Answer : TypeAlias = Annotated [
NoulAnswer | ChoiceAnswer | ScoreAnswer ,
Field ( discriminator = "type" ),
]
Uma resposta a uma única pergunta, identificada por seu type.
Modelos disponíveis
typesafe_sdk.ListModelsResponse
pydantic-model
Bases: Response
Os modelos disponíveis para a conta.
Mostrar esquema JSON:
Detalhes {
"$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"
}
Campos:
request_id
cached property
request_id : str
O cabeçalho de resposta x-typesafe-request-id.
raw_http_response
property
raw_http_response: httpx2.Response
O httpx2.Response subjacente, que expõe status, cabeçalhos e corpo.
model_config
class-attribute instance-attribute
model_config = ConfigDict(
extra = "ignore" , frozen = True , strict = True
)
models
pydantic-field
models : tuple [ ModelMetadata , ... ]
Os modelos disponíveis.
typesafe_sdk.ModelMetadata
pydantic-model
Bases: Schema
Metadados que descrevem um único modelo disponível.
Mostrar esquema JSON:
Detalhes {
"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"
}
Campos:
name
pydantic-field
name : str
Nome ou alias do modelo aceito pelo campo model de uma requisição.
description
pydantic-field
description : str
Descrição legível por humanos do modelo e de seus recursos.
release_date
pydantic-field
release_date : str
Data de lançamento do modelo, no formato AAAA-MM-DD.