Commit graph

3849 commits

Author SHA1 Message Date
Paul Gauthier
1d7320e8a0 Added httpx.RemoteProtocolError to backoff #586 2024-05-03 08:48:19 -07:00
paul-gauthier
e59b8cfa18
Update README.md 2024-05-03 06:51:34 -07:00
Paul Gauthier
c2c36283a7 copy 2024-05-02 19:04:18 -07:00
Paul Gauthier
c48d7be1f6 adjusted blog layout 2024-05-02 18:03:01 -07:00
Paul Gauthier
54aa208171 aider: Adjusted the video container's padding-bottom to maintain the original 1060x1080 aspect ratio.
# Aider chat conversation:

USER: but it's a 1060 wide by 1080 high video, not 16:9

ASSISTANT: You're right, the video dimensions are 1060x1080, which is not a 16:9 aspect ratio. To maintain the original aspect ratio of the video, we can calculate the padding-bottom percentage based on the video's height divided by its width. Here are the updated changes:

_posts/2024-05-02-browser.md
<source>
<<<<<<< SEARCH
<style>
.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}

.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
</style>
=======
<style>
.video-container {
  position: relative;
  padding-bottom: 101.89%; /* 1080 / 1060 = 1.0189 */
  height: 0;
  overflow: hidden;
}

.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
</style>
>>>>>>> REPLACE
</source>

The change:

1. Update the `padding-bottom` value to `101.89%`, which is calculated by dividing the video's height (1080) by its width (1060) and multiplying by 100 to get a percentage.

This change will ensure that the responsive video container maintains the original aspect ratio of the 1060x1080 video.
2024-05-02 18:02:51 -07:00
Paul Gauthier
a372fff409 aider: Made the video responsive to prevent overflow on mobile devices.
# Aider chat conversation:

USER: the video overflows the width of the browser on mobile

ASSISTANT: To fix the video overflowing the width of the browser on mobile devices, we can add some CSS styles to make the video responsive. Here are the changes:

_posts/2024-05-02-browser.md
<source>
<<<<<<< SEARCH
<video width="1060" height="1080" controls loop poster="/assets/browser.jpg">
  <source src="/assets/aider-browser-social.mp4" type="video/mp4">
  <a href="/assets/aider-browser-social.mp4">Aider browser UI demo video</a>
</video>
=======
<div class="video-container">
  <video controls loop poster="/assets/browser.jpg">
    <source src="/assets/aider-browser-social.mp4" type="video/mp4">
    <a href="/assets/aider-browser-social.mp4">Aider browser UI demo video</a>
  </video>
</div>

<style>
.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}

.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
</style>
>>>>>>> REPLACE
</source>

The changes:

1. Wrap the `<video>` element inside a `<div>` with class `video-container`.
2. Remove the `width` and `height` attributes from the `<video>` element.
3. Add a `<style>` block with CSS for the `video-container` class:
   - Set `position: relative` on the container.
   - Use `padding-bottom: 56.25%` to maintain a 16:9 aspect ratio.
   - Set `height: 0` and `overflow: hidden` to contain the video.
4. Add CSS for the `video` element inside `video-container`:
   - Set `position: absolute` to position it within the container.
   - Set `top: 0`, `left: 0`, `width: 100%`, `height: 100%` to make it fill the container.

These changes will make the video responsive and fit within the width of the browser on mobile devices while maintaining its aspect ratio.
2024-05-02 18:02:10 -07:00
Paul Gauthier
259a663941 Increased the size of the video player on the browser post. 2024-05-02 18:02:09 -07:00
Paul Gauthier
653dde4d94 copy 2024-05-02 14:31:47 -07:00
Paul Gauthier
250d89649b added test coverage #585 2024-05-02 13:01:41 -07:00
Paul Gauthier
0de6b36cde set version to 0.31.2-dev 2024-05-02 12:50:18 -07:00
Paul Gauthier
0f0e04b15f version bump to 0.31.1 2024-05-02 12:49:44 -07:00
Paul Gauthier
4482c24d34 Restore proper default to io.yes #585 2024-05-02 12:47:16 -07:00
Paul Gauthier
3e5f0d0c75 copy 2024-05-02 11:34:38 -07:00
Paul Gauthier
d64a457def Added --env-file param 2024-05-02 11:32:06 -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
3289383cbe new video 2024-05-02 10:52:12 -07:00
Paul Gauthier
192bc6592e aider: Added the 'loop' attribute to the video element to enable looping the video.
# Aider chat conversation:

USER: can we loop the video?

ASSISTANT: To loop the video, we can add the `loop` attribute to the `<video>` tag.

Here is the *SEARCH/REPLACE* block:

_posts/2024-05-02-browser.md
<source>
<<<<<<< SEARCH
<video width="704" height="720" controls poster="/assets/browser.jpg">
=======
<video width="704" height="720" controls loop poster="/assets/browser.jpg">
>>>>>>> REPLACE
</source>
2024-05-02 10:48:15 -07:00
Paul Gauthier
05450fb3d2 copy 2024-05-02 10:45:53 -07:00
Paul Gauthier
db0e420ea0 aider: Added a poster image to the video tag
# Aider chat conversation:

USER: add the highlight image as the thumbnail that will show before the <video> tag plays

ASSISTANT: To add the highlight image as a thumbnail that shows before the video plays, we can use the `poster` attribute on the `<video>` tag.

Here is the *SEARCH/REPLACE* block:

_posts/2024-05-02-browser.md
<source>
<<<<<<< SEARCH
<video width="704" height="720" controls>
=======
<video width="704" height="720" controls poster="/assets/browser.jpg">
>>>>>>> REPLACE
</source>

The `poster` attribute specifies an image to be shown while the video is downloading, or until the user hits the play button. This will display the `browser.jpg` image before the video starts playing.
2024-05-02 10:41:46 -07:00
Paul Gauthier
b087cd670f Enabled browser-based AI pair programming in Aider. 2024-05-02 10:41:44 -07:00
Paul Gauthier
7c2e9a394c browser blog post 2024-05-02 10:39:33 -07:00
Paul Gauthier
707fb80d87 copy 2024-05-02 09:22:09 -07:00
Paul Gauthier
8a9ba47442 set version to 0.31.1-dev 2024-05-02 09:10:09 -07:00
Paul Gauthier
ec6054a53a version bump to 0.31.0 2024-05-02 09:09:35 -07:00
Paul Gauthier
bd2900495d bump deps to pick up latest litellm 2024-05-02 08:46:16 -07:00
Paul Gauthier
258c466906 copy 2024-05-02 08:31:13 -07:00
Paul Gauthier
1a8ea2f81f added windows setx commands #584 2024-05-02 08:14:24 -07:00
Paul Gauthier
d4c63ca959 Updated the API key environment variable examples in the llms.md documentation. 2024-05-02 08:03:42 -07:00
Paul Gauthier
8800432dd7 aider: Added # Windows: setx versions of all the export commands.
# Aider chat conversation:

USER: add `# Windows: setx` versions of all the `export` commands, like the first one

ASSISTANT: Here are the changes to add `# Windows: setx` versions of all the `export` commands:

docs/llms.md
<source>markdown
<<<<<<< SEARCH
export ANTHROPIC_API_KEY=<your-key>
=======
export ANTHROPIC_API_KEY=<your-key> # Windows: setx ANTHROPIC_API_KEY <your-key>
>>>>>>> REPLACE
</source>

docs/llms.md
<source>markdown
<<<<<<< SEARCH
export GEMINI_API_KEY=<your-key>
=======
export GEMINI_API_KEY=<your-key> # Windows: setx GEMINI_API_KEY <your-key>
>>>>>>> REPLACE
</source>

docs/llms.md
<source>markdown
<<<<<<< SEARCH
export GROQ_API_KEY=<your-key>
=======
export GROQ_API_KEY=<your-key> # Windows: setx GROQ_API_KEY <your-key>
>>>>>>> REPLACE
</source>

docs/llms.md
<source>markdown
<<<<<<< SEARCH
export COHERE_API_KEY=<your-key>
=======
export COHERE_API_KEY=<your-key> # Windows: setx COHERE_API_KEY <your-key>
>>>>>>> REPLACE
</source>

docs/llms.md
<source>markdown
<<<<<<< SEARCH
export AZURE_API_KEY=<your-key>
export AZURE_API_VERSION=2023-05-15
export AZURE_API_BASE=https://example-endpoint.openai.azure.com
=======
export AZURE_API_KEY=<your-key> # Windows: setx AZURE_API_KEY <your-key>
export AZURE_API_VERSION=2023-05-15 # Windows: setx AZURE_API_VERSION 2023-05-15
export AZURE_API_BASE=https://example-endpoint.openai.azure.com # Windows: setx AZURE_API_BASE https://example-endpoint.openai.azure.com
>>>>>>> REPLACE
</source>

docs/llms.md
<source>markdown
<<<<<<< SEARCH
export OPENROUTER_API_KEY=<your-key>
=======
export OPENROUTER_API_KEY=<your-key> # Windows: setx OPENROUTER_API_KEY <your-key>
>>>>>>> REPLACE
</source>

docs/llms.md
<source>markdown
<<<<<<< SEARCH
export OLLAMA_API_BASE=http://127.0.0.1:11434
=======
export OLLAMA_API_BASE=http://127.0.0.1:11434 # Windows: setx OLLAMA_API_BASE http://127.0.0.1:11434
>>>>>>> REPLACE
</source>

docs/llms.md
<source>markdown
<<<<<<< SEARCH
export OPENAI_API_KEY=<your-key>
export OPENAI_API_BASE=https://api.deepseek.com/v1
=======
export OPENAI_API_KEY=<your-key> # Windows: setx OPENAI_API_KEY <your-key>
export OPENAI_API_BASE=https://api.deepseek.com/v1 # Windows: setx OPENAI_API_BASE https://api.deepseek.com/v1
>>>>>>> REPLACE
</source>

docs/llms.md
<source>markdown
<<<<<<< SEARCH
export OPENAI_API_BASE=<your-endpoint-goes-here>

# If your endpoint needs a key
export OPENAI_API_KEY=<your-key>
=======
export OPENAI_API_BASE=<your-endpoint-goes-here> # Windows: setx OPENAI_API_BASE <your-endpoint-goes-here>

# If your endpoint needs a key
export OPENAI_API_KEY=<your-key> # Windows: setx OPENAI_API_KEY <your-key>
>>>>>>> REPLACE
</source>
2024-05-02 07:52:20 -07:00
Paul Gauthier
3b900a4c59 Prep for windows setx 2024-05-02 07:51:01 -07:00
Paul Gauthier
b8313c5343 added docstrings 2024-05-01 15:14:14 -07:00
paul-gauthier
e922732f0a
Update HISTORY.md 2024-05-01 12:48:20 -07:00
Paul Gauthier
5ed9e8cb6d Merge remote-tracking branch 'origin/main' 2024-05-01 11:08:42 -07:00
Paul Gauthier
2f589ee379 upgraded dependencies 2024-05-01 10:46:20 -07:00
Paul Gauthier
2c0dff52d3 asking for code language in whole edit format confuses some models 2024-05-01 09:17:29 -07:00
Paul Gauthier
484f7e44c0 Updated HISTORY 2024-05-01 09:17:07 -07:00
Paul Gauthier
0185e02a92 updated favicon paths 2024-05-01 09:14:53 -07:00
paul-gauthier
5ea1c5df0b
Merge pull request #581 from paul-gauthier/switch-model
New /model command to switch models, /models to search them
2024-05-01 07:11:16 -07:00
Paul Gauthier
22d90d70c6 prompt copy 2024-04-30 20:24:53 -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
665b9044c8 added autocomplete for model names 2024-04-30 16:29:10 -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
e610e5bd0a Handle existing dirnames with [globby] chars, with test #195 2024-04-30 15:50:24 -07:00
Paul Gauthier
a3a4d87a0c treat litellm.exceptions.BadRequestError as a 400 error and do not retry 2024-04-30 15:40:28 -07:00
Paul Gauthier
3469e04eb8 Do exp backoff for litellm.exceptions.ServiceUnavailableError #580 2024-04-30 15:34:01 -07:00
Paul Gauthier
7b14d77e9e Don't retry on gemini RECITATION error 2024-04-30 14:40:15 -07:00
Paul Gauthier
d6783636c5 copy 2024-04-29 20:42:44 -07:00