Skip to content

Commit fac7409

Browse files
feat(api): api update
1 parent 711ee7c commit fac7409

10 files changed

+98
-7
lines changed

.github/workflows/create-releases.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Create releases
2+
on:
3+
schedule:
4+
- cron: '0 5 * * *' # every day at 5am UTC
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
release:
11+
name: release
12+
if: github.ref == 'refs/heads/main' && github.repository == 'openlayer-ai/openlayer-python'
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: stainless-api/trigger-release-please@v1
19+
id: release
20+
with:
21+
repo: ${{ github.event.repository.full_name }}
22+
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}
23+
24+
- name: Install Rye
25+
if: ${{ steps.release.outputs.releases_created }}
26+
run: |
27+
curl -sSf https://rye.astral.sh/get | bash
28+
echo "$HOME/.rye/shims" >> $GITHUB_PATH
29+
env:
30+
RYE_VERSION: '0.35.0'
31+
RYE_INSTALL_OPTION: '--yes'
32+
33+
- name: Publish to PyPI
34+
if: ${{ steps.release.outputs.releases_created }}
35+
run: |
36+
bash ./bin/publish-pypi
37+
env:
38+
PYPI_TOKEN: ${{ secrets.OPENLAYER_PYPI_TOKEN || secrets.PYPI_TOKEN }}

.github/workflows/publish-pypi.yml

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
# This workflow is triggered when a GitHub release is created.
2-
# It can also be run manually to re-publish to PyPI in case it failed for some reason.
3-
# You can run this workflow by navigating to https://www.github.com/openlayer-ai/openlayer-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/openlayer-ai/openlayer-python/actions/workflows/publish-pypi.yml
43
name: Publish PyPI
54
on:
65
workflow_dispatch:
76

8-
release:
9-
types: [published]
10-
117
jobs:
128
publish:
139
name: publish

.github/workflows/release-doctor.yml

+1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ jobs:
1818
run: |
1919
bash ./bin/check-release-environment
2020
env:
21+
STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }}
2122
PYPI_TOKEN: ${{ secrets.OPENLAYER_PYPI_TOKEN || secrets.PYPI_TOKEN }}

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2024 Openlayer
189+
Copyright 2025 Openlayer
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

bin/check-release-environment

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
errors=()
44

5+
if [ -z "${STAINLESS_API_KEY}" ]; then
6+
errors+=("The STAINLESS_API_KEY secret has not been set. Please contact Stainless for an API key & set it in your organization secrets on GitHub.")
7+
fi
8+
59
if [ -z "${PYPI_TOKEN}" ]; then
610
errors+=("The OPENLAYER_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
711
fi

src/openlayer/types/inference_pipeline_retrieve_response.py

+12
Original file line numberDiff line numberDiff line change
@@ -114,26 +114,37 @@ class WorkspaceMonthlyUsage(BaseModel):
114114

115115
class Workspace(BaseModel):
116116
id: str
117+
"""The workspace id."""
117118

118119
creator_id: Optional[str] = FieldInfo(alias="creatorId", default=None)
120+
"""The workspace creator id."""
119121

120122
date_created: datetime = FieldInfo(alias="dateCreated")
123+
"""The workspace creation date."""
121124

122125
date_updated: datetime = FieldInfo(alias="dateUpdated")
126+
"""The workspace last updated date."""
123127

124128
invite_count: int = FieldInfo(alias="inviteCount")
129+
"""The number of invites in the workspace."""
125130

126131
member_count: int = FieldInfo(alias="memberCount")
132+
"""The number of members in the workspace."""
127133

128134
name: str
135+
"""The workspace name."""
129136

130137
period_end_date: Optional[datetime] = FieldInfo(alias="periodEndDate", default=None)
138+
"""The end date of the current billing period."""
131139

132140
period_start_date: Optional[datetime] = FieldInfo(alias="periodStartDate", default=None)
141+
"""The start date of the current billing period."""
133142

134143
project_count: int = FieldInfo(alias="projectCount")
144+
"""The number of projects in the workspace."""
135145

136146
slug: str
147+
"""The workspace slug."""
137148

138149
status: Literal[
139150
"active", "past_due", "unpaid", "canceled", "incomplete", "incomplete_expired", "trialing", "paused"
@@ -142,6 +153,7 @@ class Workspace(BaseModel):
142153
monthly_usage: Optional[List[WorkspaceMonthlyUsage]] = FieldInfo(alias="monthlyUsage", default=None)
143154

144155
saml_only_access: Optional[bool] = FieldInfo(alias="samlOnlyAccess", default=None)
156+
"""Whether the workspace only allows SAML authentication."""
145157

146158
wildcard_domains: Optional[List[str]] = FieldInfo(alias="wildcardDomains", default=None)
147159

src/openlayer/types/inference_pipeline_update_response.py

+12
Original file line numberDiff line numberDiff line change
@@ -114,26 +114,37 @@ class WorkspaceMonthlyUsage(BaseModel):
114114

115115
class Workspace(BaseModel):
116116
id: str
117+
"""The workspace id."""
117118

118119
creator_id: Optional[str] = FieldInfo(alias="creatorId", default=None)
120+
"""The workspace creator id."""
119121

120122
date_created: datetime = FieldInfo(alias="dateCreated")
123+
"""The workspace creation date."""
121124

122125
date_updated: datetime = FieldInfo(alias="dateUpdated")
126+
"""The workspace last updated date."""
123127

124128
invite_count: int = FieldInfo(alias="inviteCount")
129+
"""The number of invites in the workspace."""
125130

126131
member_count: int = FieldInfo(alias="memberCount")
132+
"""The number of members in the workspace."""
127133

128134
name: str
135+
"""The workspace name."""
129136

130137
period_end_date: Optional[datetime] = FieldInfo(alias="periodEndDate", default=None)
138+
"""The end date of the current billing period."""
131139

132140
period_start_date: Optional[datetime] = FieldInfo(alias="periodStartDate", default=None)
141+
"""The start date of the current billing period."""
133142

134143
project_count: int = FieldInfo(alias="projectCount")
144+
"""The number of projects in the workspace."""
135145

136146
slug: str
147+
"""The workspace slug."""
137148

138149
status: Literal[
139150
"active", "past_due", "unpaid", "canceled", "incomplete", "incomplete_expired", "trialing", "paused"
@@ -142,6 +153,7 @@ class Workspace(BaseModel):
142153
monthly_usage: Optional[List[WorkspaceMonthlyUsage]] = FieldInfo(alias="monthlyUsage", default=None)
143154

144155
saml_only_access: Optional[bool] = FieldInfo(alias="samlOnlyAccess", default=None)
156+
"""Whether the workspace only allows SAML authentication."""
145157

146158
wildcard_domains: Optional[List[str]] = FieldInfo(alias="wildcardDomains", default=None)
147159

src/openlayer/types/projects/inference_pipeline_create_params.py

+4
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,15 @@ class Project(TypedDict, total=False):
4040

4141
class Workspace(TypedDict, total=False):
4242
name: Required[str]
43+
"""The workspace name."""
4344

4445
slug: Required[str]
46+
"""The workspace slug."""
4547

4648
invite_code: Annotated[str, PropertyInfo(alias="inviteCode")]
49+
"""The workspace invite code."""
4750

4851
saml_only_access: Annotated[bool, PropertyInfo(alias="samlOnlyAccess")]
52+
"""Whether the workspace only allows SAML authentication."""
4953

5054
wildcard_domains: Annotated[List[str], PropertyInfo(alias="wildcardDomains")]

src/openlayer/types/projects/inference_pipeline_create_response.py

+12
Original file line numberDiff line numberDiff line change
@@ -114,26 +114,37 @@ class WorkspaceMonthlyUsage(BaseModel):
114114

115115
class Workspace(BaseModel):
116116
id: str
117+
"""The workspace id."""
117118

118119
creator_id: Optional[str] = FieldInfo(alias="creatorId", default=None)
120+
"""The workspace creator id."""
119121

120122
date_created: datetime = FieldInfo(alias="dateCreated")
123+
"""The workspace creation date."""
121124

122125
date_updated: datetime = FieldInfo(alias="dateUpdated")
126+
"""The workspace last updated date."""
123127

124128
invite_count: int = FieldInfo(alias="inviteCount")
129+
"""The number of invites in the workspace."""
125130

126131
member_count: int = FieldInfo(alias="memberCount")
132+
"""The number of members in the workspace."""
127133

128134
name: str
135+
"""The workspace name."""
129136

130137
period_end_date: Optional[datetime] = FieldInfo(alias="periodEndDate", default=None)
138+
"""The end date of the current billing period."""
131139

132140
period_start_date: Optional[datetime] = FieldInfo(alias="periodStartDate", default=None)
141+
"""The start date of the current billing period."""
133142

134143
project_count: int = FieldInfo(alias="projectCount")
144+
"""The number of projects in the workspace."""
135145

136146
slug: str
147+
"""The workspace slug."""
137148

138149
status: Literal[
139150
"active", "past_due", "unpaid", "canceled", "incomplete", "incomplete_expired", "trialing", "paused"
@@ -142,6 +153,7 @@ class Workspace(BaseModel):
142153
monthly_usage: Optional[List[WorkspaceMonthlyUsage]] = FieldInfo(alias="monthlyUsage", default=None)
143154

144155
saml_only_access: Optional[bool] = FieldInfo(alias="samlOnlyAccess", default=None)
156+
"""Whether the workspace only allows SAML authentication."""
145157

146158
wildcard_domains: Optional[List[str]] = FieldInfo(alias="wildcardDomains", default=None)
147159

src/openlayer/types/projects/inference_pipeline_list_response.py

+12
Original file line numberDiff line numberDiff line change
@@ -115,26 +115,37 @@ class ItemWorkspaceMonthlyUsage(BaseModel):
115115

116116
class ItemWorkspace(BaseModel):
117117
id: str
118+
"""The workspace id."""
118119

119120
creator_id: Optional[str] = FieldInfo(alias="creatorId", default=None)
121+
"""The workspace creator id."""
120122

121123
date_created: datetime = FieldInfo(alias="dateCreated")
124+
"""The workspace creation date."""
122125

123126
date_updated: datetime = FieldInfo(alias="dateUpdated")
127+
"""The workspace last updated date."""
124128

125129
invite_count: int = FieldInfo(alias="inviteCount")
130+
"""The number of invites in the workspace."""
126131

127132
member_count: int = FieldInfo(alias="memberCount")
133+
"""The number of members in the workspace."""
128134

129135
name: str
136+
"""The workspace name."""
130137

131138
period_end_date: Optional[datetime] = FieldInfo(alias="periodEndDate", default=None)
139+
"""The end date of the current billing period."""
132140

133141
period_start_date: Optional[datetime] = FieldInfo(alias="periodStartDate", default=None)
142+
"""The start date of the current billing period."""
134143

135144
project_count: int = FieldInfo(alias="projectCount")
145+
"""The number of projects in the workspace."""
136146

137147
slug: str
148+
"""The workspace slug."""
138149

139150
status: Literal[
140151
"active", "past_due", "unpaid", "canceled", "incomplete", "incomplete_expired", "trialing", "paused"
@@ -143,6 +154,7 @@ class ItemWorkspace(BaseModel):
143154
monthly_usage: Optional[List[ItemWorkspaceMonthlyUsage]] = FieldInfo(alias="monthlyUsage", default=None)
144155

145156
saml_only_access: Optional[bool] = FieldInfo(alias="samlOnlyAccess", default=None)
157+
"""Whether the workspace only allows SAML authentication."""
146158

147159
wildcard_domains: Optional[List[str]] = FieldInfo(alias="wildcardDomains", default=None)
148160

0 commit comments

Comments
 (0)