@letta-ai/letta-client 1.3.2 → 1.4.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.
- package/CHANGELOG.md +40 -0
- package/internal/detect-platform.d.mts +1 -0
- package/internal/detect-platform.d.mts.map +1 -1
- package/internal/detect-platform.d.ts +1 -0
- package/internal/detect-platform.d.ts.map +1 -1
- package/internal/detect-platform.js +5 -0
- package/internal/detect-platform.js.map +1 -1
- package/internal/detect-platform.mjs +5 -0
- package/internal/detect-platform.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/agents/agents.d.mts +153 -1
- package/resources/agents/agents.d.mts.map +1 -1
- package/resources/agents/agents.d.ts +153 -1
- package/resources/agents/agents.d.ts.map +1 -1
- package/resources/agents/agents.js +4 -0
- package/resources/agents/agents.js.map +1 -1
- package/resources/agents/agents.mjs +4 -0
- package/resources/agents/agents.mjs.map +1 -1
- package/resources/agents/index.d.mts +1 -0
- package/resources/agents/index.d.mts.map +1 -1
- package/resources/agents/index.d.ts +1 -0
- package/resources/agents/index.d.ts.map +1 -1
- package/resources/agents/index.js +3 -1
- package/resources/agents/index.js.map +1 -1
- package/resources/agents/index.mjs +1 -0
- package/resources/agents/index.mjs.map +1 -1
- package/resources/agents/messages.d.mts +9 -0
- package/resources/agents/messages.d.mts.map +1 -1
- package/resources/agents/messages.d.ts +9 -0
- package/resources/agents/messages.d.ts.map +1 -1
- package/resources/agents/passages.d.mts +139 -0
- package/resources/agents/passages.d.mts.map +1 -0
- package/resources/agents/passages.d.ts +139 -0
- package/resources/agents/passages.d.ts.map +1 -0
- package/resources/agents/passages.js +49 -0
- package/resources/agents/passages.js.map +1 -0
- package/resources/agents/passages.mjs +45 -0
- package/resources/agents/passages.mjs.map +1 -0
- package/resources/messages.d.mts +83 -2
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +83 -2
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs.map +1 -1
- package/resources/models/models.d.mts +2 -2
- package/resources/models/models.d.mts.map +1 -1
- package/resources/models/models.d.ts +2 -2
- package/resources/models/models.d.ts.map +1 -1
- package/resources/runs/runs.d.mts +1 -1
- package/resources/runs/runs.d.mts.map +1 -1
- package/resources/runs/runs.d.ts +1 -1
- package/resources/runs/runs.d.ts.map +1 -1
- package/resources/runs/runs.js.map +1 -1
- package/resources/runs/runs.mjs.map +1 -1
- package/resources/tools.d.mts +4 -0
- package/resources/tools.d.mts.map +1 -1
- package/resources/tools.d.ts +4 -0
- package/resources/tools.d.ts.map +1 -1
- package/src/internal/detect-platform.ts +6 -0
- package/src/resources/agents/agents.ts +232 -1
- package/src/resources/agents/index.ts +11 -0
- package/src/resources/agents/messages.ts +9 -0
- package/src/resources/agents/passages.ts +199 -0
- package/src/resources/messages.ts +102 -12
- package/src/resources/models/models.ts +2 -2
- package/src/resources/runs/runs.ts +3 -1
- package/src/resources/tools.ts +5 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -106,6 +106,18 @@ import {
|
|
|
106
106
|
UpdateUserMessage,
|
|
107
107
|
UserMessage,
|
|
108
108
|
} from './messages';
|
|
109
|
+
import * as PassagesAPI from './passages';
|
|
110
|
+
import {
|
|
111
|
+
PassageCreateParams,
|
|
112
|
+
PassageCreateResponse,
|
|
113
|
+
PassageDeleteParams,
|
|
114
|
+
PassageDeleteResponse,
|
|
115
|
+
PassageListParams,
|
|
116
|
+
PassageListResponse,
|
|
117
|
+
PassageSearchParams,
|
|
118
|
+
PassageSearchResponse,
|
|
119
|
+
Passages,
|
|
120
|
+
} from './passages';
|
|
109
121
|
import * as AgentsToolsAPI from './tools';
|
|
110
122
|
import {
|
|
111
123
|
ToolAttachParams,
|
|
@@ -139,6 +151,7 @@ export class Agents extends APIResource {
|
|
|
139
151
|
files: FilesAPI.Files = new FilesAPI.Files(this._client);
|
|
140
152
|
groups: GroupsAPI.Groups = new GroupsAPI.Groups(this._client);
|
|
141
153
|
archives: ArchivesAPI.Archives = new ArchivesAPI.Archives(this._client);
|
|
154
|
+
passages: PassagesAPI.Passages = new PassagesAPI.Passages(this._client);
|
|
142
155
|
identities: IdentitiesAPI.Identities = new IdentitiesAPI.Identities(this._client);
|
|
143
156
|
|
|
144
157
|
/**
|
|
@@ -346,6 +359,15 @@ export interface AgentState {
|
|
|
346
359
|
*/
|
|
347
360
|
base_template_id?: string | null;
|
|
348
361
|
|
|
362
|
+
/**
|
|
363
|
+
* Configuration for conversation compaction / summarization.
|
|
364
|
+
*
|
|
365
|
+
* `model` is the only required user-facing field – it specifies the summarizer
|
|
366
|
+
* model handle (e.g. `"openai/gpt-4o-mini"`). Per-model settings (temperature, max
|
|
367
|
+
* tokens, etc.) are derived from the default configuration for that handle.
|
|
368
|
+
*/
|
|
369
|
+
compaction_settings?: AgentState.CompactionSettings | null;
|
|
370
|
+
|
|
349
371
|
/**
|
|
350
372
|
* The timestamp when the object was created.
|
|
351
373
|
*/
|
|
@@ -732,6 +754,64 @@ export namespace AgentState {
|
|
|
732
754
|
*/
|
|
733
755
|
vector_db_provider?: ArchivesArchivesAPI.VectorDBProvider;
|
|
734
756
|
}
|
|
757
|
+
|
|
758
|
+
/**
|
|
759
|
+
* Configuration for conversation compaction / summarization.
|
|
760
|
+
*
|
|
761
|
+
* `model` is the only required user-facing field – it specifies the summarizer
|
|
762
|
+
* model handle (e.g. `"openai/gpt-4o-mini"`). Per-model settings (temperature, max
|
|
763
|
+
* tokens, etc.) are derived from the default configuration for that handle.
|
|
764
|
+
*/
|
|
765
|
+
export interface CompactionSettings {
|
|
766
|
+
/**
|
|
767
|
+
* Model handle to use for summarization (format: provider/model-name).
|
|
768
|
+
*/
|
|
769
|
+
model: string;
|
|
770
|
+
|
|
771
|
+
/**
|
|
772
|
+
* The maximum length of the summary in characters. If none, no clipping is
|
|
773
|
+
* performed.
|
|
774
|
+
*/
|
|
775
|
+
clip_chars?: number | null;
|
|
776
|
+
|
|
777
|
+
/**
|
|
778
|
+
* The type of summarization technique use.
|
|
779
|
+
*/
|
|
780
|
+
mode?: 'all' | 'sliding_window';
|
|
781
|
+
|
|
782
|
+
/**
|
|
783
|
+
* Optional model settings used to override defaults for the summarizer model.
|
|
784
|
+
*/
|
|
785
|
+
model_settings?:
|
|
786
|
+
| AgentsAPI.OpenAIModelSettings
|
|
787
|
+
| AgentsAPI.AnthropicModelSettings
|
|
788
|
+
| AgentsAPI.GoogleAIModelSettings
|
|
789
|
+
| AgentsAPI.GoogleVertexModelSettings
|
|
790
|
+
| AgentsAPI.AzureModelSettings
|
|
791
|
+
| AgentsAPI.XaiModelSettings
|
|
792
|
+
| AgentsAPI.GroqModelSettings
|
|
793
|
+
| AgentsAPI.DeepseekModelSettings
|
|
794
|
+
| AgentsAPI.TogetherModelSettings
|
|
795
|
+
| AgentsAPI.BedrockModelSettings
|
|
796
|
+
| null;
|
|
797
|
+
|
|
798
|
+
/**
|
|
799
|
+
* The prompt to use for summarization.
|
|
800
|
+
*/
|
|
801
|
+
prompt?: string;
|
|
802
|
+
|
|
803
|
+
/**
|
|
804
|
+
* Whether to include an acknowledgement post-prompt (helps prevent non-summary
|
|
805
|
+
* outputs).
|
|
806
|
+
*/
|
|
807
|
+
prompt_acknowledgement?: boolean;
|
|
808
|
+
|
|
809
|
+
/**
|
|
810
|
+
* The percentage of the context window to keep post-summarization (only used in
|
|
811
|
+
* sliding window mode).
|
|
812
|
+
*/
|
|
813
|
+
sliding_window_percentage?: number;
|
|
814
|
+
}
|
|
735
815
|
}
|
|
736
816
|
|
|
737
817
|
/**
|
|
@@ -1299,7 +1379,7 @@ export namespace OpenAIModelSettings {
|
|
|
1299
1379
|
/**
|
|
1300
1380
|
* The reasoning effort to use when generating text reasoning models
|
|
1301
1381
|
*/
|
|
1302
|
-
reasoning_effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high';
|
|
1382
|
+
reasoning_effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
|
|
1303
1383
|
}
|
|
1304
1384
|
}
|
|
1305
1385
|
|
|
@@ -1481,6 +1561,15 @@ export interface AgentCreateParams {
|
|
|
1481
1561
|
*/
|
|
1482
1562
|
block_ids?: Array<string> | null;
|
|
1483
1563
|
|
|
1564
|
+
/**
|
|
1565
|
+
* Configuration for conversation compaction / summarization.
|
|
1566
|
+
*
|
|
1567
|
+
* `model` is the only required user-facing field – it specifies the summarizer
|
|
1568
|
+
* model handle (e.g. `"openai/gpt-4o-mini"`). Per-model settings (temperature, max
|
|
1569
|
+
* tokens, etc.) are derived from the default configuration for that handle.
|
|
1570
|
+
*/
|
|
1571
|
+
compaction_settings?: AgentCreateParams.CompactionSettings | null;
|
|
1572
|
+
|
|
1484
1573
|
/**
|
|
1485
1574
|
* The context window limit used by the agent.
|
|
1486
1575
|
*/
|
|
@@ -1751,6 +1840,66 @@ export interface AgentCreateParams {
|
|
|
1751
1840
|
tools?: Array<string> | null;
|
|
1752
1841
|
}
|
|
1753
1842
|
|
|
1843
|
+
export namespace AgentCreateParams {
|
|
1844
|
+
/**
|
|
1845
|
+
* Configuration for conversation compaction / summarization.
|
|
1846
|
+
*
|
|
1847
|
+
* `model` is the only required user-facing field – it specifies the summarizer
|
|
1848
|
+
* model handle (e.g. `"openai/gpt-4o-mini"`). Per-model settings (temperature, max
|
|
1849
|
+
* tokens, etc.) are derived from the default configuration for that handle.
|
|
1850
|
+
*/
|
|
1851
|
+
export interface CompactionSettings {
|
|
1852
|
+
/**
|
|
1853
|
+
* Model handle to use for summarization (format: provider/model-name).
|
|
1854
|
+
*/
|
|
1855
|
+
model: string;
|
|
1856
|
+
|
|
1857
|
+
/**
|
|
1858
|
+
* The maximum length of the summary in characters. If none, no clipping is
|
|
1859
|
+
* performed.
|
|
1860
|
+
*/
|
|
1861
|
+
clip_chars?: number | null;
|
|
1862
|
+
|
|
1863
|
+
/**
|
|
1864
|
+
* The type of summarization technique use.
|
|
1865
|
+
*/
|
|
1866
|
+
mode?: 'all' | 'sliding_window';
|
|
1867
|
+
|
|
1868
|
+
/**
|
|
1869
|
+
* Optional model settings used to override defaults for the summarizer model.
|
|
1870
|
+
*/
|
|
1871
|
+
model_settings?:
|
|
1872
|
+
| AgentsAPI.OpenAIModelSettings
|
|
1873
|
+
| AgentsAPI.AnthropicModelSettings
|
|
1874
|
+
| AgentsAPI.GoogleAIModelSettings
|
|
1875
|
+
| AgentsAPI.GoogleVertexModelSettings
|
|
1876
|
+
| AgentsAPI.AzureModelSettings
|
|
1877
|
+
| AgentsAPI.XaiModelSettings
|
|
1878
|
+
| AgentsAPI.GroqModelSettings
|
|
1879
|
+
| AgentsAPI.DeepseekModelSettings
|
|
1880
|
+
| AgentsAPI.TogetherModelSettings
|
|
1881
|
+
| AgentsAPI.BedrockModelSettings
|
|
1882
|
+
| null;
|
|
1883
|
+
|
|
1884
|
+
/**
|
|
1885
|
+
* The prompt to use for summarization.
|
|
1886
|
+
*/
|
|
1887
|
+
prompt?: string;
|
|
1888
|
+
|
|
1889
|
+
/**
|
|
1890
|
+
* Whether to include an acknowledgement post-prompt (helps prevent non-summary
|
|
1891
|
+
* outputs).
|
|
1892
|
+
*/
|
|
1893
|
+
prompt_acknowledgement?: boolean;
|
|
1894
|
+
|
|
1895
|
+
/**
|
|
1896
|
+
* The percentage of the context window to keep post-summarization (only used in
|
|
1897
|
+
* sliding window mode).
|
|
1898
|
+
*/
|
|
1899
|
+
sliding_window_percentage?: number;
|
|
1900
|
+
}
|
|
1901
|
+
}
|
|
1902
|
+
|
|
1754
1903
|
export interface AgentRetrieveParams {
|
|
1755
1904
|
/**
|
|
1756
1905
|
* Specify which relational fields to include in the response. No relationships are
|
|
@@ -1786,6 +1935,15 @@ export interface AgentUpdateParams {
|
|
|
1786
1935
|
*/
|
|
1787
1936
|
block_ids?: Array<string> | null;
|
|
1788
1937
|
|
|
1938
|
+
/**
|
|
1939
|
+
* Configuration for conversation compaction / summarization.
|
|
1940
|
+
*
|
|
1941
|
+
* `model` is the only required user-facing field – it specifies the summarizer
|
|
1942
|
+
* model handle (e.g. `"openai/gpt-4o-mini"`). Per-model settings (temperature, max
|
|
1943
|
+
* tokens, etc.) are derived from the default configuration for that handle.
|
|
1944
|
+
*/
|
|
1945
|
+
compaction_settings?: AgentUpdateParams.CompactionSettings | null;
|
|
1946
|
+
|
|
1789
1947
|
/**
|
|
1790
1948
|
* The context window limit used by the agent.
|
|
1791
1949
|
*/
|
|
@@ -1992,6 +2150,66 @@ export interface AgentUpdateParams {
|
|
|
1992
2150
|
> | null;
|
|
1993
2151
|
}
|
|
1994
2152
|
|
|
2153
|
+
export namespace AgentUpdateParams {
|
|
2154
|
+
/**
|
|
2155
|
+
* Configuration for conversation compaction / summarization.
|
|
2156
|
+
*
|
|
2157
|
+
* `model` is the only required user-facing field – it specifies the summarizer
|
|
2158
|
+
* model handle (e.g. `"openai/gpt-4o-mini"`). Per-model settings (temperature, max
|
|
2159
|
+
* tokens, etc.) are derived from the default configuration for that handle.
|
|
2160
|
+
*/
|
|
2161
|
+
export interface CompactionSettings {
|
|
2162
|
+
/**
|
|
2163
|
+
* Model handle to use for summarization (format: provider/model-name).
|
|
2164
|
+
*/
|
|
2165
|
+
model: string;
|
|
2166
|
+
|
|
2167
|
+
/**
|
|
2168
|
+
* The maximum length of the summary in characters. If none, no clipping is
|
|
2169
|
+
* performed.
|
|
2170
|
+
*/
|
|
2171
|
+
clip_chars?: number | null;
|
|
2172
|
+
|
|
2173
|
+
/**
|
|
2174
|
+
* The type of summarization technique use.
|
|
2175
|
+
*/
|
|
2176
|
+
mode?: 'all' | 'sliding_window';
|
|
2177
|
+
|
|
2178
|
+
/**
|
|
2179
|
+
* Optional model settings used to override defaults for the summarizer model.
|
|
2180
|
+
*/
|
|
2181
|
+
model_settings?:
|
|
2182
|
+
| AgentsAPI.OpenAIModelSettings
|
|
2183
|
+
| AgentsAPI.AnthropicModelSettings
|
|
2184
|
+
| AgentsAPI.GoogleAIModelSettings
|
|
2185
|
+
| AgentsAPI.GoogleVertexModelSettings
|
|
2186
|
+
| AgentsAPI.AzureModelSettings
|
|
2187
|
+
| AgentsAPI.XaiModelSettings
|
|
2188
|
+
| AgentsAPI.GroqModelSettings
|
|
2189
|
+
| AgentsAPI.DeepseekModelSettings
|
|
2190
|
+
| AgentsAPI.TogetherModelSettings
|
|
2191
|
+
| AgentsAPI.BedrockModelSettings
|
|
2192
|
+
| null;
|
|
2193
|
+
|
|
2194
|
+
/**
|
|
2195
|
+
* The prompt to use for summarization.
|
|
2196
|
+
*/
|
|
2197
|
+
prompt?: string;
|
|
2198
|
+
|
|
2199
|
+
/**
|
|
2200
|
+
* Whether to include an acknowledgement post-prompt (helps prevent non-summary
|
|
2201
|
+
* outputs).
|
|
2202
|
+
*/
|
|
2203
|
+
prompt_acknowledgement?: boolean;
|
|
2204
|
+
|
|
2205
|
+
/**
|
|
2206
|
+
* The percentage of the context window to keep post-summarization (only used in
|
|
2207
|
+
* sliding window mode).
|
|
2208
|
+
*/
|
|
2209
|
+
sliding_window_percentage?: number;
|
|
2210
|
+
}
|
|
2211
|
+
}
|
|
2212
|
+
|
|
1995
2213
|
export interface AgentListParams extends ArrayPageParams {
|
|
1996
2214
|
/**
|
|
1997
2215
|
* @deprecated Whether to sort agents oldest to newest (True) or newest to oldest
|
|
@@ -2169,6 +2387,7 @@ Agents.Folders = Folders;
|
|
|
2169
2387
|
Agents.Files = Files;
|
|
2170
2388
|
Agents.Groups = Groups;
|
|
2171
2389
|
Agents.Archives = Archives;
|
|
2390
|
+
Agents.Passages = Passages;
|
|
2172
2391
|
Agents.Identities = Identities;
|
|
2173
2392
|
|
|
2174
2393
|
export declare namespace Agents {
|
|
@@ -2318,6 +2537,18 @@ export declare namespace Agents {
|
|
|
2318
2537
|
type ArchiveDetachParams as ArchiveDetachParams,
|
|
2319
2538
|
};
|
|
2320
2539
|
|
|
2540
|
+
export {
|
|
2541
|
+
Passages as Passages,
|
|
2542
|
+
type PassageCreateResponse as PassageCreateResponse,
|
|
2543
|
+
type PassageListResponse as PassageListResponse,
|
|
2544
|
+
type PassageDeleteResponse as PassageDeleteResponse,
|
|
2545
|
+
type PassageSearchResponse as PassageSearchResponse,
|
|
2546
|
+
type PassageCreateParams as PassageCreateParams,
|
|
2547
|
+
type PassageListParams as PassageListParams,
|
|
2548
|
+
type PassageDeleteParams as PassageDeleteParams,
|
|
2549
|
+
type PassageSearchParams as PassageSearchParams,
|
|
2550
|
+
};
|
|
2551
|
+
|
|
2321
2552
|
export {
|
|
2322
2553
|
Identities as Identities,
|
|
2323
2554
|
type IdentityAttachResponse as IdentityAttachResponse,
|
|
@@ -138,6 +138,17 @@ export {
|
|
|
138
138
|
type MessagesArrayPage,
|
|
139
139
|
type InternalMessagesObjectPage,
|
|
140
140
|
} from './messages';
|
|
141
|
+
export {
|
|
142
|
+
Passages,
|
|
143
|
+
type PassageCreateResponse,
|
|
144
|
+
type PassageListResponse,
|
|
145
|
+
type PassageDeleteResponse,
|
|
146
|
+
type PassageSearchResponse,
|
|
147
|
+
type PassageCreateParams,
|
|
148
|
+
type PassageListParams,
|
|
149
|
+
type PassageDeleteParams,
|
|
150
|
+
type PassageSearchParams,
|
|
151
|
+
} from './passages';
|
|
141
152
|
export {
|
|
142
153
|
Tools,
|
|
143
154
|
type ToolExecuteRequest,
|
|
@@ -704,9 +704,15 @@ export namespace InternalMessage {
|
|
|
704
704
|
}
|
|
705
705
|
}
|
|
706
706
|
|
|
707
|
+
/**
|
|
708
|
+
* A call to a function tool created by the model.
|
|
709
|
+
*/
|
|
707
710
|
export interface ToolCall {
|
|
708
711
|
id: string;
|
|
709
712
|
|
|
713
|
+
/**
|
|
714
|
+
* The function that the model called.
|
|
715
|
+
*/
|
|
710
716
|
function: ToolCall.Function;
|
|
711
717
|
|
|
712
718
|
type: 'function';
|
|
@@ -715,6 +721,9 @@ export namespace InternalMessage {
|
|
|
715
721
|
}
|
|
716
722
|
|
|
717
723
|
export namespace ToolCall {
|
|
724
|
+
/**
|
|
725
|
+
* The function that the model called.
|
|
726
|
+
*/
|
|
718
727
|
export interface Function {
|
|
719
728
|
arguments: string;
|
|
720
729
|
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import * as PassagesAPI from '../passages';
|
|
5
|
+
import { APIPromise } from '../../core/api-promise';
|
|
6
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
7
|
+
import { path } from '../../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
export class Passages extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Insert a memory into an agent's archival memory store.
|
|
12
|
+
*
|
|
13
|
+
* @deprecated
|
|
14
|
+
*/
|
|
15
|
+
create(
|
|
16
|
+
agentID: string,
|
|
17
|
+
body: PassageCreateParams,
|
|
18
|
+
options?: RequestOptions,
|
|
19
|
+
): APIPromise<PassageCreateResponse> {
|
|
20
|
+
return this._client.post(path`/v1/agents/${agentID}/archival-memory`, { body, ...options });
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Retrieve the memories in an agent's archival memory store (paginated query).
|
|
25
|
+
*
|
|
26
|
+
* @deprecated
|
|
27
|
+
*/
|
|
28
|
+
list(
|
|
29
|
+
agentID: string,
|
|
30
|
+
query: PassageListParams | null | undefined = {},
|
|
31
|
+
options?: RequestOptions,
|
|
32
|
+
): APIPromise<PassageListResponse> {
|
|
33
|
+
return this._client.get(path`/v1/agents/${agentID}/archival-memory`, { query, ...options });
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Delete a memory from an agent's archival memory store.
|
|
38
|
+
*
|
|
39
|
+
* @deprecated
|
|
40
|
+
*/
|
|
41
|
+
delete(memoryID: string, params: PassageDeleteParams, options?: RequestOptions): APIPromise<unknown> {
|
|
42
|
+
const { agent_id } = params;
|
|
43
|
+
return this._client.delete(path`/v1/agents/${agent_id}/archival-memory/${memoryID}`, options);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Search archival memory using semantic (embedding-based) search with optional
|
|
48
|
+
* temporal filtering.
|
|
49
|
+
*
|
|
50
|
+
* This endpoint allows manual triggering of archival memory searches, enabling
|
|
51
|
+
* users to query an agent's archival memory store directly via the API. The search
|
|
52
|
+
* uses the same functionality as the agent's archival_memory_search tool but is
|
|
53
|
+
* accessible for external API usage.
|
|
54
|
+
*
|
|
55
|
+
* @deprecated
|
|
56
|
+
*/
|
|
57
|
+
search(
|
|
58
|
+
agentID: string,
|
|
59
|
+
query: PassageSearchParams,
|
|
60
|
+
options?: RequestOptions,
|
|
61
|
+
): APIPromise<PassageSearchResponse> {
|
|
62
|
+
return this._client.get(path`/v1/agents/${agentID}/archival-memory/search`, { query, ...options });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export type PassageCreateResponse = Array<PassagesAPI.Passage>;
|
|
67
|
+
|
|
68
|
+
export type PassageListResponse = Array<PassagesAPI.Passage>;
|
|
69
|
+
|
|
70
|
+
export type PassageDeleteResponse = unknown;
|
|
71
|
+
|
|
72
|
+
export interface PassageSearchResponse {
|
|
73
|
+
/**
|
|
74
|
+
* Total number of results returned
|
|
75
|
+
*/
|
|
76
|
+
count: number;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* List of search results matching the query
|
|
80
|
+
*/
|
|
81
|
+
results: Array<PassageSearchResponse.Result>;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export namespace PassageSearchResponse {
|
|
85
|
+
export interface Result {
|
|
86
|
+
/**
|
|
87
|
+
* Text content of the archival memory passage
|
|
88
|
+
*/
|
|
89
|
+
content: string;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Timestamp of when the memory was created, formatted in agent's timezone
|
|
93
|
+
*/
|
|
94
|
+
timestamp: string;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* List of tags associated with this memory
|
|
98
|
+
*/
|
|
99
|
+
tags?: Array<string>;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface PassageCreateParams {
|
|
104
|
+
/**
|
|
105
|
+
* Text to write to archival memory.
|
|
106
|
+
*/
|
|
107
|
+
text: string;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Optional timestamp for the memory (defaults to current UTC time).
|
|
111
|
+
*/
|
|
112
|
+
created_at?: string | null;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Optional list of tags to attach to the memory.
|
|
116
|
+
*/
|
|
117
|
+
tags?: Array<string> | null;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface PassageListParams {
|
|
121
|
+
/**
|
|
122
|
+
* Unique ID of the memory to start the query range at.
|
|
123
|
+
*/
|
|
124
|
+
after?: string | null;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Whether to sort passages oldest to newest (True, default) or newest to oldest
|
|
128
|
+
* (False)
|
|
129
|
+
*/
|
|
130
|
+
ascending?: boolean | null;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Unique ID of the memory to end the query range at.
|
|
134
|
+
*/
|
|
135
|
+
before?: string | null;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* How many results to include in the response.
|
|
139
|
+
*/
|
|
140
|
+
limit?: number | null;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Search passages by text
|
|
144
|
+
*/
|
|
145
|
+
search?: string | null;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export interface PassageDeleteParams {
|
|
149
|
+
/**
|
|
150
|
+
* The ID of the agent in the format 'agent-<uuid4>'
|
|
151
|
+
*/
|
|
152
|
+
agent_id: string;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export interface PassageSearchParams {
|
|
156
|
+
/**
|
|
157
|
+
* String to search for using semantic similarity
|
|
158
|
+
*/
|
|
159
|
+
query: string;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Filter results to passages created before this datetime
|
|
163
|
+
*/
|
|
164
|
+
end_datetime?: string | null;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Filter results to passages created after this datetime
|
|
168
|
+
*/
|
|
169
|
+
start_datetime?: string | null;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* How to match tags - 'any' to match passages with any of the tags, 'all' to match
|
|
173
|
+
* only passages with all tags
|
|
174
|
+
*/
|
|
175
|
+
tag_match_mode?: 'any' | 'all';
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Optional list of tags to filter search results
|
|
179
|
+
*/
|
|
180
|
+
tags?: Array<string> | null;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Maximum number of results to return. Uses system default if not specified
|
|
184
|
+
*/
|
|
185
|
+
top_k?: number | null;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export declare namespace Passages {
|
|
189
|
+
export {
|
|
190
|
+
type PassageCreateResponse as PassageCreateResponse,
|
|
191
|
+
type PassageListResponse as PassageListResponse,
|
|
192
|
+
type PassageDeleteResponse as PassageDeleteResponse,
|
|
193
|
+
type PassageSearchResponse as PassageSearchResponse,
|
|
194
|
+
type PassageCreateParams as PassageCreateParams,
|
|
195
|
+
type PassageListParams as PassageListParams,
|
|
196
|
+
type PassageDeleteParams as PassageDeleteParams,
|
|
197
|
+
type PassageSearchParams as PassageSearchParams,
|
|
198
|
+
};
|
|
199
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../core/resource';
|
|
4
|
-
import * as ToolsAPI from './tools';
|
|
5
4
|
import * as AgentsMessagesAPI from './agents/messages';
|
|
6
5
|
import { APIPromise } from '../core/api-promise';
|
|
7
6
|
import { RequestOptions } from '../internal/request-options';
|
|
@@ -88,19 +87,110 @@ export interface MessageSearchResult {
|
|
|
88
87
|
export type MessageListResponse = Array<AgentsMessagesAPI.Message>;
|
|
89
88
|
|
|
90
89
|
export type MessageSearchResponse = Array<
|
|
91
|
-
|
|
|
92
|
-
|
|
|
93
|
-
|
|
|
94
|
-
|
|
|
95
|
-
| AgentsMessagesAPI.ToolCallMessage
|
|
96
|
-
| ToolsAPI.ToolReturnMessage
|
|
97
|
-
| AgentsMessagesAPI.AssistantMessage
|
|
98
|
-
| AgentsMessagesAPI.ApprovalRequestMessage
|
|
99
|
-
| AgentsMessagesAPI.ApprovalResponseMessage
|
|
100
|
-
| AgentsMessagesAPI.SummaryMessage
|
|
101
|
-
| AgentsMessagesAPI.EventMessage
|
|
90
|
+
| MessageSearchResponse.SystemMessageListResult
|
|
91
|
+
| MessageSearchResponse.UserMessageListResult
|
|
92
|
+
| MessageSearchResponse.ReasoningMessageListResult
|
|
93
|
+
| MessageSearchResponse.AssistantMessageListResult
|
|
102
94
|
>;
|
|
103
95
|
|
|
96
|
+
export namespace MessageSearchResponse {
|
|
97
|
+
/**
|
|
98
|
+
* System message list result with agent context.
|
|
99
|
+
*
|
|
100
|
+
* Shape is identical to UpdateSystemMessage but includes the owning agent_id.
|
|
101
|
+
*/
|
|
102
|
+
export interface SystemMessageListResult {
|
|
103
|
+
/**
|
|
104
|
+
* The message content sent by the system (can be a string or an array of
|
|
105
|
+
* multi-modal content parts)
|
|
106
|
+
*/
|
|
107
|
+
content: string;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* The time the message was created in ISO format.
|
|
111
|
+
*/
|
|
112
|
+
created_at: string;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* The unique identifier of the agent that owns the message.
|
|
116
|
+
*/
|
|
117
|
+
agent_id?: string | null;
|
|
118
|
+
|
|
119
|
+
message_type?: 'system_message';
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* User message list result with agent context.
|
|
124
|
+
*
|
|
125
|
+
* Shape is identical to UpdateUserMessage but includes the owning agent_id.
|
|
126
|
+
*/
|
|
127
|
+
export interface UserMessageListResult {
|
|
128
|
+
/**
|
|
129
|
+
* The message content sent by the user (can be a string or an array of multi-modal
|
|
130
|
+
* content parts)
|
|
131
|
+
*/
|
|
132
|
+
content: Array<AgentsMessagesAPI.LettaUserMessageContentUnion> | string;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* The time the message was created in ISO format.
|
|
136
|
+
*/
|
|
137
|
+
created_at: string;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* The unique identifier of the agent that owns the message.
|
|
141
|
+
*/
|
|
142
|
+
agent_id?: string | null;
|
|
143
|
+
|
|
144
|
+
message_type?: 'user_message';
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Reasoning message list result with agent context.
|
|
149
|
+
*
|
|
150
|
+
* Shape is identical to UpdateReasoningMessage but includes the owning agent_id.
|
|
151
|
+
*/
|
|
152
|
+
export interface ReasoningMessageListResult {
|
|
153
|
+
/**
|
|
154
|
+
* The time the message was created in ISO format.
|
|
155
|
+
*/
|
|
156
|
+
created_at: string;
|
|
157
|
+
|
|
158
|
+
reasoning: string;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* The unique identifier of the agent that owns the message.
|
|
162
|
+
*/
|
|
163
|
+
agent_id?: string | null;
|
|
164
|
+
|
|
165
|
+
message_type?: 'reasoning_message';
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Assistant message list result with agent context.
|
|
170
|
+
*
|
|
171
|
+
* Shape is identical to UpdateAssistantMessage but includes the owning agent_id.
|
|
172
|
+
*/
|
|
173
|
+
export interface AssistantMessageListResult {
|
|
174
|
+
/**
|
|
175
|
+
* The message content sent by the assistant (can be a string or an array of
|
|
176
|
+
* content parts)
|
|
177
|
+
*/
|
|
178
|
+
content: Array<AgentsMessagesAPI.LettaAssistantMessageContentUnion> | string;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* The time the message was created in ISO format.
|
|
182
|
+
*/
|
|
183
|
+
created_at: string;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* The unique identifier of the agent that owns the message.
|
|
187
|
+
*/
|
|
188
|
+
agent_id?: string | null;
|
|
189
|
+
|
|
190
|
+
message_type?: 'assistant_message';
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
104
194
|
export interface MessageListParams {
|
|
105
195
|
/**
|
|
106
196
|
* Message ID cursor for pagination. Returns messages that come after this message
|
|
@@ -325,7 +325,7 @@ export interface LlmConfig {
|
|
|
325
325
|
/**
|
|
326
326
|
* The reasoning effort to use when generating text reasoning models
|
|
327
327
|
*/
|
|
328
|
-
reasoning_effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | null;
|
|
328
|
+
reasoning_effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | null;
|
|
329
329
|
|
|
330
330
|
/**
|
|
331
331
|
* The response format for the model's output. Supports text, json_object, and
|
|
@@ -490,7 +490,7 @@ export interface Model {
|
|
|
490
490
|
* @deprecated Deprecated: The reasoning effort to use when generating text
|
|
491
491
|
* reasoning models.
|
|
492
492
|
*/
|
|
493
|
-
reasoning_effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | null;
|
|
493
|
+
reasoning_effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | null;
|
|
494
494
|
|
|
495
495
|
/**
|
|
496
496
|
* The response format for the model's output. Supports text, json_object, and
|
|
@@ -140,10 +140,12 @@ export type StopReasonType =
|
|
|
140
140
|
| 'invalid_llm_response'
|
|
141
141
|
| 'invalid_tool_call'
|
|
142
142
|
| 'max_steps'
|
|
143
|
+
| 'max_tokens_exceeded'
|
|
143
144
|
| 'no_tool_call'
|
|
144
145
|
| 'tool_rule'
|
|
145
146
|
| 'cancelled'
|
|
146
|
-
| 'requires_approval'
|
|
147
|
+
| 'requires_approval'
|
|
148
|
+
| 'context_window_overflow_in_system_prompt';
|
|
147
149
|
|
|
148
150
|
export interface RunListParams extends ArrayPageParams {
|
|
149
151
|
/**
|