From 4425c4f4037c47357e212634c6224da34652667a Mon Sep 17 00:00:00 2001 From: Xi Yan Date: Mon, 3 Feb 2025 10:42:59 -0800 Subject: [PATCH] Sync updates from stainless branch: main --- src/resources/datasets.ts | 20 +------------------- src/resources/eval-tasks.ts | 2 +- src/resources/models.ts | 2 +- src/resources/post-training/job.ts | 7 +++++-- src/resources/providers.ts | 2 +- src/resources/routes.ts | 2 +- src/resources/scoring-functions.ts | 2 +- src/resources/shields.ts | 2 +- src/resources/telemetry.ts | 20 +------------------- src/resources/toolgroups.ts | 2 +- src/resources/tools.ts | 2 +- src/resources/vector-dbs.ts | 18 +----------------- 12 files changed, 16 insertions(+), 65 deletions(-) diff --git a/src/resources/datasets.ts b/src/resources/datasets.ts index ce9116f..7158fd4 100644 --- a/src/resources/datasets.ts +++ b/src/resources/datasets.ts @@ -35,25 +35,7 @@ export class Datasets extends APIResource { } export interface ListDatasetsResponse { - data: Array; -} - -export namespace ListDatasetsResponse { - export interface Data { - dataset_schema: Record; - - identifier: string; - - metadata: Record | unknown | null>; - - provider_id: string; - - provider_resource_id: string; - - type: 'dataset'; - - url: Shared.URL; - } + data: DatasetListResponse; } export interface DatasetRetrieveResponse { diff --git a/src/resources/eval-tasks.ts b/src/resources/eval-tasks.ts index 4bf05c6..9397dcb 100644 --- a/src/resources/eval-tasks.ts +++ b/src/resources/eval-tasks.ts @@ -40,7 +40,7 @@ export interface EvalTask { } export interface ListEvalTasksResponse { - data: Array; + data: EvalTaskListResponse; } export type EvalTaskListResponse = Array; diff --git a/src/resources/models.ts b/src/resources/models.ts index 3f849d9..2c561fe 100644 --- a/src/resources/models.ts +++ b/src/resources/models.ts @@ -27,7 +27,7 @@ export class Models extends APIResource { } export interface ListModelsResponse { - data: Array; + data: ModelListResponse; } export interface Model { diff --git a/src/resources/post-training/job.ts b/src/resources/post-training/job.ts index 1f9343f..97556ee 100644 --- a/src/resources/post-training/job.ts +++ b/src/resources/post-training/job.ts @@ -2,11 +2,14 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; +import { ListPostTrainingJobsResponse } from './post-training'; export class Job extends APIResource { - list(options?: Core.RequestOptions): Core.APIPromise { + list(options?: Core.RequestOptions): Core.APIPromise> { return ( - this._client.get('/v1/post-training/jobs', options) as Core.APIPromise<{ data: JobListResponse }> + this._client.get('/v1/post-training/jobs', options) as Core.APIPromise<{ + data: Array; + }> )._thenUnwrap((obj) => obj.data); } diff --git a/src/resources/providers.ts b/src/resources/providers.ts index 94ac34a..624b9da 100644 --- a/src/resources/providers.ts +++ b/src/resources/providers.ts @@ -13,7 +13,7 @@ export class Providers extends APIResource { } export interface ListProvidersResponse { - data: Array; + data: ProviderListResponse; } export type ProviderListResponse = Array; diff --git a/src/resources/routes.ts b/src/resources/routes.ts index 819a77b..3a8051d 100644 --- a/src/resources/routes.ts +++ b/src/resources/routes.ts @@ -13,7 +13,7 @@ export class Routes extends APIResource { } export interface ListRoutesResponse { - data: Array; + data: RouteListResponse; } export type RouteListResponse = Array; diff --git a/src/resources/scoring-functions.ts b/src/resources/scoring-functions.ts index d8998d0..83d6e9d 100644 --- a/src/resources/scoring-functions.ts +++ b/src/resources/scoring-functions.ts @@ -27,7 +27,7 @@ export class ScoringFunctions extends APIResource { } export interface ListScoringFunctionsResponse { - data: Array; + data: ScoringFunctionListResponse; } export interface ScoringFn { diff --git a/src/resources/shields.ts b/src/resources/shields.ts index 72596eb..edc98de 100644 --- a/src/resources/shields.ts +++ b/src/resources/shields.ts @@ -20,7 +20,7 @@ export class Shields extends APIResource { } export interface ListShieldsResponse { - data: Array; + data: ShieldListResponse; } export interface Shield { diff --git a/src/resources/telemetry.ts b/src/resources/telemetry.ts index 33aec18..5270bce 100644 --- a/src/resources/telemetry.ts +++ b/src/resources/telemetry.ts @@ -165,25 +165,7 @@ export interface QueryCondition { } export interface QuerySpansResponse { - data: Array; -} - -export namespace QuerySpansResponse { - export interface Data { - name: string; - - span_id: string; - - start_time: string; - - trace_id: string; - - attributes?: Record | unknown | null>; - - end_time?: string; - - parent_span_id?: string; - } + data: TelemetryQuerySpansResponse; } export interface SpanWithStatus { diff --git a/src/resources/toolgroups.ts b/src/resources/toolgroups.ts index 9f0135b..f5f9038 100644 --- a/src/resources/toolgroups.ts +++ b/src/resources/toolgroups.ts @@ -41,7 +41,7 @@ export class Toolgroups extends APIResource { } export interface ListToolGroupsResponse { - data: Array; + data: ToolgroupListResponse; } export interface ToolGroup { diff --git a/src/resources/tools.ts b/src/resources/tools.ts index 861ac90..3a3e4f6 100644 --- a/src/resources/tools.ts +++ b/src/resources/tools.ts @@ -28,7 +28,7 @@ export class Tools extends APIResource { } export interface ListToolsResponse { - data: Array; + data: ToolListResponse; } export interface Tool { diff --git a/src/resources/vector-dbs.ts b/src/resources/vector-dbs.ts index e85441f..37b60c1 100644 --- a/src/resources/vector-dbs.ts +++ b/src/resources/vector-dbs.ts @@ -33,23 +33,7 @@ export class VectorDBs extends APIResource { } export interface ListVectorDBsResponse { - data: Array; -} - -export namespace ListVectorDBsResponse { - export interface Data { - embedding_dimension: number; - - embedding_model: string; - - identifier: string; - - provider_id: string; - - provider_resource_id: string; - - type: 'vector_db'; - } + data: VectorDBListResponse; } export interface VectorDBRetrieveResponse {