LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Caches
    • Callbacks
    • Documents
    • Document loaders
    • Embeddings
    • Exceptions
    • Language models
    • Serialization
    • Output parsers
    • Prompts
    • Rate limiters
    • Retrievers
    • Runnables
    • Utilities
    • Vector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    โŒ˜I

    Chat LangChain

    What can I help with?

    Enter to sendยทShift+Enter new line

    Menu

    OverviewCachesCallbacksDocumentsDocument loadersEmbeddingsExceptionsLanguage modelsSerializationOutput parsersPromptsRate limitersRetrieversRunnablesUtilitiesVector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-coredecisionstypesChoiceAnswer
    Classโ—Since v1.8

    ChoiceAnswer

    Copy
    ChoiceAnswer()

    Bases

    BaseModel

    Used in Docs

    • OpenAI Decisions integration
    • TypeSafe integrations

    Attributes

    View source on GitHub
    attribute
    type: Literal['choice']

    Wire discriminator identifying a categorical answer.

    attribute
    choice: str

    Label selected from the options supplied in Choice.criteria.

    attribute
    probabilities: dict[str, float]

    Probability assigned to each candidate label, keyed by label name.

    The complete distribution is retained so applications can use a confidence measure or risk policy different from the provider's.

    attribute
    confidence: float

    Scalar certainty from 0 to 1 in the selected label.

    Each provider documents how it derives confidence. Thresholds should be chosen according to the consequences of an incorrect automated decision.

    Selected Choice label with its probability distribution and confidence.