mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 23:05:00 +00:00
refac all urls into urls.py
This commit is contained in:
parent
09d3d02971
commit
1f1da4b1a2
7 changed files with 26 additions and 18 deletions
|
@ -17,7 +17,7 @@ from jsonschema import Draft7Validator
|
|||
from rich.console import Console, Text
|
||||
from rich.markdown import Markdown
|
||||
|
||||
from aider import __version__, models, prompts, utils
|
||||
from aider import __version__, models, prompts, urls, utils
|
||||
from aider.commands import Commands
|
||||
from aider.history import ChatSummary
|
||||
from aider.io import InputOutput
|
||||
|
@ -1213,9 +1213,7 @@ class Coder:
|
|||
return
|
||||
|
||||
self.io.tool_error("Warning: it's best to only add files that need changes to the chat.")
|
||||
self.io.tool_error(
|
||||
"https://aider.chat/docs/faq.html#how-can-i-add-all-the-files-to-the-chat"
|
||||
)
|
||||
self.io.tool_error(urls.edit_errors)
|
||||
self.warning_given = True
|
||||
|
||||
def prepare_to_edit(self, edits):
|
||||
|
@ -1255,9 +1253,7 @@ class Coder:
|
|||
err = err.args[0]
|
||||
|
||||
self.io.tool_error("The LLM did not conform to the edit format.")
|
||||
self.io.tool_error(
|
||||
"For more info see: https://aider.chat/docs/faq.html#aider-isnt-editing-my-files"
|
||||
)
|
||||
self.io.tool_error(urls.edit_errors)
|
||||
self.io.tool_error()
|
||||
self.io.tool_error(str(err), strip=False)
|
||||
|
||||
|
|
13
aider/gui.py
13
aider/gui.py
|
@ -6,6 +6,7 @@ import sys
|
|||
|
||||
import streamlit as st
|
||||
|
||||
from aider import urls
|
||||
from aider.coders import Coder
|
||||
from aider.dump import dump # noqa: F401
|
||||
from aider.io import InputOutput
|
||||
|
@ -159,12 +160,12 @@ class GUI:
|
|||
pass
|
||||
|
||||
def do_recommended_actions(self):
|
||||
text = "Aider works best when your code is stored in a git repo. \n"
|
||||
text += f"[See the FAQ for more info]({urls.git})"
|
||||
|
||||
with st.expander("Recommended actions", expanded=True):
|
||||
with st.popover("Create a git repo to track changes"):
|
||||
st.write(
|
||||
"Aider works best when your code is stored in a git repo. \n[See the FAQ"
|
||||
" for more info](https://aider.chat/docs/git.html)"
|
||||
)
|
||||
st.write(text)
|
||||
self.button("Create git repo", key=random.random(), help="?")
|
||||
|
||||
with st.popover("Update your `.gitignore` file"):
|
||||
|
@ -513,9 +514,9 @@ def gui_main():
|
|||
st.set_page_config(
|
||||
layout="wide",
|
||||
page_title="Aider",
|
||||
page_icon="https://aider.chat/assets/favicon-32x32.png",
|
||||
page_icon=urls.favicon,
|
||||
menu_items={
|
||||
"Get Help": "https://aider.chat/",
|
||||
"Get Help": urls.website,
|
||||
"Report a bug": "https://github.com/paul-gauthier/aider/issues",
|
||||
"About": "# Aider\nAI pair programming in your browser.",
|
||||
},
|
||||
|
|
|
@ -8,6 +8,7 @@ from typing import Optional
|
|||
|
||||
from PIL import Image
|
||||
|
||||
from aider import urls
|
||||
from aider.dump import dump # noqa: F401
|
||||
from aider.litellm import litellm
|
||||
|
||||
|
@ -471,7 +472,7 @@ def sanity_check_model(io, model):
|
|||
io.tool_error(f"- {m} ({fq})")
|
||||
|
||||
if show:
|
||||
io.tool_error("For more info see https://aider.chat/docs/llms/warnings.html")
|
||||
io.tool_error(urls.model_warnings)
|
||||
|
||||
|
||||
def fuzzy_match_models(name):
|
||||
|
|
|
@ -8,18 +8,18 @@ import pypandoc
|
|||
from bs4 import BeautifulSoup
|
||||
from playwright.sync_api import sync_playwright
|
||||
|
||||
from aider import __version__
|
||||
from aider import __version__, urls
|
||||
|
||||
aider_user_agent = f"Aider/{__version__} +https://aider.chat"
|
||||
aider_user_agent = f"Aider/{__version__} +{urls.website}"
|
||||
|
||||
# Playwright is nice because it has a simple way to install dependencies on most
|
||||
# platforms.
|
||||
PLAYWRIGHT_INFO = """
|
||||
PLAYWRIGHT_INFO = f"""
|
||||
For better web scraping, install Playwright chromium with this command in your terminal:
|
||||
|
||||
playwright install --with-deps chromium
|
||||
|
||||
See https://aider.chat/docs/install/optional.html#enable-playwright for more info.
|
||||
See {urls.enable_playwrite} for more info.
|
||||
"""
|
||||
|
||||
|
||||
|
|
7
aider/urls.py
Normal file
7
aider/urls.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
website = "https://aider.chat/"
|
||||
add_all_files = "https://aider.chat/docs/faq.html#how-can-i-add-all-the-files-to-the-chat"
|
||||
edit_errors = "https://aider.chat/docs/troubleshooting/edit-errors.html"
|
||||
git = "https://aider.chat/docs/git.html"
|
||||
enable_playwrite = "https://aider.chat/docs/install/optional.html#enable-playwright"
|
||||
favicon = "https://aider.chat/assets/favicon-32x32.png"
|
||||
model_warnings = "https://aider.chat/docs/llms/warnings.html"
|
|
@ -26,6 +26,7 @@ pypandoc
|
|||
litellm
|
||||
google-generativeai
|
||||
streamlit
|
||||
watchdog
|
||||
flake8
|
||||
|
||||
# v3.3 no longer works on python 3.9
|
||||
|
|
|
@ -321,6 +321,8 @@ uritemplate==4.1.1
|
|||
# via google-api-python-client
|
||||
urllib3==2.2.1
|
||||
# via requests
|
||||
watchdog==4.0.1
|
||||
# via -r requirements.in
|
||||
wcwidth==0.2.13
|
||||
# via prompt-toolkit
|
||||
yarl==1.9.4
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue