Skip to content

Commit 08c54a3

Browse files
authored
Sync updates from stainless branch: main (#15)
* Sync updates from stainless branch: main * fix agent test
1 parent 0630f1f commit 08c54a3

File tree

14 files changed

+55
-157
lines changed

14 files changed

+55
-157
lines changed

examples/agents.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ describe('RAG Integration Tests', () => {
6060
for await (const chunk of turnResponse) {
6161
if (chunk.event.payload.event_type === 'turn_complete') {
6262
expect(chunk.event.payload.turn.output_message).toBeTruthy();
63-
break;
6463
}
6564
}
6665
}

src/core.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ async function defaultParseResponse<T>(props: APIResponseProps): Promise<T> {
6262
}
6363

6464
const contentType = response.headers.get('content-type');
65-
const isJSON =
66-
contentType?.includes('application/json') || contentType?.includes('application/vnd.api+json');
65+
const mediaType = contentType?.split(';')[0]?.trim();
66+
const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json');
6767
if (isJSON) {
6868
const json = await response.json();
6969

src/resources/agents.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
export * from './agents/index';

src/resources/agents/turn.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,10 +482,9 @@ export type TurnResumeParams = TurnResumeParamsNonStreaming | TurnResumeParamsSt
482482

483483
export interface TurnResumeParamsBase {
484484
/**
485-
* The tool call responses to resume the turn with. NOTE: ToolResponseMessage will
486-
* be deprecated. Use ToolResponse.
485+
* The tool call responses to resume the turn with.
487486
*/
488-
tool_responses: Array<AgentsAPI.ToolResponse> | Array<Shared.ToolResponseMessage>;
487+
tool_responses: Array<AgentsAPI.ToolResponse>;
489488

490489
/**
491490
* Whether to stream the response.

src/resources/eval-tasks.ts

Lines changed: 0 additions & 53 deletions
This file was deleted.

src/resources/eval.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
export * from './eval/index';

src/resources/inference.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -113,19 +113,9 @@ export namespace ChatCompletionResponseStreamChunk {
113113
export interface Metric {
114114
metric: string;
115115

116-
span_id: string;
117-
118-
timestamp: string;
119-
120-
trace_id: string;
121-
122-
type: 'metric';
123-
124-
unit: string;
125-
126116
value: number;
127117

128-
attributes?: Record<string, string | number | boolean | null>;
118+
unit?: string;
129119
}
130120
}
131121

@@ -147,6 +137,18 @@ export interface CompletionResponse {
147137
* Optional log probabilities for generated tokens
148138
*/
149139
logprobs?: Array<TokenLogProbs>;
140+
141+
metrics?: Array<CompletionResponse.Metric>;
142+
}
143+
144+
export namespace CompletionResponse {
145+
export interface Metric {
146+
metric: string;
147+
148+
value: number;
149+
150+
unit?: string;
151+
}
150152
}
151153

152154
/**

src/resources/inspect.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ export interface HealthInfo {
2020
export interface ProviderInfo {
2121
api: string;
2222

23+
config: Record<string, boolean | number | string | Array<unknown> | unknown | null>;
24+
2325
provider_id: string;
2426

2527
provider_type: string;

src/resources/post-training.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
export * from './post-training/index';

src/resources/providers.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ import * as Core from '../core';
55
import * as InspectAPI from './inspect';
66

77
export class Providers extends APIResource {
8+
retrieve(providerId: string, options?: Core.RequestOptions): Core.APIPromise<InspectAPI.ProviderInfo> {
9+
return this._client.get(`/v1/providers/${providerId}`, options);
10+
}
11+
812
list(options?: Core.RequestOptions): Core.APIPromise<ProviderListResponse> {
913
return (
10-
this._client.get('/v1/inspect/providers', options) as Core.APIPromise<{ data: ProviderListResponse }>
14+
this._client.get('/v1/providers', options) as Core.APIPromise<{ data: ProviderListResponse }>
1115
)._thenUnwrap((obj) => obj.data);
1216
}
1317
}

0 commit comments

Comments
 (0)