Skip to content

Class: LMMessage

Role-attributed sequence of LM parts (dspy.LMMessage).

URI: dspy:LMMessage

 classDiagram
    class LMMessage
    click LMMessage href "../LMMessage/"
      LMMessage : metadata





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



      LMMessage : name

      LMMessage : parts





        LMMessage --> "1..*" LMPart : parts
        click LMPart href "../LMPart/"



      LMMessage : role





        LMMessage --> "1" LMRole : role
        click LMRole href "../LMRole/"



Slots

Name Cardinality and Range Description Inheritance
role 1
LMRole
Conversational role of a message direct
parts 1..*
LMPart
Ordered content parts of an LM message or output direct
name 0..1
String
Short human-readable name direct
metadata 0..1
Any
Opaque key/value metadata passed alongside an object direct

Usages

used by used in type used
LMRequest messages range LMMessage

In Subsets

Identifier and Mapping Information

Annotations

property value
dspy_source_paths ['dspy/core/types.py']
dspy_source_urls ['https://github.com/stanfordnlp/dspy/blob/main/dspy/core/types.py']

Schema Source

Mappings

Mapping Type Mapped Value
self dspy:LMMessage
native dspy:LMMessage
close mcp:PromptMessage

LinkML Source

Direct

name: LMMessage
annotations:
  dspy_source_paths:
    tag: dspy_source_paths
    value:
    - dspy/core/types.py
  dspy_source_urls:
    tag: dspy_source_urls
    value:
    - https://github.com/stanfordnlp/dspy/blob/main/dspy/core/types.py
description: Role-attributed sequence of LM parts (``dspy.LMMessage``).
in_subset:
- lm_contract
from_schema: https://w3id.org/lmodel/dspy
close_mappings:
- mcp:PromptMessage
slots:
- role
- parts
- name
- metadata

Induced

name: LMMessage
annotations:
  dspy_source_paths:
    tag: dspy_source_paths
    value:
    - dspy/core/types.py
  dspy_source_urls:
    tag: dspy_source_urls
    value:
    - https://github.com/stanfordnlp/dspy/blob/main/dspy/core/types.py
description: Role-attributed sequence of LM parts (``dspy.LMMessage``).
in_subset:
- lm_contract
from_schema: https://w3id.org/lmodel/dspy
close_mappings:
- mcp:PromptMessage
attributes:
  role:
    name: role
    description: Conversational role of a message.
    from_schema: https://w3id.org/lmodel/dspy
    rank: 1000
    owner: LMMessage
    domain_of:
    - LMMessage
    range: LMRole
    required: true
  parts:
    name: parts
    description: Ordered content parts of an LM message or output.
    from_schema: https://w3id.org/lmodel/dspy
    rank: 1000
    owner: LMMessage
    domain_of:
    - LMMessage
    - LMOutput
    range: LMPart
    required: true
    multivalued: true
    inlined: true
    inlined_as_list: true
  name:
    name: name
    description: Short human-readable name.
    from_schema: https://w3id.org/lmodel/dspy
    rank: 1000
    slot_uri: rdfs:label
    owner: LMMessage
    domain_of:
    - NamedThing
    - LMToolCallPart
    - LMMessage
    - LMToolSpec
    range: string
  metadata:
    name: metadata
    description: Opaque key/value metadata passed alongside an object.
    from_schema: https://w3id.org/lmodel/dspy
    rank: 1000
    owner: LMMessage
    domain_of:
    - ToolResult
    - Citation
    - LMPart
    - LMMessage
    - LMToolSpec
    - LMRequest
    - LMUsage
    - LMOutput
    - LMResponse
    range: Any