Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Poetry support #10

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea
maestro.iml
60 changes: 55 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,51 @@ After you complete your installs.

To run this script, you need to have the following:

- Python installed
- Anthropic API key
- Required Python packages: `anthropic` and `rich`

## Installation

Option 1: Using requirements.txt
1. Clone the repository or download the script file.
2. Install the required Python packages by running the following command:

```bash
```shell
pip install -r requirements.txt
```

3. Replace the placeholder API key in the script with your actual Anthropic API key:
Option 2: Using Poetry
1. Clone the repository
2. Install [Python](https://www.python.org/), For example, on macOS, you can install Python 3.12 using Homebrew:
```shell
$ brew install python@3.12
```
3. Install [Poetry](https://python-poetry.org/) For example, on macOS, you can install Poetry using Homebrew:

```shell
$ brew install poetry
```
4. Configure virtual environments to be project-local.
```shell
$ poetry config virtualenvs.in-project true
$ poetry config --list
cache-dir = "/Users/<username>/Library/Caches/pypoetry"
experimental.new-installer = true
installer.parallel = true
virtualenvs.create = true
virtualenvs.in-project = true
virtualenvs.path = "{cache-dir}/virtualenvs" # /Users/<username>/Library/Caches/pypoetry/virtualenvs
```
5. Initialize the virtual environment.

```shell
$ poetry env use python3.12
...
$ poetry install
Creating virtualenv src in <ROOT>/.venv
Updating dependencies
...
```

Replace the placeholder API key in the script with your actual Anthropic API key:

```python
client = Anthropic(api_key="YOUR_API_KEY_HERE")
Expand Down Expand Up @@ -134,6 +165,25 @@ You can customize the script according to your needs:
- Modify the console output formatting by updating the rich library's Panel and Console configurations.
- Customize the exchange log formatting and file extension by modifying the relevant code sections.

## Running in IntelliJ

Prior to setting-up IntelliJ, make sure the virtual environment has been initialized.

* Open the project
* Navigate to **File > Project Structure...**
* Navigate to **Platform Settings > SDKs**
* Click the "+" symbol to **Add Python SDK...**
* Select **Virtualenv Environment** on the left
* Select **Existing environment**
* For **Interpreter**, use the Python executable in the installed virtual environment (e.g. `<ROOT>/.venv/bin/python`)
* Submit the new SDK
* Navigate to **Project Settings > Modules**
* Click the "+" symbol to **Add New Module...**
* Select a type of **Python** on the left
* For **Module SDK**, select the newly created SDK
* For **Content root**, select `<ROOT>`


## License

This script is released under the MIT License.
Expand Down
1,043 changes: 1,043 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[tool.poetry]
name = "src"
version = "1.0.0"
description = ""
authors = []

[tool.poetry.dependencies]
python = "~3.12.0"
requests = "^2.31.0"
anthropic="*"
rich="*"
tavily-python = "*"
ollama = "*"
openai = "*"

[tool.poetry.dev-dependencies]
pytest = "~7.4.0"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
File renamed without changes.
File renamed without changes.
File renamed without changes.