Commit graph

3893 commits

Author SHA1 Message Date
paul-gauthier
a496abbfa4
Update leaderboard.md 2024-05-03 18:46:35 -07:00
Paul Gauthier
6eeeb68049 layout 2024-05-03 18:06:47 -07:00
Paul Gauthier
1d1f53601d aider: Centered the "Percent correct" column in the leaderboard table.
# Aider chat conversation:

USER: center align the percent correct column

ASSISTANT: Here is the *SEARCH/REPLACE* block to center align the "Percent correct" column:

docs/leaderboard.md
```markdown
<<<<<<< SEARCH
      <th style="padding: 8px; text-align: left;">Percent correct</th>
=======
      <th style="padding: 8px; text-align: center;">Percent correct</th>
>>>>>>> REPLACE
```
2024-05-03 18:06:22 -07:00
paul-gauthier
b21952a71c
Update leaderboard.md 2024-05-03 17:59:25 -07:00
Paul Gauthier
bf94746614 copy 2024-05-03 17:37:41 -07:00
Paul Gauthier
6f20edd730 layout 2024-05-03 17:30:59 -07:00
Paul Gauthier
a2d16208ab aider: Replaced <pre> tag with <code> tag in leaderboard.md to denote literal code without boxing it.
# Aider chat conversation:

USER: what do the styles on the pre tag do?

ASSISTANT: The `<pre>` tag in the Markdown table is styled with the following CSS:

```css
pre {
  overflow-x: auto;
  white-space: pre-wrap;
}
```

Here's what those styles do:

- `overflow-x: auto;` adds a horizontal scrollbar to the `<pre>` block if the content is wider than the available space. This allows the user to scroll to see long commands without them wrapping or overflowing the table cell.

- `white-space: pre-wrap;` allows the content inside the `<pre>` to wrap to new lines if needed. Normally `<pre>` elements only honor line breaks that are explicitly in the content. With this style, the browser will wrap lines as needed to fit the available width, while still preserving the original line breaks and other whitespace.

So in summary, these styles allow the command examples in the table to be scrolled horizontally if long, while wrapping to multiple lines if needed to fit the cell. This provides a good balance of preserving the original formatting while keeping the content readable and not breaking the table layout.

USER: the pre is putting the text in a pale blue box. what's another way to denote literal code without boxing it?

ASSISTANT: Here are a couple options to denote literal code without using a `<pre>` tag that puts it in a box:

1. Use inline code formatting with backticks, like `this`. This works well for short code snippets within a sentence.

2. Use a `<code>` tag instead of `<pre>`. This will format the text in a monospace font to denote code, but won't put it in a box. You can add CSS to style it further if desired.

Here's a *SEARCH/REPLACE* block to make that change:

docs/leaderboard.md
```markdown
<<<<<<< SEARCH
        <td style="padding: 4px;"><pre style="overflow-x: auto; white-space: pre-wrap;">{{ row.command }}</pre></td>
=======
        <td style="padding: 4px;"><code>{{ row.command }}</code></td>
>>>>>>> REPLACE
```

This replaces the `<pre>` tag with a `<code>` tag. The code will now render inline without the pale blue box, but will still be visibly denoted as code.

You can remove the `overflow-x` and `white-space` styles since they are no longer needed on the `<code>` tag. The browser will wrap the code naturally within the table cell.

Let me know if you would like me to make this change or if you have any other questions!
2024-05-03 17:28:35 -07:00
Paul Gauthier
e99eaf5e90 aider: Reduced font size of table in leaderboard.md
# Aider chat conversation:

USER: make the font smaller for the table

ASSISTANT: Here is the *SEARCH/REPLACE* block to make the font smaller in the table:

docs/leaderboard.md
```markdown
<<<<<<< SEARCH
<table style="width: 90%; max-width: 800px; margin: auto; border-collapse: collapse; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
=======
<table style="width: 90%; max-width: 800px; margin: auto; border-collapse: collapse; box-shadow: 0 2px 4px rgba(0,0,0,0.1); font-size: 14px;">
>>>>>>> REPLACE
```
2024-05-03 17:23:47 -07:00
Paul Gauthier
01cf0c43a0 layout 2024-05-03 17:21:04 -07:00
Paul Gauthier
8aa1e10f2a copy 2024-05-03 17:14:56 -07:00
paul-gauthier
f1871d104a
Update leaderboard.md 2024-05-03 16:27:51 -07:00
paul-gauthier
6f002bf68f
Update leaderboard.md 2024-05-03 16:14:45 -07:00
Paul Gauthier
052df34300 copy 2024-05-03 15:48:43 -07:00
Paul Gauthier
4b0dfc3d05 copy 2024-05-03 15:45:12 -07:00
Paul Gauthier
3266ccdfe6 sort data 2024-05-03 15:33:55 -07:00
Paul Gauthier
f3d9d8f08f aider: Styled the table to be 90% wide with a max-width of 800px, centered it, added a box shadow, and made other visual improvements.
# Aider chat conversation:

USER: add some styling to the table. it's very plain right now. it also is a bit too wide for the page and is forcing the user to scroll left/right.

ASSISTANT: ```diff
--- docs/leaderboard.md
+++ docs/leaderboard.md
@@ ... @@
-<table>
+<table style="width: 100%; max-width: 960px; margin: auto; border-collapse: collapse;">
@@ ... @@
-  <thead>
+  <thead style="background-color: #f2f2f2;">
@@ ... @@
-    <tr>
+    <tr style="border-bottom: 1px solid #ddd;">
@@ ... @@
-      <th>Model</th>
-      <th>Percent correct</th>
-      <th>Command</th>
-      <th>Edit format</th>
+      <th style="padding: 8px; text-align: left;">Model</th>
+      <th style="padding: 8px; text-align: left;">Percent correct</th>
+      <th style="padding: 8px; text-align: left;">Command</th>
+      <th style="padding: 8px; text-align: left;">Edit format</th>
@@ ... @@
-      <tr>
+      <tr style="border-bottom: 1px solid #ddd;">
@@ ... @@
-        <td>{{ row.model }}</td>
-        <td>{{ row.second }}%</td>
-        <td><pre>{{ row.command }}</pre></td>
-        <td>{{ row.format }}</td>
+        <td style="padding: 8px;">{{ row.model }}</td>
+        <td style="padding: 8px;">{{ row.second }}%</td>
+        <td style="padding: 8px;"><pre style="overflow-x: auto; white-space: pre-wrap;">{{ row.command }}</pre></td>
+        <td style="padding: 8px;">{{ row.format }}</td>
```

This diff adds some basic styling to the table to make it look less plain and ensures that it fits within the page without causing horizontal scrolling. The `max-width` property is set to `960px`, which is a common width for content on web pages, and `margin: auto` centers the table on the page. The `border-collapse` property is used to make the borders between cells look cleaner. The `background-color` for the table header improves the visual separation of the header from the body. Padding is added to the cells for better readability, and the `overflow-x: auto; white-space: pre-wrap;` styles on the `<pre>` tag ensure that the command text does not force the table to be wider than the page.

ASSISTANT: ```diff
--- docs/leaderboard.md
+++ docs/leaderboard.md
@@ ... @@
-<table>
+<table style="width: 100%; max-width: 960px; margin: auto; border-collapse: collapse;">
@@ ... @@
-  <thead>
+  <thead style="background-color: #f2f2f2;">
@@ ... @@
-    <tr>
+    <tr style="border-bottom: 1px solid #ddd;">
@@ ... @@
-      <th>Model</th>
-      <th>Percent correct</th>
-      <th>Command</th>
-      <th>Edit format</th>
+      <th style="padding: 8px; text-align: left;">Model</th>
+      <th style="padding: 8px; text-align: left;">Percent correct</th>
+      <th style="padding: 8px; text-align: left;">Command</th>
+      <th style="padding: 8px; text-align: left;">Edit format</th>
@@ ... @@
-      <tr>
+      <tr style="border-bottom: 1px solid #ddd;">
@@ ... @@
-        <td>{{ row.model }}</td>
-        <td>{{ row.second }}%</td>
-        <td><pre>{{ row.command }}</pre></td>
-        <td>{{ row.format }}</td>
+        <td style="padding: 8px;">{{ row.model }}</td>
+        <td style="padding: 8px;">{{ row.second }}%</td>
+        <td style="padding: 8px;"><pre style="overflow-x: auto; white-space: pre-wrap;">{{ row.command }}</pre></td>
+        <td style="padding: 8px;">{{ row.format }}</td>
```

This diff adds some basic styling to the table to make it look less plain and ensures that it fits within the page without causing horizontal scrolling. The `max-width` property is set to `960px`, which is a common width for content on web pages, and `margin: auto` centers the table on the page. The `border-collapse` property is used to make the borders between cells look cleaner. The `background-color` for the table header improves the visual separation of the header from the body. Padding is added to the cells for better readability, and the `overflow-x: auto; white-space: pre-wrap;` styles on the `<pre>` tag ensure that the command text does not force the table to be wider than the page.

USER: UnifiedDiffNoMatch: hunk failed to apply!

docs/leaderboard.md does not contain lines that match the diff you provided!
Try again.
DO NOT skip blank lines, comments, docstrings, etc!
The diff needs to apply cleanly to the lines in docs/leaderboard.md!

docs/leaderboard.md does not contain these 1 exact lines in a row:
```
    <tr>
```

ASSISTANT: ```diff
--- docs/leaderboard.md
+++ docs/leaderboard.md
@@ -1,4 +1,4 @@
-<table style="width: 100%; max-width: 960px; margin: auto; border-collapse: collapse;">
+<table style="width: 90%; max-width: 800px; margin: auto; border-collapse: collapse; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
   <thead style="background-color: #f2f2f2;">
     <tr>
       <th style="padding: 8px; text-align: left;">Model</th>
```
2024-05-03 15:33:42 -07:00
Paul Gauthier
d7ddeab294 Updated leaderboard table styling for better readability and aesthetics. 2024-05-03 15:33:41 -07:00
Paul Gauthier
0e79b3dcc6 Update leaderboard to display command in a preformatted block. 2024-05-03 15:33:32 -07:00
Paul Gauthier
471d637694 updated llama3 2024-05-03 15:31:20 -07:00
Paul Gauthier
b5bb453378 examples_as_sys_msg 2024-05-03 15:24:36 -07:00
Paul Gauthier
f115236801 llama reminder_as_sys_msg=True 2024-05-03 15:11:22 -07:00
Paul Gauthier
b476671399 copy 2024-05-03 15:08:38 -07:00
Paul Gauthier
cb42150bba added leaderboard 2024-05-03 14:52:21 -07:00
Paul Gauthier
4825808f85 aider: Added an HTML table to display leaderboard data from _data/leaderboard.csv in the Jekyll site.
# Aider chat conversation:

USER: make an html table for this jekyll site pulling data from `_data/leaderboard.csv`

ASSISTANT: Here is the *SEARCH/REPLACE* block to add an HTML table to `docs/leaderboard.md` using data from `_data/leaderboard.csv`:

docs/leaderboard.md
```markdown
<<<<<<< SEARCH
```
=======
<table>
  <thead>
    <tr>
      <th>Model</th>
      <th>Second</th>
      <th>First</th>
      <th>Format</th>
      <th>Command</th>
      <th>Version</th>
      <th>Commit</th>
      <th>Date</th>
    </tr>
  </thead>
  <tbody>
    {% for row in site.data.leaderboard %}
      <tr>
        <td>{{ row.model }}</td>
        <td>{{ row.second }}</td>
        <td>{{ row.first }}</td>
        <td>{{ row.format }}</td>
        <td>{{ row.command }}</td>
        <td>{{ row.version }}</td>
        <td>{{ row.commit }}</td>
        <td>{{ row.date }}</td>
      </tr>
    {% endfor %}
  </tbody>
</table>
>>>>>>> REPLACE
```

This will:

1. Add an HTML `<table>` element
2. Define the table header row with column names matching the CSV
3. Loop through `site.data.leaderboard` (loaded from the CSV file)
4. Output a `<tr>` table row for each data row
5. Output `<td>` table cells for each column value

When rendered by Jekyll, this will display the leaderboard data in an HTML table on the page.
2024-05-03 14:51:31 -07:00
Paul Gauthier
a34f1a6529 Added documentation for the leaderboard feature. 2024-05-03 14:51:30 -07:00
Paul Gauthier
f0b794ce9c revert docker.sh 2024-05-03 14:46:52 -07:00
Paul Gauthier
5d32dd77fc Added diff-fenced coder 2024-05-03 13:50:15 -07:00
Paul Gauthier
921c7ceb80 Merge branch 'main' into gemini-editblock-and-examples 2024-05-03 13:17:23 -07:00
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