Skip to content

Commit 9d7134c

Browse files
feat(api): api update
1 parent 7c70da6 commit 9d7134c

File tree

6 files changed

+3
-183
lines changed

6 files changed

+3
-183
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 40
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2Ftogetherai-3885e173e675b1df17ca50f196a2e15bdc972477464f6188437b97846c17ccf1.yml
3-
openapi_spec_hash: 2d53f9040a93f6d19354d49112f39c24
1+
configured_endpoints: 39
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2Ftogetherai-c726068d4924b141db32af3b6780cfdb4adf6201eb5b73cc48f22e85be84bd94.yml
3+
openapi_spec_hash: 98eafd4bc6d118e15f1f59e0f7f5e18d
44
config_hash: e2d1be538fd1fb65bfc566a2a168cc16

api.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,13 +244,11 @@ Types:
244244
- <code><a href="./src/resources/evaluation.ts">EvaluationModelRequest</a></code>
245245
- <code><a href="./src/resources/evaluation.ts">EvaluationRetrieveResponse</a></code>
246246
- <code><a href="./src/resources/evaluation.ts">EvaluationGetStatusResponse</a></code>
247-
- <code><a href="./src/resources/evaluation.ts">EvaluationUpdateStatusResponse</a></code>
248247

249248
Methods:
250249

251250
- <code title="get /evaluation/{id}">client.evaluation.<a href="./src/resources/evaluation.ts">retrieve</a>(id) -> EvaluationRetrieveResponse</code>
252251
- <code title="get /evaluation/{id}/status">client.evaluation.<a href="./src/resources/evaluation.ts">getStatus</a>(id) -> EvaluationGetStatusResponse</code>
253-
- <code title="post /evaluation/{id}/update">client.evaluation.<a href="./src/resources/evaluation.ts">updateStatus</a>(id, { ...params }) -> EvaluationUpdateStatusResponse</code>
254252

255253
# Evaluations
256254

src/client.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ import {
5454
EvaluationJudgeModelConfig,
5555
EvaluationModelRequest,
5656
EvaluationRetrieveResponse,
57-
EvaluationUpdateStatusParams,
58-
EvaluationUpdateStatusResponse,
5957
} from './resources/evaluation';
6058
import {
6159
EvaluationGetAllowedModelsResponse,
@@ -989,8 +987,6 @@ export declare namespace Together {
989987
type EvaluationModelRequest as EvaluationModelRequest,
990988
type EvaluationRetrieveResponse as EvaluationRetrieveResponse,
991989
type EvaluationGetStatusResponse as EvaluationGetStatusResponse,
992-
type EvaluationUpdateStatusResponse as EvaluationUpdateStatusResponse,
993-
type EvaluationUpdateStatusParams as EvaluationUpdateStatusParams,
994990
};
995991

996992
export {

src/resources/evaluation.ts

Lines changed: 0 additions & 146 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,6 @@ export class Evaluation extends APIResource {
1919
getStatus(id: string, options?: RequestOptions): APIPromise<EvaluationGetStatusResponse> {
2020
return this._client.get(path`/evaluation/${id}/status`, options);
2121
}
22-
23-
/**
24-
* Internal callback endpoint for workflows to update job status and results
25-
*/
26-
updateStatus(
27-
id: string,
28-
body: EvaluationUpdateStatusParams,
29-
options?: RequestOptions,
30-
): APIPromise<EvaluationUpdateStatusResponse> {
31-
return this._client.post(path`/evaluation/${id}/update`, { body, ...options });
32-
}
3322
}
3423

3524
export interface EvaluationJudgeModelConfig {
@@ -379,146 +368,11 @@ export namespace EvaluationGetStatusResponse {
379368
}
380369
}
381370

382-
export interface EvaluationUpdateStatusResponse {
383-
status?: string;
384-
385-
workflow_id?: string;
386-
}
387-
388-
export interface EvaluationUpdateStatusParams {
389-
/**
390-
* The new status for the job
391-
*/
392-
status: 'completed' | 'error' | 'running' | 'queued' | 'user_error' | 'inference_error';
393-
394-
/**
395-
* Error message
396-
*/
397-
error?: string;
398-
399-
results?:
400-
| EvaluationUpdateStatusParams.EvaluationClassifyResults
401-
| EvaluationUpdateStatusParams.EvaluationScoreResults
402-
| EvaluationUpdateStatusParams.EvaluationCompareResults;
403-
}
404-
405-
export namespace EvaluationUpdateStatusParams {
406-
export interface EvaluationClassifyResults {
407-
/**
408-
* Number of failed generations.
409-
*/
410-
generation_fail_count?: number | null;
411-
412-
/**
413-
* Number of invalid labels
414-
*/
415-
invalid_label_count?: number | null;
416-
417-
/**
418-
* Number of failed judge generations
419-
*/
420-
judge_fail_count?: number | null;
421-
422-
/**
423-
* JSON string representing label counts
424-
*/
425-
label_counts?: string;
426-
427-
/**
428-
* Pecentage of pass labels.
429-
*/
430-
pass_percentage?: number | null;
431-
432-
/**
433-
* Data File ID
434-
*/
435-
result_file_id?: string;
436-
}
437-
438-
export interface EvaluationScoreResults {
439-
aggregated_scores?: EvaluationScoreResults.AggregatedScores;
440-
441-
/**
442-
* number of failed samples generated from model
443-
*/
444-
failed_samples?: number;
445-
446-
/**
447-
* Number of failed generations.
448-
*/
449-
generation_fail_count?: number | null;
450-
451-
/**
452-
* number of invalid scores generated from model
453-
*/
454-
invalid_score_count?: number;
455-
456-
/**
457-
* Number of failed judge generations
458-
*/
459-
judge_fail_count?: number | null;
460-
461-
/**
462-
* Data File ID
463-
*/
464-
result_file_id?: string;
465-
}
466-
467-
export namespace EvaluationScoreResults {
468-
export interface AggregatedScores {
469-
mean_score?: number;
470-
471-
pass_percentage?: number;
472-
473-
std_score?: number;
474-
}
475-
}
476-
477-
export interface EvaluationCompareResults {
478-
/**
479-
* Number of times model A won
480-
*/
481-
A_wins?: number;
482-
483-
/**
484-
* Number of times model B won
485-
*/
486-
B_wins?: number;
487-
488-
/**
489-
* Number of failed generations.
490-
*/
491-
generation_fail_count?: number | null;
492-
493-
/**
494-
* Number of failed judge generations
495-
*/
496-
judge_fail_count?: number | null;
497-
498-
/**
499-
* Total number of samples compared
500-
*/
501-
num_samples?: number;
502-
503-
/**
504-
* Data File ID
505-
*/
506-
result_file_id?: string;
507-
508-
/**
509-
* Number of ties
510-
*/
511-
Ties?: number;
512-
}
513-
}
514-
515371
export declare namespace Evaluation {
516372
export {
517373
type EvaluationJudgeModelConfig as EvaluationJudgeModelConfig,
518374
type EvaluationModelRequest as EvaluationModelRequest,
519375
type EvaluationRetrieveResponse as EvaluationRetrieveResponse,
520376
type EvaluationGetStatusResponse as EvaluationGetStatusResponse,
521-
type EvaluationUpdateStatusResponse as EvaluationUpdateStatusResponse,
522-
type EvaluationUpdateStatusParams as EvaluationUpdateStatusParams,
523377
};
524378
}

src/resources/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ export {
5050
type EvaluationModelRequest,
5151
type EvaluationRetrieveResponse,
5252
type EvaluationGetStatusResponse,
53-
type EvaluationUpdateStatusResponse,
54-
type EvaluationUpdateStatusParams,
5553
} from './evaluation';
5654
export {
5755
Evaluations,

tests/api-resources/evaluation.test.ts

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -29,30 +29,4 @@ describe('resource evaluation', () => {
2929
expect(dataAndResponse.data).toBe(response);
3030
expect(dataAndResponse.response).toBe(rawResponse);
3131
});
32-
33-
test('updateStatus: only required params', async () => {
34-
const responsePromise = client.evaluation.updateStatus('id', { status: 'completed' });
35-
const rawResponse = await responsePromise.asResponse();
36-
expect(rawResponse).toBeInstanceOf(Response);
37-
const response = await responsePromise;
38-
expect(response).not.toBeInstanceOf(Response);
39-
const dataAndResponse = await responsePromise.withResponse();
40-
expect(dataAndResponse.data).toBe(response);
41-
expect(dataAndResponse.response).toBe(rawResponse);
42-
});
43-
44-
test('updateStatus: required and optional params', async () => {
45-
const response = await client.evaluation.updateStatus('id', {
46-
status: 'completed',
47-
error: 'error',
48-
results: {
49-
generation_fail_count: 0,
50-
invalid_label_count: 0,
51-
judge_fail_count: 0,
52-
label_counts: '{"yes": 10, "no": 0}',
53-
pass_percentage: 10,
54-
result_file_id: 'file-1234-aefd',
55-
},
56-
});
57-
});
5832
});

0 commit comments

Comments
 (0)