Skip to content

Commit cc72fe8

Browse files
feat(api): api update
1 parent 173a753 commit cc72fe8

7 files changed

Lines changed: 71 additions & 11 deletions

File tree

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 22
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta/warp-api-1fecc5f5d6ee664d804b81bd1aa6eec4d3f170ffa788d214fead4f7e95ab9d4e.yml
3-
openapi_spec_hash: 82990b03bd5a93e45bfc79db56ae7fc0
4-
config_hash: f52e7636f248f25c4ea0b086e7326816
1+
configured_endpoints: 23
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta/warp-api-e752e75a35d88b84870729ef94b0c32783172983420cbff1b204ca14375553f7.yml
3+
openapi_spec_hash: 34787afc1e1c84a643431a0f0eb352ae
4+
config_hash: 5a6e285f6e3a958a887b31b972a3f49c

api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ Methods:
7979
- <code title="put /agent/identities/{uid}">client.agent.agent.<a href="./src/resources/agent/agent_.ts">update</a>(uid, { ...params }) -> AgentResponse</code>
8080
- <code title="get /agent/identities">client.agent.agent.<a href="./src/resources/agent/agent_.ts">list</a>() -> ListAgentIdentitiesResponse</code>
8181
- <code title="delete /agent/identities/{uid}">client.agent.agent.<a href="./src/resources/agent/agent_.ts">delete</a>(uid) -> void</code>
82+
- <code title="get /agent/identities/{uid}">client.agent.agent.<a href="./src/resources/agent/agent_.ts">get</a>(uid) -> AgentResponse</code>
8283

8384
## Sessions
8485

src/resources/agent/agent_.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,20 @@ export class Agent extends APIResource {
6767
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
6868
});
6969
}
70+
71+
/**
72+
* Retrieve a single agent by its unique identifier. The response includes an
73+
* `available` flag indicating whether the agent is within the team's plan limit
74+
* and may be used for runs.
75+
*
76+
* @example
77+
* ```ts
78+
* const agentResponse = await client.agent.agent.get('uid');
79+
* ```
80+
*/
81+
get(uid: string, options?: RequestOptions): APIPromise<AgentResponse> {
82+
return this._client.get(path`/agent/identities/${uid}`, options);
83+
}
7084
}
7185

7286
export interface AgentResponse {
@@ -101,6 +115,16 @@ export interface AgentResponse {
101115
*/
102116
uid: string;
103117

118+
/**
119+
* Base model for runs executed by this agent. The precedence order for model
120+
* resolution is:
121+
*
122+
* 1. The model specified on the run itself
123+
* 2. The agent's base model
124+
* 3. The team's default model
125+
*/
126+
base_model?: string;
127+
104128
/**
105129
* Optional description of the agent
106130
*/
@@ -125,6 +149,11 @@ export interface CreateAgentRequest {
125149
*/
126150
name: string;
127151

152+
/**
153+
* Optional base model for runs executed by this agent.
154+
*/
155+
base_model?: string | null;
156+
128157
/**
129158
* Optional description of the agent
130159
*/
@@ -171,6 +200,12 @@ export interface ListAgentIdentitiesResponse {
171200
* - Non-empty: replace the field wholesale with the provided value.
172201
*/
173202
export interface UpdateAgentRequest {
203+
/**
204+
* Replacement base model. Omit or pass `null` to leave unchanged, or pass an empty
205+
* string to clear.
206+
*/
207+
base_model?: string | null;
208+
174209
/**
175210
* Replacement description. Omit or pass `null` to leave unchanged, or use an empty
176211
* value to clear.
@@ -213,6 +248,11 @@ export interface AgentCreateParams {
213248
*/
214249
name: string;
215250

251+
/**
252+
* Optional base model for runs executed by this agent.
253+
*/
254+
base_model?: string | null;
255+
216256
/**
217257
* Optional description of the agent
218258
*/
@@ -248,6 +288,12 @@ export namespace AgentCreateParams {
248288
}
249289

250290
export interface AgentUpdateParams {
291+
/**
292+
* Replacement base model. Omit or pass `null` to leave unchanged, or pass an empty
293+
* string to clear.
294+
*/
295+
base_model?: string | null;
296+
251297
/**
252298
* Replacement description. Omit or pass `null` to leave unchanged, or use an empty
253299
* value to clear.

src/resources/agent/runs.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,11 @@ export namespace RunItem {
455455
* Cost of LLM inference for the run
456456
*/
457457
inference_cost?: number;
458+
459+
/**
460+
* Cost of platform usage for the run
461+
*/
462+
platform_cost?: number;
458463
}
459464

460465
/**

src/resources/agent/schedules.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,6 @@ export interface ScheduledAgentItem {
178178
*/
179179
agent_config?: AgentAPI.AmbientAgentConfig;
180180

181-
/**
182-
* UID of the agent that this schedule runs as
183-
*/
184-
agent_uid?: string;
185-
186181
created_by?: AgentAPI.UserProfile;
187182

188183
/**

tests/api-resources/agent/agent_.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ describe('resource agent', () => {
2424
test.skip('create: required and optional params', async () => {
2525
const response = await client.agent.agent.create({
2626
name: 'name',
27+
base_model: 'base_model',
2728
description: 'description',
2829
secrets: [{ name: 'name' }],
2930
skills: ['string'],
@@ -65,4 +66,16 @@ describe('resource agent', () => {
6566
expect(dataAndResponse.data).toBe(response);
6667
expect(dataAndResponse.response).toBe(rawResponse);
6768
});
69+
70+
// Mock server tests are disabled
71+
test.skip('get', async () => {
72+
const responsePromise = client.agent.agent.get('uid');
73+
const rawResponse = await responsePromise.asResponse();
74+
expect(rawResponse).toBeInstanceOf(Response);
75+
const response = await responsePromise;
76+
expect(response).not.toBeInstanceOf(Response);
77+
const dataAndResponse = await responsePromise.withResponse();
78+
expect(dataAndResponse.data).toBe(response);
79+
expect(dataAndResponse.response).toBe(rawResponse);
80+
});
6881
});

tests/api-resources/agent/schedules.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ describe('resource schedules', () => {
5151
skill_spec: 'skill_spec',
5252
worker_host: 'worker_host',
5353
},
54-
agent_uid: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
54+
agent_uid: 'agent_uid',
5555
enabled: true,
5656
mode: 'normal',
5757
prompt: 'Review open pull requests and provide feedback',
@@ -116,7 +116,7 @@ describe('resource schedules', () => {
116116
skill_spec: 'skill_spec',
117117
worker_host: 'worker_host',
118118
},
119-
agent_uid: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
119+
agent_uid: 'agent_uid',
120120
mode: 'normal',
121121
prompt: 'prompt',
122122
});

0 commit comments

Comments
 (0)