Skip to content

Commit 9c6a2a0

Browse files
feat(api): api update (#20)
1 parent b7cad3e commit 9c6a2a0

File tree

9 files changed

+127
-207
lines changed

9 files changed

+127
-207
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 9
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/letta-ai%2Fletta-4bed1c3abfa651287046439cb3bb015ec25b01b3c410c80f07908cb54d643439.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/letta-ai%2Fletta-7565f071511c7e2702a9da4a40be04bef653e2e5aa36e995dd6512ac874ceb1a.yml

api.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Types:
44

55
- <code><a href="./src/resources/agents/agents.ts">AgentState</a></code>
66
- <code><a href="./src/resources/agents/agents.ts">AgentListResponse</a></code>
7-
- <code><a href="./src/resources/agents/agents.ts">AgentDeleteResponse</a></code>
87
- <code><a href="./src/resources/agents/agents.ts">AgentMigrateResponse</a></code>
98

109
Methods:
@@ -13,7 +12,7 @@ Methods:
1312
- <code title="get /v1/agents/{agent_id}">client.agents.<a href="./src/resources/agents/agents.ts">retrieve</a>(agentId) -> AgentState</code>
1413
- <code title="patch /v1/agents/{agent_id}">client.agents.<a href="./src/resources/agents/agents.ts">update</a>(agentId, { ...params }) -> AgentState</code>
1514
- <code title="get /v1/agents/">client.agents.<a href="./src/resources/agents/agents.ts">list</a>({ ...params }) -> AgentListResponse</code>
16-
- <code title="delete /v1/agents/{agent_id}">client.agents.<a href="./src/resources/agents/agents.ts">delete</a>(agentId) -> unknown</code>
15+
- <code title="delete /v1/agents/{agent_id}">client.agents.<a href="./src/resources/agents/agents.ts">delete</a>(agentId) -> AgentState</code>
1716
- <code title="post /v1/agents/{agent_id}/migrate">client.agents.<a href="./src/resources/agents/agents.ts">migrate</a>(agentId, { ...params }) -> AgentMigrateResponse</code>
1817

1918
## Messages

src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import * as Uploads from './uploads';
88
import * as API from './resources/index';
99
import {
1010
AgentCreateParams,
11-
AgentDeleteResponse,
1211
AgentListParams,
1312
AgentListResponse,
1413
AgentMigrateParams,
@@ -203,7 +202,6 @@ export declare namespace Letta {
203202
Agents as Agents,
204203
type AgentState as AgentState,
205204
type AgentListResponse as AgentListResponse,
206-
type AgentDeleteResponse as AgentDeleteResponse,
207205
type AgentMigrateResponse as AgentMigrateResponse,
208206
type AgentCreateParams as AgentCreateParams,
209207
type AgentUpdateParams as AgentUpdateParams,

src/resources/agents/agents.ts

Lines changed: 27 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export class Agents extends APIResource {
6161
/**
6262
* Delete an agent.
6363
*/
64-
delete(agentId: string, options?: Core.RequestOptions): Core.APIPromise<unknown> {
64+
delete(agentId: string, options?: Core.RequestOptions): Core.APIPromise<AgentState> {
6565
return this._client.delete(`/v1/agents/${agentId}`, options);
6666
}
6767

@@ -96,7 +96,7 @@ export interface AgentState {
9696
/**
9797
* The type of agent.
9898
*/
99-
agent_type: 'memgpt_agent' | 'split_thread_agent' | 'o1_agent';
99+
agent_type: 'memgpt_agent' | 'split_thread_agent' | 'o1_agent' | 'offline_memory_agent' | 'chat_only_agent';
100100

101101
/**
102102
* The embedding configuration used by the agent.
@@ -531,6 +531,11 @@ export namespace AgentState {
531531
*/
532532
organization_id?: string | null;
533533

534+
/**
535+
* The maximum number of characters in the response.
536+
*/
537+
return_char_limit?: number;
538+
534539
/**
535540
* The type of the source code.
536541
*/
@@ -596,8 +601,6 @@ export namespace AgentState {
596601

597602
export type AgentListResponse = Array<AgentState>;
598603

599-
export type AgentDeleteResponse = unknown;
600-
601604
export interface AgentMigrateResponse {
602605
success: true;
603606
}
@@ -609,9 +612,14 @@ export interface AgentCreateParams {
609612
memory_blocks: Array<AgentCreateParams.MemoryBlock>;
610613

611614
/**
612-
* Enum to represent the type of agent.
615+
* The type of agent.
613616
*/
614-
agent_type?: 'memgpt_agent' | 'split_thread_agent' | 'o1_agent' | null;
617+
agent_type?:
618+
| 'memgpt_agent'
619+
| 'split_thread_agent'
620+
| 'o1_agent'
621+
| 'offline_memory_agent'
622+
| 'chat_only_agent';
615623

616624
/**
617625
* The description of the agent.
@@ -690,11 +698,8 @@ export interface AgentCreateParams {
690698
/**
691699
* The tools used by the agent.
692700
*/
693-
tools?: Array<string> | null;
701+
tools?: Array<string>;
694702

695-
/**
696-
* The user id of the agent.
697-
*/
698703
user_id?: string | null;
699704
}
700705

@@ -792,100 +797,43 @@ export namespace AgentCreateParams {
792797
}
793798

794799
/**
795-
* Letta's internal representation of a message. Includes methods to convert
796-
* to/from LLM provider formats.
797-
*
798-
* Attributes: id (str): The unique identifier of the message. role (MessageRole):
799-
* The role of the participant. text (str): The text of the message. user_id (str):
800-
* The unique identifier of the user. agent_id (str): The unique identifier of the
801-
* agent. model (str): The model used to make the function call. name (str): The
802-
* name of the participant. created_at (datetime): The time the message was
803-
* created. tool_calls (List[ToolCall]): The list of tool calls requested.
804-
* tool_call_id (str): The id of the tool call.
800+
* Request to create a message
805801
*/
806802
export interface InitialMessageSequence {
807803
/**
808804
* The role of the participant.
809805
*/
810-
role: 'assistant' | 'user' | 'tool' | 'function' | 'system';
806+
role: 'user' | 'system';
811807

812808
/**
813-
* The human-friendly ID of the Message
809+
* The text of the message.
814810
*/
815-
id?: string;
811+
text: string;
816812

817813
/**
818-
* The unique identifier of the agent.
814+
* The timestamp when the object was created.
819815
*/
820-
agent_id?: string | null;
816+
created_at?: string | null;
821817

822818
/**
823-
* The time the message was created.
819+
* The id of the user that made this object.
824820
*/
825-
created_at?: string;
821+
created_by_id?: string | null;
826822

827823
/**
828-
* The model used to make the function call.
824+
* The id of the user that made this object.
829825
*/
830-
model?: string | null;
826+
last_updated_by_id?: string | null;
831827

832828
/**
833829
* The name of the participant.
834830
*/
835831
name?: string | null;
836832

837833
/**
838-
* The text of the message.
839-
*/
840-
text?: string | null;
841-
842-
/**
843-
* The id of the tool call.
844-
*/
845-
tool_call_id?: string | null;
846-
847-
/**
848-
* The list of tool calls requested.
849-
*/
850-
tool_calls?: Array<InitialMessageSequence.ToolCall> | null;
851-
852-
/**
853-
* The unique identifier of the user.
834+
* The timestamp when the object was last updated.
854835
*/
855-
user_id?: string | null;
856-
}
857-
858-
export namespace InitialMessageSequence {
859-
export interface ToolCall {
860-
/**
861-
* The ID of the tool call
862-
*/
863-
id: string;
864-
865-
/**
866-
* The arguments and name for the function
867-
*/
868-
function: ToolCall.Function;
869-
870-
type?: string;
871-
}
872-
873-
export namespace ToolCall {
874-
/**
875-
* The arguments and name for the function
876-
*/
877-
export interface Function {
878-
/**
879-
* The arguments to pass to the function (JSON dump)
880-
*/
881-
arguments: string;
882-
883-
/**
884-
* The name of the function to call
885-
*/
886-
name: string;
887-
}
888-
}
836+
updated_at?: string | null;
889837
}
890838

891839
/**
@@ -1238,7 +1186,6 @@ export declare namespace Agents {
12381186
export {
12391187
type AgentState as AgentState,
12401188
type AgentListResponse as AgentListResponse,
1241-
type AgentDeleteResponse as AgentDeleteResponse,
12421189
type AgentMigrateResponse as AgentMigrateResponse,
12431190
type AgentCreateParams as AgentCreateParams,
12441191
type AgentUpdateParams as AgentUpdateParams,

src/resources/agents/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ export {
44
Agents,
55
type AgentState,
66
type AgentListResponse,
7-
type AgentDeleteResponse,
87
type AgentMigrateResponse,
98
type AgentCreateParams,
109
type AgentUpdateParams,

0 commit comments

Comments
 (0)