mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-20 12:24:59 +00:00
feat: Add openrouter/openai/o1 model and update prompts
This commit is contained in:
parent
7dd1346878
commit
2aa4615c78
6 changed files with 57 additions and 19 deletions
|
@ -764,6 +764,15 @@ MODEL_SETTINGS = [
|
||||||
use_temperature=False,
|
use_temperature=False,
|
||||||
streaming=False,
|
streaming=False,
|
||||||
),
|
),
|
||||||
|
ModelSettings(
|
||||||
|
"openrouter/openai/o1",
|
||||||
|
"diff",
|
||||||
|
weak_model_name="openrouter/openai/gpt-4o-mini",
|
||||||
|
editor_model_name="openrouter/openai/gpt-4o",
|
||||||
|
editor_edit_format="editor-diff",
|
||||||
|
use_repo_map=True,
|
||||||
|
use_temperature=False,
|
||||||
|
),
|
||||||
ModelSettings(
|
ModelSettings(
|
||||||
"openrouter/qwen/qwen-2.5-coder-32b-instruct",
|
"openrouter/qwen/qwen-2.5-coder-32b-instruct",
|
||||||
"diff",
|
"diff",
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
watch_code_prompt = """
|
watch_code_prompt = """
|
||||||
Find the "AI" comments below (marked with █) in the code files I've shared with you.
|
Find the "AI" comments below (marked with █) in the code files I've shared with you.
|
||||||
They contain your instructions.
|
I've written your instructions there.
|
||||||
Make the requested changes.
|
Follow my instructions as given in the AI comments and make the requested changes.
|
||||||
Be sure to remove all these "AI" comments from the code!
|
Also, be sure to remove all the "AI" comments from the code too.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
watch_ask_prompt = """/ask
|
watch_ask_prompt = """/ask
|
||||||
Find the "AI" comments below (marked with █) in the code files I've shared with you.
|
Find the "AI" comments below (marked with █) in the code files I've shared with you.
|
||||||
They contain your questions you need to answer and other instructions.
|
They contain my questions that I need you to answer and other instructions for you.
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -2180,4 +2180,27 @@
|
||||||
date: 2024-12-11
|
date: 2024-12-11
|
||||||
versions: 0.68.1.dev
|
versions: 0.68.1.dev
|
||||||
seconds_per_case: 7.3
|
seconds_per_case: 7.3
|
||||||
|
total_cost: 0.0000
|
||||||
|
|
||||||
|
- dirname: 2024-12-18-01-50-08--o1
|
||||||
|
test_cases: 133
|
||||||
|
model: openrouter/openai/o1
|
||||||
|
edit_format: diff
|
||||||
|
commit_hash: 074c636-dirty
|
||||||
|
pass_rate_1: 65.4
|
||||||
|
pass_rate_2: 84.2
|
||||||
|
percent_cases_well_formed: 99.2
|
||||||
|
error_outputs: 1
|
||||||
|
num_malformed_responses: 1
|
||||||
|
num_with_malformed_responses: 1
|
||||||
|
user_asks: 0
|
||||||
|
lazy_comments: 0
|
||||||
|
syntax_errors: 0
|
||||||
|
indentation_errors: 0
|
||||||
|
exhausted_context_windows: 0
|
||||||
|
test_timeouts: 2
|
||||||
|
command: aider --model openrouter/openai/o1
|
||||||
|
date: 2024-12-18
|
||||||
|
versions: 0.69.2.dev
|
||||||
|
seconds_per_case: 29.9
|
||||||
total_cost: 0.0000
|
total_cost: 0.0000
|
|
@ -15,6 +15,17 @@ RUN apt-get update && apt-get install -y \
|
||||||
# Make python3.11 the default python3
|
# Make python3.11 the default python3
|
||||||
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
|
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
|
||||||
|
|
||||||
|
# Install Go
|
||||||
|
RUN curl -OL https://golang.org/dl/go1.21.5.linux-amd64.tar.gz && \
|
||||||
|
tar -C /usr/local -xzf go1.21.5.linux-amd64.tar.gz && \
|
||||||
|
rm go1.21.5.linux-amd64.tar.gz
|
||||||
|
ENV PATH="/usr/local/go/bin:${PATH}"
|
||||||
|
|
||||||
|
# Install Rust
|
||||||
|
ADD https://sh.rustup.rs /tmp/rustup.sh
|
||||||
|
RUN chmod +x /tmp/rustup.sh && /tmp/rustup.sh -y && rm /tmp/rustup.sh
|
||||||
|
ENV PATH="/root/.cargo/bin:${PATH}"
|
||||||
|
|
||||||
# Install Node.js and dependencies
|
# Install Node.js and dependencies
|
||||||
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
|
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
|
||||||
apt-get install -y nodejs && \
|
apt-get install -y nodejs && \
|
||||||
|
@ -33,17 +44,6 @@ RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
|
||||||
core-js@3.37.1 \
|
core-js@3.37.1 \
|
||||||
eslint@8.49.0
|
eslint@8.49.0
|
||||||
|
|
||||||
# Install Go
|
|
||||||
RUN curl -OL https://golang.org/dl/go1.21.5.linux-amd64.tar.gz && \
|
|
||||||
tar -C /usr/local -xzf go1.21.5.linux-amd64.tar.gz && \
|
|
||||||
rm go1.21.5.linux-amd64.tar.gz
|
|
||||||
ENV PATH="/usr/local/go/bin:${PATH}"
|
|
||||||
|
|
||||||
# Install Rust
|
|
||||||
ADD https://sh.rustup.rs /tmp/rustup.sh
|
|
||||||
RUN chmod +x /tmp/rustup.sh && /tmp/rustup.sh -y && rm /tmp/rustup.sh
|
|
||||||
ENV PATH="/root/.cargo/bin:${PATH}"
|
|
||||||
|
|
||||||
COPY . /aider
|
COPY . /aider
|
||||||
RUN pip3 install --no-cache-dir --upgrade pip uv
|
RUN pip3 install --no-cache-dir --upgrade pip uv
|
||||||
RUN uv pip install --system --no-cache-dir -e /aider[dev]
|
RUN uv pip install --system --no-cache-dir -e /aider[dev]
|
||||||
|
|
|
@ -416,6 +416,7 @@ def load_results(dirname):
|
||||||
results = json.loads(fname.read_text())
|
results = json.loads(fname.read_text())
|
||||||
all_results.append(results)
|
all_results.append(results)
|
||||||
except json.JSONDecodeError:
|
except json.JSONDecodeError:
|
||||||
|
print("json.JSONDecodeError", fname)
|
||||||
continue
|
continue
|
||||||
return all_results
|
return all_results
|
||||||
|
|
||||||
|
@ -655,7 +656,9 @@ def run_test_real(
|
||||||
config = json.loads(f.read())
|
config = json.loads(f.read())
|
||||||
|
|
||||||
# Get solution and test files from config
|
# Get solution and test files from config
|
||||||
solution_files = config.get("files", {}).get("solution", [])
|
solution_files = set(config.get("files", {}).get("solution", []))
|
||||||
|
solution_files.discard("Cargo.toml")
|
||||||
|
|
||||||
test_files = config.get("files", {}).get("test", [])
|
test_files = config.get("files", {}).get("test", [])
|
||||||
|
|
||||||
# Copy all solution files
|
# Copy all solution files
|
||||||
|
@ -743,7 +746,10 @@ def run_test_real(
|
||||||
# auto_lint=False, # disabled for code-in-json experiments
|
# auto_lint=False, # disabled for code-in-json experiments
|
||||||
cache_prompts=True,
|
cache_prompts=True,
|
||||||
suggest_shell_commands=False,
|
suggest_shell_commands=False,
|
||||||
|
ignore_mentions=set(test_files),
|
||||||
)
|
)
|
||||||
|
dump(coder.ignore_mentions)
|
||||||
|
|
||||||
coder.max_apply_update_errors = max_apply_update_errors
|
coder.max_apply_update_errors = max_apply_update_errors
|
||||||
coder.show_announcements()
|
coder.show_announcements()
|
||||||
|
|
||||||
|
@ -851,7 +857,7 @@ def run_unit_tests(original_dname, testdir, history_fname, test_files):
|
||||||
# Map of file extensions to test commands
|
# Map of file extensions to test commands
|
||||||
TEST_COMMANDS = {
|
TEST_COMMANDS = {
|
||||||
".py": ["pytest"],
|
".py": ["pytest"],
|
||||||
".rs": ["cargo", "test", "--", "--include-ignored"],
|
".rs": ["cargo", "test", "--offline", "--", "--include-ignored"],
|
||||||
".cs": ["dotnet", "test"],
|
".cs": ["dotnet", "test"],
|
||||||
".go": ["go", "test", "./..."],
|
".go": ["go", "test", "./..."],
|
||||||
".js": ["/aider/benchmark/npm-test.sh"],
|
".js": ["/aider/benchmark/npm-test.sh"],
|
||||||
|
|
|
@ -3,7 +3,7 @@ instructions_addendum = """
|
||||||
|
|
||||||
Use the above instructions to modify the supplied files: {file_list}
|
Use the above instructions to modify the supplied files: {file_list}
|
||||||
Don't change the names of existing functions or classes, as they may be referenced from other code like unit tests, etc.
|
Don't change the names of existing functions or classes, as they may be referenced from other code like unit tests, etc.
|
||||||
Only use standard python libraries, don't suggest installing any packages.
|
Only use standard libraries, don't suggest installing any packages.
|
||||||
""" # noqa: E501
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,6 +11,6 @@ test_failures = """
|
||||||
####
|
####
|
||||||
|
|
||||||
See the testing errors above.
|
See the testing errors above.
|
||||||
The tests are correct.
|
The tests are correct, don't try and change them.
|
||||||
Fix the code in {file_list} to resolve the errors.
|
Fix the code in {file_list} to resolve the errors.
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue