-
Notifications
You must be signed in to change notification settings - Fork 9
feat: migrate to uv #53
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.11 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,9 +35,9 @@ With the githooks installed the following will run automatically on a commit: | |
* [mypy](https://github.com/python/mypy) is used to check for type errors | ||
* a simple format check is applied to the commit message to verify for use of [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) | ||
|
||
Additional tools are integrated into poetry via the [poetry plugin](https://poethepoet.natn.io/poetry_plugin.html) | ||
Additional tools are provided via [Poe the Poet](https://github.com/nat-n/poethepoet) tasks and can be run with uv. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's also possible to ditch Poe and use project scripts: ...just mind the caveat that if the project is a library, these scripts get installed alongside it. So it's only usable for apps. (Or we could unify and use Mise, but I'm probably overthinking this.) |
||
|
||
Tools can also be run directly via the command line (run within `poetry shell` or prefix with `poetry run`): | ||
Tools can be run directly via the command line (activate the venv or prefix commands with `uv run`): | ||
|
||
* `poe lint` - lints and formats your code | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you should write these as prefixed ( |
||
* `poe format` - formats your code | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -24,13 +24,13 @@ This starter template helps you **quickly** get started with the [BeeAI framewor | |||||
## 📋 Requirements | ||||||
|
||||||
- **Python Version 3.11+** | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Technically you don't need this anymore, |
||||||
- **Poetry Version 2.0+** for Python package management - See [installation guide](https://python-poetry.org/docs/#installation) | ||||||
- **uv** (fast Python package manager) - See installation: https://docs.astral.sh/uv/getting-started/installation/ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd leave it as before since all the other links in this section are text links
Suggested change
|
||||||
- **Container system** (with Compose support): | ||||||
- [Docker](https://www.docker.com/) | ||||||
- [Rancher](https://www.rancher.com/) (For macOS, use VZ instead of QEMU) | ||||||
- [Podman](https://podman.io/) (Requires [Compose](https://podman-desktop.io/docs/compose/setting-up-compose) and rootful machine) | ||||||
- **LLM Provider** - External [WatsonX](https://www.ibm.com/watsonx) (OpenAI, Groq, ...) or local [Ollama](https://ollama.com) | ||||||
- **IDE/Code Editor** (e.g., WebStorm, VSCode) - Optional but recommended for smooth smooth configuration handling | ||||||
- **IDE/Code Editor** (e.g., WebStorm, VSCode) - Optional but recommended for smooth configuration handling | ||||||
|
||||||
--- | ||||||
|
||||||
|
@@ -44,25 +44,19 @@ cd beeai-framework-py-starter | |||||
|
||||||
**Step 2:** Install dependencies | ||||||
```sh | ||||||
poetry install | ||||||
uv sync | ||||||
``` | ||||||
|
||||||
**Step 3:** Install and start the poetry environment | ||||||
```sh | ||||||
poetry self add poetry-plugin-shell | ||||||
poetry shell | ||||||
``` | ||||||
|
||||||
**Step 4:** Create an `.env` file with the contents from `.env.template` | ||||||
**Step 3:** Create an `.env` file with the contents from `.env.template` | ||||||
|
||||||
**Step 5:** [Ollama](https://ollama.com/) must be installed and running, with the granite3.3 model pulled. | ||||||
**Step 4:** [Ollama](https://ollama.com/) must be installed and running, with the granite3.3 model pulled. | ||||||
```sh | ||||||
ollama pull granite3.3 | ||||||
``` | ||||||
|
||||||
**Step 6:** Start all services related to [beeai-code-interpreter](https://github.com/i-am-bee/beeai-code-interpreter) | ||||||
**Step 5:** Start all services related to [beeai-code-interpreter](https://github.com/i-am-bee/beeai-code-interpreter) | ||||||
```sh | ||||||
poe infra --type start | ||||||
uv run poe infra --type start | ||||||
``` | ||||||
|
||||||
> [!NOTE] | ||||||
|
@@ -76,21 +70,12 @@ Get complete visibility of the agent's inner workings via [OpenInference Instrum | |||||
|
||||||
### Instructions | ||||||
|
||||||
1. (Optional) In order to see spans in [Phoenix](https://github.com/Arize-ai/phoenix), begin running a Phoenix server. This can be done in one command using docker. | ||||||
1. In order to see spans in [Phoenix](https://github.com/Arize-ai/phoenix), begin running a Phoenix server. This can be done in one command using docker. | ||||||
Tomas2D marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
``` | ||||||
docker run -p 6006:6006 -i -t arizephoenix/phoenix | ||||||
docker run -p 6006:6006 -i -t arizephoenix/phoenix:latest | ||||||
Tomas2D marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
``` | ||||||
|
||||||
or via the command line: | ||||||
|
||||||
``` | ||||||
brew install i-am-bee/beeai/arize-phoenix | ||||||
brew services start arize-phoenix | ||||||
``` | ||||||
|
||||||
see https://docs.beeai.dev/observability/agents-traceability for more details. | ||||||
|
||||||
2. Run the agent `python beeai_framework_starter/agent_observe.py` | ||||||
3. You should see your spans exported in your console. If you've set up a locally running Phoenix server, head to [**localhost:6006**](http://localhost:6006/projects) to see your spans. | ||||||
|
||||||
|
@@ -100,37 +85,38 @@ see https://docs.beeai.dev/observability/agents-traceability for more details. | |||||
|
||||||
### 🤖 Agent | ||||||
|
||||||
Now that you’ve set up your project, let’s run the agent example located at `/beeai_framework_starter/agent_react.py`. | ||||||
Now that you’ve set up your project, let’s run the agent example. | ||||||
|
||||||
You have two options: | ||||||
|
||||||
**Option 1:** Interactive mode | ||||||
```sh | ||||||
python beeai_framework_starter/agent.py | ||||||
uv run python beeai_framework_starter/agent.py | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
``` | ||||||
|
||||||
**Option 2:** Define your prompt up front | ||||||
```sh | ||||||
python beeai_framework_starter/agent.py <<< "I am going out tomorrow morning to walk around Boston. What should I plan to wear?" | ||||||
uv run python beeai_framework_starter/agent.py <<< "I am going out tomorrow morning to walk around Boston. What should I plan to wear?" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
``` | ||||||
|
||||||
> [!NOTE] | ||||||
> Notice this prompts triggers the agent to call a tool. | ||||||
> Notice that this prompt triggers the agent to call a tool. | ||||||
|
||||||
--- | ||||||
|
||||||
### 🧑💻 Code interpreter agent | ||||||
|
||||||
Now let's run the code interpreter agent example located at `/beeai_framework_starter/agent_code_interpreter.py`. | ||||||
|
||||||
Try the `Python Tool` and ask the agent to perform a complex calculation: | ||||||
Try the `PythonTool` and ask the agent to perform a complex calculation: | ||||||
```sh | ||||||
python beeai_framework_starter/agent_code_interpreter.py <<< "Calculate 534*342?" | ||||||
uv run python beeai_framework_starter/agent_code_interpreter.py <<< "Calculate 534*342?" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
``` | ||||||
|
||||||
Try the `SandBox tool` and run a custom Python function `get_riddle()`: | ||||||
Try the `SandboxTool` and run a custom Python function `get_riddle()`: | ||||||
|
||||||
```sh | ||||||
python beeai_framework_starter/agent_code_interpreter.py <<< "Generate a riddle" | ||||||
uv run python beeai_framework_starter/agent_code_interpreter.py <<< "Generate a riddle" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
``` | ||||||
|
||||||
--- | ||||||
|
@@ -140,13 +126,15 @@ python beeai_framework_starter/agent_code_interpreter.py <<< "Generate a riddle" | |||||
This example demonstrates a **multi-agent workflow** where different agents work together to provide a comprehensive understanding of a location. | ||||||
|
||||||
The workflow includes three agents: | ||||||
|
||||||
1. **Researcher:** Gathers information about the location using the Wikipedia tool. | ||||||
2. **WeatherForecaster:** Retrieves and reports weather details using the OpenMeteo API. | ||||||
3. **DataSynthesizer:** Combines the historical and weather data into a final summary. | ||||||
|
||||||
To run the workflow: | ||||||
|
||||||
```sh | ||||||
python beeai_framework_starter/agent_workflow.py | ||||||
uv run python beeai_framework_starter/agent_workflow.py | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
``` | ||||||
|
||||||
--- | ||||||
|
@@ -157,4 +145,4 @@ For additional examples to try, check out the examples directory of BeeAI framew | |||||
|
||||||
## Development | ||||||
|
||||||
If you are developing with this repository as a base, or updating this template, see additional information in [DEVELOP.md]. | ||||||
If you are developing with this repository as a base, or updating this template, see additional information in [./DEVELOP.md]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be necessary AFAIK,
uv sync
downloads the correct Python when creating venv