weaviate-agents 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. weaviate_agents-0.1.0/.github/CODEOWNERS +3 -0
  2. weaviate_agents-0.1.0/.github/dependabot.yml +17 -0
  3. weaviate_agents-0.1.0/.github/workflows/main.yaml +115 -0
  4. weaviate_agents-0.1.0/.gitignore +171 -0
  5. weaviate_agents-0.1.0/.pre-commit-config.yaml +35 -0
  6. weaviate_agents-0.1.0/.python-version +1 -0
  7. weaviate_agents-0.1.0/LICENSE +28 -0
  8. weaviate_agents-0.1.0/PKG-INFO +11 -0
  9. weaviate_agents-0.1.0/README.md +3 -0
  10. weaviate_agents-0.1.0/bash/run_unit_tests.sh +3 -0
  11. weaviate_agents-0.1.0/makefile +7 -0
  12. weaviate_agents-0.1.0/mypy.ini +2 -0
  13. weaviate_agents-0.1.0/publishing.md +69 -0
  14. weaviate_agents-0.1.0/pyproject.toml +39 -0
  15. weaviate_agents-0.1.0/setup.cfg +4 -0
  16. weaviate_agents-0.1.0/test/query_agent/test_query_model.py +191 -0
  17. weaviate_agents-0.1.0/uv.lock +950 -0
  18. weaviate_agents-0.1.0/weaviate_agents/__init__.py +0 -0
  19. weaviate_agents-0.1.0/weaviate_agents/base.py +33 -0
  20. weaviate_agents-0.1.0/weaviate_agents/classes/__init__.py +3 -0
  21. weaviate_agents-0.1.0/weaviate_agents/classes/query.py +3 -0
  22. weaviate_agents-0.1.0/weaviate_agents/classes/transformation.py +0 -0
  23. weaviate_agents-0.1.0/weaviate_agents/errors.py +16 -0
  24. weaviate_agents-0.1.0/weaviate_agents/query/.gitkeep +0 -0
  25. weaviate_agents-0.1.0/weaviate_agents/query/__init__.py +3 -0
  26. weaviate_agents-0.1.0/weaviate_agents/query/classes/__init__.py +3 -0
  27. weaviate_agents-0.1.0/weaviate_agents/query/classes/response.py +150 -0
  28. weaviate_agents-0.1.0/weaviate_agents/query/query_agent.py +129 -0
  29. weaviate_agents-0.1.0/weaviate_agents/transformation/.gitkeep +0 -0
  30. weaviate_agents-0.1.0/weaviate_agents.egg-info/PKG-INFO +11 -0
  31. weaviate_agents-0.1.0/weaviate_agents.egg-info/SOURCES.txt +32 -0
  32. weaviate_agents-0.1.0/weaviate_agents.egg-info/dependency_links.txt +1 -0
  33. weaviate_agents-0.1.0/weaviate_agents.egg-info/requires.txt +1 -0
  34. weaviate_agents-0.1.0/weaviate_agents.egg-info/top_level.txt +3 -0
@@ -0,0 +1,3 @@
1
+ # Ci related folders
2
+ /.github/ @weaviate/labs
3
+ /ci/ @weaviate/labs
@@ -0,0 +1,17 @@
1
+ ---
2
+ # To get started with Dependabot version updates, you'll need to specify which
3
+ # package ecosystems to update and where the package manifests are located.
4
+ # Please see the documentation for all configuration options:
5
+ # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
6
+
7
+ version: 2
8
+ updates:
9
+ - package-ecosystem: pip # See documentation for possible values
10
+ directory: / # Location of package manifests
11
+ schedule:
12
+ interval: daily
13
+ ignore:
14
+ - dependency-name: grpcio
15
+ - dependency-name: grpcio-tools
16
+ - dependency-name: grpcio-health-checking
17
+ - dependency-name: pydantic
@@ -0,0 +1,115 @@
1
+ ---
2
+ name: Tests
3
+
4
+ on:
5
+ push:
6
+ branches: [main]
7
+ pull_request:
8
+ branches: [main]
9
+ workflow_call:
10
+
11
+ jobs:
12
+ lint-and-format:
13
+ name: Lint and Format
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+
18
+ - name: Set up Python 3.11
19
+ uses: actions/setup-python@v5
20
+ with:
21
+ python-version: '3.11'
22
+
23
+ - name: Install uv --group
24
+ run: pip install uv==0.5.8
25
+
26
+ - name: Sync dependencies with uv
27
+ run: uv sync --all-extras
28
+
29
+ - name: Run ruff for linting
30
+ run: uv run ruff check .
31
+
32
+ - name: Run Pre-commit hooks
33
+ uses: pre-commit/action@v3.0.0
34
+ with:
35
+ extra_args: --verbose --all-files --config=.pre-commit-config.yaml
36
+
37
+ type-checking:
38
+ name: Type Checking
39
+ runs-on: ubuntu-latest
40
+ strategy:
41
+ fail-fast: false
42
+ matrix:
43
+ version: ['3.9', '3.10', '3.11', '3.12']
44
+ folder: [.]
45
+
46
+ steps:
47
+ - uses: actions/checkout@v4
48
+
49
+ - name: Set up Python ${{ matrix.version }}
50
+ uses: actions/setup-python@v5
51
+ with:
52
+ python-version: ${{ matrix.version }}
53
+
54
+ - name: Install uv
55
+ run: pip install uv==0.5.8
56
+
57
+ - name: Sync dependencies with uv
58
+ run: uv sync --all-extras
59
+
60
+ - name: Run mypy
61
+ run: uv run mypy --config-file=./mypy.ini --warn-unused-ignores --python-version ${{ matrix.version }} .
62
+
63
+ unit-tests:
64
+ name: Unit Tests
65
+ runs-on: ubuntu-latest
66
+ strategy:
67
+ fail-fast: false
68
+ matrix:
69
+ python: ['3.9', '3.10', '3.11', '3.12']
70
+ steps:
71
+ - uses: actions/checkout@v4
72
+
73
+ - name: Set up Python ${{ matrix.python }}
74
+ uses: actions/setup-python@v5
75
+ with:
76
+ python-version: ${{ matrix.python }}
77
+
78
+ - name: Install uv
79
+ run: pip install uv==0.5.8
80
+
81
+ - name: Sync dependencies with uv
82
+ run: uv sync --all-extras
83
+
84
+ - name: Run Unit Tests
85
+ run: make run_unit_tests
86
+
87
+ build-and-publish:
88
+ name: Build and Publish Package
89
+ if: startsWith(github.ref, 'refs/tags')
90
+ needs: [lint-and-format, type-checking, unit-tests]
91
+ runs-on: ubuntu-latest
92
+ steps:
93
+ - name: Checkout code
94
+ uses: actions/checkout@v4
95
+ with:
96
+ fetch-depth: 0
97
+
98
+ - name: Set up Python 3.11
99
+ uses: actions/setup-python@v5
100
+ with:
101
+ python-version: '3.11'
102
+
103
+ - name: Install uv
104
+ run: pip install uv==0.5.8
105
+
106
+ - name: Sync dependencies with uv
107
+ run: uv sync --all-extras
108
+
109
+ - name: Build package with uv
110
+ run: uv build
111
+
112
+ - name: Publish package to PyPI
113
+ env:
114
+ UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
115
+ run: uv publish --token $UV_PUBLISH_TOKEN
@@ -0,0 +1,171 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+
110
+ # pdm
111
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112
+ #pdm.lock
113
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114
+ # in version control.
115
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116
+ .pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121
+ __pypackages__/
122
+
123
+ # Celery stuff
124
+ celerybeat-schedule
125
+ celerybeat.pid
126
+
127
+ # SageMath parsed files
128
+ *.sage.py
129
+
130
+ # Environments
131
+ .env
132
+ .venv
133
+ env/
134
+ venv/
135
+ ENV/
136
+ env.bak/
137
+ venv.bak/
138
+
139
+ # Spyder project settings
140
+ .spyderproject
141
+ .spyproject
142
+
143
+ # Rope project settings
144
+ .ropeproject
145
+
146
+ # mkdocs documentation
147
+ /site
148
+
149
+ # mypy
150
+ .mypy_cache/
151
+ .dmypy.json
152
+ dmypy.json
153
+
154
+ # Pyre type checker
155
+ .pyre/
156
+
157
+ # pytype static type analyzer
158
+ .pytype/
159
+
160
+ # Cython debug symbols
161
+ cython_debug/
162
+
163
+ # PyCharm
164
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
167
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
168
+ #.idea/
169
+
170
+ # PyPI configuration file
171
+ .pypirc
@@ -0,0 +1,35 @@
1
+ ---
2
+ default_language_version:
3
+ python: python3.11
4
+ repos:
5
+ - repo: https://github.com/pre-commit/pre-commit-hooks
6
+ rev: v4.6.0
7
+ hooks:
8
+ - id: trailing-whitespace
9
+ - id: check-toml
10
+ - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
11
+ rev: 0.2.1
12
+ hooks:
13
+ - id: yamlfmt
14
+ args: [--mapping, '2', --sequence, '2', --offset, '0']
15
+ exclude: templates # Exclude this due to helm template syntax not being valid yaml
16
+ - repo: https://github.com/astral-sh/ruff-pre-commit
17
+ rev: v0.4.2
18
+ hooks:
19
+ - id: ruff
20
+ args: [--fix, --extend-select, I]
21
+ - id: ruff-format
22
+ - repo: https://github.com/koalaman/shellcheck-precommit
23
+ rev: v0.10.0
24
+ hooks:
25
+ - id: shellcheck
26
+ files: containerize/.*$
27
+ - repo: https://github.com/pre-commit/mirrors-mypy
28
+ rev: v1.4.0
29
+ hooks:
30
+ - id: mypy
31
+ args: [--config-file=mypy.ini, --explicit-package-bases]
32
+ name: mypy (poetry)
33
+ language: system
34
+ types_or: [python, cython]
35
+ entry: uv run mypy
@@ -0,0 +1 @@
1
+ 3.9
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2025, Weaviate
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,11 @@
1
+ Metadata-Version: 2.2
2
+ Name: weaviate-agents
3
+ Version: 0.1.0
4
+ Summary: Add your description here
5
+ Requires-Python: >=3.9
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: weaviate-client>=4.11.0
8
+
9
+ # Weaviate Agents Python Client
10
+
11
+ Official Python client for Weaviate Agents.
@@ -0,0 +1,3 @@
1
+ # Weaviate Agents Python Client
2
+
3
+ Official Python client for Weaviate Agents.
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+
3
+ uv run pytest -v test/query_agent/test_query_model.py
@@ -0,0 +1,7 @@
1
+ .PHONY: all run_unit_tests
2
+
3
+ all: run_unit_tests
4
+
5
+ run_unit_tests:
6
+ @echo "Executing run_unit_tests.sh..."
7
+ @./bash/run_unit_tests.sh
@@ -0,0 +1,2 @@
1
+ [mypy]
2
+ files = weaviate_agents
@@ -0,0 +1,69 @@
1
+ # Publishing a New Version
2
+
3
+ This repository uses [UV](https://docs.astral.sh/uv/guides/publish/) for building and publishing the package to PyPI. The GitHub Actions workflow defined in [`.github/workflows/main.yaml`](.github/workflows/main.yaml) automates the following steps:
4
+
5
+ 1. **Linting and Type Checking:**
6
+ The workflow runs linting, formatting, type-checking, and unit tests on every commit and pull request.
7
+
8
+ 2. **Building and Publishing:**
9
+ When a new Git tag is pushed, the workflow:
10
+ - Checks out the source code.
11
+ - Sets up Python and installs UV.
12
+ - Syncs dependencies.
13
+ - Builds the package using `uv build`.
14
+ - Publishes the package to PyPI using `uv publish`.
15
+
16
+ ## Steps to Publish a New Version
17
+
18
+ 1. **Update the Version in `pyproject.toml`:**
19
+ In the `[project]` section of your `pyproject.toml`, update the `version` field:
20
+
21
+ ```toml
22
+ [project]
23
+ name = "your_package_name"
24
+ version = "X.Y.Z" # Update this to your new version
25
+ description = "Your package description."
26
+ # ... other metadata ...
27
+ ```
28
+
29
+ 2. **Commit Your Changes:**
30
+ Commit the updated `pyproject.toml` (or any other relevant files) to your repository.
31
+
32
+ ```bash
33
+ git add pyproject.toml
34
+ git commit -m "Bump version to X.Y.Z"
35
+ ```
36
+
37
+ 3. **Tag the Commit:**
38
+ Create a git tag following your versioning convention (e.g., `vX.Y.Z`):
39
+
40
+ ```bash
41
+ git tag vX.Y.Z
42
+ ```
43
+
44
+ Alternatively, you can also create a tag using the GitHub web interface to draft a new release, which will automatically tag the commit.
45
+
46
+ 4. **Push the Changes and the Tag:**
47
+ Push your commit and tags to the main branch:
48
+
49
+ ```bash
50
+ git push origin main --tags
51
+ ```
52
+
53
+ 5. **Automatic Build and Publish:**
54
+ Once the tag is pushed, GitHub Actions will trigger the `build-and-publish` job:
55
+
56
+ - **Build:** The job runs `uv build` to create the package distributions.
57
+ - **Publish:** The job then runs `uv publish --token $UV_PUBLISH_TOKEN` to publish the package to PyPI. Make sure that the `PYPI_API_TOKEN` secret is set in your repository configuration.
58
+
59
+ 6. **Verify the Release:**
60
+ - Check the workflow run in GitHub Actions for any errors.
61
+ - Confirm that the new version is available on [PyPI](https://pypi.org/).
62
+
63
+ ## Additional Notes
64
+
65
+ - **Version Management:** The version published to PyPI is read from the `pyproject.toml` file. It is your responsibility to update it for each release.
66
+ - **Secrets:** Ensure that the secret `PYPI_API_TOKEN` is defined in your repository's settings. This token should have the necessary permissions to publish to PyPI.
67
+ - **Workflow Dependencies:** The publishing step depends on successful completion of linting, type-checking, and unit tests.
68
+
69
+ Happy releasing!
@@ -0,0 +1,39 @@
1
+ [project]
2
+ name = "weaviate-agents"
3
+ version = "0.1.0"
4
+ description = "Add your description here"
5
+ readme = "README.md"
6
+ requires-python = ">=3.9"
7
+ dependencies = [
8
+ "weaviate-client>=4.11.0",
9
+ ]
10
+
11
+
12
+ [tool.setuptools]
13
+ license-files = []
14
+
15
+ [build-system]
16
+ requires = [
17
+ "setuptools >= 65",
18
+ "setuptools_scm[toml] >6.2",
19
+ "wheel >= 0.38.1",
20
+ ]
21
+ build-backend = 'setuptools.build_meta'
22
+
23
+ [dependency-groups]
24
+ dev = [
25
+ "mypy>=1.15.0",
26
+ "pre-commit>=4.1.0",
27
+ "pytest-cov>=6.0.0",
28
+ "pytest>=8.3.4",
29
+ "ruff>=0.9.6",
30
+ ]
31
+
32
+ [tool.setuptools.packages.find]
33
+ where = ["."] # Search in current directory
34
+ exclude = [
35
+ "bash*",
36
+ "tests*",
37
+ "docs*",
38
+ "scripts*",
39
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+