Skip to content

Commit e4f7840

Browse files
feat(api): fixes to URLs
1 parent 5cee3d6 commit e4f7840

File tree

10 files changed

+1194
-87
lines changed

10 files changed

+1194
-87
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 93
1+
configured_endpoints: 108
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/llamastack%2Fllama-stack-client-f26df77f0800baeaea40407776f6c1e618756037969411e29de209ce961655dd.yml
33
openapi_spec_hash: e7c2329edc0f9f5aa1c78b6afb996e1c
4-
config_hash: 0412cd40c0609550c1a47c69dd104e4f
4+
config_hash: 8800bdff1a087b9d5211dda2a7b9f66f

api.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,19 @@ Methods:
9898
Types:
9999

100100
- <code><a href="./src/resources/datasets.ts">ListDatasetsResponse</a></code>
101+
- <code><a href="./src/resources/datasets.ts">DatasetRetrieveResponse</a></code>
102+
- <code><a href="./src/resources/datasets.ts">DatasetListResponse</a></code>
103+
- <code><a href="./src/resources/datasets.ts">DatasetIterrowsResponse</a></code>
104+
- <code><a href="./src/resources/datasets.ts">DatasetRegisterResponse</a></code>
105+
106+
Methods:
107+
108+
- <code title="get /v1beta/datasets/{dataset_id}">client.datasets.<a href="./src/resources/datasets.ts">retrieve</a>(datasetId) -> DatasetRetrieveResponse</code>
109+
- <code title="get /v1beta/datasets">client.datasets.<a href="./src/resources/datasets.ts">list</a>() -> DatasetListResponse</code>
110+
- <code title="post /v1beta/datasetio/append-rows/{dataset_id}">client.datasets.<a href="./src/resources/datasets.ts">appendrows</a>(datasetId, { ...params }) -> void</code>
111+
- <code title="get /v1beta/datasetio/iterrows/{dataset_id}">client.datasets.<a href="./src/resources/datasets.ts">iterrows</a>(datasetId, { ...params }) -> DatasetIterrowsResponse</code>
112+
- <code title="post /v1beta/datasets">client.datasets.<a href="./src/resources/datasets.ts">register</a>({ ...params }) -> DatasetRegisterResponse</code>
113+
- <code title="delete /v1beta/datasets/{dataset_id}">client.datasets.<a href="./src/resources/datasets.ts">unregister</a>(datasetId) -> void</code>
101114

102115
# Inspect
103116

@@ -331,10 +344,21 @@ Types:
331344
- <code><a href="./src/resources/telemetry.ts">QuerySpansResponse</a></code>
332345
- <code><a href="./src/resources/telemetry.ts">SpanWithStatus</a></code>
333346
- <code><a href="./src/resources/telemetry.ts">Trace</a></code>
347+
- <code><a href="./src/resources/telemetry.ts">TelemetryGetSpanResponse</a></code>
348+
- <code><a href="./src/resources/telemetry.ts">TelemetryGetSpanTreeResponse</a></code>
349+
- <code><a href="./src/resources/telemetry.ts">TelemetryQueryMetricsResponse</a></code>
350+
- <code><a href="./src/resources/telemetry.ts">TelemetryQuerySpansResponse</a></code>
351+
- <code><a href="./src/resources/telemetry.ts">TelemetryQueryTracesResponse</a></code>
334352

335353
Methods:
336354

337-
- <code title="post /v1/telemetry/events">client.telemetry.<a href="./src/resources/telemetry.ts">logEvent</a>({ ...params }) -> void</code>
355+
- <code title="get /v1alpha/telemetry/traces/{trace_id}/spans/{span_id}">client.telemetry.<a href="./src/resources/telemetry.ts">getSpan</a>(traceId, spanId) -> TelemetryGetSpanResponse</code>
356+
- <code title="post /v1alpha/telemetry/spans/{span_id}/tree">client.telemetry.<a href="./src/resources/telemetry.ts">getSpanTree</a>(spanId, { ...params }) -> TelemetryGetSpanTreeResponse</code>
357+
- <code title="get /v1alpha/telemetry/traces/{trace_id}">client.telemetry.<a href="./src/resources/telemetry.ts">getTrace</a>(traceId) -> Trace</code>
358+
- <code title="post /v1alpha/telemetry/metrics/{metric_name}">client.telemetry.<a href="./src/resources/telemetry.ts">queryMetrics</a>(metricName, { ...params }) -> TelemetryQueryMetricsResponse</code>
359+
- <code title="post /v1alpha/telemetry/spans">client.telemetry.<a href="./src/resources/telemetry.ts">querySpans</a>({ ...params }) -> TelemetryQuerySpansResponse</code>
360+
- <code title="post /v1alpha/telemetry/traces">client.telemetry.<a href="./src/resources/telemetry.ts">queryTraces</a>({ ...params }) -> TelemetryQueryTracesResponse</code>
361+
- <code title="post /v1alpha/telemetry/spans/export">client.telemetry.<a href="./src/resources/telemetry.ts">saveSpansToDataset</a>({ ...params }) -> void</code>
338362

339363
# Scoring
340364

@@ -369,6 +393,13 @@ Types:
369393

370394
- <code><a href="./src/resources/benchmarks.ts">Benchmark</a></code>
371395
- <code><a href="./src/resources/benchmarks.ts">ListBenchmarksResponse</a></code>
396+
- <code><a href="./src/resources/benchmarks.ts">BenchmarkListResponse</a></code>
397+
398+
Methods:
399+
400+
- <code title="get /v1alpha/eval/benchmarks/{benchmark_id}">client.benchmarks.<a href="./src/resources/benchmarks.ts">retrieve</a>(benchmarkId) -> Benchmark</code>
401+
- <code title="get /v1alpha/eval/benchmarks">client.benchmarks.<a href="./src/resources/benchmarks.ts">list</a>() -> BenchmarkListResponse</code>
402+
- <code title="post /v1alpha/eval/benchmarks">client.benchmarks.<a href="./src/resources/benchmarks.ts">register</a>({ ...params }) -> void</code>
372403

373404
# Files
374405

src/index.ts

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,31 @@ import {
1313
} from './pagination';
1414
import * as Uploads from './uploads';
1515
import * as API from './resources/index';
16-
import { Benchmark, Benchmarks, ListBenchmarksResponse } from './resources/benchmarks';
16+
import {
17+
Benchmark,
18+
BenchmarkListResponse,
19+
BenchmarkRegisterParams,
20+
Benchmarks,
21+
ListBenchmarksResponse,
22+
} from './resources/benchmarks';
1723
import {
1824
CompletionCreateParams,
1925
CompletionCreateParamsNonStreaming,
2026
CompletionCreateParamsStreaming,
2127
CompletionCreateResponse,
2228
Completions,
2329
} from './resources/completions';
24-
import { Datasets, ListDatasetsResponse } from './resources/datasets';
30+
import {
31+
DatasetAppendrowsParams,
32+
DatasetIterrowsParams,
33+
DatasetIterrowsResponse,
34+
DatasetListResponse,
35+
DatasetRegisterParams,
36+
DatasetRegisterResponse,
37+
DatasetRetrieveResponse,
38+
Datasets,
39+
ListDatasetsResponse,
40+
} from './resources/datasets';
2541
import { CreateEmbeddingsResponse, EmbeddingCreateParams, Embeddings } from './resources/embeddings';
2642
import {
2743
DeleteFileResponse,
@@ -71,7 +87,16 @@ import {
7187
QuerySpansResponse,
7288
SpanWithStatus,
7389
Telemetry,
74-
TelemetryLogEventParams,
90+
TelemetryGetSpanResponse,
91+
TelemetryGetSpanTreeParams,
92+
TelemetryGetSpanTreeResponse,
93+
TelemetryQueryMetricsParams,
94+
TelemetryQueryMetricsResponse,
95+
TelemetryQuerySpansParams,
96+
TelemetryQuerySpansResponse,
97+
TelemetryQueryTracesParams,
98+
TelemetryQueryTracesResponse,
99+
TelemetrySaveSpansToDatasetParams,
75100
Trace,
76101
} from './resources/telemetry';
77102
import {
@@ -400,7 +425,17 @@ export declare namespace LlamaStackClient {
400425
type ResponseListParams as ResponseListParams,
401426
};
402427

403-
export { Datasets as Datasets, type ListDatasetsResponse as ListDatasetsResponse };
428+
export {
429+
Datasets as Datasets,
430+
type ListDatasetsResponse as ListDatasetsResponse,
431+
type DatasetRetrieveResponse as DatasetRetrieveResponse,
432+
type DatasetListResponse as DatasetListResponse,
433+
type DatasetIterrowsResponse as DatasetIterrowsResponse,
434+
type DatasetRegisterResponse as DatasetRegisterResponse,
435+
type DatasetAppendrowsParams as DatasetAppendrowsParams,
436+
type DatasetIterrowsParams as DatasetIterrowsParams,
437+
type DatasetRegisterParams as DatasetRegisterParams,
438+
};
404439

405440
export {
406441
Inspect as Inspect,
@@ -508,7 +543,16 @@ export declare namespace LlamaStackClient {
508543
type QuerySpansResponse as QuerySpansResponse,
509544
type SpanWithStatus as SpanWithStatus,
510545
type Trace as Trace,
511-
type TelemetryLogEventParams as TelemetryLogEventParams,
546+
type TelemetryGetSpanResponse as TelemetryGetSpanResponse,
547+
type TelemetryGetSpanTreeResponse as TelemetryGetSpanTreeResponse,
548+
type TelemetryQueryMetricsResponse as TelemetryQueryMetricsResponse,
549+
type TelemetryQuerySpansResponse as TelemetryQuerySpansResponse,
550+
type TelemetryQueryTracesResponse as TelemetryQueryTracesResponse,
551+
type TelemetryGetSpanTreeParams as TelemetryGetSpanTreeParams,
552+
type TelemetryQueryMetricsParams as TelemetryQueryMetricsParams,
553+
type TelemetryQuerySpansParams as TelemetryQuerySpansParams,
554+
type TelemetryQueryTracesParams as TelemetryQueryTracesParams,
555+
type TelemetrySaveSpansToDatasetParams as TelemetrySaveSpansToDatasetParams,
512556
};
513557

514558
export {
@@ -532,6 +576,8 @@ export declare namespace LlamaStackClient {
532576
Benchmarks as Benchmarks,
533577
type Benchmark as Benchmark,
534578
type ListBenchmarksResponse as ListBenchmarksResponse,
579+
type BenchmarkListResponse as BenchmarkListResponse,
580+
type BenchmarkRegisterParams as BenchmarkRegisterParams,
535581
};
536582

537583
export {

src/resources/benchmarks.ts

Lines changed: 72 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,38 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
import { APIResource } from '../resource';
4+
import * as Core from '../core';
45

5-
export class Benchmarks extends APIResource {}
6+
export class Benchmarks extends APIResource {
7+
/**
8+
* Get a benchmark by its ID.
9+
*/
10+
retrieve(benchmarkId: string, options?: Core.RequestOptions): Core.APIPromise<Benchmark> {
11+
return this._client.get(`/v1alpha/eval/benchmarks/${benchmarkId}`, options);
12+
}
13+
14+
/**
15+
* List all benchmarks.
16+
*/
17+
list(options?: Core.RequestOptions): Core.APIPromise<BenchmarkListResponse> {
18+
return (
19+
this._client.get('/v1alpha/eval/benchmarks', options) as Core.APIPromise<{
20+
data: BenchmarkListResponse;
21+
}>
22+
)._thenUnwrap((obj) => obj.data);
23+
}
24+
25+
/**
26+
* Register a benchmark.
27+
*/
28+
register(body: BenchmarkRegisterParams, options?: Core.RequestOptions): Core.APIPromise<void> {
29+
return this._client.post('/v1alpha/eval/benchmarks', {
30+
body,
31+
...options,
32+
headers: { Accept: '*/*', ...options?.headers },
33+
});
34+
}
35+
}
636

737
/**
838
* A benchmark resource for evaluating model performance.
@@ -36,9 +66,48 @@ export interface Benchmark {
3666
}
3767

3868
export interface ListBenchmarksResponse {
39-
data: Array<Benchmark>;
69+
data: BenchmarkListResponse;
70+
}
71+
72+
export type BenchmarkListResponse = Array<Benchmark>;
73+
74+
export interface BenchmarkRegisterParams {
75+
/**
76+
* The ID of the benchmark to register.
77+
*/
78+
benchmark_id: string;
79+
80+
/**
81+
* The ID of the dataset to use for the benchmark.
82+
*/
83+
dataset_id: string;
84+
85+
/**
86+
* The scoring functions to use for the benchmark.
87+
*/
88+
scoring_functions: Array<string>;
89+
90+
/**
91+
* The metadata to use for the benchmark.
92+
*/
93+
metadata?: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
94+
95+
/**
96+
* The ID of the provider benchmark to use for the benchmark.
97+
*/
98+
provider_benchmark_id?: string;
99+
100+
/**
101+
* The ID of the provider to use for the benchmark.
102+
*/
103+
provider_id?: string;
40104
}
41105

42106
export declare namespace Benchmarks {
43-
export { type Benchmark as Benchmark, type ListBenchmarksResponse as ListBenchmarksResponse };
107+
export {
108+
type Benchmark as Benchmark,
109+
type ListBenchmarksResponse as ListBenchmarksResponse,
110+
type BenchmarkListResponse as BenchmarkListResponse,
111+
type BenchmarkRegisterParams as BenchmarkRegisterParams,
112+
};
44113
}

0 commit comments

Comments
 (0)