Skip to content

Commit fa47f44

Browse files
release: 0.1.0-alpha.7 (#13)
* feat(client): add agent_domain option * feat(api): manual updates Added agent chat completions * feat(api): manual updates made chat_token log prob shared * feat(api): manual updates Move models to platform api * release: 0.1.0-alpha.7 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 40d3032 commit fa47f44

29 files changed

+1286
-202
lines changed

.release-please-manifest.json

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

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 77
1+
configured_endpoints: 76
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradientai-e8b3cbc80e18e4f7f277010349f25e1319156704f359911dc464cc21a0d077a6.yml
33
openapi_spec_hash: c773d792724f5647ae25a5ae4ccec208
4-
config_hash: 9c2519464cf5de240e34bd89b9f65706
4+
config_hash: f0976fbc552ea878bb527447b5e663c9

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
## 0.1.0-alpha.7 (2025-06-27)
4+
5+
Full Changelog: [v0.1.0-alpha.6...v0.1.0-alpha.7](https://github.com/digitalocean/gradientai-python/compare/v0.1.0-alpha.6...v0.1.0-alpha.7)
6+
7+
### Features
8+
9+
* **api:** manual updates ([63b9ec0](https://github.com/digitalocean/gradientai-python/commit/63b9ec02a646dad258afbd048db8db1af8d4401b))
10+
* **api:** manual updates ([5247aee](https://github.com/digitalocean/gradientai-python/commit/5247aee6d6052f6380fbe892d7c2bd9a8d0a32c0))
11+
* **api:** manual updates ([aa9e2c7](https://github.com/digitalocean/gradientai-python/commit/aa9e2c78956162f6195fdbaa1c95754ee4af207e))
12+
* **client:** add agent_domain option ([b4b6260](https://github.com/digitalocean/gradientai-python/commit/b4b62609a12a1dfa0b505e9ec54334b776fb0515))
13+
314
## 0.1.0-alpha.6 (2025-06-27)
415

516
Full Changelog: [v0.1.0-alpha.5...v0.1.0-alpha.6](https://github.com/digitalocean/gradientai-python/compare/v0.1.0-alpha.5...v0.1.0-alpha.6)

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ client = GradientAI(
3131
api_key=os.environ.get("GRADIENTAI_API_KEY"), # This is the default and can be omitted
3232
)
3333

34-
completion = client.chat.completions.create(
34+
completion = client.agents.chat.completions.create(
3535
messages=[
3636
{
3737
"content": "string",
@@ -63,7 +63,7 @@ client = AsyncGradientAI(
6363

6464

6565
async def main() -> None:
66-
completion = await client.chat.completions.create(
66+
completion = await client.agents.chat.completions.create(
6767
messages=[
6868
{
6969
"content": "string",
@@ -105,7 +105,7 @@ async def main() -> None:
105105
api_key=os.environ.get("GRADIENTAI_API_KEY"), # This is the default and can be omitted
106106
http_client=DefaultAioHttpClient(),
107107
) as client:
108-
completion = await client.chat.completions.create(
108+
completion = await client.agents.chat.completions.create(
109109
messages=[
110110
{
111111
"content": "string",
@@ -138,7 +138,7 @@ from gradientai import GradientAI
138138

139139
client = GradientAI()
140140

141-
completion = client.chat.completions.create(
141+
completion = client.agents.chat.completions.create(
142142
messages=[
143143
{
144144
"content": "string",

api.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Shared Types
22

33
```python
4-
from gradientai.types import APILinks, APIMeta
4+
from gradientai.types import APILinks, APIMeta, ChatCompletionTokenLogprob
55
```
66

77
# Agents
@@ -58,6 +58,20 @@ Methods:
5858
- <code title="delete /v2/gen-ai/agents/{agent_uuid}/api_keys/{api_key_uuid}">client.agents.api_keys.<a href="./src/gradientai/resources/agents/api_keys.py">delete</a>(api_key_uuid, \*, agent_uuid) -> <a href="./src/gradientai/types/agents/api_key_delete_response.py">APIKeyDeleteResponse</a></code>
5959
- <code title="put /v2/gen-ai/agents/{agent_uuid}/api_keys/{api_key_uuid}/regenerate">client.agents.api_keys.<a href="./src/gradientai/resources/agents/api_keys.py">regenerate</a>(api_key_uuid, \*, agent_uuid) -> <a href="./src/gradientai/types/agents/api_key_regenerate_response.py">APIKeyRegenerateResponse</a></code>
6060

61+
## Chat
62+
63+
### Completions
64+
65+
Types:
66+
67+
```python
68+
from gradientai.types.agents.chat import CompletionCreateResponse
69+
```
70+
71+
Methods:
72+
73+
- <code title="post /chat/completions">client.agents.chat.completions.<a href="./src/gradientai/resources/agents/chat/completions.py">create</a>(\*\*<a href="src/gradientai/types/agents/chat/completion_create_params.py">params</a>) -> <a href="./src/gradientai/types/agents/chat/completion_create_response.py">CompletionCreateResponse</a></code>
74+
6175
## EvaluationMetrics
6276

6377
Types:
@@ -382,7 +396,7 @@ Methods:
382396
Types:
383397

384398
```python
385-
from gradientai.types.chat import ChatCompletionTokenLogprob, CompletionCreateResponse
399+
from gradientai.types.chat import CompletionCreateResponse
386400
```
387401

388402
Methods:
@@ -419,10 +433,9 @@ Methods:
419433
Types:
420434

421435
```python
422-
from gradientai.types import APIAgreement, APIModel, APIModelVersion, Model, ModelListResponse
436+
from gradientai.types import APIAgreement, APIModel, APIModelVersion, ModelListResponse
423437
```
424438

425439
Methods:
426440

427-
- <code title="get /models/{model}">client.models.<a href="./src/gradientai/resources/models.py">retrieve</a>(model) -> <a href="./src/gradientai/types/model.py">Model</a></code>
428-
- <code title="get /models">client.models.<a href="./src/gradientai/resources/models.py">list</a>() -> <a href="./src/gradientai/types/model_list_response.py">ModelListResponse</a></code>
441+
- <code title="get /v2/gen-ai/models">client.models.<a href="./src/gradientai/resources/models.py">list</a>(\*\*<a href="src/gradientai/types/model_list_params.py">params</a>) -> <a href="./src/gradientai/types/model_list_response.py">ModelListResponse</a></code>

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "c63a5cfe-b235-4fbe-8bbb-82a9e02a482a-python"
3-
version = "0.1.0-alpha.6"
3+
version = "0.1.0-alpha.7"
44
description = "The official Python library for GradientAI"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

src/gradientai/_client.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,14 @@ class GradientAI(SyncAPIClient):
5757
# client options
5858
api_key: str | None
5959
inference_key: str | None
60+
agent_domain: str | None
6061

6162
def __init__(
6263
self,
6364
*,
6465
api_key: str | None = None,
6566
inference_key: str | None = None,
67+
agent_domain: str | None = None,
6668
base_url: str | httpx.URL | None = None,
6769
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
6870
max_retries: int = DEFAULT_MAX_RETRIES,
@@ -96,6 +98,8 @@ def __init__(
9698
inference_key = os.environ.get("GRADIENTAI_INFERENCE_KEY")
9799
self.inference_key = inference_key
98100

101+
self.agent_domain = agent_domain
102+
99103
if base_url is None:
100104
base_url = os.environ.get("GRADIENT_AI_BASE_URL")
101105
self._base_url_overridden = base_url is not None
@@ -201,6 +205,7 @@ def copy(
201205
*,
202206
api_key: str | None = None,
203207
inference_key: str | None = None,
208+
agent_domain: str | None = None,
204209
base_url: str | httpx.URL | None = None,
205210
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
206211
http_client: httpx.Client | None = None,
@@ -236,6 +241,7 @@ def copy(
236241
client = self.__class__(
237242
api_key=api_key or self.api_key,
238243
inference_key=inference_key or self.inference_key,
244+
agent_domain=agent_domain or self.agent_domain,
239245
base_url=base_url or self.base_url,
240246
timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
241247
http_client=http_client,
@@ -289,12 +295,14 @@ class AsyncGradientAI(AsyncAPIClient):
289295
# client options
290296
api_key: str | None
291297
inference_key: str | None
298+
agent_domain: str | None
292299

293300
def __init__(
294301
self,
295302
*,
296303
api_key: str | None = None,
297304
inference_key: str | None = None,
305+
agent_domain: str | None = None,
298306
base_url: str | httpx.URL | None = None,
299307
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
300308
max_retries: int = DEFAULT_MAX_RETRIES,
@@ -328,6 +336,8 @@ def __init__(
328336
inference_key = os.environ.get("GRADIENTAI_INFERENCE_KEY")
329337
self.inference_key = inference_key
330338

339+
self.agent_domain = agent_domain
340+
331341
if base_url is None:
332342
base_url = os.environ.get("GRADIENT_AI_BASE_URL")
333343
self._base_url_overridden = base_url is not None
@@ -433,6 +443,7 @@ def copy(
433443
*,
434444
api_key: str | None = None,
435445
inference_key: str | None = None,
446+
agent_domain: str | None = None,
436447
base_url: str | httpx.URL | None = None,
437448
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
438449
http_client: httpx.AsyncClient | None = None,
@@ -468,6 +479,7 @@ def copy(
468479
client = self.__class__(
469480
api_key=api_key or self.api_key,
470481
inference_key=inference_key or self.inference_key,
482+
agent_domain=agent_domain or self.agent_domain,
471483
base_url=base_url or self.base_url,
472484
timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
473485
http_client=http_client,

src/gradientai/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "gradientai"
4-
__version__ = "0.1.0-alpha.6" # x-release-please-version
4+
__version__ = "0.1.0-alpha.7" # x-release-please-version

src/gradientai/resources/agents/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3+
from .chat import (
4+
ChatResource,
5+
AsyncChatResource,
6+
ChatResourceWithRawResponse,
7+
AsyncChatResourceWithRawResponse,
8+
ChatResourceWithStreamingResponse,
9+
AsyncChatResourceWithStreamingResponse,
10+
)
311
from .agents import (
412
AgentsResource,
513
AsyncAgentsResource,
@@ -88,6 +96,12 @@
8896
"AsyncAPIKeysResourceWithRawResponse",
8997
"APIKeysResourceWithStreamingResponse",
9098
"AsyncAPIKeysResourceWithStreamingResponse",
99+
"ChatResource",
100+
"AsyncChatResource",
101+
"ChatResourceWithRawResponse",
102+
"AsyncChatResourceWithRawResponse",
103+
"ChatResourceWithStreamingResponse",
104+
"AsyncChatResourceWithStreamingResponse",
91105
"EvaluationMetricsResource",
92106
"AsyncEvaluationMetricsResource",
93107
"EvaluationMetricsResourceWithRawResponse",

src/gradientai/resources/agents/agents.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@
4141
AsyncVersionsResourceWithStreamingResponse,
4242
)
4343
from ..._compat import cached_property
44+
from .chat.chat import (
45+
ChatResource,
46+
AsyncChatResource,
47+
ChatResourceWithRawResponse,
48+
AsyncChatResourceWithRawResponse,
49+
ChatResourceWithStreamingResponse,
50+
AsyncChatResourceWithStreamingResponse,
51+
)
4452
from .functions import (
4553
FunctionsResource,
4654
AsyncFunctionsResource,
@@ -114,6 +122,10 @@ class AgentsResource(SyncAPIResource):
114122
def api_keys(self) -> APIKeysResource:
115123
return APIKeysResource(self._client)
116124

125+
@cached_property
126+
def chat(self) -> ChatResource:
127+
return ChatResource(self._client)
128+
117129
@cached_property
118130
def evaluation_metrics(self) -> EvaluationMetricsResource:
119131
return EvaluationMetricsResource(self._client)
@@ -498,6 +510,10 @@ class AsyncAgentsResource(AsyncAPIResource):
498510
def api_keys(self) -> AsyncAPIKeysResource:
499511
return AsyncAPIKeysResource(self._client)
500512

513+
@cached_property
514+
def chat(self) -> AsyncChatResource:
515+
return AsyncChatResource(self._client)
516+
501517
@cached_property
502518
def evaluation_metrics(self) -> AsyncEvaluationMetricsResource:
503519
return AsyncEvaluationMetricsResource(self._client)
@@ -904,6 +920,10 @@ def __init__(self, agents: AgentsResource) -> None:
904920
def api_keys(self) -> APIKeysResourceWithRawResponse:
905921
return APIKeysResourceWithRawResponse(self._agents.api_keys)
906922

923+
@cached_property
924+
def chat(self) -> ChatResourceWithRawResponse:
925+
return ChatResourceWithRawResponse(self._agents.chat)
926+
907927
@cached_property
908928
def evaluation_metrics(self) -> EvaluationMetricsResourceWithRawResponse:
909929
return EvaluationMetricsResourceWithRawResponse(self._agents.evaluation_metrics)
@@ -964,6 +984,10 @@ def __init__(self, agents: AsyncAgentsResource) -> None:
964984
def api_keys(self) -> AsyncAPIKeysResourceWithRawResponse:
965985
return AsyncAPIKeysResourceWithRawResponse(self._agents.api_keys)
966986

987+
@cached_property
988+
def chat(self) -> AsyncChatResourceWithRawResponse:
989+
return AsyncChatResourceWithRawResponse(self._agents.chat)
990+
967991
@cached_property
968992
def evaluation_metrics(self) -> AsyncEvaluationMetricsResourceWithRawResponse:
969993
return AsyncEvaluationMetricsResourceWithRawResponse(self._agents.evaluation_metrics)
@@ -1024,6 +1048,10 @@ def __init__(self, agents: AgentsResource) -> None:
10241048
def api_keys(self) -> APIKeysResourceWithStreamingResponse:
10251049
return APIKeysResourceWithStreamingResponse(self._agents.api_keys)
10261050

1051+
@cached_property
1052+
def chat(self) -> ChatResourceWithStreamingResponse:
1053+
return ChatResourceWithStreamingResponse(self._agents.chat)
1054+
10271055
@cached_property
10281056
def evaluation_metrics(self) -> EvaluationMetricsResourceWithStreamingResponse:
10291057
return EvaluationMetricsResourceWithStreamingResponse(self._agents.evaluation_metrics)
@@ -1084,6 +1112,10 @@ def __init__(self, agents: AsyncAgentsResource) -> None:
10841112
def api_keys(self) -> AsyncAPIKeysResourceWithStreamingResponse:
10851113
return AsyncAPIKeysResourceWithStreamingResponse(self._agents.api_keys)
10861114

1115+
@cached_property
1116+
def chat(self) -> AsyncChatResourceWithStreamingResponse:
1117+
return AsyncChatResourceWithStreamingResponse(self._agents.chat)
1118+
10871119
@cached_property
10881120
def evaluation_metrics(self) -> AsyncEvaluationMetricsResourceWithStreamingResponse:
10891121
return AsyncEvaluationMetricsResourceWithStreamingResponse(self._agents.evaluation_metrics)

0 commit comments

Comments
 (0)