Skip to content

Commit dc9ac24

Browse files
feat(api): api update
1 parent 5a544ff commit dc9ac24

File tree

7 files changed

+9
-410
lines changed

7 files changed

+9
-410
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: 39
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lemma%2Flemma-c6e812a928786cc1313c8e7f766407a18427f65265cd03cb60bc1a01a3185043.yml
3-
openapi_spec_hash: 399ee45682c5fd181d707acc90b36fd2
1+
configured_endpoints: 34
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lemma%2Flemma-8a3987f5dfe31eeb7686c0f2025612d95c5810abc7e0a85682836b6768c0bff3.yml
3+
openapi_spec_hash: c7e3a1600776698bf79c16154bf8db3d
44
config_hash: 3ccc0e50f28be581a8cc4501a5758970

api.md

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -116,22 +116,6 @@ Methods:
116116

117117
## Evaluations
118118

119-
Types:
120-
121-
- <code><a href="./src/resources/projects/evaluations.ts">EvaluationEntry</a></code>
122-
- <code><a href="./src/resources/projects/evaluations.ts">EvaluationObjectiveType</a></code>
123-
- <code><a href="./src/resources/projects/evaluations.ts">EvaluationListResponse</a></code>
124-
- <code><a href="./src/resources/projects/evaluations.ts">EvaluationDeleteResponse</a></code>
125-
- <code><a href="./src/resources/projects/evaluations.ts">EvaluationCreateIterationResponse</a></code>
126-
127-
Methods:
128-
129-
- <code title="post /project/{project_id}/evaluations">client.projects.evaluations.<a href="./src/resources/projects/evaluations.ts">create</a>(projectID, { ...params }) -> EvaluationEntry</code>
130-
- <code title="get /project/{project_id}/evaluations/{evaluation_id}">client.projects.evaluations.<a href="./src/resources/projects/evaluations.ts">retrieve</a>(evaluationID, { ...params }) -> EvaluationEntry</code>
131-
- <code title="get /project/{project_id}/evaluations/">client.projects.evaluations.<a href="./src/resources/projects/evaluations.ts">list</a>(projectID) -> EvaluationListResponse</code>
132-
- <code title="delete /project/{project_id}/evaluations/{evaluation_id}">client.projects.evaluations.<a href="./src/resources/projects/evaluations.ts">delete</a>(evaluationID, { ...params }) -> EvaluationDeleteResponse</code>
133-
- <code title="post /project/{project_id}/evaluations/{evaluation_id}/iterations">client.projects.evaluations.<a href="./src/resources/projects/evaluations.ts">createIteration</a>(evaluationID, { ...params }) -> EvaluationCreateIterationResponse</code>
134-
135119
## Agents
136120

137121
Types:
Lines changed: 1 addition & 243 deletions
Original file line numberDiff line numberDiff line change
@@ -1,247 +1,5 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
import { APIResource } from '../../core/resource';
4-
import { APIPromise } from '../../core/api-promise';
5-
import { RequestOptions } from '../../internal/request-options';
6-
import { path } from '../../internal/utils/path';
74

8-
export class Evaluations extends APIResource {
9-
/**
10-
* Create a new evaluation.
11-
*
12-
* Creates a new evaluation with the specified prompt, dataset, and objective
13-
* configuration. The evaluation will be associated with the specified project and
14-
* will automatically create an evaluation iteration that processes all dataset
15-
* entries.
16-
*/
17-
create(
18-
projectID: string,
19-
body: EvaluationCreateParams,
20-
options?: RequestOptions,
21-
): APIPromise<EvaluationEntry> {
22-
return this._client.post(path`/project/${projectID}/evaluations`, { body, ...options });
23-
}
24-
25-
/**
26-
* Get an evaluation by ID.
27-
*
28-
* Retrieves a specific evaluation by its ID. The evaluation must belong to the
29-
* specified project, which must belong to the current user's tenant.
30-
*/
31-
retrieve(
32-
evaluationID: string,
33-
params: EvaluationRetrieveParams,
34-
options?: RequestOptions,
35-
): APIPromise<EvaluationEntry> {
36-
const { project_id } = params;
37-
return this._client.get(path`/project/${project_id}/evaluations/${evaluationID}`, options);
38-
}
39-
40-
/**
41-
* List all evaluations for the specified project.
42-
*
43-
* Retrieves all evaluations that belong to the specified project. The project must
44-
* belong to the current user's tenant.
45-
*/
46-
list(projectID: string, options?: RequestOptions): APIPromise<EvaluationListResponse> {
47-
return this._client.get(path`/project/${projectID}/evaluations/`, options);
48-
}
49-
50-
/**
51-
* Delete an evaluation by ID.
52-
*
53-
* Permanently deletes an evaluation and all its associated data. This action
54-
* cannot be undone. The evaluation must belong to the specified project, which
55-
* must belong to the current user's tenant.
56-
*/
57-
delete(
58-
evaluationID: string,
59-
params: EvaluationDeleteParams,
60-
options?: RequestOptions,
61-
): APIPromise<EvaluationDeleteResponse> {
62-
const { project_id } = params;
63-
return this._client.delete(path`/project/${project_id}/evaluations/${evaluationID}`, options);
64-
}
65-
66-
/**
67-
* Create a new evaluation iteration.
68-
*
69-
* Creates a new evaluation iteration that will process all entries in the
70-
* evaluation's dataset. The method reads all files from the dataset's S3 folder
71-
* and creates evaluation results for each dataset entry.
72-
*
73-
* Args: evaluation_id: The ID of the evaluation to create an iteration for
74-
* request_data: Contains the prompt iteration ID to use project_id: The ID of the
75-
* project the evaluation belongs to request: FastAPI request object for tenant
76-
* information
77-
*
78-
* Returns: The created EvaluationIterationEntry with COMPLETED status
79-
*/
80-
createIteration(
81-
evaluationID: string,
82-
params: EvaluationCreateIterationParams,
83-
options?: RequestOptions,
84-
): APIPromise<EvaluationCreateIterationResponse> {
85-
const { project_id, ...body } = params;
86-
return this._client.post(path`/project/${project_id}/evaluations/${evaluationID}/iterations`, {
87-
body,
88-
...options,
89-
});
90-
}
91-
}
92-
93-
/**
94-
* Evaluation entry database model.
95-
*/
96-
export interface EvaluationEntry {
97-
/**
98-
* The ID of the dataset to evaluate against
99-
*/
100-
datasetId: string;
101-
102-
/**
103-
* Configuration for the evaluation objective
104-
*/
105-
objectiveConfig: { [key: string]: unknown };
106-
107-
/**
108-
* The type of evaluation objective
109-
*/
110-
objectiveType: EvaluationObjectiveType;
111-
112-
projectId: string;
113-
114-
id?: string;
115-
116-
/**
117-
* The ID of the agent to evaluate (mutually exclusive with promptId)
118-
*/
119-
agentId?: string | null;
120-
121-
/**
122-
* Timestamp when the record was created
123-
*/
124-
createdAt?: string | null;
125-
126-
/**
127-
* The ID of the prompt to evaluate (mutually exclusive with agentId)
128-
*/
129-
promptId?: string | null;
130-
131-
/**
132-
* Timestamp when the record was last updated
133-
*/
134-
updatedAt?: string | null;
135-
}
136-
137-
/**
138-
* Enum for evaluation objective types.
139-
*/
140-
export type EvaluationObjectiveType = 'RUBRIC' | 'ACCURACY' | 'REGRESSION';
141-
142-
export type EvaluationListResponse = Array<EvaluationEntry>;
143-
144-
export type EvaluationDeleteResponse = boolean;
145-
146-
/**
147-
* Evaluation iteration entry database model.
148-
*/
149-
export interface EvaluationCreateIterationResponse {
150-
/**
151-
* The ID of the evaluation
152-
*/
153-
evaluationId: string;
154-
155-
id?: string;
156-
157-
/**
158-
* Timestamp when the record was created
159-
*/
160-
createdAt?: string | null;
161-
162-
/**
163-
* The number of entries completed for this evaluation iteration
164-
*/
165-
entriesCompleted?: number;
166-
167-
/**
168-
* The number of entries required for this evaluation iteration
169-
*/
170-
entriesRequired?: number;
171-
172-
/**
173-
* The ID of the prompt iteration (optional for agent evaluations)
174-
*/
175-
promptIterationId?: string | null;
176-
177-
/**
178-
* The status of the evaluation iteration
179-
*/
180-
status?: 'PENDING' | 'COMPLETED';
181-
182-
/**
183-
* Timestamp when the record was last updated
184-
*/
185-
updatedAt?: string | null;
186-
}
187-
188-
export interface EvaluationCreateParams {
189-
/**
190-
* The ID of the dataset to evaluate against
191-
*/
192-
datasetId: string;
193-
194-
/**
195-
* Configuration for the evaluation objective
196-
*/
197-
objectiveConfig: { [key: string]: unknown };
198-
199-
/**
200-
* The type of evaluation objective
201-
*/
202-
objectiveType: EvaluationObjectiveType;
203-
204-
/**
205-
* The ID of the agent to evaluate (mutually exclusive with promptId)
206-
*/
207-
agentId?: string | null;
208-
209-
/**
210-
* The ID of the prompt to evaluate (mutually exclusive with agentId)
211-
*/
212-
promptId?: string | null;
213-
}
214-
215-
export interface EvaluationRetrieveParams {
216-
project_id: string;
217-
}
218-
219-
export interface EvaluationDeleteParams {
220-
project_id: string;
221-
}
222-
223-
export interface EvaluationCreateIterationParams {
224-
/**
225-
* Path param:
226-
*/
227-
project_id: string;
228-
229-
/**
230-
* Body param: The ID of the prompt iteration to use
231-
*/
232-
promptIterationId: string;
233-
}
234-
235-
export declare namespace Evaluations {
236-
export {
237-
type EvaluationEntry as EvaluationEntry,
238-
type EvaluationObjectiveType as EvaluationObjectiveType,
239-
type EvaluationListResponse as EvaluationListResponse,
240-
type EvaluationDeleteResponse as EvaluationDeleteResponse,
241-
type EvaluationCreateIterationResponse as EvaluationCreateIterationResponse,
242-
type EvaluationCreateParams as EvaluationCreateParams,
243-
type EvaluationRetrieveParams as EvaluationRetrieveParams,
244-
type EvaluationDeleteParams as EvaluationDeleteParams,
245-
type EvaluationCreateIterationParams as EvaluationCreateIterationParams,
246-
};
247-
}
5+
export class Evaluations extends APIResource {}

src/resources/projects/evaluators/evaluators.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export class Evaluators extends APIResource {
6565
*/
6666
export interface EvaluatorEntry {
6767
/**
68-
* Variables used in the prompt template
68+
* Configuration for the evaluator
6969
*/
7070
config: { [key: string]: unknown };
7171

@@ -105,7 +105,7 @@ export interface EvaluatorUpdateParams {
105105
project_id: string;
106106

107107
/**
108-
* Body param: Variables used in the prompt template
108+
* Body param: Configuration for the evaluator
109109
*/
110110
config: { [key: string]: unknown };
111111

src/resources/projects/index.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,7 @@ export {
1010
type AgentUpdateParams,
1111
type AgentDeleteParams,
1212
} from './agents';
13-
export {
14-
Evaluations,
15-
type EvaluationEntry,
16-
type EvaluationObjectiveType,
17-
type EvaluationListResponse,
18-
type EvaluationDeleteResponse,
19-
type EvaluationCreateIterationResponse,
20-
type EvaluationCreateParams,
21-
type EvaluationRetrieveParams,
22-
type EvaluationDeleteParams,
23-
type EvaluationCreateIterationParams,
24-
} from './evaluations';
13+
export { Evaluations } from './evaluations';
2514
export {
2615
Evaluators,
2716
type EvaluatorEntry,

src/resources/projects/projects.ts

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,7 @@ import {
1313
Agents,
1414
} from './agents';
1515
import * as EvaluationsAPI from './evaluations';
16-
import {
17-
EvaluationCreateIterationParams,
18-
EvaluationCreateIterationResponse,
19-
EvaluationCreateParams,
20-
EvaluationDeleteParams,
21-
EvaluationDeleteResponse,
22-
EvaluationEntry,
23-
EvaluationListResponse,
24-
EvaluationObjectiveType,
25-
EvaluationRetrieveParams,
26-
Evaluations,
27-
} from './evaluations';
16+
import { Evaluations } from './evaluations';
2817
import * as OptimizationsAPI from './optimizations';
2918
import {
3019
Optimization,
@@ -195,18 +184,7 @@ export declare namespace Projects {
195184
type EvaluatorUpdateParams as EvaluatorUpdateParams,
196185
};
197186

198-
export {
199-
Evaluations as Evaluations,
200-
type EvaluationEntry as EvaluationEntry,
201-
type EvaluationObjectiveType as EvaluationObjectiveType,
202-
type EvaluationListResponse as EvaluationListResponse,
203-
type EvaluationDeleteResponse as EvaluationDeleteResponse,
204-
type EvaluationCreateIterationResponse as EvaluationCreateIterationResponse,
205-
type EvaluationCreateParams as EvaluationCreateParams,
206-
type EvaluationRetrieveParams as EvaluationRetrieveParams,
207-
type EvaluationDeleteParams as EvaluationDeleteParams,
208-
type EvaluationCreateIterationParams as EvaluationCreateIterationParams,
209-
};
187+
export { Evaluations as Evaluations };
210188

211189
export {
212190
Agents as Agents,

0 commit comments

Comments
 (0)