Commit graph

2406 commits

Author SHA1 Message Date
Paul Gauthier
a57c651c05 version bump to 0.9.0 2023-07-16 09:47:24 -03:00
Paul Gauthier
a3f3a18ee0 Updated HISTORY 2023-07-16 09:47:03 -03:00
Paul Gauthier
a9cca05680 Added GitTemporaryDirectory 2023-07-16 09:39:07 -03:00
Paul Gauthier
86cea01434 aider: Change the relative import to an absolute import for the IgnorantTemporaryDirectory class in test_repomap.py.
# Aider chat conversation:

USER: ImportError: Failed to import test module: test_repomap
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.8.17/x64/lib/python3.8/unittest/loader.py", line 436, in _find_test_path
    module = self._get_module_from_name(name)
  File "/opt/hostedtoolcache/Python/3.8.17/x64/lib/python3.8/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
  File "/home/runner/work/aider/aider/tests/test_repomap.py", line 8, in <module>
    from .utils import IgnorantTemporaryDirectory
ImportError: attempted relative import with no known parent package

ASSISTANT: The error message indicates that Python is unable to find the `utils` module when it's being imported in `test_repomap.py`. This is because the import statement is using a relative import with the dot (`.`) prefix, which is not working in this context.

To fix this, we need to change the relative import to an absolute import. This means we need to specify the full path to the `utils` module from the project's root directory.

Here is the change you need to make:

```python
tests/test_repomap.py
<<<<<<< ORIGINAL
from .utils import IgnorantTemporaryDirectory
=======
from tests.utils import IgnorantTemporaryDirectory
>>>>>>> UPDATED
```

This change tells Python to import the `IgnorantTemporaryDirectory` class from the `utils` module located in the `tests` directory, which is an absolute path from the project's root directory.
2023-07-16 09:05:18 -03:00
Paul Gauthier
cdf35cd122 refac 2023-07-16 09:02:35 -03:00
Paul Gauthier
9785ede960 copy 2023-07-15 10:59:16 -07:00
Paul Gauthier
adf123c30e aider: Added table of contents to the faq.md file.
# Aider chat conversation:

USER: add a table of contents

ASSISTANT: To add a table of contents to the `faq.md` file, we need to add a list of links to the sections at the top of the file. Each link should be in the format `[Section Name](#section-name)`, where `Section Name` is the name of the section and `section-name` is the section name in lowercase with spaces replaced by hyphens.

Here is the *edit block* for this change:

<source>markdown
docs/faq.md
<<<<<<< ORIGINAL
# Frequently asked questions

## How does aider use git?
=======
# Frequently asked questions

- [How does aider use git?](#how-does-aider-use-git)
- [GPT-4 vs GPT-3.5](#gpt-4-vs-gpt-35)
- [Aider isn't editing my files?](#aider-isnt-editing-my-files)
- [Can I use aider with other LLMs, local LLMs, etc?](#can-i-use-aider-with-other-llms-local-llms-etc)
- [Can I change the system prompts that aider uses?](#can-i-change-the-system-prompts-that-aider-uses)
- [Can I run aider in Google Colab?](#can-i-run-aider-in-google-colab)

## How does aider use git?
>>>>>>> UPDATED
</source>
2023-07-15 10:53:12 -07:00
Paul Gauthier
7a2c954eb7 Updated HISTORY 2023-07-15 10:36:02 -07:00
Paul Gauthier
8622ffaf4c Added faq entry 2023-07-15 10:34:55 -07:00
Paul Gauthier
1b10751585 More informative retry messages 2023-07-15 10:19:48 -07:00
Paul Gauthier
9f7f6607c2 copy 2023-07-14 21:22:49 -07:00
Paul Gauthier
843c51c35e copy 2023-07-14 21:21:00 -07:00
Paul Gauthier
9d9de4d02e added git faq 2023-07-14 21:16:18 -07:00
Paul Gauthier
e6996da018 fix tests for windows 2023-07-14 20:28:33 -07:00
Paul Gauthier
84da88feec Updated HISTORY 2023-07-14 20:00:57 -07:00
Paul Gauthier
78d9d014f2 fix bug blocking addition of subdir filename mentions 2023-07-14 20:00:04 -07:00
Paul Gauthier
16a21d9844 added failing test for mention 2023-07-14 19:53:49 -07:00
Paul Gauthier
edbec5498e update benchmark driver 2023-07-13 20:02:58 -07:00
Paul Gauthier
743d3f0d1c copy 2023-07-13 19:44:59 -07:00
Paul Gauthier
92f5c712fd copy 2023-07-13 19:44:50 -07:00
Paul Gauthier
ef6714b381 show a js example 2023-07-13 17:56:52 -07:00
Paul Gauthier
719810b1a1 removed import 2023-07-13 17:47:24 -07:00
Paul Gauthier
b52a62190a Ignore errors when cleaning up temp dirs (Win) 2023-07-13 17:18:09 -07:00
Paul Gauthier
8e2b92febb close the open cache files, so Windows won't error 2023-07-13 16:02:29 -07:00
Paul Gauthier
24015dab5f Try and make test run on windows 2023-07-13 15:55:33 -07:00
Paul Gauthier
14ce1d43c7 strip the correct fence 2023-07-13 15:54:54 -07:00
Paul Gauthier
12c3c1ed68 updated editblock to use all the fences 2023-07-13 15:48:13 -07:00
Paul Gauthier
82f8f1f62a copy 2023-07-13 15:33:46 -07:00
Paul Gauthier
f543cf9737 make og:image link absolute 2023-07-13 14:06:32 -07:00
Paul Gauthier
598d81d77c aider: Set the full URL to "https://aider.chat" in _config.yml.
# Aider chat conversation:

USER: what is the site.baseurl ?

ASSISTANT: In Jekyll, `site.baseurl` is a variable that stores the subpath of your site. For example, if your site is at `http://example.com/my_site`, then `site.baseurl` would be `/my_site`. It's often used in templates to prepend to URLs to ensure they work correctly regardless of the site's subpath.

However, I don't see `site.baseurl` defined in your `_config.yml` file. If you're not hosting your site in a subdirectory, you may not need it. If you are, you should add it to your `_config.yml` file like this:

```yml
baseurl: "/my_site" # replace "my_site" with your actual subpath
```

Please let me know if you want to add this to your `_config.yml` file.

USER: https://aider.chat

ASSISTANT: If you want to set the `baseurl` to "https://aider.chat", you should know that `baseurl` is typically used for subpaths, not the full URL. The full URL is usually set in the `url` field.

Here's how you can add it:

```yaml
_config.yml
<<<<<<< ORIGINAL
theme: jekyll-theme-cayman

defaults:
  - scope:
      path: "README.md"
      type: "pages"
    values:
      description: "A command-line chat tool for coding with GPT"
=======
theme: jekyll-theme-cayman
url: "https://aider.chat"

defaults:
  - scope:
      path: "README.md"
      type: "pages"
    values:

^C KeyboardInterrupt

USER: ok, set the full url

ASSISTANT: Alright, here's how you can add the full URL to your `_config.yml` file:

```yaml
_config.yml
<<<<<<< ORIGINAL
theme: jekyll-theme-cayman

defaults:
  - scope:
      path: "README.md"
      type: "pages"
    values:
      description: "A command-line chat tool for coding with GPT"
=======
theme: jekyll-theme-cayman
url: "https://aider.chat"

defaults:
  - scope:
      path: "README.md"
      type: "pages"
    values:
      description: "A command-line chat tool for coding with GPT"
>>>>>>> UPDATED
```

This will set the `url` variable to "https://aider.chat". You can use `{{ site.url }}` in your templates to refer to this URL.
2023-07-13 14:05:38 -07:00
Paul Gauthier
b685695fef Anchor the cache to the project root 2023-07-13 14:01:07 -07:00
Paul Gauthier
b05b8e2087 Improved output when no changes made to git tracked files 2023-07-13 13:41:34 -07:00
Paul Gauthier
7c3bbcede6 aider: Scrub sensitive information from verbose logs before saving.
# Aider chat conversation:

USER: open api key saved in log file when run in verbose mode #94
Open
joshuavial opened this issue 8 hours ago · 2 comments
Comments
@joshuavial
joshuavial commented 8 hours ago
Seems like it would be easy for someone (particularly new to coding) to forget to add the log file to a .gitignore and inadvertently publish their key. Maybe the logger should scrub the keys before saving?

ASSISTANT: To address this issue, we need to modify the `aider/main.py` file. We will add a function to scrub sensitive information like the OpenAI API key from the verbose logs before they are saved.

Here are the steps:

1. Define a new function `scrub_sensitive_info` that takes a string as input and replaces sensitive information (like the OpenAI API key) with a placeholder like `***`.
2. Call this function before logging the arguments in verbose mode.

Here is the *edit block* for these changes:

```python
aider/main.py
<<<<<<< ORIGINAL
    if args.verbose:
        show = parser.format_values()
        io.tool_output(show)
        io.tool_output("Option settings:")
        for arg, val in sorted(vars(args).items()):
            io.tool_output(f"  - {arg}: {val}")
=======
    def scrub_sensitive_info(text):
        # Replace sensitive information with placeholder
        return text.replace(args.openai_api_key, '***')

    if args.verbose:
        show = scrub_sensitive_info(parser.format_values())
        io.tool_output(show)
        io.tool_output("Option settings:")
        for arg, val in sorted(vars(args).items()):
            io.tool_output(f"  - {arg}: {scrub_sensitive_info(str(val))}")
>>>>>>> UPDATED
```

This change will ensure that the OpenAI API key is not saved in the log file when the program is run in verbose mode.
2023-07-13 12:28:05 -07:00
Paul Gauthier
fb11754492 new screenshot 2023-07-13 12:24:06 -07:00
Paul Gauthier
226a4d60ad new screenshot 2023-07-13 11:21:44 -07:00
Paul Gauthier
20897e9a77 new screenshot 2023-07-13 11:18:38 -07:00
Paul Gauthier
88f6a1c02a copy 2023-07-13 11:14:17 -07:00
Paul Gauthier
27ffd62027 new screenshot 2023-07-13 11:10:22 -07:00
Paul Gauthier
48d725116f copy 2023-07-13 10:56:15 -07:00
Paul Gauthier
c3045ddfef copy 2023-07-13 10:52:12 -07:00
Paul Gauthier
b09c95c9c6 added hello aider example 2023-07-13 10:46:49 -07:00
Paul Gauthier
6ab4f09a3a cleanup --show-repo-map 2023-07-13 10:06:46 -07:00
Paul Gauthier
041c19b7dd show universal ctags output 2023-07-13 10:03:01 -07:00
Paul Gauthier
f78977cd5b finished --show-repo-map 2023-07-12 13:46:27 -07:00
Paul Gauthier
a10b08e8de aider: Add --show-map option to print the repo map and then exit.
# Aider chat conversation:

USER: add --show-map which will just print the repomap and then exit

ASSISTANT: To add the `--show-map` option, we need to modify the `aider/main.py` file. We will add a new argument to the argument parser and then use this argument to conditionally print the repo map and exit.

Here are the changes:

```python
aider/main.py
<<<<<<< ORIGINAL
    ##########
    other_group = parser.add_argument_group("Other Settings")
    other_group.add_argument(
        "--version",
        action="version",
        version=f"%(prog)s {__version__}",
        help="Show the version number and exit",
    )
=======
    ##########
    other_group = parser.add_argument_group("Other Settings")
    other_group.add_argument(
        "--show-map",
        action="store_true",
        help="Print the repo map and exit",
        default=False,
    )
    other_group.add_argument(
        "--version",
        action="version",
        version=f"%(prog)s {__version__}",
        help="Show the version number and exit",
    )
>>>>>>> UPDATED
```

```python
aider/main.py
<<<<<<< ORIGINAL
    coder = Coder.create(
        main_model,
        args.edit_format,
        io,
        ##
        fnames=args.files,
        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,
    )
=======
    if args.show_map:
        repo_map = RepoMap(map_tokens=args.map_tokens, root=git_root, main_model=main_model, io=io, verbose=args.verbose)
        print(repo_map)
        sys.exit(0)
    else:
        coder = Coder.create(
            main_model,
            args.edit_format,
            io,
            ##
            fnames=args.files,
            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,
        )
>>>>>>> UPDATED
```

Please note that the `RepoMap` class is used to create the repo map. If the `--show-map` option is used, the repo map is printed and the program exits. If not, the program continues as before.
2023-07-12 13:40:10 -07:00
Paul Gauthier
e3aa9db5a2 Updated HISTORY 2023-07-12 07:34:24 -07:00
paul-gauthier
549a1a7640
Merge pull request #88 from paul-gauthier/azure
Added args to configure openai module to access Azure
2023-07-12 07:32:10 -07:00
Paul Gauthier
ec65822369 copy 2023-07-12 06:39:13 -07:00
Paul Gauthier
7f8ab9c895 Merge remote-tracking branch 'origin/main' 2023-07-12 06:38:07 -07:00
paul-gauthier
789909bdea
Update faq.md 2023-07-11 19:17:39 -07:00