Skip to content

Commit 7be8b1f

Browse files
abrichrclaude
andcommitted
chore: prepare for PyPI publishing and update Gemini models
- Add PyPI metadata: maintainers, classifiers, keywords, project URLs - Create LICENSE file (MIT) - Add GitHub workflow for trusted PyPI publishing - Update Google provider to use current Gemini models (3.x, 2.5.x) - Remove deprecated models (2.0, 1.5) that are retired or retiring - Update tests to reflect new model names Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 89abfc5 commit 7be8b1f

5 files changed

Lines changed: 150 additions & 7 deletions

File tree

.github/workflows/publish.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build:
10+
name: Build distribution
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: '3.12'
19+
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@v4
22+
with:
23+
version: "latest"
24+
25+
- name: Build package
26+
run: uv build
27+
28+
- name: Store distribution packages
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: python-package-distributions
32+
path: dist/
33+
34+
publish-to-pypi:
35+
name: Publish to PyPI
36+
needs: build
37+
runs-on: ubuntu-latest
38+
environment:
39+
name: pypi
40+
url: https://pypi.org/p/openadapt-grounding
41+
permissions:
42+
id-token: write # Required for trusted publishing
43+
44+
steps:
45+
- name: Download distribution packages
46+
uses: actions/download-artifact@v4
47+
with:
48+
name: python-package-distributions
49+
path: dist/
50+
51+
- name: Publish to PyPI
52+
uses: pypa/gh-action-pypi-publish@release/v1
53+
# No API token needed - uses trusted publishing via OIDC
54+
55+
publish-to-testpypi:
56+
name: Publish to TestPyPI
57+
needs: build
58+
runs-on: ubuntu-latest
59+
environment:
60+
name: testpypi
61+
url: https://test.pypi.org/p/openadapt-grounding
62+
permissions:
63+
id-token: write # Required for trusted publishing
64+
65+
steps:
66+
- name: Download distribution packages
67+
uses: actions/download-artifact@v4
68+
with:
69+
name: python-package-distributions
70+
path: dist/
71+
72+
- name: Publish to TestPyPI
73+
uses: pypa/gh-action-pypi-publish@release/v1
74+
with:
75+
repository-url: https://test.pypi.org/legacy/
76+
# No API token needed - uses trusted publishing via OIDC
77+
78+
github-release:
79+
name: Create GitHub Release
80+
needs: publish-to-pypi
81+
runs-on: ubuntu-latest
82+
permissions:
83+
contents: write # Required to create releases
84+
85+
steps:
86+
- name: Download distribution packages
87+
uses: actions/download-artifact@v4
88+
with:
89+
name: python-package-distributions
90+
path: dist/
91+
92+
- name: Create GitHub Release
93+
env:
94+
GITHUB_TOKEN: ${{ github.token }}
95+
run: |
96+
gh release create '${{ github.ref_name }}' \
97+
--repo '${{ github.repository }}' \
98+
--title '${{ github.ref_name }}' \
99+
--generate-notes \
100+
dist/*

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 OpenAdaptAI
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.

pyproject.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,21 @@ license = "MIT"
1212
authors = [
1313
{name = "Richard Abrich", email = "richard@openadapt.ai"}
1414
]
15+
maintainers = [
16+
{name = "OpenAdaptAI", email = "info@openadapt.ai"}
17+
]
18+
keywords = ["grounding", "ui", "localization", "automation", "vlm", "vision", "ocr", "omniparser"]
19+
classifiers = [
20+
"Development Status :: 3 - Alpha",
21+
"Intended Audience :: Developers",
22+
"License :: OSI Approved :: MIT License",
23+
"Programming Language :: Python :: 3",
24+
"Programming Language :: Python :: 3.10",
25+
"Programming Language :: Python :: 3.11",
26+
"Programming Language :: Python :: 3.12",
27+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
28+
"Topic :: Software Development :: Libraries :: Python Modules",
29+
]
1530

1631
dependencies = [
1732
"pillow>=10.0.0",
@@ -56,6 +71,13 @@ all = [
5671
"openadapt-grounding[dev,deploy,uitars,eval,providers]",
5772
]
5873

74+
[project.urls]
75+
Homepage = "https://github.com/OpenAdaptAI/openadapt-grounding"
76+
Repository = "https://github.com/OpenAdaptAI/openadapt-grounding"
77+
Documentation = "https://github.com/OpenAdaptAI/openadapt-grounding#readme"
78+
Issues = "https://github.com/OpenAdaptAI/openadapt-grounding/issues"
79+
Changelog = "https://github.com/OpenAdaptAI/openadapt-grounding/releases"
80+
5981
[tool.hatch.build.targets.wheel]
6082
packages = ["src/openadapt_grounding"]
6183

src/openadapt_grounding/providers/google.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class GoogleProvider(BaseAPIProvider):
1919
>>> image = Image.open("screenshot.png")
2020
>>> response = provider.send_message(
2121
... client=client,
22-
... model="gemini-2.5-pro",
22+
... model="gemini-3-pro",
2323
... system="Describe UI elements in the image.",
2424
... content=[
2525
... {"type": "text", "text": "What buttons are visible?"},
@@ -29,11 +29,11 @@ class GoogleProvider(BaseAPIProvider):
2929
"""
3030

3131
SUPPORTED_MODELS: List[str] = [
32+
"gemini-3-pro",
33+
"gemini-3-flash",
3234
"gemini-2.5-pro",
3335
"gemini-2.5-flash",
34-
"gemini-2.0-flash",
35-
"gemini-1.5-pro",
36-
"gemini-1.5-flash",
36+
"gemini-2.5-flash-lite",
3737
]
3838

3939
@property
@@ -84,7 +84,7 @@ def send_message(
8484
8585
Args:
8686
client: Client from create_client() (google.genai.Client).
87-
model: Model identifier (e.g., "gemini-2.5-pro").
87+
model: Model identifier (e.g., "gemini-3-pro").
8888
system: System prompt to set context/behavior.
8989
content: List of content blocks. Supported types:
9090
- {"type": "text", "text": "..."}

tests/test_providers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,9 @@ def test_supported_models(self):
271271
"""Test supported models list."""
272272
provider = GoogleProvider()
273273
models = provider.get_supported_models()
274+
assert "gemini-3-pro" in models
274275
assert "gemini-2.5-pro" in models
275276
assert "gemini-2.5-flash" in models
276-
assert "gemini-2.0-flash" in models
277277

278278
def test_is_model_supported(self):
279279
"""Test model support check."""
@@ -499,7 +499,7 @@ def test_google_invalid_api_key(self):
499499
with pytest.raises(RuntimeError, match="Google AI API call failed"):
500500
provider.send_message(
501501
client=client,
502-
model="gemini-2.0-flash",
502+
model="gemini-2.5-flash",
503503
system="Test",
504504
content=[{"type": "text", "text": "Test"}],
505505
)

0 commit comments

Comments
 (0)