Skip to content

Commit 4b86b41

Browse files
Merge pull request #15 from joaopauloschuler/hf_main
Hf main
2 parents 8dea443 + 3883aee commit 4b86b41

File tree

145 files changed

+20147
-7338
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+20147
-7338
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Bug report
3+
about: The clearer your bug report, the faster it will be fixed!
4+
title: "[BUG]"
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**Code to reproduce the error**
14+
The simplest code snippet that produces your bug.
15+
16+
**Error logs (if any)**
17+
Provide error logs if there are any.
18+
19+
**Expected behavior**
20+
A clear and concise description of what you expected to happen.
21+
22+
**Packages version:**
23+
Run `pip freeze | grep smolagents` and paste it here.
24+
25+
**Additional context**
26+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/custom.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: Custom issue template
3+
about: Describe this issue template's purpose here.
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Is this not possible with the current options.**
17+
Make sure to consider if what you're requesting can be done with current abstractions.
18+
19+
**Describe alternatives you've considered**
20+
A clear and concise description of any alternative solutions or features you've considered.
21+
22+
**Additional context**
23+
Add any other context or screenshots about the feature request here.

.github/workflows/build_documentation.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
commit_sha: ${{ github.sha }}
2121
package: smolagents
2222
languages: en
23+
notebook_folder: smolagents_doc
2324
# additional_args: --not_python_module # use this arg if repository is documentation only
2425
secrets:
2526
token: ${{ secrets.HUGGINGFACE_PUSH }}

.github/workflows/quality.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Quality Check
22

33
on: [pull_request]
44

5+
env:
6+
UV_SYSTEM_PYTHON: 1
7+
58
jobs:
69
check_code_quality:
710
runs-on: ubuntu-latest
@@ -16,15 +19,13 @@ jobs:
1619
python-version: "3.12"
1720

1821
# Setup venv
19-
- name: Setup venv + uv
22+
- name: Setup uv
2023
run: |
2124
pip install --upgrade uv
22-
uv venv
2325
2426
- name: Install dependencies
2527
run: uv pip install "smolagents[quality] @ ."
2628

2729
# Equivalent of "make quality" but step by step
28-
- run: uv run ruff check examples src tests utils # linter
29-
- run: uv run ruff format --check examples src tests utils # formatter
30-
- run: uv run python utils/check_tests_in_ci.py
30+
- run: ruff check examples src tests # linter
31+
- run: ruff format --check examples src tests # formatter

.github/workflows/tests.yml

Lines changed: 12 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
name: Python tests
22

3-
on: [pull_request]
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- ci-*
8+
9+
env:
10+
UV_SYSTEM_PYTHON: 1
411

512
jobs:
613
build-ubuntu:
@@ -21,74 +28,16 @@ jobs:
2128
python-version: ${{ matrix.python-version }}
2229

2330
# Setup venv
24-
- name: Setup venv + uv
31+
- name: Setup uv
2532
run: |
2633
pip install --upgrade uv
27-
uv venv
2834
2935
# Install dependencies
3036
- name: Install dependencies
3137
run: |
3238
uv pip install "smolagents[test] @ ."
3339
34-
# Run all tests separately for individual feedback
35-
# Use 'if success() || failure()' so that all tests are run even if one failed
36-
# See https://stackoverflow.com/a/62112985
37-
- name: Agent tests
38-
run: |
39-
uv run pytest ./tests/test_agents.py
40-
if: ${{ success() || failure() }}
41-
42-
- name: Default tools tests
43-
run: |
44-
uv run pytest ./tests/test_default_tools.py
45-
if: ${{ success() || failure() }}
46-
47-
# - name: Docs tests # Disabled for now (slow test + requires API keys)
48-
# run: |
49-
# uv run pytest ./tests/test_all_docs.py
50-
51-
- name: Final answer tests
52-
run: |
53-
uv run pytest ./tests/test_final_answer.py
54-
if: ${{ success() || failure() }}
55-
56-
- name: Models tests
57-
run: |
58-
uv run pytest ./tests/test_models.py
59-
if: ${{ success() || failure() }}
60-
61-
- name: Monitoring tests
62-
run: |
63-
uv run pytest ./tests/test_monitoring.py
64-
if: ${{ success() || failure() }}
65-
66-
- name: Python interpreter tests
67-
run: |
68-
uv run pytest ./tests/test_python_interpreter.py
69-
if: ${{ success() || failure() }}
70-
71-
- name: Search tests
72-
run: |
73-
uv run pytest ./tests/test_search.py
74-
if: ${{ success() || failure() }}
75-
76-
- name: Tools tests
77-
run: |
78-
uv run pytest ./tests/test_tools.py
79-
if: ${{ success() || failure() }}
80-
81-
- name: Types tests
82-
run: |
83-
uv run pytest ./tests/test_types.py
84-
if: ${{ success() || failure() }}
85-
86-
- name: Utils tests
87-
run: |
88-
uv run pytest ./tests/test_utils.py
89-
if: ${{ success() || failure() }}
90-
91-
- name: Function type hints utils tests
40+
# Run tests
41+
- name: Test with pytest
9242
run: |
93-
uv run pytest ./tests/test_function_type_hints_utils.py
94-
if: ${{ success() || failure() }}
43+
pytest ./tests/

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,6 @@ archive/
150150
savedir/
151151
output/
152152
tool_output/
153+
154+
# Gradio runtime
155+
.gradio/

CONTRIBUTING.md

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,17 @@ However you choose to contribute, please be mindful and respect our
3333

3434
There are several ways you can contribute to smolagents.
3535

36-
* Fix outstanding issues with the existing code.
3736
* Submit issues related to bugs or desired new features.
3837
* Contribute to the examples or to the documentation.
38+
* Fix outstanding issues with the existing code.
3939

4040
> All contributions are equally valuable to the community. 🥰
4141
42-
## Fixing outstanding issues
43-
44-
If you notice an issue with the existing code and have a fix in mind, feel free to [start contributing](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request) and open
45-
a Pull Request!
46-
4742
## Submitting a bug-related issue or feature request
4843

44+
At any moment, feel welcome to open an issue, citing your exact error traces and package versions if it's a bug.
45+
It's often even better to open a PR with your proposed fixes/changes!
46+
4947
Do your best to follow these guidelines when submitting a bug-related issue or a feature
5048
request. It will make it easier for us to come back to you quickly and with good
5149
feedback.
@@ -89,10 +87,41 @@ We're always looking for improvements to the documentation that make it more cle
8987
how the documentation can be improved such as typos and any content that is missing, unclear or inaccurate. We'll be
9088
happy to make the changes or help you make a contribution if you're interested!
9189

90+
## Fixing outstanding issues
91+
92+
If you notice an issue with the existing code and have a fix in mind, feel free to [start contributing](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request) and open
93+
a Pull Request!
94+
95+
### Making code changes
96+
97+
To install dev dependencies, run:
98+
```
99+
pip install -e ".[dev]"
100+
```
101+
102+
When making changes to the codebase, please check that it follows the repo's code quality requirements by running:
103+
To check code quality of the source code:
104+
```
105+
make quality
106+
```
107+
108+
If the checks fail, you can run the formatter with:
109+
```
110+
make style
111+
```
112+
113+
And commit the changes.
114+
115+
To run tests locally, run this command:
116+
```bash
117+
make test
118+
```
119+
</details>
120+
92121
## I want to become a maintainer of the project. How do I get there?
93122

94123
smolagents is a project led and managed by Hugging Face. We are more than
95124
happy to have motivated individuals from other organizations join us as maintainers with the goal of helping smolagents
96125
make a dent in the world of Agents.
97126

98-
If you are such an individual (or organization), please reach out to us and let's collaborate.
127+
If you are such an individual (or organization), please reach out to us and let's collaborate.

Dockerfile

Lines changed: 0 additions & 29 deletions
This file was deleted.

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
.PHONY: quality style test docs utils
1+
.PHONY: quality style test docs
22

33
check_dirs := examples src tests utils
44

55
# Check code quality of the source code
66
quality:
77
ruff check $(check_dirs)
88
ruff format --check $(check_dirs)
9-
python utils/check_tests_in_ci.py
109

1110
# Format source code automatically
1211
style:

0 commit comments

Comments
 (0)