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 would need to modify its implementation to facilitate real-time user input and output, allowing for a conversational interface. Below are steps and suggestions on how to achieve this:Steps to Implement an Interactive Chat Interface
-
Replace Command Line Input with Real-time Input:
- Instead of taking a single input from the command line through
--query, implement a loop that continuously accepts user input. - This can be achieved using
readlineor similar Node.js libraries to handle standard input and output.
- Instead of taking a single input from the command line through
-
Set Up a Loop for Conversation:
- Create a loop that will repeatedly prompt the user for input and process each query interactively.
- After processing the input with the existing logic, output the results back to the user and prompt for the next query.
-
Modify the
runFunction:- The current
runfunction needs to be refactored to accept continuous input instead of a single query. You can useasyncfunctions to handle the asynchronous nature of the chat interactions.
- The current
-
Example Code for Interactive Input: Here’s a basic implementation to demonstrate how you might modify the existing code:
typescript
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.