how do i make it interactive like a chat instead of using --query
- User
how do i make it interactive like a chat instead of using --query
- Assistant
To make the dumb-dumb-code-checker interactive like a chat instead of using the
--querycommand-line option, you'll need to modify the code to continuously accept user input and process it in real time. Here's how you can do it:
Steps to Make It Interactive
-
Replace the
--queryCommand-Line Argument with a Loop for User Input
Modify therunfunction insrc/main.tsto enter a loop where it repeatedly asks the user for input. -
Use Node.js's
readlineModule for Input
Thereadlinemodule allows you to create an interactive command-line interface where users can enter queries dynamically. -
Refactor the Code to Handle Queries Dynamically
Instead of processing a single query provided via the--queryoption, dynamically process each query entered by the user.
Implementation Example
Here's how you can modify the code in
src/main.ts:Import
readlineAt the top of the file, add:
tsimport readline from 'node:readline';Update the
runFunctionReplace the logic for handling a single query with an interactive prompt:
ts -
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.