Skip to content

Commit fc5cb3b

Browse files
fix: create agent for template openapi response schema
1 parent 146e4ec commit fc5cb3b

File tree

5 files changed

+37
-14
lines changed

5 files changed

+37
-14
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 117
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/letta-ai%2Fletta-sdk-4c6a97f6e90b483b513093a9765356f96fc938da525380b4acaf13b56688251c.yml
3-
openapi_spec_hash: ba7a15b19c6a22f202fdf5603b016298
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/letta-ai%2Fletta-sdk-467b56c7f84bbc387cccfda48345431547f7e621bfb06f005ea5844de77f1858.yml
3+
openapi_spec_hash: ad37dbb38f5802754d614f1bb51e1b21
44
config_hash: b9227d561917304255fa4365a296d3b3

api.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,9 +454,13 @@ Methods:
454454

455455
## Agents
456456

457+
Types:
458+
459+
- <code><a href="./src/resources/templates/agents.ts">AgentCreateResponse</a></code>
460+
457461
Methods:
458462

459-
- <code title="post /v1/templates/{template_version}/agents">client.templates.agents.<a href="./src/resources/templates/agents.ts">create</a>(templateVersion, { ...params }) -> void</code>
463+
- <code title="post /v1/templates/{template_version}/agents">client.templates.agents.<a href="./src/resources/templates/agents.ts">create</a>(templateVersion, { ...params }) -> AgentCreateResponse</code>
460464

461465
# Tags
462466

src/resources/templates/agents.ts

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import { APIResource } from '../../core/resource';
44
import { APIPromise } from '../../core/api-promise';
5-
import { buildHeaders } from '../../internal/headers';
65
import { RequestOptions } from '../../internal/request-options';
76
import { path } from '../../internal/utils/path';
87

@@ -14,15 +13,31 @@ export class Agents extends APIResource {
1413
templateVersion: string,
1514
body: AgentCreateParams | null | undefined = {},
1615
options?: RequestOptions,
17-
): APIPromise<void> {
18-
return this._client.post(path`/v1/templates/${templateVersion}/agents`, {
19-
body,
20-
...options,
21-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
22-
});
16+
): APIPromise<AgentCreateResponse> {
17+
return this._client.post(path`/v1/templates/${templateVersion}/agents`, { body, ...options });
2318
}
2419
}
2520

21+
/**
22+
* Response containing created agent IDs and associated metadata
23+
*/
24+
export interface AgentCreateResponse {
25+
/**
26+
* Array of created agent IDs
27+
*/
28+
agent_ids: Array<string>;
29+
30+
/**
31+
* The deployment ID for the created agents
32+
*/
33+
deployment_id: string;
34+
35+
/**
36+
* Optional group ID if agents were created in a group
37+
*/
38+
group_id: string | null;
39+
}
40+
2641
export interface AgentCreateParams {
2742
/**
2843
* The name of the agent, optional otherwise a random one will be assigned
@@ -76,5 +91,5 @@ export namespace AgentCreateParams {
7691
}
7792

7893
export declare namespace Agents {
79-
export { type AgentCreateParams as AgentCreateParams };
94+
export { type AgentCreateResponse as AgentCreateResponse, type AgentCreateParams as AgentCreateParams };
8095
}

src/resources/templates/index.ts

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

3-
export { Agents, type AgentCreateParams } from './agents';
3+
export { Agents, type AgentCreateResponse, type AgentCreateParams } from './agents';
44
export { Templates } from './templates';

src/resources/templates/templates.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { APIResource } from '../../core/resource';
44
import * as AgentsAPI from './agents';
5-
import { AgentCreateParams, Agents } from './agents';
5+
import { AgentCreateParams, AgentCreateResponse, Agents } from './agents';
66

77
export class Templates extends APIResource {
88
agents: AgentsAPI.Agents = new AgentsAPI.Agents(this._client);
@@ -11,5 +11,9 @@ export class Templates extends APIResource {
1111
Templates.Agents = Agents;
1212

1313
export declare namespace Templates {
14-
export { Agents as Agents, type AgentCreateParams as AgentCreateParams };
14+
export {
15+
Agents as Agents,
16+
type AgentCreateResponse as AgentCreateResponse,
17+
type AgentCreateParams as AgentCreateParams,
18+
};
1519
}

0 commit comments

Comments
 (0)