Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "3.6.0"
".": "3.7.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 175
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-cb3bf9b21459cad24410206c27a32fd31ef6cf86711700597549dbbd0d634002.yml
openapi_spec_hash: 6a9149a81ba15e7c5c5c1f4d77daad92
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-f07d74847e620dfa26d8df40ea4680814af9bba381b3a57a7b6ed76ad49d85f8.yml
openapi_spec_hash: e3553dc2abf2afd4368b736bcc32a289
config_hash: bad49c3bf949d5168ec3896bedff253a
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## 3.7.0 (2025-10-30)

Full Changelog: [v3.6.0...v3.7.0](https://github.com/digitalocean/gradient-python/compare/v3.6.0...v3.7.0)

### Features

* add wait_for_completion method to IndexingJobs resource with sy… ([#49](https://github.com/digitalocean/gradient-python/issues/49)) ([9edc2a6](https://github.com/digitalocean/gradient-python/commit/9edc2a60f5aa49749e151477615bbecb3a79e92b))
* Add wait_until_ready() method for agent deployment polling ([#56](https://github.com/digitalocean/gradient-python/issues/56)) ([dcef3d5](https://github.com/digitalocean/gradient-python/commit/dcef3d5ebb4ef903c0c91aa4008853bb978f5544))
* **api:** add inference errors ([d61d495](https://github.com/digitalocean/gradient-python/commit/d61d4955f596d9ac1bebc9387a6573989e823022))


### Bug Fixes

* **client:** close streams without requiring full consumption ([33fe04b](https://github.com/digitalocean/gradient-python/commit/33fe04b2e4ab71094ee13e7b83d4c04867e7d485))


### Chores

* bump `httpx-aiohttp` version to 0.1.9 ([db39cc6](https://github.com/digitalocean/gradient-python/commit/db39cc63fb126ac81edfe2cb991493d10a2d0936))

## 3.6.0 (2025-10-16)

Full Changelog: [v3.5.0...v3.6.0](https://github.com/digitalocean/gradient-python/compare/v3.5.0...v3.6.0)
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "gradient"
version = "3.6.0"
version = "3.7.0"
description = "The official Python library for the Gradient API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down Expand Up @@ -37,7 +37,7 @@ Homepage = "https://github.com/digitalocean/gradient-python"
Repository = "https://github.com/digitalocean/gradient-python"

[project.optional-dependencies]
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"]
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.9"]

[tool.rye]
managed = true
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ httpx==0.28.1
# via gradient
# via httpx-aiohttp
# via respx
httpx-aiohttp==0.1.8
httpx-aiohttp==0.1.9
# via gradient
idna==3.4
# via anyio
Expand Down
2 changes: 1 addition & 1 deletion requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ httpcore==1.0.9
httpx==0.28.1
# via gradient
# via httpx-aiohttp
httpx-aiohttp==0.1.8
httpx-aiohttp==0.1.9
# via gradient
idna==3.4
# via anyio
Expand Down
10 changes: 4 additions & 6 deletions src/gradient/_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,8 @@ def __stream__(self) -> Iterator[_T]:

yield process_data(data=data, cast_to=cast_to, response=response)

# Ensure the entire stream is consumed
for _sse in iterator:
...
# As we might not fully consume the response stream, we need to close it explicitly
response.close()

def __enter__(self) -> Self:
return self
Expand Down Expand Up @@ -158,9 +157,8 @@ async def __stream__(self) -> AsyncIterator[_T]:

yield process_data(data=data, cast_to=cast_to, response=response)

# Ensure the entire stream is consumed
async for _sse in iterator:
...
# As we might not fully consume the response stream, we need to close it explicitly
await response.aclose()

async def __aenter__(self) -> Self:
return self
Expand Down
2 changes: 1 addition & 1 deletion src/gradient/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "gradient"
__version__ = "3.6.0" # x-release-please-version
__version__ = "3.7.0" # x-release-please-version
30 changes: 30 additions & 0 deletions src/gradient/resources/agents/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,14 @@ def create(
description: str | Omit = omit,
instruction: str | Omit = omit,
knowledge_base_uuid: SequenceNotStr[str] | Omit = omit,
model_provider_key_uuid: str | Omit = omit,
model_uuid: str | Omit = omit,
name: str | Omit = omit,
openai_key_uuid: str | Omit = omit,
project_id: str | Omit = omit,
region: str | Omit = omit,
tags: SequenceNotStr[str] | Omit = omit,
workspace_uuid: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -227,6 +229,8 @@ def create(

tags: Agent tag to organize related resources

workspace_uuid: Identifier for the workspace

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -245,12 +249,14 @@ def create(
"description": description,
"instruction": instruction,
"knowledge_base_uuid": knowledge_base_uuid,
"model_provider_key_uuid": model_provider_key_uuid,
"model_uuid": model_uuid,
"name": name,
"openai_key_uuid": openai_key_uuid,
"project_id": project_id,
"region": region,
"tags": tags,
"workspace_uuid": workspace_uuid,
},
agent_create_params.AgentCreateParams,
),
Expand Down Expand Up @@ -302,12 +308,14 @@ def update(
path_uuid: str,
*,
agent_log_insights_enabled: bool | Omit = omit,
allowed_domains: SequenceNotStr[str] | Omit = omit,
anthropic_key_uuid: str | Omit = omit,
conversation_logs_enabled: bool | Omit = omit,
description: str | Omit = omit,
instruction: str | Omit = omit,
k: int | Omit = omit,
max_tokens: int | Omit = omit,
model_provider_key_uuid: str | Omit = omit,
model_uuid: str | Omit = omit,
name: str | Omit = omit,
openai_key_uuid: str | Omit = omit,
Expand All @@ -331,6 +339,9 @@ def update(
response body is a JSON object containing the agent.

Args:
allowed_domains: Optional list of allowed domains for the chatbot - Must use fully qualified
domain name (FQDN) such as https://example.com

anthropic_key_uuid: Optional anthropic key uuid for use with anthropic models

conversation_logs_enabled: Optional update of conversation logs enabled
Expand All @@ -348,6 +359,8 @@ def update(
or output, set as a number between 1 and 512. This determines the length of each
response.

model_provider_key_uuid: Optional Model Provider uuid for use with provider models

model_uuid: Identifier for the foundation model.

name: Agent name
Expand Down Expand Up @@ -391,12 +404,14 @@ def update(
body=maybe_transform(
{
"agent_log_insights_enabled": agent_log_insights_enabled,
"allowed_domains": allowed_domains,
"anthropic_key_uuid": anthropic_key_uuid,
"conversation_logs_enabled": conversation_logs_enabled,
"description": description,
"instruction": instruction,
"k": k,
"max_tokens": max_tokens,
"model_provider_key_uuid": model_provider_key_uuid,
"model_uuid": model_uuid,
"name": name,
"openai_key_uuid": openai_key_uuid,
Expand Down Expand Up @@ -767,12 +782,14 @@ async def create(
description: str | Omit = omit,
instruction: str | Omit = omit,
knowledge_base_uuid: SequenceNotStr[str] | Omit = omit,
model_provider_key_uuid: str | Omit = omit,
model_uuid: str | Omit = omit,
name: str | Omit = omit,
openai_key_uuid: str | Omit = omit,
project_id: str | Omit = omit,
region: str | Omit = omit,
tags: SequenceNotStr[str] | Omit = omit,
workspace_uuid: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -809,6 +826,8 @@ async def create(

tags: Agent tag to organize related resources

workspace_uuid: Identifier for the workspace

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -827,12 +846,14 @@ async def create(
"description": description,
"instruction": instruction,
"knowledge_base_uuid": knowledge_base_uuid,
"model_provider_key_uuid": model_provider_key_uuid,
"model_uuid": model_uuid,
"name": name,
"openai_key_uuid": openai_key_uuid,
"project_id": project_id,
"region": region,
"tags": tags,
"workspace_uuid": workspace_uuid,
},
agent_create_params.AgentCreateParams,
),
Expand Down Expand Up @@ -884,12 +905,14 @@ async def update(
path_uuid: str,
*,
agent_log_insights_enabled: bool | Omit = omit,
allowed_domains: SequenceNotStr[str] | Omit = omit,
anthropic_key_uuid: str | Omit = omit,
conversation_logs_enabled: bool | Omit = omit,
description: str | Omit = omit,
instruction: str | Omit = omit,
k: int | Omit = omit,
max_tokens: int | Omit = omit,
model_provider_key_uuid: str | Omit = omit,
model_uuid: str | Omit = omit,
name: str | Omit = omit,
openai_key_uuid: str | Omit = omit,
Expand All @@ -913,6 +936,9 @@ async def update(
response body is a JSON object containing the agent.

Args:
allowed_domains: Optional list of allowed domains for the chatbot - Must use fully qualified
domain name (FQDN) such as https://example.com

anthropic_key_uuid: Optional anthropic key uuid for use with anthropic models

conversation_logs_enabled: Optional update of conversation logs enabled
Expand All @@ -930,6 +956,8 @@ async def update(
or output, set as a number between 1 and 512. This determines the length of each
response.

model_provider_key_uuid: Optional Model Provider uuid for use with provider models

model_uuid: Identifier for the foundation model.

name: Agent name
Expand Down Expand Up @@ -973,12 +1001,14 @@ async def update(
body=await async_maybe_transform(
{
"agent_log_insights_enabled": agent_log_insights_enabled,
"allowed_domains": allowed_domains,
"anthropic_key_uuid": anthropic_key_uuid,
"conversation_logs_enabled": conversation_logs_enabled,
"description": description,
"instruction": instruction,
"k": k,
"max_tokens": max_tokens,
"model_provider_key_uuid": model_provider_key_uuid,
"model_uuid": model_uuid,
"name": name,
"openai_key_uuid": openai_key_uuid,
Expand Down
5 changes: 5 additions & 0 deletions src/gradient/types/agent_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class AgentCreateParams(TypedDict, total=False):
knowledge_base_uuid: SequenceNotStr[str]
"""Ids of the knowledge base(s) to attach to the agent"""

model_provider_key_uuid: str

model_uuid: str
"""Identifier for the foundation model."""

Expand All @@ -45,3 +47,6 @@ class AgentCreateParams(TypedDict, total=False):

tags: SequenceNotStr[str]
"""Agent tag to organize related resources"""

workspace_uuid: str
"""Identifier for the workspace"""
3 changes: 3 additions & 0 deletions src/gradient/types/agent_list_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@


class AgentChatbot(BaseModel):
allowed_domains: Optional[List[str]] = None

button_background_color: Optional[str] = None

logo: Optional[str] = None
Expand Down Expand Up @@ -61,6 +63,7 @@ class AgentDeployment(BaseModel):
"STATUS_UNDEPLOYING",
"STATUS_UNDEPLOYMENT_FAILED",
"STATUS_DELETED",
"STATUS_BUILDING",
]
] = None

Expand Down
9 changes: 9 additions & 0 deletions src/gradient/types/agent_update_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
class AgentUpdateParams(TypedDict, total=False):
agent_log_insights_enabled: bool

allowed_domains: SequenceNotStr[str]
"""
Optional list of allowed domains for the chatbot - Must use fully qualified
domain name (FQDN) such as https://example.com
"""

anthropic_key_uuid: str
"""Optional anthropic key uuid for use with anthropic models"""

Expand Down Expand Up @@ -41,6 +47,9 @@ class AgentUpdateParams(TypedDict, total=False):
response.
"""

model_provider_key_uuid: str
"""Optional Model Provider uuid for use with provider models"""

model_uuid: str
"""Identifier for the foundation model."""

Expand Down
Loading