Skip to content

Commit 4173864

Browse files
feat(api): update via SDK Studio
1 parent f6b12b8 commit 4173864

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-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: 189
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-ca993fd0bc66f703323a773c92da75207266f7f9d8c54ddac2fbd271a3cdaf86.yml
33
openapi_spec_hash: 35d7edb04aab2ab28bc7e5851a54b4e3
4-
config_hash: 70aafd9d59b80da716b5a9d896c8c0bd
4+
config_hash: fad48c8ac796b240fe3b90181586d1a4

src/gradient/_client.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ class Gradient(SyncAPIClient):
8282
agent_access_key: str | None
8383
_agent_endpoint: str | None
8484
inference_endpoint: str | None
85+
kbass_endpoint: str | None
8586

8687
def __init__(
8788
self,
@@ -91,6 +92,7 @@ def __init__(
9192
agent_access_key: str | None = None,
9293
agent_endpoint: str | None = None,
9394
inference_endpoint: str | None = None,
95+
kbass_endpoint: str | None = None,
9496
base_url: str | httpx.URL | None = None,
9597
timeout: float | Timeout | None | NotGiven = not_given,
9698
max_retries: int = DEFAULT_MAX_RETRIES,
@@ -121,6 +123,7 @@ def __init__(
121123
- `agent_access_key` from `GRADIENT_AGENT_ACCESS_KEY`
122124
- `agent_endpoint` from `GRADIENT_AGENT_ENDPOINT`
123125
- `inference_endpoint` from `GRADIENT_INFERENCE_ENDPOINT`
126+
- `kbass_endpoint` from `GRADIENT_KBASS_ENDPOINT`
124127
"""
125128
if access_token is None:
126129
access_token = os.environ.get("DIGITALOCEAN_ACCESS_TOKEN")
@@ -145,6 +148,10 @@ def __init__(
145148
)
146149
self.inference_endpoint = inference_endpoint
147150

151+
if kbass_endpoint is None:
152+
kbass_endpoint = os.environ.get("GRADIENT_KBASS_ENDPOINT") or "kbaas.do-ai.run"
153+
self.kbass_endpoint = kbass_endpoint
154+
148155
if base_url is None:
149156
base_url = os.environ.get("GRADIENT_BASE_URL")
150157
self._base_url_overridden = base_url is not None
@@ -334,6 +341,7 @@ def copy(
334341
agent_access_key: str | None = None,
335342
agent_endpoint: str | None = None,
336343
inference_endpoint: str | None = None,
344+
kbass_endpoint: str | None = None,
337345
base_url: str | httpx.URL | None = None,
338346
timeout: float | Timeout | None | NotGiven = not_given,
339347
http_client: httpx.Client | None = None,
@@ -378,6 +386,7 @@ def copy(
378386
agent_access_key=agent_access_key or self.agent_access_key,
379387
agent_endpoint=agent_endpoint or self._agent_endpoint,
380388
inference_endpoint=inference_endpoint or self.inference_endpoint,
389+
kbass_endpoint=kbass_endpoint or self.kbass_endpoint,
381390
base_url=base_url or self.base_url,
382391
timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
383392
http_client=http_client,
@@ -444,6 +453,7 @@ class AsyncGradient(AsyncAPIClient):
444453
agent_access_key: str | None
445454
_agent_endpoint: str | None
446455
inference_endpoint: str | None
456+
kbass_endpoint: str | None
447457

448458
def __init__(
449459
self,
@@ -453,6 +463,7 @@ def __init__(
453463
agent_access_key: str | None = None,
454464
agent_endpoint: str | None = None,
455465
inference_endpoint: str | None = None,
466+
kbass_endpoint: str | None = None,
456467
base_url: str | httpx.URL | None = None,
457468
timeout: float | Timeout | None | NotGiven = not_given,
458469
max_retries: int = DEFAULT_MAX_RETRIES,
@@ -483,6 +494,7 @@ def __init__(
483494
- `agent_access_key` from `GRADIENT_AGENT_ACCESS_KEY`
484495
- `agent_endpoint` from `GRADIENT_AGENT_ENDPOINT`
485496
- `inference_endpoint` from `GRADIENT_INFERENCE_ENDPOINT`
497+
- `kbass_endpoint` from `GRADIENT_KBASS_ENDPOINT`
486498
"""
487499
if access_token is None:
488500
access_token = os.environ.get("DIGITALOCEAN_ACCESS_TOKEN")
@@ -507,6 +519,10 @@ def __init__(
507519
)
508520
self.inference_endpoint = inference_endpoint
509521

522+
if kbass_endpoint is None:
523+
kbass_endpoint = os.environ.get("GRADIENT_KBASS_ENDPOINT") or "kbaas.do-ai.run"
524+
self.kbass_endpoint = kbass_endpoint
525+
510526
if base_url is None:
511527
base_url = os.environ.get("GRADIENT_BASE_URL")
512528
self._base_url_overridden = base_url is not None
@@ -696,6 +712,7 @@ def copy(
696712
model_access_key: str | None = None,
697713
agent_access_key: str | None = None,
698714
inference_endpoint: str | None = None,
715+
kbass_endpoint: str | None = None,
699716
base_url: str | httpx.URL | None = None,
700717
timeout: float | Timeout | None | NotGiven = not_given,
701718
http_client: httpx.AsyncClient | None = None,
@@ -740,6 +757,7 @@ def copy(
740757
agent_access_key=agent_access_key or self.agent_access_key,
741758
agent_endpoint=agent_endpoint or self._agent_endpoint,
742759
inference_endpoint=inference_endpoint or self.inference_endpoint,
760+
kbass_endpoint=kbass_endpoint or self.kbass_endpoint,
743761
base_url=base_url or self.base_url,
744762
timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
745763
http_client=http_client,

0 commit comments

Comments
 (0)