@letta-ai/letta-client 1.4.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -126,11 +126,13 @@ export {
126
126
  type UpdateUserMessage,
127
127
  type UserMessage,
128
128
  type MessageCancelResponse,
129
+ type MessageCompactResponse,
129
130
  type MessageCreateParams,
130
131
  type MessageCreateParamsNonStreaming,
131
132
  type MessageCreateParamsStreaming,
132
133
  type MessageListParams,
133
134
  type MessageCancelParams,
135
+ type MessageCompactParams,
134
136
  type MessageCreateAsyncParams,
135
137
  type MessageResetParams,
136
138
  type MessageStreamParams,
@@ -8,7 +8,6 @@ import * as RunsAPI from '../runs/runs';
8
8
  import { APIPromise } from '../../core/api-promise';
9
9
  import { ArrayPage, type ArrayPageParams, ObjectPage, PagePromise } from '../../core/pagination';
10
10
  import { Stream } from '../../core/streaming';
11
- import { buildHeaders } from '../../internal/headers';
12
11
  import { RequestOptions } from '../../internal/request-options';
13
12
  import { path } from '../../internal/utils/path';
14
13
 
@@ -87,11 +86,12 @@ export class Messages extends APIResource {
87
86
  /**
88
87
  * Summarize an agent's conversation history.
89
88
  */
90
- compact(agentID: string, options?: RequestOptions): APIPromise<void> {
91
- return this._client.post(path`/v1/agents/${agentID}/summarize`, {
92
- ...options,
93
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
94
- });
89
+ compact(
90
+ agentID: string,
91
+ body: MessageCompactParams | null | undefined = {},
92
+ options?: RequestOptions,
93
+ ): APIPromise<MessageCompactResponse> {
94
+ return this._client.post(path`/v1/agents/${agentID}/summarize`, { body, ...options });
95
95
  }
96
96
 
97
97
  /**
@@ -1778,6 +1778,14 @@ export interface UserMessage {
1778
1778
 
1779
1779
  export type MessageCancelResponse = { [key: string]: unknown };
1780
1780
 
1781
+ export interface MessageCompactResponse {
1782
+ num_messages_after: number;
1783
+
1784
+ num_messages_before: number;
1785
+
1786
+ summary_message: string;
1787
+ }
1788
+
1781
1789
  export type MessageCreateParams = MessageCreateParamsNonStreaming | MessageCreateParamsStreaming;
1782
1790
 
1783
1791
  export interface MessageCreateParamsBase {
@@ -1961,6 +1969,77 @@ export interface MessageCancelParams {
1961
1969
  run_ids?: Array<string> | null;
1962
1970
  }
1963
1971
 
1972
+ export interface MessageCompactParams {
1973
+ /**
1974
+ * Configuration for conversation compaction / summarization.
1975
+ *
1976
+ * `model` is the only required user-facing field – it specifies the summarizer
1977
+ * model handle (e.g. `"openai/gpt-4o-mini"`). Per-model settings (temperature, max
1978
+ * tokens, etc.) are derived from the default configuration for that handle.
1979
+ */
1980
+ compaction_settings?: MessageCompactParams.CompactionSettings | null;
1981
+ }
1982
+
1983
+ export namespace MessageCompactParams {
1984
+ /**
1985
+ * Configuration for conversation compaction / summarization.
1986
+ *
1987
+ * `model` is the only required user-facing field – it specifies the summarizer
1988
+ * model handle (e.g. `"openai/gpt-4o-mini"`). Per-model settings (temperature, max
1989
+ * tokens, etc.) are derived from the default configuration for that handle.
1990
+ */
1991
+ export interface CompactionSettings {
1992
+ /**
1993
+ * Model handle to use for summarization (format: provider/model-name).
1994
+ */
1995
+ model: string;
1996
+
1997
+ /**
1998
+ * The maximum length of the summary in characters. If none, no clipping is
1999
+ * performed.
2000
+ */
2001
+ clip_chars?: number | null;
2002
+
2003
+ /**
2004
+ * The type of summarization technique use.
2005
+ */
2006
+ mode?: 'all' | 'sliding_window';
2007
+
2008
+ /**
2009
+ * Optional model settings used to override defaults for the summarizer model.
2010
+ */
2011
+ model_settings?:
2012
+ | AgentsAPI.OpenAIModelSettings
2013
+ | AgentsAPI.AnthropicModelSettings
2014
+ | AgentsAPI.GoogleAIModelSettings
2015
+ | AgentsAPI.GoogleVertexModelSettings
2016
+ | AgentsAPI.AzureModelSettings
2017
+ | AgentsAPI.XaiModelSettings
2018
+ | AgentsAPI.GroqModelSettings
2019
+ | AgentsAPI.DeepseekModelSettings
2020
+ | AgentsAPI.TogetherModelSettings
2021
+ | AgentsAPI.BedrockModelSettings
2022
+ | null;
2023
+
2024
+ /**
2025
+ * The prompt to use for summarization.
2026
+ */
2027
+ prompt?: string;
2028
+
2029
+ /**
2030
+ * Whether to include an acknowledgement post-prompt (helps prevent non-summary
2031
+ * outputs).
2032
+ */
2033
+ prompt_acknowledgement?: boolean;
2034
+
2035
+ /**
2036
+ * The percentage of the context window to keep post-summarization (only used in
2037
+ * sliding window mode).
2038
+ */
2039
+ sliding_window_percentage?: number;
2040
+ }
2041
+ }
2042
+
1964
2043
  export interface MessageCreateAsyncParams {
1965
2044
  /**
1966
2045
  * @deprecated The name of the message argument in the designated message tool.
@@ -2245,12 +2324,14 @@ export declare namespace Messages {
2245
2324
  type UpdateUserMessage as UpdateUserMessage,
2246
2325
  type UserMessage as UserMessage,
2247
2326
  type MessageCancelResponse as MessageCancelResponse,
2327
+ type MessageCompactResponse as MessageCompactResponse,
2248
2328
  type MessagesArrayPage as MessagesArrayPage,
2249
2329
  type MessageCreateParams as MessageCreateParams,
2250
2330
  type MessageCreateParamsNonStreaming as MessageCreateParamsNonStreaming,
2251
2331
  type MessageCreateParamsStreaming as MessageCreateParamsStreaming,
2252
2332
  type MessageListParams as MessageListParams,
2253
2333
  type MessageCancelParams as MessageCancelParams,
2334
+ type MessageCompactParams as MessageCompactParams,
2254
2335
  type MessageCreateAsyncParams as MessageCreateAsyncParams,
2255
2336
  type MessageResetParams as MessageResetParams,
2256
2337
  type MessageStreamParams as MessageStreamParams,
@@ -97,7 +97,8 @@ export namespace MessageSearchResponse {
97
97
  /**
98
98
  * System message list result with agent context.
99
99
  *
100
- * Shape is identical to UpdateSystemMessage but includes the owning agent_id.
100
+ * Shape is identical to UpdateSystemMessage but includes the owning agent_id and
101
+ * message id.
101
102
  */
102
103
  export interface SystemMessageListResult {
103
104
  /**
@@ -111,6 +112,11 @@ export namespace MessageSearchResponse {
111
112
  */
112
113
  created_at: string;
113
114
 
115
+ /**
116
+ * The unique identifier of the message.
117
+ */
118
+ message_id: string;
119
+
114
120
  /**
115
121
  * The unique identifier of the agent that owns the message.
116
122
  */
@@ -122,7 +128,8 @@ export namespace MessageSearchResponse {
122
128
  /**
123
129
  * User message list result with agent context.
124
130
  *
125
- * Shape is identical to UpdateUserMessage but includes the owning agent_id.
131
+ * Shape is identical to UpdateUserMessage but includes the owning agent_id and
132
+ * message id.
126
133
  */
127
134
  export interface UserMessageListResult {
128
135
  /**
@@ -136,6 +143,11 @@ export namespace MessageSearchResponse {
136
143
  */
137
144
  created_at: string;
138
145
 
146
+ /**
147
+ * The unique identifier of the message.
148
+ */
149
+ message_id: string;
150
+
139
151
  /**
140
152
  * The unique identifier of the agent that owns the message.
141
153
  */
@@ -147,7 +159,8 @@ export namespace MessageSearchResponse {
147
159
  /**
148
160
  * Reasoning message list result with agent context.
149
161
  *
150
- * Shape is identical to UpdateReasoningMessage but includes the owning agent_id.
162
+ * Shape is identical to UpdateReasoningMessage but includes the owning agent_id
163
+ * and message id.
151
164
  */
152
165
  export interface ReasoningMessageListResult {
153
166
  /**
@@ -155,6 +168,11 @@ export namespace MessageSearchResponse {
155
168
  */
156
169
  created_at: string;
157
170
 
171
+ /**
172
+ * The unique identifier of the message.
173
+ */
174
+ message_id: string;
175
+
158
176
  reasoning: string;
159
177
 
160
178
  /**
@@ -168,7 +186,8 @@ export namespace MessageSearchResponse {
168
186
  /**
169
187
  * Assistant message list result with agent context.
170
188
  *
171
- * Shape is identical to UpdateAssistantMessage but includes the owning agent_id.
189
+ * Shape is identical to UpdateAssistantMessage but includes the owning agent_id
190
+ * and message id.
172
191
  */
173
192
  export interface AssistantMessageListResult {
174
193
  /**
@@ -182,6 +201,11 @@ export namespace MessageSearchResponse {
182
201
  */
183
202
  created_at: string;
184
203
 
204
+ /**
205
+ * The unique identifier of the message.
206
+ */
207
+ message_id: string;
208
+
185
209
  /**
186
210
  * The unique identifier of the agent that owns the message.
187
211
  */
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.4.0'; // x-release-please-version
1
+ export const VERSION = '1.6.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.4.0";
1
+ export declare const VERSION = "1.6.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.4.0";
1
+ export declare const VERSION = "1.6.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '1.4.0'; // x-release-please-version
4
+ exports.VERSION = '1.6.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.4.0'; // x-release-please-version
1
+ export const VERSION = '1.6.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map