feat: reasoning-aware response API - #44
Merged
Merged
Conversation
lmeyerov
force-pushed
the
feat/skills-fastapi-reasoning
branch
from
July 25, 2026 03:18
f694728 to
6754c52
Compare
lmeyerov
commented
Jul 25, 2026
Contributor
Author
There was a problem hiding this comment.
drop older ai/prompts/ in favor of these
lmeyerov
force-pushed
the
feat/skills-fastapi-reasoning
branch
from
July 25, 2026 21:44
88181e4 to
229f20a
Compare
Contributor
Author
|
Follow-up filed: #46 — exposing a streaming/iterator API for reasoning and phase events, plus the accumulator unification it depends on. Out of scope here; this PR's accessors are read after completion. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
Louie streams a run tree: provisional reasoning text, phase/status updates, traces, and a final answer. Today all of that collapses into
.textand the element list, so you cannot tell a draft from the answer, or see why a run failed.This makes the stream addressable — opt-in, and inert by default.
Opting in
include_reasoningisFalseeverywhere. With it off, behaviour is byte-identical to today.Reading the result
Plural and element-level forms exist alongside each:
final_texts,final_text_elements,final_text_element,final_answer_id,reasoning_texts,reasoning_elements,run_nodes,root_run,run_updates,phase_updates,token_flow,terminals,terminal.The same surface is on the notebook cursor, so
lui.reasoning_text,lui.status,lui.phaseswork identically.Why
.textis unchanged.textstays final-answer-oriented. Reasoning is reachable only through the explicit accessors, so turning oninclude_reasoningcannot leak drafts into the common path:Compatibility
Additive. Regression tests cover
.text,.df, the callable form, positional constructor args, legacy and concatenated JSONL, and responses with no reasoning at all. Classification is conservative: withinclude_reasoning=Falsethe parser preserves historical multi-text behaviour rather than guessing which element was "final".Review focus
src/louieai/_client.py— the parser is the substantive change; the accessors are thin views over it.src/louieai/notebook/cursor.py—.text/ reasoning separation.src/louieai/notebook/_html.py— escaping and URL validation for server-controlled render content.Docs
Rendered pages this PR edits (links are current
latest, i.e. pre-merge — this project has no RTD PR preview build, so they do not yet show these changes):To review the new copy before merge, read the
docs/diff, oruv run --locked mkdocs serve.Validation
CI-equivalent scope, lockfile toolchain (ruff 0.12.5 / mypy 1.17.0):
ruff check .,ruff format --check .,mypy .,uv lock --check, secret detection, strict MkDocs, doc tests: passNotes
mainafter security: make the secret-detection gates actually reject #45; this PR is reasoning-API only.real_client, replacing four local fixtures that each re-implemented auth.pyproject.tomladvertiseshttps://louieai.readthedocs.io, which 404s. The real site islouie-py.readthedocs.io, so the PyPI "Documentation" link is broken.🤖 Generated with Claude Code
https://claude.ai/code/session_01MyiG851jxkDkqB5u9gnpox