dashai-ollama 0.2.3__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 (31) hide show
  1. dashai_ollama-0.2.3/.github/PULL_REQUEST_TEMPLATE.md +12 -0
  2. dashai_ollama-0.2.3/.github/dependabot.yml +20 -0
  3. dashai_ollama-0.2.3/.github/workflows/ci.yml +173 -0
  4. dashai_ollama-0.2.3/.github/workflows/scheduled.yml +63 -0
  5. dashai_ollama-0.2.3/.gitignore +9 -0
  6. dashai_ollama-0.2.3/.pre-commit-config.yaml +56 -0
  7. dashai_ollama-0.2.3/.python-version +1 -0
  8. dashai_ollama-0.2.3/CHANGELOG.md +19 -0
  9. dashai_ollama-0.2.3/LICENSE +21 -0
  10. dashai_ollama-0.2.3/PKG-INFO +517 -0
  11. dashai_ollama-0.2.3/README.md +488 -0
  12. dashai_ollama-0.2.3/pyproject.toml +207 -0
  13. dashai_ollama-0.2.3/src/dashai_ollama/__init__.py +0 -0
  14. dashai_ollama-0.2.3/src/dashai_ollama/ollama_embedding.py +321 -0
  15. dashai_ollama-0.2.3/src/dashai_ollama/ollama_model.py +768 -0
  16. dashai_ollama-0.2.3/src/dashai_ollama/py.typed +0 -0
  17. dashai_ollama-0.2.3/stubs/DashAI/__init__.py +0 -0
  18. dashai_ollama-0.2.3/stubs/DashAI/back/__init__.py +0 -0
  19. dashai_ollama-0.2.3/stubs/DashAI/back/core/__init__.py +0 -0
  20. dashai_ollama-0.2.3/stubs/DashAI/back/core/schema_fields/__init__.py +35 -0
  21. dashai_ollama-0.2.3/stubs/DashAI/back/core/utils/__init__.py +13 -0
  22. dashai_ollama-0.2.3/stubs/DashAI/back/models/RAG/__init__.py +0 -0
  23. dashai_ollama-0.2.3/stubs/DashAI/back/models/RAG/embeddings/__init__.py +0 -0
  24. dashai_ollama-0.2.3/stubs/DashAI/back/models/RAG/embeddings/dense_embedding.py +13 -0
  25. dashai_ollama-0.2.3/stubs/DashAI/back/models/__init__.py +0 -0
  26. dashai_ollama-0.2.3/stubs/DashAI/back/models/text_to_text_generation_model.py +17 -0
  27. dashai_ollama-0.2.3/stubs/README.md +13 -0
  28. dashai_ollama-0.2.3/tests/compat/test_with_dashai.py +63 -0
  29. dashai_ollama-0.2.3/tests/test_ollama_embedding.py +106 -0
  30. dashai_ollama-0.2.3/tests/test_ollama_model.py +150 -0
  31. dashai_ollama-0.2.3/uv.lock +1376 -0
@@ -0,0 +1,12 @@
1
+ ## What and why
2
+
3
+ <!-- What does this change, and why? -->
4
+
5
+ ## Checklist
6
+
7
+ - [ ] The **PR title** follows [Conventional Commits](https://www.conventionalcommits.org/)
8
+ (`feat(model): ...`, `fix: ...`). It becomes the commit message on a squash merge.
9
+ - [ ] `uv run pre-commit run --all-files` passes (ruff, ty, gitleaks, ...).
10
+ - [ ] Tests cover the change, and `uv run pytest` passes.
11
+ - [ ] If a parameter or default changed, the README tables and the descriptions in
12
+ all five languages are updated.
@@ -0,0 +1,20 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: github-actions
4
+ directory: /
5
+ schedule:
6
+ interval: weekly
7
+ commit-message:
8
+ prefix: ci
9
+ - package-ecosystem: uv
10
+ directory: /
11
+ schedule:
12
+ interval: weekly
13
+ commit-message:
14
+ # Runtime dependencies change the shipped package, so they release a patch;
15
+ # development tools do not (ci never releases).
16
+ prefix: build
17
+ prefix-development: ci
18
+ groups:
19
+ dev-tools:
20
+ dependency-type: development
@@ -0,0 +1,173 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ concurrency:
10
+ group: ci-${{ github.ref }}
11
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
12
+
13
+ permissions:
14
+ contents: read
15
+
16
+ env:
17
+ UV_FROZEN: "1"
18
+
19
+ jobs:
20
+ commits:
21
+ name: Commit messages
22
+ if: github.event_name == 'pull_request'
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - uses: actions/checkout@v7
26
+ with:
27
+ fetch-depth: 0
28
+ - uses: astral-sh/setup-uv@v10.3.3
29
+ - name: Check every commit of the PR
30
+ run: |
31
+ uvx --from commitizen cz check \
32
+ --rev-range "${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}"
33
+ - name: Check the PR title (it becomes the commit on a squash merge)
34
+ env:
35
+ PR_TITLE: ${{ github.event.pull_request.title }}
36
+ run: uvx --from commitizen cz check --message "$PR_TITLE"
37
+ - name: Preview the release this PR would produce
38
+ run: |
39
+ set +e
40
+ out=$(uvx --from commitizen cz bump --dry-run 2>&1)
41
+ rc=$?
42
+ {
43
+ echo "### Release preview"
44
+ if [ "$rc" -eq 0 ]; then
45
+ echo "Merging this PR would release: \`$(echo "$out" | grep -m1 '^tag to create')\`"
46
+ else
47
+ echo "Merging this PR would not release a new version (only docs, test or ci changes)."
48
+ fi
49
+ } >> "$GITHUB_STEP_SUMMARY"
50
+ echo "$out"
51
+ exit 0
52
+
53
+ lint:
54
+ name: Lint
55
+ runs-on: ubuntu-latest
56
+ steps:
57
+ - uses: actions/checkout@v7
58
+ - uses: astral-sh/setup-uv@v10.3.3
59
+ with:
60
+ enable-cache: true
61
+ - run: uv sync
62
+ - run: uv lock --check
63
+ - run: uv run ruff check .
64
+ - run: uv run ruff format --check .
65
+
66
+ typecheck:
67
+ name: Type check (ty)
68
+ runs-on: ubuntu-latest
69
+ steps:
70
+ - uses: actions/checkout@v7
71
+ - uses: astral-sh/setup-uv@v10.3.3
72
+ with:
73
+ enable-cache: true
74
+ - run: uv sync
75
+ - run: uv run ty check
76
+
77
+ test:
78
+ name: Test (Python ${{ matrix.python-version }})
79
+ runs-on: ubuntu-latest
80
+ strategy:
81
+ fail-fast: false
82
+ matrix:
83
+ python-version: ["3.11", "3.12", "3.13", "3.14"]
84
+ steps:
85
+ - uses: actions/checkout@v7
86
+ - uses: astral-sh/setup-uv@v10.3.3
87
+ with:
88
+ enable-cache: true
89
+ python-version: ${{ matrix.python-version }}
90
+ - run: uv sync
91
+ - run: uv run pytest
92
+
93
+ min-deps:
94
+ name: Minimum dependencies
95
+ runs-on: ubuntu-latest
96
+ steps:
97
+ - uses: actions/checkout@v7
98
+ - uses: astral-sh/setup-uv@v10.3.3
99
+ with:
100
+ python-version: "3.11"
101
+ - name: Install the runtime dependencies at their lowest allowed versions
102
+ run: |
103
+ uv venv
104
+ uv pip install --resolution lowest-direct -e .
105
+ uv pip install pytest pytest-cov pydantic
106
+ uv pip list | grep -iE '^(ollama|httpx|numpy) '
107
+ - run: .venv/bin/pytest
108
+
109
+ build:
110
+ name: Build
111
+ runs-on: ubuntu-latest
112
+ steps:
113
+ - uses: actions/checkout@v7
114
+ - uses: astral-sh/setup-uv@v10.3.3
115
+ - run: uv build
116
+ - name: Check the metadata and the plugin entry points
117
+ run: |
118
+ uvx twine check dist/*
119
+ unzip -p dist/*.whl '*/entry_points.txt' | tee /dev/stderr | grep -q 'dashai.plugins'
120
+ - uses: actions/upload-artifact@v7
121
+ with:
122
+ name: dist
123
+ path: dist/
124
+ retention-days: 7
125
+
126
+ release:
127
+ name: Release
128
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
129
+ needs: [lint, typecheck, test, min-deps, build]
130
+ runs-on: ubuntu-latest
131
+ permissions:
132
+ contents: write
133
+ concurrency:
134
+ group: release
135
+ cancel-in-progress: false
136
+ steps:
137
+ - uses: actions/checkout@v7
138
+ with:
139
+ fetch-depth: 0
140
+ - uses: astral-sh/setup-uv@v10.3.3
141
+ - name: Bump the version from the conventional commits
142
+ id: bump
143
+ run: |
144
+ git config user.name "github-actions[bot]"
145
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
146
+ set +e
147
+ uvx --from commitizen cz bump --yes
148
+ rc=$?
149
+ set -e
150
+ # 21: nothing to release (only docs, test or ci); 3: no commits since the tag
151
+ if [ "$rc" -eq 21 ] || [ "$rc" -eq 3 ]; then
152
+ echo "released=false" >> "$GITHUB_OUTPUT"
153
+ echo "No release needed."
154
+ exit 0
155
+ fi
156
+ [ "$rc" -eq 0 ] || exit "$rc"
157
+ tag=$(git describe --tags --abbrev=0)
158
+ echo "released=true" >> "$GITHUB_OUTPUT"
159
+ echo "tag=$tag" >> "$GITHUB_OUTPUT"
160
+ - name: Push the bump commit and the tag
161
+ if: steps.bump.outputs.released == 'true'
162
+ run: git push origin HEAD:main --follow-tags
163
+ - name: Build the distributions
164
+ if: steps.bump.outputs.released == 'true'
165
+ run: uv build
166
+ - name: Create the GitHub release
167
+ if: steps.bump.outputs.released == 'true'
168
+ env:
169
+ GH_TOKEN: ${{ github.token }}
170
+ TAG: ${{ steps.bump.outputs.tag }}
171
+ run: |
172
+ uvx --from commitizen cz changelog "${TAG#v}" --dry-run > notes.md
173
+ gh release create "$TAG" dist/* --title "$TAG" --notes-file notes.md
@@ -0,0 +1,63 @@
1
+ name: Compatibility
2
+
3
+ # Catches breakage that no pull request causes: new releases of our dependencies
4
+ # and of DashAI itself. It also runs on pull requests that change this file or
5
+ # the compat tests, so those changes are validated before they merge.
6
+ on:
7
+ schedule:
8
+ - cron: "0 6 * * 1" # Mondays, 06:00 UTC
9
+ workflow_dispatch:
10
+ pull_request:
11
+ paths:
12
+ - ".github/workflows/scheduled.yml"
13
+ - "tests/compat/**"
14
+
15
+ concurrency:
16
+ group: compat-${{ github.ref }}
17
+ cancel-in-progress: true
18
+
19
+ permissions:
20
+ contents: read
21
+
22
+ jobs:
23
+ latest-deps:
24
+ name: Latest dependencies
25
+ runs-on: ubuntu-latest
26
+ steps:
27
+ - uses: actions/checkout@v7
28
+ - uses: astral-sh/setup-uv@v10.3.3
29
+ - name: Resolve everything again, ignoring the lock file
30
+ run: |
31
+ uv lock --upgrade
32
+ uv sync
33
+ uv pip list | grep -iE '^(ollama|httpx|numpy|pydantic) '
34
+ - run: uv run ty check
35
+ - run: uv run pytest
36
+
37
+ dashai-compat:
38
+ name: DashAI ${{ matrix.label }}
39
+ runs-on: ubuntu-latest
40
+ strategy:
41
+ fail-fast: false
42
+ matrix:
43
+ include:
44
+ - label: latest
45
+ spec: dashai
46
+ - label: 0.10.x (oldest supported)
47
+ spec: dashai==0.10.*
48
+ steps:
49
+ - uses: actions/checkout@v7
50
+ - uses: astral-sh/setup-uv@v10.3.3
51
+ with:
52
+ python-version: "3.12"
53
+ - name: Install DashAI (CPU PyTorch) and this plugin
54
+ # Take only torch from the PyTorch index. As an extra index it would also
55
+ # shadow PyPI for packaging and others, and the build backend would fall
56
+ # back to an old hatchling that cannot read this project.
57
+ run: |
58
+ uv venv
59
+ uv pip install --index-url https://download.pytorch.org/whl/cpu torch torchvision
60
+ uv pip install "${{ matrix.spec }}" -e . pytest
61
+ uv pip list | grep -iE '^(dashai|torch|ollama) '
62
+ - name: Run the tests that need the real DashAI
63
+ run: .venv/bin/pytest -m dashai -o pythonpath=src -o addopts=""
@@ -0,0 +1,9 @@
1
+ .coverage
2
+ coverage.xml
3
+ dist/
4
+ *.egg-info/
5
+ .env
6
+ __pycache__/
7
+ .pytest_cache/
8
+ .ruff_cache/
9
+ .venv/
@@ -0,0 +1,56 @@
1
+ # Install once with: uv run pre-commit install
2
+ default_install_hook_types: [pre-commit, commit-msg, pre-push]
3
+ default_stages: [pre-commit]
4
+
5
+ repos:
6
+ - repo: https://github.com/pre-commit/pre-commit-hooks
7
+ rev: v6.0.0
8
+ hooks:
9
+ - id: trailing-whitespace
10
+ - id: end-of-file-fixer
11
+ - id: mixed-line-ending
12
+ - id: check-case-conflict
13
+ - id: check-merge-conflict
14
+ - id: check-added-large-files
15
+ - id: check-yaml
16
+ - id: check-toml
17
+ - id: detect-private-key
18
+
19
+ - repo: https://github.com/gitleaks/gitleaks
20
+ rev: v8.30.1
21
+ hooks:
22
+ - id: gitleaks
23
+
24
+ - repo: https://github.com/astral-sh/ruff-pre-commit
25
+ rev: v0.17.3
26
+ hooks:
27
+ - id: ruff-check
28
+ args: [--fix, --exit-non-zero-on-fix]
29
+ - id: ruff-format
30
+
31
+ - repo: https://github.com/astral-sh/uv-pre-commit
32
+ rev: 0.13.7
33
+ hooks:
34
+ - id: uv-lock
35
+
36
+ - repo: https://github.com/commitizen-tools/commitizen
37
+ rev: v4.19.3
38
+ hooks:
39
+ - id: commitizen
40
+ stages: [commit-msg]
41
+
42
+ - repo: local
43
+ hooks:
44
+ - id: ty
45
+ name: ty
46
+ entry: uv run --frozen ty check
47
+ language: system
48
+ types: [python]
49
+ pass_filenames: false
50
+ - id: pytest
51
+ name: pytest
52
+ entry: uv run --frozen pytest -q
53
+ language: system
54
+ types: [python]
55
+ pass_filenames: false
56
+ stages: [pre-push]
@@ -0,0 +1 @@
1
+ 3.11
@@ -0,0 +1,19 @@
1
+ ## v0.2.3 (2026-11-03)
2
+
3
+ ### Fix
4
+
5
+ - improve component descriptions and link the repository (#7)
6
+
7
+ ## v0.2.2 (2026-11-03)
8
+
9
+ ### Chore
10
+
11
+ - add IDIA-tt as author, classifiers and project URLs (#5)
12
+
13
+ ## v0.2.1 (2026-11-03)
14
+
15
+ ### Chore
16
+
17
+ - **model**: rename the display name to "Ollama Model" (#2)
18
+
19
+ ## v0.2.0 (2026-11-03)
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022-2026 dashAI Team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.