Skip to content
Merged
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.0.0-beta.2"
".": "3.0.0-beta.3"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 170
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-9aca3802735e1375125412aa28ac36bf2175144b8218610a73d2e7f775694dff.yml
openapi_spec_hash: e29d14e3e4679fcf22b3e760e49931b1
config_hash: de89a9c8fde0120577d2aca8be4ae027
config_hash: 99e3cd5dde0beb796f4547410869f726
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## 3.0.0-beta.3 (2025-08-08)

Full Changelog: [v3.0.0-beta.2...v3.0.0-beta.3](https://github.com/digitalocean/gradient-python/compare/v3.0.0-beta.2...v3.0.0-beta.3)

### Features

* **api:** make kwargs match the env vars ([b74952e](https://github.com/digitalocean/gradient-python/commit/b74952e665a92a50937f475ef68331d85d96e018))
* **api:** rename environment variables ([ed70ab7](https://github.com/digitalocean/gradient-python/commit/ed70ab72ce3faecd7fb5070f429275518b7aa6f2))


### Bug Fixes

* actually read env vars ([68daceb](https://github.com/digitalocean/gradient-python/commit/68daceb4cf89b76fbf04e5111cea7541a989afed))
* **config:** align environment variables with other DO tools and console ([#40](https://github.com/digitalocean/gradient-python/issues/40)) ([#41](https://github.com/digitalocean/gradient-python/issues/41)) ([6853d05](https://github.com/digitalocean/gradient-python/commit/6853d0542055a29a70685cab67414e5612890c7d))
* use of cached variable in internals ([4bd6ace](https://github.com/digitalocean/gradient-python/commit/4bd6ace92d2dbfe1364c5f5aa8e0bf5899e8fc16))


### Chores

* **internal:** fix ruff target version ([b370349](https://github.com/digitalocean/gradient-python/commit/b370349a68d24b00854e3f54df50c86f2c29651b))

## 3.0.0-beta.2 (2025-08-04)

Full Changelog: [v3.0.0-beta.1...v3.0.0-beta.2](https://github.com/digitalocean/gradient-python/compare/v3.0.0-beta.1...v3.0.0-beta.2)
Expand Down
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,17 @@ import os
from gradient import Gradient

client = Gradient(
api_key=os.environ.get("GRADIENT_API_KEY"), # This is the default and can be omitted
access_token=os.environ.get(
"DIGITALOCEAN_ACCESS_TOKEN"
), # This is the default and can be omitted
)
inference_client = Gradient(
inference_key=os.environ.get(
"GRADIENT_INFERENCE_KEY"
"GRADIENT_MODEL_ACCESS_KEY"
), # This is the default and can be omitted
)
agent_client = Gradient(
agent_key=os.environ.get("GRADIENT_AGENT_KEY"), # This is the default and can be omitted
agent_key=os.environ.get("GRADIENT_AGENT_ACCESS_KEY"), # This is the default and can be omitted
agent_endpoint="https://my-agent.agents.do-ai.run",
)

Expand Down Expand Up @@ -90,9 +92,9 @@ print("--- Agent Inference")
print(agent_response.choices[0].message.content)
```

While you can provide an `api_key`, `inference_key` keyword argument,
While you can provide an `access_token`, `model_access_key` keyword argument,
we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
to add `GRADIENT_API_KEY="My API Key"`, `GRADIENT_INFERENCE_KEY="My INFERENCE Key"` to your `.env` file
to add `DIGITALOCEAN_ACCESS_TOKEN="My API Key"`, `GRADIENT_MODEL_ACCESS_KEY="My INFERENCE Key"` to your `.env` file
so that your keys are not stored in source control.

## Async usage
Expand All @@ -105,7 +107,9 @@ import asyncio
from gradient import AsyncGradient

client = AsyncGradient(
api_key=os.environ.get("GRADIENT_API_KEY"), # This is the default and can be omitted
access_token=os.environ.get(
"DIGITALOCEAN_ACCESS_TOKEN"
), # This is the default and can be omitted
)


Expand Down Expand Up @@ -148,7 +152,7 @@ from gradient import AsyncGradient

async def main() -> None:
async with AsyncGradient(
api_key="My API Key",
access_token="My Access Token",
http_client=DefaultAioHttpClient(),
) as client:
completion = await client.chat.completions.create(
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.0.0-beta.2"
version = "3.0.0-beta.3"
description = "The official Python library for the Gradient API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down Expand Up @@ -142,7 +142,7 @@ reportPrivateUsage = false
[tool.ruff]
line-length = 120
output-format = "grouped"
target-version = "py37"
target-version = "py38"

[tool.ruff.format]
docstring-code-format = true
Expand Down
Loading