Skip to content

Class: Example

Flexible data container for DSPy examples (trainset rows). Maps to dspy.Example.

URI: dspy:Example

 classDiagram
    class Example
    click Example href "../Example/"
      NamedThing <|-- Example
        click NamedThing href "../NamedThing/"


      Example <|-- Prediction
        click Prediction href "../Prediction/"


      Example : description

      Example : fields





        Example --> "*" ExampleField : fields
        click ExampleField href "../ExampleField/"



      Example : id

      Example : input_keys

      Example : name

Inheritance

Class Properties

Property Value
Class URI dspy:Example

Slots

Name Cardinality and Range Description Inheritance
fields *
ExampleField
Named scalar fields carried by an Example / Prediction direct
input_keys *
String
Subset of fields flagged as inputs via ``with_inputs( direct
id 1
Identifier
Stable opaque identifier for an instance NamedThing
name 0..1
String
Short human-readable name NamedThing
description 0..1
String
Free-form description NamedThing

Usages

used by used in type used
Completions candidates range Example
Predictor demos range Example
Predictor train range Example
Predict demos range Example
Predict train range Example
ChainOfThought demos range Example
ChainOfThought train range Example
MultiChainComparison demos range Example
MultiChainComparison train range Example
ReAct demos range Example
ReAct train range Example
ReActV2 demos range Example
ReActV2 train range Example
ProgramOfThought demos range Example
ProgramOfThought train range Example
CodeAct demos range Example
CodeAct train range Example
KNN trainset range Example
EvaluationRow example range Example
Evaluate devset range Example
Dataset trainset range Example
Dataset devset range Example
Dataset testset range Example
Colors trainset range Example
Colors devset range Example
Colors testset range Example
HotPotQA trainset range Example
HotPotQA devset range Example
HotPotQA testset range Example
MATH trainset range Example
MATH devset range Example
MATH testset range Example
AlfWorld trainset range Example
AlfWorld devset range Example
AlfWorld testset range Example
GSM8K trainset range Example
GSM8K devset range Example
GSM8K testset range Example

In Subsets

Identifier and Mapping Information

Annotations

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

Schema Source

Mappings

Mapping Type Mapped Value
self dspy:Example
native dspy:Example
related uco_core:UcoObject

LinkML Source

Direct

name: Example
annotations:
  dspy_source_paths:
    tag: dspy_source_paths
    value:
    - dspy/primitives/example.py
  dspy_source_urls:
    tag: dspy_source_urls
    value:
    - https://github.com/stanfordnlp/dspy/blob/main/dspy/primitives/example.py
description: Flexible data container for DSPy examples (trainset rows). Maps to ``dspy.Example``.
in_subset:
- core
from_schema: https://w3id.org/lmodel/dspy
related_mappings:
- uco_core:UcoObject
is_a: NamedThing
slots:
- fields
- input_keys
class_uri: dspy:Example

Induced

name: Example
annotations:
  dspy_source_paths:
    tag: dspy_source_paths
    value:
    - dspy/primitives/example.py
  dspy_source_urls:
    tag: dspy_source_urls
    value:
    - https://github.com/stanfordnlp/dspy/blob/main/dspy/primitives/example.py
description: Flexible data container for DSPy examples (trainset rows). Maps to ``dspy.Example``.
in_subset:
- core
from_schema: https://w3id.org/lmodel/dspy
related_mappings:
- uco_core:UcoObject
is_a: NamedThing
attributes:
  fields:
    name: fields
    description: Named scalar fields carried by an ``Example`` / ``Prediction``.
    from_schema: https://w3id.org/lmodel/dspy
    rank: 1000
    owner: Example
    domain_of:
    - Example
    range: ExampleField
    multivalued: true
    inlined: true
    inlined_as_list: true
  input_keys:
    name: input_keys
    description: Subset of ``fields`` flagged as inputs via ``with_inputs(...)``.
    from_schema: https://w3id.org/lmodel/dspy
    rank: 1000
    owner: Example
    domain_of:
    - Example
    range: string
    multivalued: true
  id:
    name: id
    description: Stable opaque identifier for an instance.
    from_schema: https://w3id.org/lmodel/dspy
    rank: 1000
    slot_uri: schema:identifier
    identifier: true
    owner: Example
    domain_of:
    - NamedThing
    range: Identifier
    required: true
  name:
    name: name
    description: Short human-readable name.
    from_schema: https://w3id.org/lmodel/dspy
    rank: 1000
    slot_uri: rdfs:label
    owner: Example
    domain_of:
    - NamedThing
    - LMToolCallPart
    - LMMessage
    - LMToolSpec
    range: string
  description:
    name: description
    description: Free-form description.
    from_schema: https://w3id.org/lmodel/dspy
    rank: 1000
    slot_uri: dct:description
    owner: Example
    domain_of:
    - NamedThing
    - LMToolSpec
    range: string
class_uri: dspy:Example