Skip to content

Commit b4b6260

Browse files
feat(client): add agent_domain option
1 parent 40d3032 commit b4b6260

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 77
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: 80395df07aec0cf06a5aa7caa2e3f4bc

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,

0 commit comments

Comments
 (0)