You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ifself.io.confirm_ask(f"Add {rel_fname} to the chat?", group=group, allow_never=True):
However in scripting this is inconvienient, because you can only use InputOutput(yes=True), which you have to declare BEFORE Coder.create or Coder.run
Example as is:
fromaider.codersimportCoderfromaider.modelsimportModelfromaider.ioimportInputOutput# This is a list of files to add to the chatfnames= ["greeting.py"]
model=Model("gpt-4-turbo")
# Create an io object (required) and optionally enable confirmations with yes=Trueio=InputOutput(yes=True)
# Create a coder objectcoder=Coder.create(main_model=model, io=io, fnames=fnames)
# This will execute one instruction on those files and then return the last LLM messageresult=coder.run("make a script that prints hello world")
print(result)
Instead, logically, you should be able to run something like this to see if you want to respond yes or not:
fnames= [] # Pretend we didn't give it the filename hereio=InputOutput(yes=None) # Don't set yes
...
result=coder.run("make a script that prints hello world. Use greetings.py") # Instead we gave it hereprint(result)
result: Do you want to add greetings.py to the context? [Y/n]
result=coder.run("yes") # Or maybe coder.answer to provide verification
Now result should equal result from the previous run.
Further, we should be able to load this from history!
the chat.history.md file should allow "unanswered" steps:
This function could be modified to scan for answered Y/n questions to things such as adding a file or url, and auto-rerunning those commands.
But further, if there is an unanswered "Y/n" followed by a user "/yes" or "/no" then it adds that to the chat history file as the answer, and then proceeds.
I am willing to implement the demo.
Version and model info
No response
The text was updated successfully, but these errors were encountered:
Issue
Right now
InputOutput.confirm_ask
is being used as part of a single "run" given a user input.aider/aider/coders/base_coder.py
Line 815 in 77d2bc5
aider/aider/coders/base_coder.py
Line 864 in 77d2bc5
aider/aider/coders/base_coder.py
Lines 855 to 858 in 77d2bc5
aider/aider/coders/base_coder.py
Line 1598 in 77d2bc5
However in scripting this is inconvienient, because you can only use
InputOutput(yes=True)
, which you have to declare BEFORECoder.create
orCoder.run
Example as is:
Instead, logically, you should be able to run something like this to see if you want to respond yes or not:
result: Do you want to add greetings.py to the context? [Y/n]
Now result should equal result from the previous run.
Further, we should be able to load this from history!
the chat.history.md file should allow "unanswered" steps:
aider/aider/coders/base_coder.py
Lines 464 to 468 in 77d2bc5
aider/aider/utils.py
Line 145 in 77d2bc5
This function could be modified to scan for answered Y/n questions to things such as adding a file or url, and auto-rerunning those commands.
But further, if there is an unanswered "Y/n" followed by a user "/yes" or "/no" then it adds that to the chat history file as the answer, and then proceeds.
I am willing to implement the demo.
Version and model info
No response
The text was updated successfully, but these errors were encountered: