Skip to content

Commit a9cd7d3

Browse files
feat(api): update via SDK Studio
1 parent 516734f commit a9cd7d3

File tree

12 files changed

+503
-55
lines changed

12 files changed

+503
-55
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 188
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-f07d74847e620dfa26d8df40ea4680814af9bba381b3a57a7b6ed76ad49d85f8.yml
3-
openapi_spec_hash: e3553dc2abf2afd4368b736bcc32a289
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-30169d8c02f8de86ae431cb475d1c44326289f9690e3c2a7a0442bf081870680.yml
3+
openapi_spec_hash: f266f59f7fcc777103f8b5b002b30c8e
44
config_hash: b28984dd49d4baf1d68572efe83ac103

src/gradient/resources/agents/chat/completions.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -472,9 +472,7 @@ def create(
472472
headers = {"Authorization": f"Bearer {self._client.agent_access_key}", **headers}
473473

474474
return self._post(
475-
"/chat/completions?agent=true"
476-
if self._client._base_url_overridden
477-
else f"{self._client.agent_endpoint}/api/v1/chat/completions?agent=true",
475+
"/chat/completions?agent=true",
478476
body=maybe_transform(
479477
{
480478
"messages": messages,
@@ -958,9 +956,7 @@ async def create(
958956
headers = {"Authorization": f"Bearer {self._client.agent_access_key}", **headers}
959957

960958
return await self._post(
961-
"/chat/completions?agent=true"
962-
if self._client._base_url_overridden
963-
else f"{self._client.agent_endpoint}/api/v1/chat/completions?agent=true",
959+
"/chat/completions?agent=true",
964960
body=await async_maybe_transform(
965961
{
966962
"messages": messages,

src/gradient/resources/chat/completions.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -473,9 +473,7 @@ def create(
473473
}
474474

475475
return self._post(
476-
"/chat/completions"
477-
if self._client._base_url_overridden
478-
else f"{self._client.inference_endpoint}/v1/chat/completions",
476+
"/chat/completions",
479477
body=maybe_transform(
480478
{
481479
"messages": messages,
@@ -963,9 +961,7 @@ async def create(
963961
}
964962

965963
return await self._post(
966-
"/chat/completions"
967-
if self._client._base_url_overridden
968-
else f"{self._client.inference_endpoint}/v1/chat/completions",
964+
"/chat/completions",
969965
body=await async_maybe_transform(
970966
{
971967
"messages": messages,

src/gradient/resources/images.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,7 @@ def generate(
317317
}
318318

319319
return self._post(
320-
"/images/generations"
321-
if self._client._base_url_overridden
322-
else f"{self._client.inference_endpoint}/v1/images/generations",
320+
"/images/generations",
323321
body=maybe_transform(
324322
{
325323
"prompt": prompt,
@@ -638,9 +636,7 @@ async def generate(
638636
**headers,
639637
}
640638
return await self._post(
641-
"/images/generations"
642-
if self._client._base_url_overridden
643-
else f"{self._client.inference_endpoint}/v1/images/generations",
639+
"/images/generations",
644640
body=await async_maybe_transform(
645641
{
646642
"prompt": prompt,

src/gradient/resources/nfs/nfs.py

Lines changed: 196 additions & 16 deletions
Large diffs are not rendered by default.

src/gradient/types/agents/api_evaluation_metric.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,28 @@
99

1010

1111
class APIEvaluationMetric(BaseModel):
12+
category: Optional[
13+
Literal[
14+
"METRIC_CATEGORY_UNSPECIFIED",
15+
"METRIC_CATEGORY_CORRECTNESS",
16+
"METRIC_CATEGORY_USER_OUTCOMES",
17+
"METRIC_CATEGORY_SAFETY_AND_SECURITY",
18+
"METRIC_CATEGORY_CONTEXT_QUALITY",
19+
"METRIC_CATEGORY_MODEL_FIT",
20+
]
21+
] = None
22+
1223
description: Optional[str] = None
1324

1425
inverted: Optional[bool] = None
1526
"""If true, the metric is inverted, meaning that a lower value is better."""
1627

28+
is_metric_goal: Optional[bool] = None
29+
1730
metric_name: Optional[str] = None
1831

32+
metric_rank: Optional[int] = None
33+
1934
metric_type: Optional[
2035
Literal["METRIC_TYPE_UNSPECIFIED", "METRIC_TYPE_GENERAL_QUALITY", "METRIC_TYPE_RAG_AND_TOOL"]
2136
] = None

src/gradient/types/knowledge_bases/api_indexing_job.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class APIIndexingJob(BaseModel):
5353
"INDEX_JOB_STATUS_FAILED",
5454
"INDEX_JOB_STATUS_NO_CHANGES",
5555
"INDEX_JOB_STATUS_PENDING",
56+
"INDEX_JOB_STATUS_CANCELLED",
5657
]
5758
] = None
5859

@@ -62,18 +63,6 @@ class APIIndexingJob(BaseModel):
6263
total_datasources: Optional[int] = None
6364
"""Number of datasources being indexed"""
6465

65-
total_items_failed: Optional[str] = None
66-
"""Total Items Failed"""
67-
68-
total_items_indexed: Optional[str] = None
69-
"""Total Items Indexed"""
70-
71-
total_items_removed: Optional[str] = None
72-
"""Total Items Removed"""
73-
74-
total_items_skipped: Optional[str] = None
75-
"""Total Items Skipped"""
76-
7766
total_tokens: Optional[str] = None
7867
"""Total Tokens Consumed By the Indexing Job"""
7968

src/gradient/types/knowledge_bases/api_knowledge_base_data_source.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from datetime import datetime
55

66
from ..._models import BaseModel
7-
from .api_indexing_job import APIIndexingJob
87
from .api_spaces_data_source import APISpacesDataSource
98
from .api_indexed_data_source import APIIndexedDataSource
109
from .api_file_upload_data_source import APIFileUploadDataSource
@@ -58,9 +57,6 @@ class APIKnowledgeBaseDataSource(BaseModel):
5857

5958
last_datasource_indexing_job: Optional[APIIndexedDataSource] = None
6059

61-
last_indexing_job: Optional[APIIndexingJob] = None
62-
"""IndexingJob description"""
63-
6460
region: Optional[str] = None
6561
"""Region code - Deprecated, moved to data_source_details"""
6662

src/gradient/types/knowledge_bases/api_web_crawler_data_source.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ class APIWebCrawlerDataSource(BaseModel):
1212
base_url: Optional[str] = None
1313
"""The base url to crawl."""
1414

15-
crawling_option: Optional[Literal["UNKNOWN", "SCOPED", "PATH", "DOMAIN", "SUBDOMAINS"]] = None
15+
crawling_option: Optional[Literal["UNKNOWN", "SCOPED", "PATH", "DOMAIN", "SUBDOMAINS", "SITEMAP"]] = None
1616
"""Options for specifying how URLs found on pages should be handled.
1717
1818
- UNKNOWN: Default unknown value
1919
- SCOPED: Only include the base URL.
2020
- PATH: Crawl the base URL and linked pages within the URL path.
2121
- DOMAIN: Crawl the base URL and linked pages within the same domain.
2222
- SUBDOMAINS: Crawl the base URL and linked pages for any subdomain.
23+
- SITEMAP: Crawl URLs discovered in the sitemap.
2324
"""
2425

2526
embed_media: Optional[bool] = None

src/gradient/types/knowledge_bases/api_web_crawler_data_source_param.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@ class APIWebCrawlerDataSourceParam(TypedDict, total=False):
1313
base_url: str
1414
"""The base url to crawl."""
1515

16-
crawling_option: Literal["UNKNOWN", "SCOPED", "PATH", "DOMAIN", "SUBDOMAINS"]
16+
crawling_option: Literal["UNKNOWN", "SCOPED", "PATH", "DOMAIN", "SUBDOMAINS", "SITEMAP"]
1717
"""Options for specifying how URLs found on pages should be handled.
1818
1919
- UNKNOWN: Default unknown value
2020
- SCOPED: Only include the base URL.
2121
- PATH: Crawl the base URL and linked pages within the URL path.
2222
- DOMAIN: Crawl the base URL and linked pages within the same domain.
2323
- SUBDOMAINS: Crawl the base URL and linked pages for any subdomain.
24+
- SITEMAP: Crawl URLs discovered in the sitemap.
2425
"""
2526

2627
embed_media: bool

0 commit comments

Comments
 (0)