diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index f932f257e..bcb68bb68 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -1246,7 +1246,7 @@ class Coder: self.io.tool_output("- Use /drop to remove unneeded files from the chat") self.io.tool_output("- Use /clear to clear the chat history") self.io.tool_output("- Break your code into smaller files") - proceed = "y" + proceed = "Y" self.io.tool_output( "It's probably safe to try and send the request, most providers won't charge if" " the context limit is exceeded." @@ -1255,14 +1255,14 @@ class Coder: # Special warning for Ollama models about context window size if self.main_model.name.startswith(("ollama/", "ollama_chat/")): extra_params = getattr(self.main_model, "extra_params", None) or {} - num_ctx = extra_params.get("num_ctx", 8192) - if max_input_tokens and max_input_tokens > num_ctx: - self.io.tool_waning( - f"Your Ollama model is configured with num_ctx={num_ctx} tokens of" - " context window\nSee" - " https://aider.chat/docs/llms/ollama.html#setting-the-context-window-size" - " for help configuring larger context windows." - ) + num_ctx = extra_params.get("num_ctx", 2048) + if input_tokens > num_ctx: + proceed = "N" + self.io.tool_warning(f""" +Your Ollama model is configured with num_ctx={num_ctx} tokens of context window. +You are attempting to send {input_tokens} tokens. +See https://aider.chat/docs/llms/ollama.html#setting-the-context-window-size +""".strip()) # noqa if proceed and not self.io.confirm_ask("Try to proceed anyway?", default=proceed): return False diff --git a/aider/io.py b/aider/io.py index 34be6f294..87bce5b17 100644 --- a/aider/io.py +++ b/aider/io.py @@ -732,6 +732,7 @@ class InputOutput: question, style=style, complete_while_typing=False, + default=default, ) else: res = input(question)