Skip to content

Commit ee5bde6

Browse files
authored
Sync updates from stainless branch: ehhuang/dev (#21)
1 parent de56089 commit ee5bde6

36 files changed

+2508
-134
lines changed

src/index.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ import {
5858
Models,
5959
} from './resources/models';
6060
import { ListProvidersResponse, ProviderListResponse, Providers } from './resources/providers';
61+
import {
62+
ResponseCreateParams,
63+
ResponseCreateParamsNonStreaming,
64+
ResponseCreateParamsStreaming,
65+
ResponseObject,
66+
ResponseObjectStream,
67+
Responses,
68+
} from './resources/responses';
6169
import { ListRoutesResponse, RouteListResponse, Routes } from './resources/routes';
6270
import { RunShieldResponse, Safety, SafetyRunShieldParams } from './resources/safety';
6371
import {
@@ -275,6 +283,7 @@ export class LlamaStackClient extends Core.APIClient {
275283
toolgroups: API.Toolgroups = new API.Toolgroups(this);
276284
tools: API.Tools = new API.Tools(this);
277285
toolRuntime: API.ToolRuntime = new API.ToolRuntime(this);
286+
responses: API.Responses = new API.Responses(this);
278287
agents: API.Agents = new API.Agents(this);
279288
datasets: API.Datasets = new API.Datasets(this);
280289
eval: API.Eval = new API.Eval(this);
@@ -342,6 +351,7 @@ export class LlamaStackClient extends Core.APIClient {
342351
LlamaStackClient.Toolgroups = Toolgroups;
343352
LlamaStackClient.Tools = Tools;
344353
LlamaStackClient.ToolRuntime = ToolRuntime;
354+
LlamaStackClient.Responses = Responses;
345355
LlamaStackClient.Agents = Agents;
346356
LlamaStackClient.Datasets = Datasets;
347357
LlamaStackClient.Eval = Eval;
@@ -396,6 +406,15 @@ export declare namespace LlamaStackClient {
396406
type ToolRuntimeListToolsParams as ToolRuntimeListToolsParams,
397407
};
398408

409+
export {
410+
Responses as Responses,
411+
type ResponseObject as ResponseObject,
412+
type ResponseObjectStream as ResponseObjectStream,
413+
type ResponseCreateParams as ResponseCreateParams,
414+
type ResponseCreateParamsNonStreaming as ResponseCreateParamsNonStreaming,
415+
type ResponseCreateParamsStreaming as ResponseCreateParamsStreaming,
416+
};
417+
399418
export {
400419
Agents as Agents,
401420
type InferenceStep as InferenceStep,

src/resources/agents/agents.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class Agents extends APIResource {
4141
}
4242

4343
/**
44-
* Delete an agent by its ID.
44+
* Delete an agent by its ID and its associated sessions and turns.
4545
*/
4646
delete(agentId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
4747
return this._client.delete(`/v1/agents/${agentId}`, {
@@ -65,6 +65,9 @@ export interface InferenceStep {
6565
*/
6666
step_id: string;
6767

68+
/**
69+
* Type of the step in an agent turn.
70+
*/
6871
step_type: 'inference';
6972

7073
/**
@@ -97,6 +100,9 @@ export interface MemoryRetrievalStep {
97100
*/
98101
step_id: string;
99102

103+
/**
104+
* Type of the step in an agent turn.
105+
*/
100106
step_type: 'memory_retrieval';
101107

102108
/**
@@ -129,6 +135,9 @@ export interface ShieldCallStep {
129135
*/
130136
step_id: string;
131137

138+
/**
139+
* Type of the step in an agent turn.
140+
*/
132141
step_type: 'shield_call';
133142

134143
/**
@@ -161,6 +170,9 @@ export interface ToolExecutionStep {
161170
*/
162171
step_id: string;
163172

173+
/**
174+
* Type of the step in an agent turn.
175+
*/
164176
step_type: 'tool_execution';
165177

166178
/**

src/resources/agents/session.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class SessionResource extends APIResource {
4040
}
4141

4242
/**
43-
* Delete an agent session by its ID.
43+
* Delete an agent session by its ID and its associated turns.
4444
*/
4545
delete(agentId: string, sessionId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
4646
return this._client.delete(`/v1/agents/${agentId}/session/${sessionId}`, {

src/resources/benchmarks.ts

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,25 @@ import { APIResource } from '../resource';
44
import * as Core from '../core';
55

66
export class Benchmarks extends APIResource {
7+
/**
8+
* Get a benchmark by its ID.
9+
*/
710
retrieve(benchmarkId: string, options?: Core.RequestOptions): Core.APIPromise<Benchmark> {
811
return this._client.get(`/v1/eval/benchmarks/${benchmarkId}`, options);
912
}
1013

14+
/**
15+
* List all benchmarks.
16+
*/
1117
list(options?: Core.RequestOptions): Core.APIPromise<BenchmarkListResponse> {
1218
return (
1319
this._client.get('/v1/eval/benchmarks', options) as Core.APIPromise<{ data: BenchmarkListResponse }>
1420
)._thenUnwrap((obj) => obj.data);
1521
}
1622

23+
/**
24+
* Register a benchmark.
25+
*/
1726
register(body: BenchmarkRegisterParams, options?: Core.RequestOptions): Core.APIPromise<void> {
1827
return this._client.post('/v1/eval/benchmarks', {
1928
body,
@@ -32,11 +41,11 @@ export interface Benchmark {
3241

3342
provider_id: string;
3443

35-
provider_resource_id: string;
36-
3744
scoring_functions: Array<string>;
3845

3946
type: 'benchmark';
47+
48+
provider_resource_id?: string;
4049
}
4150

4251
export interface ListBenchmarksResponse {
@@ -46,16 +55,34 @@ export interface ListBenchmarksResponse {
4655
export type BenchmarkListResponse = Array<Benchmark>;
4756

4857
export interface BenchmarkRegisterParams {
58+
/**
59+
* The ID of the benchmark to register.
60+
*/
4961
benchmark_id: string;
5062

63+
/**
64+
* The ID of the dataset to use for the benchmark.
65+
*/
5166
dataset_id: string;
5267

68+
/**
69+
* The scoring functions to use for the benchmark.
70+
*/
5371
scoring_functions: Array<string>;
5472

73+
/**
74+
* The metadata to use for the benchmark.
75+
*/
5576
metadata?: Record<string, boolean | number | string | Array<unknown> | unknown | null>;
5677

78+
/**
79+
* The ID of the provider benchmark to use for the benchmark.
80+
*/
5781
provider_benchmark_id?: string;
5882

83+
/**
84+
* The ID of the provider to use for the benchmark.
85+
*/
5986
provider_id?: string;
6087
}
6188

src/resources/chat/chat.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ import {
77
CompletionCreateParamsNonStreaming,
88
CompletionCreateParamsStreaming,
99
CompletionCreateResponse,
10+
CompletionListParams,
11+
CompletionListResponse,
12+
CompletionRetrieveResponse,
1013
Completions,
1114
} from './completions';
1215

@@ -199,8 +202,11 @@ export declare namespace Chat {
199202
export {
200203
Completions as Completions,
201204
type CompletionCreateResponse as CompletionCreateResponse,
205+
type CompletionRetrieveResponse as CompletionRetrieveResponse,
206+
type CompletionListResponse as CompletionListResponse,
202207
type CompletionCreateParams as CompletionCreateParams,
203208
type CompletionCreateParamsNonStreaming as CompletionCreateParamsNonStreaming,
204209
type CompletionCreateParamsStreaming as CompletionCreateParamsStreaming,
210+
type CompletionListParams as CompletionListParams,
205211
};
206212
}

0 commit comments

Comments
 (0)