Commit graph

531 commits

Author SHA1 Message Date
Krazer
f3b5eae778 remove duplicates 2024-06-11 13:30:18 -05:00
Krazer
d819d52f82 add current directory 2024-06-11 13:18:43 -05:00
Krazer
acccbb1512 update command line arg 2024-06-11 13:14:22 -05:00
Krazer
d91707f73e all models to be registered with litellm 2024-06-11 13:07:19 -05:00
Paul Gauthier
05a74d67de finished --vim 2024-06-10 21:16:33 -07:00
Paul Gauthier
eddf31b38f Fix duplicate import and remove redundant code for setting editing mode in main function. 2024-06-10 21:11:29 -07:00
Paul Gauthier
b30077daee Add support for different editing modes in the main function. 2024-06-10 21:10:10 -07:00
Paul Gauthier
e63cc92cb9 Set editing mode based on user input before initializing InputOutput. 2024-06-10 21:10:04 -07:00
Paul Gauthier
196c1314eb Add support for VI editing mode in the terminal. 2024-06-10 21:09:46 -07:00
Paul Gauthier
d30b21139b aider: Skip commit action when running --commit --dry-run.
# Aider chat conversation:

USER: https://github.com/paul-gauthier/aider/issues/663

https://github.com/paul-gauthier/aider/issues/663:

[Skip to content](#start-of-content)

## Navigation Menu

Toggle navigation

[](https://github.com/)

[Sign
in](/login?return_to=https%3A%2F%2Fgithub.com%2Fpaul-gauthier%2Faider%2Fissues%2F663)

-   Product

    -   [](https://github.com/features/actions)

        Actions

        Automate any workflow

    -   [](https://github.com/features/packages)

        Packages

        Host and manage packages

    -   [](https://github.com/features/security)

        Security

        Find and fix vulnerabilities

    -   [](https://github.com/features/codespaces)

        Codespaces

        Instant dev environments

    -   [](https://github.com/features/copilot)

        GitHub Copilot

        Write better code with AI

    -   [](https://github.com/features/code-review)

        Code review

        Manage code changes

    -   [](https://github.com/features/issues)

        Issues

        Plan and track work

    -   [](https://github.com/features/discussions)

        Discussions

        Collaborate outside of code

    Explore
    -   [All features](https://github.com/features)
    -   [Documentation](https://docs.github.com)
    -   [GitHub Skills](https://skills.github.com)
    -   [Blog](https://github.blog)

-   Solutions

    For
    -   [Enterprise](https://github.com/enterprise)
    -   [Teams](https://github.com/team)
    -   [Startups](https://github.com/enterprise/startups)
    -   [Education](https://education.github.com)

    By Solution
    -   [CI/CD & Automation](https://github.com/solutions/ci-cd)
    -   [DevOps](https://github.com/solutions/devops)
    -   [DevSecOps](https://resources.github.com/devops/fundamentals/devsecops)

    Resources
    -   [Learning Pathways](https://resources.github.com/learn/pathways)
    -   [White papers, Ebooks, Webinars](https://resources.github.com)
    -   [Customer Stories](https://github.com/customer-stories)
    -   [Partners](https://partner.github.com)

-   Open Source

    -   [](/sponsors)

        GitHub Sponsors

        Fund open source developers

    -   [](https://github.com/readme)

        The ReadME Project

        GitHub community articles

    Repositories
    -   [Topics](https://github.com/topics)
    -   [Trending](https://github.com/trending)
    -   [Collections](https://github.com/collections)

-   Enterprise

    -   [](/enterprise)

        Enterprise platform

        AI-powered developer platform

    Available add-ons
    -   [](https://github.com/enterprise/advanced-security)

        Advanced Security

        Enterprise-grade security features

    -   [](/features/copilot#enterprise)

        GitHub Copilot

        Enterprise-grade AI features

    -   [](/premium-support)

        Premium Support

        Enterprise-grade 24/7 support

-   [Pricing](https://github.com/pricing)

Search or jump to\...

# Search code, repositories, users, issues, pull requests\...

Search

Clear

[Search syntax
tips](https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax)

# Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

# Saved searches

## Use saved searches to filter your results more quickly

Name

Query

To see all available qualifiers, see our
[documentation](https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax).

Cancel

Create saved search

[Sign
in](/login?return_to=https%3A%2F%2Fgithub.com%2Fpaul-gauthier%2Faider%2Fissues%2F663)

[Sign
up](/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=paul-gauthier%2Faider)

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

{{ message }}

::: {role="main"}

[paul-gauthier](/paul-gauthier) / **[aider](/paul-gauthier/aider)**
Public

-   [Notifications](/login?return_to=%2Fpaul-gauthier%2Faider) You must
    be signed in to change notification settings

-   [Fork 1.1k](/login?return_to=%2Fpaul-gauthier%2Faider)

-

    [ Star 11.3k](/login?return_to=%2Fpaul-gauthier%2Faider)

-   [Code ](/paul-gauthier/aider)
-   [Issues 59](/paul-gauthier/aider/issues)
-   [Pull requests 14](/paul-gauthier/aider/pulls)
-   [Actions ](/paul-gauthier/aider/actions)
-   [Projects 0](/paul-gauthier/aider/projects)
-   [Security](/paul-gauthier/aider/security)
-   [Insights ](/paul-gauthier/aider/pulse)

Additional navigation options

-   [ Code ](/paul-gauthier/aider)
-   [ Issues ](/paul-gauthier/aider/issues)
-   [ Pull requests ](/paul-gauthier/aider/pulls)
-   [ Actions ](/paul-gauthier/aider/actions)
-   [ Projects ](/paul-gauthier/aider/projects)
-   [ Security ](/paul-gauthier/aider/security)
-   [ Insights ](/paul-gauthier/aider/pulse)

New issue

**Have a question about this project?** Sign up for a free GitHub
account to open an issue and contact its maintainers and the community.

[Sign up for
GitHub](/signup?return_to=%2Fpaul-gauthier%2Faider%2Fissues%2Fnew%2Fchoose)

By clicking "Sign up for GitHub", you agree to our [terms of
service](https://docs.github.com/terms) and [privacy
statement](https://docs.github.com/privacy). We'll occasionally send you
account related emails.

Already on GitHub? [Sign
in](/login?return_to=%2Fpaul-gauthier%2Faider%2Fissues%2Fnew%2Fchoose)
to your account

[Jump to bottom](#issue-comment-box)

# Running \--commit \--dry-run should not actually make the commit #663

Open

[paul-gauthier](/paul-gauthier) opened this issue Jun 10, 2024 · 0
comments

Open

# [Running \--commit \--dry-run should not actually make the commit](#top) #663

[paul-gauthier](/paul-gauthier) opened this issue Jun 10, 2024 · 0
comments

Labels

[bug](/paul-gauthier/aider/labels/bug) Something isn\'t working

## Comments

[](/paul-gauthier)

Copy link

Owner

###

**[paul-gauthier](/paul-gauthier)** commented [Jun 10,
2024](#issue-2344397167)

+-----------------------------------------------------------------------+
| ### Issue                                                             |
|                                                                       |
| Per discord:                                                          |
|                                                                       |
| <https://discord.com/                                                 |
| channels/1131200896827654144/1133060505792159755/1249568492634509344> |
|                                                                       |
| ### Version and model info                                            |
|                                                                       |
| *No response*                                                         |
+-----------------------------------------------------------------------+
|                                                                       |
|                                                                       |
| The text was updated successfully, but these errors were encountered: |
|                                                                       |
|                                                                       |
+-----------------------------------------------------------------------+

All reactions

[paul-gauthier](/paul-gauthier) added the
[bug](/paul-gauthier/aider/labels/bug) Something isn\'t working label
[Jun 10, 2024](#event-13104705978)

[Sign up for free](/join?source=comment-repo) **to join this
conversation on GitHub**. Already have an account? [Sign in to
comment](/login?return_to=https%3A%2F%2Fgithub.com%2Fpaul-gauthier%2Faider%2Fissues%2F663)

Assignees

No one assigned

Labels

[bug](/paul-gauthier/aider/labels/bug) Something isn\'t working

Projects

None yet

Milestone

No milestone

Development

No branches or pull requests

1 participant

:::

## Footer

[](https://github.com) © 2024 GitHub, Inc.

### Footer navigation

-   [Terms](https://docs.github.com/site-policy/github-terms/github-terms-of-service)
-   [Privacy](https://docs.github.com/site-policy/privacy-policies/github-privacy-statement)
-   [Security](https://github.com/security)
-   [Status](https://www.githubstatus.com/)
-   [Docs](https://docs.github.com/)
-   [Contact](https://support.github.com?tags=dotcom-footer)
-   Manage cookies
-   Do not share my personal information

You can't perform that action at this time.

ASSISTANT: To address the issue where running `--commit --dry-run` should not actually make the commit, we need to modify the `main.py` file to ensure that the commit action is skipped when `--dry-run` is specified.

Here are the steps to implement this:

1. Check if `args.dry_run` is set before performing the commit action.
2. If `args.dry_run` is set, skip the commit action and print a message indicating that the commit is being skipped due to the dry run.

Let's implement these changes:

aider/main.py
```python
<<<<<<< SEARCH
    if args.commit:
        coder.commands.cmd_commit()
        return
=======
    if args.commit:
        if args.dry_run:
            io.tool_output("Dry run enabled, skipping commit.")
        else:
            coder.commands.cmd_commit()
        return
>>>>>>> REPLACE
```

This change ensures that when `--dry-run` is specified along with `--commit`, the commit action is skipped, and a message is printed to indicate this.
2024-06-10 15:54:56 -07:00
Paul Gauthier
bde80e4577 aider: Handle the case where the ~/.gitconfig file is missing or does not contain the user.name entry.
# Aider chat conversation:

USER: https://github.com/paul-gauthier/aider/issues/662

https://github.com/paul-gauthier/aider/issues/662:

[Skip to content](#start-of-content)

## Navigation Menu

Toggle navigation

[](https://github.com/)

[Sign
in](/login?return_to=https%3A%2F%2Fgithub.com%2Fpaul-gauthier%2Faider%2Fissues%2F662)

-   Product

    -   [](https://github.com/features/actions)

        Actions

        Automate any workflow

    -   [](https://github.com/features/packages)

        Packages

        Host and manage packages

    -   [](https://github.com/features/security)

        Security

        Find and fix vulnerabilities

    -   [](https://github.com/features/codespaces)

        Codespaces

        Instant dev environments

    -   [](https://github.com/features/copilot)

        GitHub Copilot

        Write better code with AI

    -   [](https://github.com/features/code-review)

        Code review

        Manage code changes

    -   [](https://github.com/features/issues)

        Issues

        Plan and track work

    -   [](https://github.com/features/discussions)

        Discussions

        Collaborate outside of code

    Explore
    -   [All features](https://github.com/features)
    -   [Documentation](https://docs.github.com)
    -   [GitHub Skills](https://skills.github.com)
    -   [Blog](https://github.blog)

-   Solutions

    For
    -   [Enterprise](https://github.com/enterprise)
    -   [Teams](https://github.com/team)
    -   [Startups](https://github.com/enterprise/startups)
    -   [Education](https://education.github.com)

    By Solution
    -   [CI/CD & Automation](https://github.com/solutions/ci-cd)
    -   [DevOps](https://github.com/solutions/devops)
    -   [DevSecOps](https://resources.github.com/devops/fundamentals/devsecops)

    Resources
    -   [Learning Pathways](https://resources.github.com/learn/pathways)
    -   [White papers, Ebooks, Webinars](https://resources.github.com)
    -   [Customer Stories](https://github.com/customer-stories)
    -   [Partners](https://partner.github.com)

-   Open Source

    -   [](/sponsors)

        GitHub Sponsors

        Fund open source developers

    -   [](https://github.com/readme)

        The ReadME Project

        GitHub community articles

    Repositories
    -   [Topics](https://github.com/topics)
    -   [Trending](https://github.com/trending)
    -   [Collections](https://github.com/collections)

-   Enterprise

    -   [](/enterprise)

        Enterprise platform

        AI-powered developer platform

    Available add-ons
    -   [](https://github.com/enterprise/advanced-security)

        Advanced Security

        Enterprise-grade security features

    -   [](/features/copilot#enterprise)

        GitHub Copilot

        Enterprise-grade AI features

    -   [](/premium-support)

        Premium Support

        Enterprise-grade 24/7 support

-   [Pricing](https://github.com/pricing)

Search or jump to\...

# Search code, repositories, users, issues, pull requests\...

Search

Clear

[Search syntax
tips](https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax)

# Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

# Saved searches

## Use saved searches to filter your results more quickly

Name

Query

To see all available qualifiers, see our
[documentation](https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax).

Cancel

Create saved search

[Sign
in](/login?return_to=https%3A%2F%2Fgithub.com%2Fpaul-gauthier%2Faider%2Fissues%2F662)

[Sign
up](/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=paul-gauthier%2Faider)

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

{{ message }}

::: {role="main"}

[paul-gauthier](/paul-gauthier) / **[aider](/paul-gauthier/aider)**
Public

-   [Notifications](/login?return_to=%2Fpaul-gauthier%2Faider) You must
    be signed in to change notification settings

-   [Fork 1.1k](/login?return_to=%2Fpaul-gauthier%2Faider)

-

    [ Star 11.3k](/login?return_to=%2Fpaul-gauthier%2Faider)

-   [Code ](/paul-gauthier/aider)
-   [Issues 59](/paul-gauthier/aider/issues)
-   [Pull requests 14](/paul-gauthier/aider/pulls)
-   [Actions ](/paul-gauthier/aider/actions)
-   [Projects 0](/paul-gauthier/aider/projects)
-   [Security](/paul-gauthier/aider/security)
-   [Insights ](/paul-gauthier/aider/pulse)

Additional navigation options

-   [ Code ](/paul-gauthier/aider)
-   [ Issues ](/paul-gauthier/aider/issues)
-   [ Pull requests ](/paul-gauthier/aider/pulls)
-   [ Actions ](/paul-gauthier/aider/actions)
-   [ Projects ](/paul-gauthier/aider/projects)
-   [ Security ](/paul-gauthier/aider/security)
-   [ Insights ](/paul-gauthier/aider/pulse)

New issue

**Have a question about this project?** Sign up for a free GitHub
account to open an issue and contact its maintainers and the community.

[Sign up for
GitHub](/signup?return_to=%2Fpaul-gauthier%2Faider%2Fissues%2Fnew%2Fchoose)

By clicking "Sign up for GitHub", you agree to our [terms of
service](https://docs.github.com/terms) and [privacy
statement](https://docs.github.com/privacy). We'll occasionally send you
account related emails.

Already on GitHub? [Sign
in](/login?return_to=%2Fpaul-gauthier%2Faider%2Fissues%2Fnew%2Fchoose)
to your account

[Jump to bottom](#issue-comment-box)

# Ugly crash during startup when `~/.gitconfig` is missing \[user\] #662

Open

[Megamannen](/Megamannen) opened this issue Jun 10, 2024 · 1 comment

Open

# [Ugly crash during startup when `~/.gitconfig` is missing \[user\]](#top) #662

[Megamannen](/Megamannen) opened this issue Jun 10, 2024 · 1 comment

## Comments

[](/Megamannen)

Copy link

###

**[Megamannen](/Megamannen)** commented [Jun 10,
2024](#issue-2343705266)

+-----------------------------------------------------------------------+
| ### Issue                                                             |
|                                                                       |
| This is my `~/.gitconfig`                                             |
|                                                                       |
|                                                                       |
|                                                                       |
|     [safe]                                                            |
|         directory = /home/mega/Projects                               |
|                                                                       |
|                                                                       |
|                                                                       |
|                                                                       |
|                                                                       |
|                                                                       |
|                                                                       |
| This is the output:                                                   |
|                                                                       |
|                                                                       |
|                                                                       |
|     aider                                                             |
|     Traceback (most recent call last):                                |
|       File "/usr/lib/python3.12/configparser.py", line 767, in get    |
|         value = d[option]                                             |
|                 ~^^^^^^^^                                             |
|       File "/u                                                        |
| sr/lib/python3.12/collections/__init__.py", line 1015, in __getitem__ |
|         return self.__m                                               |
| issing__(key)            # support subclasses that define __missing__ |
|                ^^^^^^^^^^^^^^^^^^^^^                                  |
|       File "/u                                                        |
| sr/lib/python3.12/collections/__init__.py", line 1007, in __missing__ |
|         raise KeyError(key)                                           |
|     KeyError: 'name'                                                  |
|                                                                       |
|                                                                       |
|   During handling of the above exception, another exception occurred: |
|                                                                       |
|     Traceback (most recent call last):                                |
|       File "/home/mega/.local/bin/aider", line 8, in <module>         |
|         sys.exit(main())                                              |
|                  ^^^^^^                                               |
|       File "/home/mega/.local/share/pipx/venvs/aide                   |
| r-chat/lib/python3.12/site-packages/aider/main.py", line 306, in main |
|         git_root = setup_git(git_root, io)                            |
|                    ^^^^^^^^^^^^^^^^^^^^^^^                            |
|       File "/home/mega/.local/share/pipx/venvs/aider-ch               |
| at/lib/python3.12/site-packages/aider/main.py", line 68, in setup_git |
|         user_name = config.get_value("user", "name", None)            |
|                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^            |
|       File "/home/mega/.local/share/pipx/venvs/aider-cha              |
| t/lib/python3.12/site-packages/git/config.py", line 793, in get_value |
|         valuestr = self.get(section, option)                          |
|                    ^^^^^^^^^^^^^^^^^^^^^^^^^                          |
|       File "/home/mega/.local/share/pipx/venvs/aider-chat/lib/pyth    |
| on3.12/site-packages/git/config.py", line 114, in assure_data_present |
|         return func(self, *args, **kwargs)                            |
|                ^^^^^^^^^^^^^^^^^^^^^^^^^^^                            |
|       File "/usr/lib/python3.12/configparser.py", line 770, in get    |
|         raise NoOptionError(option, section)                          |
|     configparser.NoOptionError: No option 'name' in section: 'user'   |
|                                                                       |
|                                                                       |
|                                                                       |
|                                                                       |
|                                                                       |
|                                                                       |
|                                                                       |
| I added my user info to .gitconfig and it works                       |
|                                                                       |
| ### Version and model info                                            |
|                                                                       |
| Aider: v0.37.0                                                        |
+-----------------------------------------------------------------------+
|                                                                       |
|                                                                       |
| The text was updated successfully, but these errors were encountered: |
|                                                                       |
|                                                                       |
+-----------------------------------------------------------------------+

All reactions

Copy link

Owner

###

**[paul-gauthier](/paul-gauthier)** commented [Jun 10,
2024](#issuecomment-2159441132)

+-----------------------------------------------------------------------+
| Thanks for trying aider and filing this issue.                        |
|                                                                       |
| I am unable to reproduce this issue. I made my `~/.gitconfig` the     |
| same as yours and aider does the expected thing:                      |
|                                                                       |
|                                                                       |
|                                                                       |
|     $ git init                                                        |
|                                                                       |
|     $ aider                                                           |
|     Update git name with: git config user.name "Your Name"            |
|     Update git email with: git config user.email "you@example.com"    |
|     ...                                                               |
|                                                                       |
|                                                                       |
|                                                                       |
|                                                                       |
|                                                                       |
|                                                                       |
|                                                                       |
| Can you describe more clearly how to reproduce?                       |
+-----------------------------------------------------------------------+

All reactions

Sorry, something went wrong.

[Sign up for free](/join?source=comment-repo) **to join this
conversation on GitHub**. Already have an account? [Sign in to
comment](/login?return_to=https%3A%2F%2Fgithub.com%2Fpaul-gauthier%2Faider%2Fissues%2F662)

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

No branches or pull requests

2 participants

:::

## Footer

[](https://github.com) © 2024 GitHub, Inc.

### Footer navigation

-   [Terms](https://docs.github.com/site-policy/github-terms/github-terms-of-service)
-   [Privacy](https://docs.github.com/site-policy/privacy-policies/github-privacy-statement)
-   [Security](https://github.com/security)
-   [Status](https://www.githubstatus.com/)
-   [Docs](https://docs.github.com/)
-   [Contact](https://support.github.com?tags=dotcom-footer)
-   Manage cookies
-   Do not share my personal information

You can't perform that action at this time.

ASSISTANT: To address the issue described in https://github.com/paul-gauthier/aider/issues/662, we need to handle the case where the `~/.gitconfig` file is missing or does not contain the `user.name` entry. The most likely file to need changes is:

- `aider/main.py`

Please add `aider/main.py` to the chat so I can propose the necessary changes.

USER: I added these files to the chat: aider/main.py.

If you need to propose edits to other existing files not already added to the chat, you *MUST* tell the me their full path names and ask me to *add the files to the chat*. End your reply and wait for my approval. You can keep asking if you then decide you need to edit more files.

ASSISTANT: To handle the case where the `~/.gitconfig` file is missing or does not contain the `user.name` entry, we need to catch the `configparser.NoOptionError` exception and handle it gracefully.

Here are the changes needed:

1. Modify the `setup_git` function to handle the `configparser.NoOptionError` exception.

aider/main.py
```python
<<<<<<< SEARCH
        except configparser.NoSectionError:
=======
        except (configparser.NoSectionError, configparser.NoOptionError):
>>>>>>> REPLACE
```

This change will ensure that the code handles the case where the `user.name` or `user.email` is missing in the `~/.gitconfig` file without crashing.
2024-06-10 15:52:57 -07:00
Daniel Vainsencher
e6e360a4ef Added support for logging LLM history to a specified file. 2024-06-07 10:40:32 -04:00
Paul Gauthier
9c28bbc98e Refactored linting process and error handling in commands. 2024-05-20 08:55:49 -07:00
Paul Gauthier
afd827b9d9 aider: Fixed f-string error and added missing blank line before the main function.
# Aider chat conversation:

USER: # Fix any errors below, if possible.

## Running: flake8 aider/main.py

aider/main.py:195:27: F541 f-string is missing placeholders
aider/main.py:202:1: E302 expected 2 blank lines, found 1

## See relevant lines below marked with █.

aider/main.py:
...⋮...
180│def parse_lint_cmds(lint_cmds, io):
181│    err = False
182│    res = dict()
183│    for lint_cmd in lint_cmds:
184│        pieces = lint_cmd.split(":")
...⋮...
191│        if lang and cmd:
192│            res[lang] = cmd
193│        else:
194│            io.tool_error(f'Unable to parse --lint-cmd "{lint_cmd}"')
195█            io.tool_error(f'The arg should be "language: cmd --args ..."')
196│            io.tool_error('For example: --lint-cmd "python: flake8 --select=E9"')
197│            err = True
198│    if err:
199│        return
200│    return res
201│
202█def main(argv=None, input=None, output=None, force_git_root=None, return_coder=False):
203│    if argv is None:
204│        argv = sys.argv[1:]
205│
...⋮...

ASSISTANT: Here are the necessary changes to fix the flake8 errors:

1. Correct the f-string to not use placeholders when not needed.
2. Add the missing blank line before the `main` function.

aider/main.py
```python
<<<<<<< SEARCH
            io.tool_error(f'The arg should be "language: cmd --args ..."')
=======
            io.tool_error('The arg should be "language: cmd --args ..."')
>>>>>>> REPLACE
```

aider/main.py
```python
<<<<<<< SEARCH
    return res
=======
    return res

>>>>>>> REPLACE
```
2024-05-19 07:40:54 -07:00
Paul Gauthier
9bd78d7ff3 Refactored lint command parsing and setup logic. 2024-05-19 07:40:41 -07:00
Paul Gauthier
9ee332f5d9 Added options for automatic linting and testing after changes. 2024-05-19 07:34:19 -07:00
Paul Gauthier
38de35e924 Set linters based on provided commands in args.lint_cmd. 2024-05-18 21:04:47 -07:00
Paul Gauthier
5a6e72a64b Updated linting functionality to only run linting without committing. 2024-05-18 21:00:45 -07:00
Paul Gauthier
bc06d8623c Updated lint command to commit after fixing problems. 2024-05-18 19:30:32 -07:00
Paul Gauthier
04084883e8 Added a new command to run the linter on dirty files, fix problems, and then commit. 2024-05-18 18:35:33 -07:00
Paul Gauthier
ea05cf05e1 Added --restore-chat-history 2024-05-13 11:09:28 -07:00
paul-gauthier
45b2ba8a10
Merge pull request #591 from paul-gauthier/restore-chat-history
Restore prior chat history on launch
2024-05-11 07:49:43 -07:00
Paul Gauthier
48fd67485c add a user message during --show-prompts 2024-05-08 13:49:38 -07:00
Paul Gauthier
f256b43043 wip 2024-05-08 13:35:34 -07:00
Paul Gauthier
9ff6770a04 refactored litellm to avoid duplicating workarounds 2024-05-08 08:05:15 -07:00
Paul Gauthier
1747525418 aider: Added max_chat_history_tokens as an explicit argument to the Coder.__init__ method and passed args.max_chat_history_tokens when creating the Coder instance in main().
# Aider chat conversation:

USER: don't use kwargs, add it as an explicit arg

ASSISTANT: Here is the *SEARCH/REPLACE block* to add `max_chat_history_tokens` as an explicit argument instead of using `**kwargs`:

aider/coders/base_coder.py
```python
<<<<<<< SEARCH
    def __init__(
        self,
        main_model,
        io,
        fnames=None,
        git_dname=None,
        pretty=True,
        show_diffs=False,
        auto_commits=True,
        dirty_commits=True,
        dry_run=False,
        map_tokens=1024,
        verbose=False,
        assistant_output_color="blue",
        code_theme="default",
        stream=True,
        use_git=True,
        voice_language=None,
        aider_ignore_file=None,
        cur_messages=None,
        done_messages=None,
    ):
=======
    def __init__(
        self,
        main_model,
        io,
        fnames=None,
        git_dname=None,
        pretty=True,
        show_diffs=False,
        auto_commits=True,
        dirty_commits=True,
        dry_run=False,
        map_tokens=1024,
        verbose=False,
        assistant_output_color="blue",
        code_theme="default",
        stream=True,
        use_git=True,
        voice_language=None,
        aider_ignore_file=None,
        cur_messages=None,
        done_messages=None,
        max_chat_history_tokens=None,
    ):
>>>>>>> REPLACE
```

aider/main.py
```python
<<<<<<< SEARCH
        coder = Coder.create(
            main_model=main_model,
            edit_format=args.edit_format,
            io=io,
            ##
            fnames=fnames,
            git_dname=git_dname,
            pretty=args.pretty,
            show_diffs=args.show_diffs,
            auto_commits=args.auto_commits,
            dirty_commits=args.dirty_commits,
            dry_run=args.dry_run,
            map_tokens=args.map_tokens,
            verbose=args.verbose,
            assistant_output_color=args.assistant_output_color,
            code_theme=args.code_theme,
            stream=args.stream,
            use_git=args.git,
            voice_language=args.voice_language,
            aider_ignore_file=args.aiderignore,
        )
=======
        coder = Coder.create(
            main_model=main_model,
            edit_format=args.edit_format,
            io=io,
            ##
            fnames=fnames,
            git_dname=git_dname,
            pretty=args.pretty,
            show_diffs=args.show_diffs,
            auto_commits=args.auto_commits,
            dirty_commits=args.dirty_commits,
            dry_run=args.dry_run,
            map_tokens=args.map_tokens,
            verbose=args.verbose,
            assistant_output_color=args.assistant_output_color,
            code_theme=args.code_theme,
            stream=args.stream,
            use_git=args.git,
            voice_language=args.voice_language,
            aider_ignore_file=args.aiderignore,
            max_chat_history_tokens=args.max_chat_history_tokens,
        )
>>>>>>> REPLACE
```

This adds `max_chat_history_tokens` as an explicit argument to the `Coder.__init__` method, and passes `args.max_chat_history_tokens` when creating the `Coder` instance in `main()`.
2024-05-06 09:25:04 -07:00
Paul Gauthier
250d89649b added test coverage #585 2024-05-02 13:01:41 -07:00
Paul Gauthier
4482c24d34 Restore proper default to io.yes #585 2024-05-02 12:47:16 -07:00
Paul Gauthier
254481408e aider: Implemented loading .env file specified by command line argument.
# Aider chat conversation:

USER: do the todo

ASSISTANT: To implement the TODO item in `aider/main.py` about loading a .env file, we can make the following changes:

1. Add the python-dotenv package to the imports.
2. Load the .env file specified by args.env_file using dotenv.load_dotenv().

Here are the *SEARCH/REPLACE* blocks to make those changes:

aider/main.py
```python
<<<<<<< SEARCH
import configparser
import os
import sys
from pathlib import Path

import git
import litellm
from streamlit.web import cli
=======
import configparser
import os
import sys
from pathlib import Path

import git
import litellm
from dotenv import load_dotenv
from streamlit.web import cli
>>>>>>> REPLACE
```

aider/main.py
```python
<<<<<<< SEARCH
    # todo: load .env using filename args.env_file
=======
    if args.env_file:
        load_dotenv(args.env_file)
>>>>>>> REPLACE
```

This will load the environment variables from the specified .env file, if provided via the `--env-file` command line argument.

Note: You'll need to install the `python-dotenv` package for this to work, e.g. via `pip install python-dotenv`.
2024-05-02 11:29:12 -07:00
Paul Gauthier
8cfdd36620 Added support for loading environment variables from a custom .env file. 2024-05-02 11:29:11 -07:00
Paul Gauthier
256a9a454c move cloning into Coder.create, summarize chat history if edit format changes 2024-04-30 17:31:58 -07:00
Paul Gauthier
8e9a00006b carry conversation history to switched model 2024-04-30 16:25:47 -07:00
Paul Gauthier
304856fc60 roughed in model switch 2024-04-30 16:22:13 -07:00
Paul Gauthier
050d35790e added /models cmd 2024-04-30 16:02:38 -07:00
Paul Gauthier
29f4d788a3 set streamlit config options 2024-04-29 10:19:22 -07:00
Paul Gauthier
ec9fac2500 simpler launch of streamlit 2024-04-28 14:48:40 -07:00
Paul Gauthier
73bad5250b hit control-c 2024-04-28 14:38:30 -07:00
Paul Gauthier
542c091cf3 Added --gui functionality 2024-04-28 14:08:25 -07:00
Paul Gauthier
15a50a6afc more refactor 2024-04-28 13:19:48 -07:00
Paul Gauthier
5a01ba70a6 refactored parser, args 2024-04-28 13:15:14 -07:00
Paul Gauthier
701103a9cc chat works, with commits and reflected messages 2024-04-27 08:09:13 -07:00
Paul Gauthier
d21de778ff announcements 2024-04-26 11:24:42 -07:00
Paul Gauthier
f9e122b9d7 Added --show-model-warnings 2024-04-23 12:15:37 -07:00
Paul Gauthier
89a7b3470a Use fq model name in --models search 2024-04-22 19:17:27 -07:00
Paul Gauthier
25b8d6fec8 Added --models 2024-04-22 18:45:20 -07:00
Paul Gauthier
6901f92f96 refac 2024-04-22 14:42:46 -07:00
Paul Gauthier
efd3c39e50 Better unknown model warnings 2024-04-22 14:09:08 -07:00
Paul Gauthier
a9925d58af Updated AZURE env assignments in main, docs 2024-04-22 09:45:06 -07:00
Paul Gauthier
6863b47e6a Check the environment inside Model 2024-04-20 08:09:17 -07:00
Paul Gauthier
e513174da4 Warn if litellm is not giving us good validate_environment() responses 2024-04-20 08:01:50 -07:00