Skip to content

Class: LMResponse

Normalized result of one LM request (dspy.LMResponse).

URI: dspy:LMResponse

 classDiagram
    class LMResponse
    click LMResponse href "../LMResponse/"
      LMResponse : cache_hit

      LMResponse : cost

      LMResponse : metadata





        LMResponse --> "0..1" Any : metadata
        click Any href "../Any/"



      LMResponse : model

      LMResponse : outputs





        LMResponse --> "1..*" LMOutput : outputs
        click LMOutput href "../LMOutput/"



      LMResponse : provider_data





        LMResponse --> "0..1" Any : provider_data
        click Any href "../Any/"



      LMResponse : response_id

      LMResponse : usage





        LMResponse --> "0..1" LMUsage : usage
        click LMUsage href "../LMUsage/"



Slots

Name Cardinality and Range Description Inheritance
model 0..1
ModelName
LiteLLM-style provider/model identifier direct
outputs 1..*
LMOutput
One or more generated candidates returned by the LM direct
usage 0..1
LMUsage
Token and timing usage for the request direct
cost 0..1
Float
Estimated USD cost for the request (when computable) direct
cache_hit 0..1
Boolean
Whether this response was served from DSPy's cache direct
response_id 0..1
Identifier
Provider-issued response id (when available) direct
provider_data 0..1
Any
Provider-specific raw payload preserved with a normalized object direct
metadata 0..1
Any
Opaque key/value metadata passed alongside an object direct

Usages

used by used in type used
LMHistoryEntry response range LMResponse

In Subsets

Identifier and Mapping Information

Schema Source

Mappings

Mapping Type Mapped Value
self dspy:LMResponse
native dspy:LMResponse

LinkML Source

Direct

name: LMResponse
description: Normalized result of one LM request (``dspy.LMResponse``).
in_subset:
- lm_contract
from_schema: https://w3id.org/lmodel/dspy
slots:
- model
- outputs
- usage
- cost
- cache_hit
- response_id
- provider_data
- metadata

Induced

name: LMResponse
description: Normalized result of one LM request (``dspy.LMResponse``).
in_subset:
- lm_contract
from_schema: https://w3id.org/lmodel/dspy
attributes:
  model:
    name: model
    description: LiteLLM-style ``provider/model`` identifier.
    from_schema: https://w3id.org/lmodel/dspy
    rank: 1000
    owner: LMResponse
    domain_of:
    - LMRequest
    - LMResponse
    - BaseLM
    - TrainingJob
    range: ModelName
  outputs:
    name: outputs
    description: One or more generated candidates returned by the LM.
    from_schema: https://w3id.org/lmodel/dspy
    rank: 1000
    owner: LMResponse
    domain_of:
    - LMResponse
    - LMHistoryEntry
    range: LMOutput
    multivalued: true
    inlined: true
    inlined_as_list: true
    minimum_cardinality: 1
  usage:
    name: usage
    description: Token and timing usage for the request.
    from_schema: https://w3id.org/lmodel/dspy
    rank: 1000
    owner: LMResponse
    domain_of:
    - LMResponse
    range: LMUsage
    inlined: true
  cost:
    name: cost
    description: Estimated USD cost for the request (when computable).
    from_schema: https://w3id.org/lmodel/dspy
    rank: 1000
    owner: LMResponse
    domain_of:
    - LMResponse
    range: float
    minimum_value: 0.0
  cache_hit:
    name: cache_hit
    description: Whether this response was served from DSPy's cache.
    from_schema: https://w3id.org/lmodel/dspy
    rank: 1000
    ifabsent: boolean(False)
    owner: LMResponse
    domain_of:
    - LMResponse
    range: boolean
  response_id:
    name: response_id
    description: Provider-issued response id (when available).
    from_schema: https://w3id.org/lmodel/dspy
    rank: 1000
    owner: LMResponse
    domain_of:
    - LMResponse
    range: Identifier
  provider_data:
    name: provider_data
    description: Provider-specific raw payload preserved with a normalized object.
    from_schema: https://w3id.org/lmodel/dspy
    rank: 1000
    owner: LMResponse
    domain_of:
    - ToolResult
    - LMToolCallPart
    - LMToolResultPart
    - LMToolSpec
    - LMOutput
    - LMResponse
    range: Any
  metadata:
    name: metadata
    description: Opaque key/value metadata passed alongside an object.
    from_schema: https://w3id.org/lmodel/dspy
    rank: 1000
    owner: LMResponse
    domain_of:
    - ToolResult
    - Citation
    - LMPart
    - LMMessage
    - LMToolSpec
    - LMRequest
    - LMUsage
    - LMOutput
    - LMResponse
    range: Any