Skip to content

Commit a30df71

Browse files
Merge pull request #166 from stainless-sdks/rthakkar/responses
Gradient SDK Responses API Support
2 parents bf5fa9f + 7160d35 commit a30df71

63 files changed

Lines changed: 5098 additions & 113 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ${{ github.repository == 'stainless-sdks/gradient-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
2020
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
2121
steps:
22-
- uses: actions/checkout@v4
22+
- uses: actions/checkout@v6
2323

2424
- name: Install Rye
2525
run: |
@@ -44,7 +44,7 @@ jobs:
4444
id-token: write
4545
runs-on: ${{ github.repository == 'stainless-sdks/gradient-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
4646
steps:
47-
- uses: actions/checkout@v4
47+
- uses: actions/checkout@v6
4848

4949
- name: Install Rye
5050
run: |
@@ -81,7 +81,7 @@ jobs:
8181
runs-on: ${{ github.repository == 'stainless-sdks/gradient-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
8282
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
8383
steps:
84-
- uses: actions/checkout@v4
84+
- uses: actions/checkout@v6
8585

8686
- name: Install Rye
8787
run: |

.github/workflows/publish-pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@v6
1818

1919
- name: Install Rye
2020
run: |

.github/workflows/release-doctor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
if: github.repository == 'digitalocean/gradient-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
1313

1414
steps:
15-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v6
1616

1717
- name: Check release environment
1818
run: |

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 189
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-0778b2e9d56c826f92ee69ef081d8d73fd94c139b85e11becaa88bf1cbe95fb9.yml
3-
openapi_spec_hash: 49daca0dd735cad7200ca1c741a5dd43
4-
config_hash: fad48c8ac796b240fe3b90181586d1a4
1+
configured_endpoints: 193
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-2344b44246a44d39ad5b74d3077bd2958745aad67feb15970756532fa0b3f9d6.yml
3+
openapi_spec_hash: a1913979235ce152a8dc380fabe5362e
4+
config_hash: 6c9a04f3cc5dd88e1e4f0ae42d98ba9a

api.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ from gradient.types import (
1010
ChatCompletionChunk,
1111
ChatCompletionTokenLogprob,
1212
CompletionUsage,
13+
CreateResponseResponse,
14+
CreateResponseStreamResponse,
1315
DiskInfo,
1416
Droplet,
1517
DropletNextBackupWindow,
@@ -404,6 +406,12 @@ Methods:
404406

405407
- <code title="post /images/generations">client.images.<a href="./src/gradient/resources/images.py">generate</a>(\*\*<a href="src/gradient/types/image_generate_params.py">params</a>) -> <a href="./src/gradient/types/image_generate_response.py">ImageGenerateResponse</a></code>
406408

409+
# Responses
410+
411+
Methods:
412+
413+
- <code title="post /responses">client.responses.<a href="./src/gradient/resources/responses.py">create</a>(\*\*<a href="src/gradient/types/response_create_params.py">params</a>) -> <a href="./src/gradient/types/shared/create_response_response.py">CreateResponseResponse</a></code>
414+
407415
# GPUDroplets
408416

409417
Types:
@@ -856,6 +864,7 @@ from gradient.types.knowledge_bases import (
856864
APIWebCrawlerDataSource,
857865
AwsDataSource,
858866
DataSourceCreateResponse,
867+
DataSourceUpdateResponse,
859868
DataSourceListResponse,
860869
DataSourceDeleteResponse,
861870
DataSourceCreatePresignedURLsResponse,
@@ -865,6 +874,7 @@ from gradient.types.knowledge_bases import (
865874
Methods:
866875

867876
- <code title="post /v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources">client.knowledge_bases.data_sources.<a href="./src/gradient/resources/knowledge_bases/data_sources.py">create</a>(path_knowledge_base_uuid, \*\*<a href="src/gradient/types/knowledge_bases/data_source_create_params.py">params</a>) -> <a href="./src/gradient/types/knowledge_bases/data_source_create_response.py">DataSourceCreateResponse</a></code>
877+
- <code title="put /v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources/{data_source_uuid}">client.knowledge_bases.data_sources.<a href="./src/gradient/resources/knowledge_bases/data_sources.py">update</a>(path_data_source_uuid, \*, path_knowledge_base_uuid, \*\*<a href="src/gradient/types/knowledge_bases/data_source_update_params.py">params</a>) -> <a href="./src/gradient/types/knowledge_bases/data_source_update_response.py">DataSourceUpdateResponse</a></code>
868878
- <code title="get /v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources">client.knowledge_bases.data_sources.<a href="./src/gradient/resources/knowledge_bases/data_sources.py">list</a>(knowledge_base_uuid, \*\*<a href="src/gradient/types/knowledge_bases/data_source_list_params.py">params</a>) -> <a href="./src/gradient/types/knowledge_bases/data_source_list_response.py">DataSourceListResponse</a></code>
869879
- <code title="delete /v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources/{data_source_uuid}">client.knowledge_bases.data_sources.<a href="./src/gradient/resources/knowledge_bases/data_sources.py">delete</a>(data_source_uuid, \*, knowledge_base_uuid) -> <a href="./src/gradient/types/knowledge_bases/data_source_delete_response.py">DataSourceDeleteResponse</a></code>
870880
- <code title="post /v2/gen-ai/knowledge_bases/data_sources/file_upload_presigned_urls">client.knowledge_bases.data_sources.<a href="./src/gradient/resources/knowledge_bases/data_sources.py">create_presigned_urls</a>(\*\*<a href="src/gradient/types/knowledge_bases/data_source_create_presigned_urls_params.py">params</a>) -> <a href="./src/gradient/types/knowledge_bases/data_source_create_presigned_urls_response.py">DataSourceCreatePresignedURLsResponse</a></code>
@@ -1039,3 +1049,29 @@ from gradient.types import RetrieveDocumentsResponse
10391049
Methods:
10401050

10411051
- <code title="post /{knowledgeBaseId}/retrieve">client.retrieve.<a href="./src/gradient/resources/retrieve.py">documents</a>(knowledge_base_id, \*\*<a href="src/gradient/types/retrieve_documents_params.py">params</a>) -> <a href="./src/gradient/types/retrieve_documents_response.py">RetrieveDocumentsResponse</a></code>
1052+
1053+
# Apps
1054+
1055+
## JobInvocations
1056+
1057+
Types:
1058+
1059+
```python
1060+
from gradient.types.apps import JobInvocationCancelResponse
1061+
```
1062+
1063+
Methods:
1064+
1065+
- <code title="post /v2/apps/{app_id}/job-invocations/{job_invocation_id}/cancel">client.apps.job_invocations.<a href="./src/gradient/resources/apps/job_invocations.py">cancel</a>(job_invocation_id, \*, app_id, \*\*<a href="src/gradient/types/apps/job_invocation_cancel_params.py">params</a>) -> <a href="./src/gradient/types/apps/job_invocation_cancel_response.py">JobInvocationCancelResponse</a></code>
1066+
1067+
# Billing
1068+
1069+
Types:
1070+
1071+
```python
1072+
from gradient.types import BillingListInsightsResponse
1073+
```
1074+
1075+
Methods:
1076+
1077+
- <code title="get /v2/billing/{account_urn}/insights/{start_date}/{end_date}">client.billing.<a href="./src/gradient/resources/billing.py">list_insights</a>(end_date, \*, account_urn, start_date, \*\*<a href="src/gradient/types/billing_list_insights_params.py">params</a>) -> <a href="./src/gradient/types/billing_list_insights_response.py">BillingListInsightsResponse</a></code>

requirements-dev.lock

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
-e file:.
1313
aiohappyeyeballs==2.6.1
1414
# via aiohttp
15-
aiohttp==3.13.2
15+
aiohttp==3.13.3
1616
# via gradient
1717
# via httpx-aiohttp
1818
aiosignal==1.4.0
1919
# via aiohttp
2020
annotated-types==0.7.0
2121
# via pydantic
22-
anyio==4.12.0
22+
anyio==4.12.1
2323
# via gradient
2424
# via httpx
2525
argcomplete==3.6.3
@@ -31,7 +31,7 @@ attrs==25.4.0
3131
# via nox
3232
backports-asyncio-runner==1.2.0
3333
# via pytest-asyncio
34-
certifi==2025.11.12
34+
certifi==2026.1.4
3535
# via httpcore
3636
# via httpx
3737
colorlog==6.10.1
@@ -61,15 +61,15 @@ httpx==0.28.1
6161
# via gradient
6262
# via httpx-aiohttp
6363
# via respx
64-
httpx-aiohttp==0.1.9
64+
httpx-aiohttp==0.1.12
6565
# via gradient
6666
humanize==4.13.0
6767
# via nox
6868
idna==3.11
6969
# via anyio
7070
# via httpx
7171
# via yarl
72-
importlib-metadata==8.7.0
72+
importlib-metadata==8.7.1
7373
iniconfig==2.1.0
7474
# via pytest
7575
markdown-it-py==3.0.0
@@ -82,14 +82,14 @@ multidict==6.7.0
8282
mypy==1.17.0
8383
mypy-extensions==1.1.0
8484
# via mypy
85-
nodeenv==1.9.1
85+
nodeenv==1.10.0
8686
# via pyright
8787
nox==2025.11.12
8888
packaging==25.0
8989
# via dependency-groups
9090
# via nox
9191
# via pytest
92-
pathspec==0.12.1
92+
pathspec==1.0.3
9393
# via mypy
9494
platformdirs==4.4.0
9595
# via virtualenv
@@ -115,13 +115,13 @@ python-dateutil==2.9.0.post0
115115
# via time-machine
116116
respx==0.22.0
117117
rich==14.2.0
118-
ruff==0.14.7
118+
ruff==0.14.13
119119
six==1.17.0
120120
# via python-dateutil
121121
sniffio==1.3.1
122122
# via gradient
123123
time-machine==2.19.0
124-
tomli==2.3.0
124+
tomli==2.4.0
125125
# via dependency-groups
126126
# via mypy
127127
# via nox
@@ -141,7 +141,7 @@ typing-extensions==4.15.0
141141
# via virtualenv
142142
typing-inspection==0.4.2
143143
# via pydantic
144-
virtualenv==20.35.4
144+
virtualenv==20.36.1
145145
# via nox
146146
yarl==1.22.0
147147
# via aiohttp

requirements.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@
1212
-e file:.
1313
aiohappyeyeballs==2.6.1
1414
# via aiohttp
15-
aiohttp==3.13.2
15+
aiohttp==3.13.3
1616
# via gradient
1717
# via httpx-aiohttp
1818
aiosignal==1.4.0
1919
# via aiohttp
2020
annotated-types==0.7.0
2121
# via pydantic
22-
anyio==4.12.0
22+
anyio==4.12.1
2323
# via gradient
2424
# via httpx
2525
async-timeout==5.0.1
2626
# via aiohttp
2727
attrs==25.4.0
2828
# via aiohttp
29-
certifi==2025.11.12
29+
certifi==2026.1.4
3030
# via httpcore
3131
# via httpx
3232
distro==1.9.0
@@ -43,7 +43,7 @@ httpcore==1.0.9
4343
httpx==0.28.1
4444
# via gradient
4545
# via httpx-aiohttp
46-
httpx-aiohttp==0.1.9
46+
httpx-aiohttp==0.1.12
4747
# via gradient
4848
idna==3.11
4949
# via anyio

0 commit comments

Comments
 (0)