Skip to content

ModelOutputThunk should not be a CBlock #269

Description

@nrfulton

Justification: Python pattern matching is based on order not specificity, so the following code never makes it into the second branch.

match span:
  case CBlock():
    handle cblocks generically
  case ModelOutputThunk():
    handle mots in particular
  case Component():
    handle more complex stuff

This is a footgun. The easiest solution is to simply remove mot from the cblock type hierarchy. There are no disadvanatges: anywhere we expect a cblock or a mot we should be explicit about that with a union type anyways, because mot.value is semantically different from cb.value

Metadata

Metadata

Labels

area/componentComponent type system, CBlock, @generative decorator, prompt templates, RichDocumentarea/stdlibCore abstractions: Context, MOT, SamplingStrategy, formatters, serializationarea/telemetryOTel spans, metrics, tracing, semconvenhancementNew feature or requestneeds-designProblem is clear; implementation approach needs design discussion before work starts

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions