Skip to content

Commit c8ddd5b

Browse files
committed
Refactor for AIMLAPI repo and update version to 2.8.1-beta.1
Updated repository references from 'api-sdk-python' to 'aimlapi-sdk-python' throughout the codebase and workflows. Changed version to 2.8.1-beta.1 in pyproject.toml, .release-please-manifest.json, and _version.py. Added a manual version bump workflow, removed OpenAI-specific release workflows, and adjusted CI and PyPI publishing logic for AIMLAPI. Cleaned up imports and ordering in several modules, improved README with example capabilities, and removed deprecated uploads example and test files.
1 parent 12b9ab9 commit c8ddd5b

36 files changed

+253
-318
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
lint:
1717
timeout-minutes: 10
1818
name: lint
19-
runs-on: ${{ github.repository == 'stainless-sdks/openai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
19+
runs-on: ubuntu-latest
2020
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
2121
steps:
2222
- uses: actions/checkout@v4
@@ -42,7 +42,7 @@ jobs:
4242
permissions:
4343
contents: read
4444
id-token: write
45-
runs-on: ${{ github.repository == 'stainless-sdks/openai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
45+
runs-on: ubuntu-latest
4646
steps:
4747
- uses: actions/checkout@v4
4848

@@ -60,25 +60,10 @@ jobs:
6060
- name: Run build
6161
run: rye build
6262

63-
- name: Get GitHub OIDC Token
64-
if: github.repository == 'stainless-sdks/openai-python'
65-
id: github-oidc
66-
uses: actions/github-script@v6
67-
with:
68-
script: core.setOutput('github_token', await core.getIDToken());
69-
70-
- name: Upload tarball
71-
if: github.repository == 'stainless-sdks/openai-python'
72-
env:
73-
URL: https://pkg.stainless.com/s
74-
AUTH: ${{ steps.github-oidc.outputs.github_token }}
75-
SHA: ${{ github.sha }}
76-
run: ./scripts/utils/upload-artifact.sh
77-
7863
test:
7964
timeout-minutes: 10
8065
name: test
81-
runs-on: ${{ github.repository == 'stainless-sdks/openai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
66+
runs-on: ubuntu-latest
8267
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
8368
steps:
8469
- uses: actions/checkout@v4
@@ -100,8 +85,8 @@ jobs:
10085
examples:
10186
timeout-minutes: 10
10287
name: examples
103-
runs-on: ${{ github.repository == 'stainless-sdks/openai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
104-
if: github.repository == 'openai/openai-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
88+
runs-on: ubuntu-latest
89+
if: github.repository == 'aimlapi/aimlapi-sdk-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository)
10590

10691
steps:
10792
- uses: actions/checkout@v4
@@ -118,10 +103,10 @@ jobs:
118103
rye sync --all-features
119104
120105
- env:
121-
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
106+
AIML_API_KEY: ${{ secrets.AIML_API_KEY || secrets.AIMLAPI_API_KEY }}
122107
run: |
123108
rye run python examples/demo.py
124109
- env:
125-
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
110+
AIML_API_KEY: ${{ secrets.AIML_API_KEY || secrets.AIMLAPI_API_KEY }}
126111
run: |
127112
rye run python examples/async_demo.py

.github/workflows/create-releases.yml

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

.github/workflows/detect-breaking-changes.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
detect_breaking_changes:
1010
runs-on: 'ubuntu-latest'
1111
name: detect-breaking-changes
12-
if: github.repository == 'openai/openai-python'
12+
if: github.repository == 'aimlapi/aimlapi-sdk-python'
1313
steps:
1414
- name: Calculate fetch-depth
1515
run: |
@@ -39,4 +39,4 @@ jobs:
3939
# Try to check out previous versions of the breaking change detection script. This ensures that
4040
# we still detect breaking changes when entire files and their tests are removed.
4141
git checkout "${{ github.event.pull_request.base.sha }}" -- ./scripts/detect-breaking-changes 2>/dev/null || true
42-
./scripts/detect-breaking-changes ${{ github.event.pull_request.base.sha }}
42+
./scripts/detect-breaking-changes ${{ github.event.pull_request.base.sha }}
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Manual bump version
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
new_version:
7+
description: "New version (e.g. 0.5.3)"
8+
required: true
9+
type: string
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
bump-version:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Update version in files
25+
run: |
26+
python - << 'PY'
27+
import re
28+
import json
29+
import pathlib
30+
import sys
31+
32+
new_version = "${{ github.event.inputs.new_version }}".strip()
33+
if not new_version:
34+
print("No version provided", file=sys.stderr)
35+
sys.exit(1)
36+
37+
root = pathlib.Path(".")
38+
39+
# 1) Update pyproject.toml
40+
pyproject = root / "pyproject.toml"
41+
text = pyproject.read_text(encoding="utf-8")
42+
text, count = re.subn(
43+
r'(?m)^(version\s*=\s*")[^"]+(")',
44+
rf'\1{new_version}\2',
45+
text,
46+
)
47+
if count == 0:
48+
print('Could not find version = "..." in pyproject.toml', file=sys.stderr)
49+
sys.exit(1)
50+
pyproject.write_text(text, encoding="utf-8")
51+
print("Updated pyproject.toml")
52+
53+
# 2) Update src/aimlapi/_version.py
54+
version_py = root / "src" / "aimlapi" / "_version.py"
55+
if version_py.exists():
56+
text = version_py.read_text(encoding="utf-8")
57+
text, _ = re.subn(
58+
r'(?m)^__version__\s*=\s*"[^\"]+"',
59+
f'__version__ = "{new_version}"',
60+
text,
61+
)
62+
version_py.write_text(text, encoding="utf-8")
63+
print("Updated src/aimlapi/_version.py")
64+
else:
65+
print("src/aimlapi/_version.py not found, skipping")
66+
67+
# 3) Update .release-please-manifest.json (if present)
68+
manifest = root / ".release-please-manifest.json"
69+
if manifest.exists():
70+
data = json.loads(manifest.read_text(encoding="utf-8"))
71+
72+
if isinstance(data, dict):
73+
for key in list(data.keys()):
74+
data[key] = new_version
75+
else:
76+
print("Unexpected manifest format, skipping")
77+
sys.exit(1)
78+
79+
manifest.write_text(json.dumps(data, indent=2) + "\n", encoding="utf-8")
80+
print("Updated .release-please-manifest.json")
81+
else:
82+
print(".release-please-manifest.json not found, skipping")
83+
84+
PY
85+
86+
- name: Commit and push
87+
env:
88+
NEW_VERSION: ${{ github.event.inputs.new_version }}
89+
run: |
90+
git config user.name "github-actions[bot]"
91+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
92+
93+
git add pyproject.toml src/aimlapi/_version.py .release-please-manifest.json 2> /dev/null || true
94+
95+
if git diff --cached --quiet; then
96+
echo "No changes to commit"
97+
exit 0
98+
99+
fi
100+
101+
git commit -m "chore: bump version to ${NEW_VERSION}"
102+
git push

.github/workflows/publish-pypi.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# workflow for re-running publishing to PyPI in case it fails for some reason
2-
# you can run this workflow by navigating to https://www.github.com/openai/openai-python/actions/workflows/publish-pypi.yml
1+
# Workflow for re-running publishing to PyPI in case it fails for some reason
2+
# You can run this workflow by navigating to https://www.github.com/aimlapi/aimlapi-sdk-python/actions/workflows/publish-pypi.yml
33
name: Publish PyPI
44
on:
55
workflow_dispatch:
@@ -25,4 +25,4 @@ jobs:
2525
run: |
2626
bash ./bin/publish-pypi
2727
env:
28-
PYPI_TOKEN: ${{ secrets.OPENAI_PYPI_TOKEN || secrets.PYPI_TOKEN }}
28+
PYPI_TOKEN: ${{ secrets.AIMLAPI_PYPI_TOKEN || secrets.PYPI_TOKEN }}

.github/workflows/release-doctor.yml

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

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "2.8.1"
2+
".": "2.8.1-beta.1"
33
}

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
AI/ML API provides access to 300+ AI models (including DeepSeek, Gemini, and ChatGPT) with enterprise-grade rate limits and uptime. This package is an OpenAI-compatible fork of the official OpenAI Python client and defaults to the AI/ML API endpoints so you can reuse familiar APIs while targeting [api.aimlapi.com](https://api.aimlapi.com/v1/).
44

5+
**Overview of example capabilities:**
6+
7+
* **Chat completions** — sync, async, and streaming
8+
* **Responses API streaming** — incremental response events
9+
* **Vision and image generation** — creating and processing visual content
10+
* **Speech generation and transcription** — TTS and STT capabilities
11+
* **Video generation** — multi-step video creation and retrieval
12+
* **Structured outputs** — schema-validated responses
13+
* **Tool calling** — function and tool execution via the model
14+
* **Azure / Entra authentication flows** — enterprise identity support
15+
* **Modular client usage** — flexible, component-based API design
16+
517
- Models: https://aimlapi.com/models
618
- REST API reference: https://docs.aimlapi.com/
719
- Example endpoints: https://api.aimlapi.com/v1/ and https://api.aimlapi.com/v1/chat/completions

examples/picture.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#!/usr/bin/env python
22

3-
from aimlapi import AIMLAPI
43
import base64
54

5+
from aimlapi import AIMLAPI
6+
67
# gets AIML_API_KEY from your environment variables
78
aimlapi = AIMLAPI()
89

examples/uploads.py

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

0 commit comments

Comments
 (0)