fix(interactive): skip comment lines when reading requests from a file - #435
Open
Mohammed Alkindi (MohammedAlkindi) wants to merge 1 commit into
Open
Mohammed Alkindi (MohammedAlkindi) wants to merge 1 commit into
Mohammed Alkindi (MohammedAlkindi) wants to merge 1 commit into
Conversation
The Python port filters lines starting with '# ' before dispatching; the TypeScript one did not, so the header comments in the shipped healthData input.txt were sent to the translator as requests.
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.
processRequestsin the TypeScript port dispatches every non-empty line of an input file to the translator. The Python port skips comments first.python/src/typechat/_internal/interactive.py:typescript/src/interactive/interactive.tshad only theline.lengthcheck, so the header comments in the shipped example are sent as requests.typescript/examples/healthData/src/input.txtopens with#and# Conversations with a Health Data Agent, byte-identical in shape topython/examples/healthData/input.txt, which the Python demo skips.This aligns the TypeScript branch with the Python one exactly,
#prefix and all. Worth noting the parity is literal rather than improved: both ports still pass a bare#line through, since neither tests for it, and I left that alone rather than widening the change.npm install --ignore-scriptsthennpx tsc -p src --noEmitboth exit 0.Could not verify: there is no test file for
interactive.tson the TypeScript side, unlikepython/tests/test_interactive.py, so there is no existing suite to fail before and pass after.