Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoWorms authored Nov 16, 2023
1 parent 8d5fa23 commit 72a9b03
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ The smartest ape in the jungle
Here is a handy python function that can help you take an entire repo and concatenate all files in a single .txt with all files contents and paths:

```python
import os

# Function to concatenate files into a single .txt file
def concatenate_files(dir_name, output_filename):
with open(output_filename, 'w', encoding='utf-8') as output_file:
Expand All @@ -25,7 +27,7 @@ def concatenate_files(dir_name, output_filename):
print(f"Skipping non-text file or error reading file: {file_path} - {e}")

# Example Call
concatenate_files(dir_name, 'knowledge_base.txt')
concatenate_files('./folder_name', 'knowledge_base.txt')
```

### 2. Set `OPENAI_API_KEY` and `TELEGRAM_TOKEN` environment variables.
Expand Down

0 comments on commit 72a9b03

Please sign in to comment.