feat(core): stream_parsed_repr — streaming parsed representation on the MOT
I maintainer di solito rispondono entro 3 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start with ModelOutputThunk.parsed_repr, Component._parse, and the stream() primitive in issue #1440; the issue does not identify file paths or tests. First settle the incremental parsing contract, including yielded values, parser ownership, emission timing, errors, and multi-modal output. Done means the MOT exposes parsed values as output streams and streaming completion agrees with the existing whole-output parse across output types.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Add a streaming counterpart to ModelOutputThunk.parsed_repr: expose the MOT's typed parsed representation incrementally as the stream arrives, rather than only once at completion. stream_parsed_repr is to parsed_repr what astream() is to value.
This work is independent of the other Phase 2 issues. It depends only on the stream() primitive (#1440) and can proceed in parallel with per-validator chunking (#1441) and sampling (#403).
parsed_repr today
ModelOutputThunk is Generic[S]; parsed_repr: S | None is the typed interpretation of the output, populated exactly once at completion:
Componentaction:parsed_repr = action._parse(computed_mot)— the component's parser turns the finished output into its typed formS.CBlock/ModelOutputThunkaction:parsed_repr = value(raw string).
_parse is therefore a whole-output operation: it runs once, on the complete text, and yields the final S.
Scope
This issue covers only the streaming parsed representation. It is separate from:
- chunking — how a stream is split for validation (issues 1 and 2); a different concern with a different owner.
- validation —
stream_validateand the requirement flow are unaffected.
The original epic framing conflated MOT-owned chunking with stream_parsed_repr; these are now separate. This issue is strictly the parsed-representation stream.
Multi-modal output (audio segments, image regions, video) is in scope here, not a separate issue. A multi-modal MOT parses its stream into typed units the same way a text MOT parses into S, so the incremental-parse contract must admit non-text S. Multi-modal is a case of stream_parsed_repr, not a follow-on to it.
The core problem: incremental parsing
_parse is defined on the complete output. Producing meaningful intermediate S values from partial output is fundamentally harder than streaming raw text:
- A partial output may not be a valid
Syet — half a JSON object, a truncated structured value. - Each output type parses differently. Prose, JSON, structured outputs, and multi-modal each have their own notion of a partial parse.
The deliverable is therefore not a single function but a contract for parsing incrementally that each output type implements, plus the plumbing to expose it on the MOT.
Open questions
- Yielded type. Bare
S(assuming every intermediate is a validS), or a typed envelope carrying a best-effort partial parse plus a "settled vs. still forming" flag? Multi-modal and partial-JSON push toward an envelope; text-only is fine with bareS. (This is the A-vs-C fork from the epic notes, scoped to parsing.) - Parser source.
_parseis whole-output today. Does eachComponentgain an incremental-parse method, with a fallback that parses the accumulated text each time? Where does the default live? - Emit timing. On every delta, on a type-defined boundary (which risks re-tangling with chunking), or on demand when the caller asks?
- Relationship to
stream(). Isstream_parsed_reprconsumed throughStreameror directly off the MOT alongsideastream()? It needs the same single-consumer discipline asastream()/__aiter__(#1440's guard). - Backpressure. If parsing lags the raw token stream, where does the partial state live?
_GenerationState(from #909's structural cleanup) is a candidate. - Error handling. If incremental parsing fails on a not-yet-valid partial stream, does it surface, wait for more data, or fall back to raw?
- Testability. Each output type's
stream_parsed_reprmust be verifiable against its non-streamingparsed_repr: streaming then completing must agree with parsing the whole output. Needs a shared harness and multi-modal fixtures.
- Lingua principale
- Python
- Stelle
- 1.8k
- Fork
- 161
- Merge medio
- 4g 3h
- PR unite (30g)
- 45
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di generative-computing/mellea
-
bug: `mellea.plugins.builtin_debug.generation.log_generation_post_call` shows model as unknownApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
generative-computing/mellea#1864 ·
I maintainer di solito rispondono entro 3 giorni
-
bug: instruct() and react() replay tool-call turns without tool_callsForse già presa @simonyang08 l’ha presa 21 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
generative-computing/mellea#1784 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
-
Silently mangled docstrings: lone backslash line-continuations in non-raw docstrings collapse command examplesForse già presa @madhusudhan1260 l’ha presa 18 giorni fa. Apertagood first issue p2
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
generative-computing/mellea#1780 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 3 giorni
-
area/telemetry enhancement p2
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
generative-computing/mellea#1210 ·
I maintainer di solito rispondono entro 3 giorni
-
Add requirement priorityApertaarea/requirement area/stdlib enhancement p2
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
generative-computing/mellea#31 · 2 commenti ·
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di generative-computing/mellea
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
OpenFreeEnergy/openfe#2371 ·
I maintainer di solito rispondono entro 2 giorni
-
HMDB's smiles file writes "None" for metabolites with an empty <smiles/> (file not currently used)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
NCATSTranslator/Babel#1269 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 Mezza giornata Idoneità per principianti 80/100
I maintainer di solito rispondono entro 1 giorno
-
404 on sample dataApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
bcgov/nr-hydrometric-rating-curve#443 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100