Skip to content

Commit 8dbcbb2

Browse files
feat(api): put/patch methods swap (#182)
1 parent 131ba06 commit 8dbcbb2

File tree

13 files changed

+533
-533
lines changed

13 files changed

+533
-533
lines changed

api.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ Types:
1515
Methods:
1616

1717
- <code title="post /agents">client.agents.<a href="./src/resources/agents/agents.ts">create</a>({ ...params }) -> ResourceCreated</code>
18-
- <code title="put /agents/{agent_id}">client.agents.<a href="./src/resources/agents/agents.ts">update</a>(agentId, { ...params }) -> ResourceUpdated</code>
18+
- <code title="patch /agents/{agent_id}">client.agents.<a href="./src/resources/agents/agents.ts">update</a>(agentId, { ...params }) -> ResourceUpdated</code>
1919
- <code title="get /agents">client.agents.<a href="./src/resources/agents/agents.ts">list</a>({ ...params }) -> AgentsOffsetPagination</code>
2020
- <code title="delete /agents/{agent_id}">client.agents.<a href="./src/resources/agents/agents.ts">delete</a>(agentId) -> ResourceDeleted</code>
2121
- <code title="post /agents/{agent_id}">client.agents.<a href="./src/resources/agents/agents.ts">createOrUpdate</a>(agentId, { ...params }) -> ResourceCreated</code>
2222
- <code title="get /agents/{agent_id}">client.agents.<a href="./src/resources/agents/agents.ts">get</a>(agentId) -> Agent</code>
23-
- <code title="patch /agents/{agent_id}">client.agents.<a href="./src/resources/agents/agents.ts">patch</a>(agentId, { ...params }) -> ResourceUpdated</code>
23+
- <code title="put /agents/{agent_id}">client.agents.<a href="./src/resources/agents/agents.ts">reset</a>(agentId, { ...params }) -> ResourceUpdated</code>
2424

2525
## Tools
2626

@@ -31,10 +31,10 @@ Types:
3131
Methods:
3232

3333
- <code title="post /agents/{agent_id}/tools">client.agents.tools.<a href="./src/resources/agents/tools.ts">create</a>(agentId, { ...params }) -> ResourceCreated</code>
34-
- <code title="put /agents/{agent_id}/tools/{tool_id}">client.agents.tools.<a href="./src/resources/agents/tools.ts">update</a>(agentId, toolId, { ...params }) -> ResourceUpdated</code>
34+
- <code title="patch /agents/{agent_id}/tools/{tool_id}">client.agents.tools.<a href="./src/resources/agents/tools.ts">update</a>(agentId, toolId, { ...params }) -> ResourceUpdated</code>
3535
- <code title="get /agents/{agent_id}/tools">client.agents.tools.<a href="./src/resources/agents/tools.ts">list</a>(agentId, { ...params }) -> ToolListResponsesOffsetPagination</code>
3636
- <code title="delete /agents/{agent_id}/tools/{tool_id}">client.agents.tools.<a href="./src/resources/agents/tools.ts">delete</a>(agentId, toolId) -> ResourceDeleted</code>
37-
- <code title="patch /agents/{agent_id}/tools/{tool_id}">client.agents.tools.<a href="./src/resources/agents/tools.ts">patch</a>(agentId, toolId, { ...params }) -> ResourceUpdated</code>
37+
- <code title="put /agents/{agent_id}/tools/{tool_id}">client.agents.tools.<a href="./src/resources/agents/tools.ts">reset</a>(agentId, toolId, { ...params }) -> ResourceUpdated</code>
3838

3939
## Docs
4040

@@ -77,14 +77,14 @@ Types:
7777
Methods:
7878

7979
- <code title="post /sessions">client.sessions.<a href="./src/resources/sessions.ts">create</a>({ ...params }) -> ResourceCreated</code>
80-
- <code title="put /sessions/{session_id}">client.sessions.<a href="./src/resources/sessions.ts">update</a>(sessionId, { ...params }) -> ResourceUpdated</code>
80+
- <code title="patch /sessions/{session_id}">client.sessions.<a href="./src/resources/sessions.ts">update</a>(sessionId, { ...params }) -> ResourceUpdated</code>
8181
- <code title="get /sessions">client.sessions.<a href="./src/resources/sessions.ts">list</a>({ ...params }) -> SessionsOffsetPagination</code>
8282
- <code title="delete /sessions/{session_id}">client.sessions.<a href="./src/resources/sessions.ts">delete</a>(sessionId) -> ResourceDeleted</code>
8383
- <code title="post /sessions/{session_id}/chat">client.sessions.<a href="./src/resources/sessions.ts">chat</a>(sessionId, { ...params }) -> SessionChatResponse</code>
8484
- <code title="post /sessions/{session_id}">client.sessions.<a href="./src/resources/sessions.ts">createOrUpdate</a>(sessionId, { ...params }) -> ResourceUpdated</code>
8585
- <code title="get /sessions/{session_id}">client.sessions.<a href="./src/resources/sessions.ts">get</a>(sessionId) -> Session</code>
8686
- <code title="get /sessions/{session_id}/history">client.sessions.<a href="./src/resources/sessions.ts">history</a>(sessionId) -> History</code>
87-
- <code title="patch /sessions/{session_id}">client.sessions.<a href="./src/resources/sessions.ts">patch</a>(sessionId, { ...params }) -> ResourceUpdated</code>
87+
- <code title="put /sessions/{session_id}">client.sessions.<a href="./src/resources/sessions.ts">reset</a>(sessionId, { ...params }) -> ResourceUpdated</code>
8888

8989
# Users
9090

@@ -95,12 +95,12 @@ Types:
9595
Methods:
9696

9797
- <code title="post /users">client.users.<a href="./src/resources/users/users.ts">create</a>({ ...params }) -> ResourceCreated</code>
98-
- <code title="put /users/{user_id}">client.users.<a href="./src/resources/users/users.ts">update</a>(userId, { ...params }) -> ResourceUpdated</code>
98+
- <code title="patch /users/{user_id}">client.users.<a href="./src/resources/users/users.ts">update</a>(userId, { ...params }) -> ResourceUpdated</code>
9999
- <code title="get /users">client.users.<a href="./src/resources/users/users.ts">list</a>({ ...params }) -> UsersOffsetPagination</code>
100100
- <code title="delete /users/{user_id}">client.users.<a href="./src/resources/users/users.ts">delete</a>(userId) -> ResourceDeleted</code>
101101
- <code title="post /users/{user_id}">client.users.<a href="./src/resources/users/users.ts">createOrUpdate</a>(userId, { ...params }) -> ResourceCreated</code>
102102
- <code title="get /users/{user_id}">client.users.<a href="./src/resources/users/users.ts">get</a>(userId) -> User</code>
103-
- <code title="patch /users/{user_id}">client.users.<a href="./src/resources/users/users.ts">patch</a>(userId, { ...params }) -> ResourceUpdated</code>
103+
- <code title="put /users/{user_id}">client.users.<a href="./src/resources/users/users.ts">reset</a>(userId, { ...params }) -> ResourceUpdated</code>
104104

105105
## Docs
106106

src/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
SessionCreateOrUpdateParams,
2525
SessionCreateParams,
2626
SessionListParams,
27-
SessionPatchParams,
27+
SessionResetParams,
2828
SessionUpdateParams,
2929
Sessions,
3030
SessionsOffsetPagination,
@@ -42,7 +42,7 @@ import {
4242
AgentCreateOrUpdateParams,
4343
AgentCreateParams,
4444
AgentListParams,
45-
AgentPatchParams,
45+
AgentResetParams,
4646
AgentUpdateParams,
4747
Agents,
4848
AgentsOffsetPagination,
@@ -62,7 +62,7 @@ import {
6262
UserCreateOrUpdateParams,
6363
UserCreateParams,
6464
UserListParams,
65-
UserPatchParams,
65+
UserResetParams,
6666
UserUpdateParams,
6767
Users,
6868
UsersOffsetPagination,
@@ -287,7 +287,7 @@ export declare namespace Julep {
287287
type AgentUpdateParams as AgentUpdateParams,
288288
type AgentListParams as AgentListParams,
289289
type AgentCreateOrUpdateParams as AgentCreateOrUpdateParams,
290-
type AgentPatchParams as AgentPatchParams,
290+
type AgentResetParams as AgentResetParams,
291291
};
292292

293293
export { Files as Files, type File as File, type FileCreateParams as FileCreateParams };
@@ -308,7 +308,7 @@ export declare namespace Julep {
308308
type SessionListParams as SessionListParams,
309309
type SessionChatParams as SessionChatParams,
310310
type SessionCreateOrUpdateParams as SessionCreateOrUpdateParams,
311-
type SessionPatchParams as SessionPatchParams,
311+
type SessionResetParams as SessionResetParams,
312312
};
313313

314314
export {
@@ -319,7 +319,7 @@ export declare namespace Julep {
319319
type UserUpdateParams as UserUpdateParams,
320320
type UserListParams as UserListParams,
321321
type UserCreateOrUpdateParams as UserCreateOrUpdateParams,
322-
type UserPatchParams as UserPatchParams,
322+
type UserResetParams as UserResetParams,
323323
};
324324

325325
export { Jobs as Jobs, type JobStatus as JobStatus };

src/resources/agents/agents.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
ToolListParams,
1313
ToolListResponse,
1414
ToolListResponsesOffsetPagination,
15-
ToolPatchParams,
15+
ToolResetParams,
1616
ToolUpdateParams,
1717
Tools,
1818
} from './tools';
@@ -30,14 +30,14 @@ export class Agents extends APIResource {
3030
}
3131

3232
/**
33-
* Update Agent
33+
* Patch Agent
3434
*/
3535
update(
3636
agentId: string,
3737
body: AgentUpdateParams,
3838
options?: Core.RequestOptions,
3939
): Core.APIPromise<Shared.ResourceUpdated> {
40-
return this._client.put(`/agents/${agentId}`, { body, ...options });
40+
return this._client.patch(`/agents/${agentId}`, { body, ...options });
4141
}
4242

4343
/**
@@ -84,14 +84,14 @@ export class Agents extends APIResource {
8484
}
8585

8686
/**
87-
* Patch Agent
87+
* Update Agent
8888
*/
89-
patch(
89+
reset(
9090
agentId: string,
91-
body: AgentPatchParams,
91+
body: AgentResetParams,
9292
options?: Core.RequestOptions,
9393
): Core.APIPromise<Shared.ResourceUpdated> {
94-
return this._client.patch(`/agents/${agentId}`, { body, ...options });
94+
return this._client.put(`/agents/${agentId}`, { body, ...options });
9595
}
9696
}
9797

@@ -184,8 +184,6 @@ export namespace AgentCreateParams {
184184
}
185185

186186
export interface AgentUpdateParams {
187-
name: string;
188-
189187
about?: string;
190188

191189
canonical_name?: string | null;
@@ -200,6 +198,8 @@ export interface AgentUpdateParams {
200198
metadata?: unknown | null;
201199

202200
model?: string;
201+
202+
name?: string | null;
203203
}
204204

205205
export namespace AgentUpdateParams {
@@ -271,26 +271,26 @@ export namespace AgentCreateOrUpdateParams {
271271
}
272272
}
273273

274-
export interface AgentPatchParams {
274+
export interface AgentResetParams {
275+
name: string;
276+
275277
about?: string;
276278

277279
canonical_name?: string | null;
278280

279281
/**
280282
* Default settings for the chat session (also used by the agent)
281283
*/
282-
default_settings?: AgentPatchParams.DefaultSettings | null;
284+
default_settings?: AgentResetParams.DefaultSettings | null;
283285

284286
instructions?: string | Array<string>;
285287

286288
metadata?: unknown | null;
287289

288290
model?: string;
289-
290-
name?: string | null;
291291
}
292292

293-
export namespace AgentPatchParams {
293+
export namespace AgentResetParams {
294294
/**
295295
* Default settings for the chat session (also used by the agent)
296296
*/
@@ -324,7 +324,7 @@ export declare namespace Agents {
324324
type AgentUpdateParams as AgentUpdateParams,
325325
type AgentListParams as AgentListParams,
326326
type AgentCreateOrUpdateParams as AgentCreateOrUpdateParams,
327-
type AgentPatchParams as AgentPatchParams,
327+
type AgentResetParams as AgentResetParams,
328328
};
329329

330330
export {
@@ -334,7 +334,7 @@ export declare namespace Agents {
334334
type ToolCreateParams as ToolCreateParams,
335335
type ToolUpdateParams as ToolUpdateParams,
336336
type ToolListParams as ToolListParams,
337-
type ToolPatchParams as ToolPatchParams,
337+
type ToolResetParams as ToolResetParams,
338338
};
339339

340340
export {

src/resources/agents/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export {
88
type AgentUpdateParams,
99
type AgentListParams,
1010
type AgentCreateOrUpdateParams,
11-
type AgentPatchParams,
11+
type AgentResetParams,
1212
} from './agents';
1313
export {
1414
Docs,
@@ -24,5 +24,5 @@ export {
2424
type ToolCreateParams,
2525
type ToolUpdateParams,
2626
type ToolListParams,
27-
type ToolPatchParams,
27+
type ToolResetParams,
2828
} from './tools';

0 commit comments

Comments
 (0)