Skip to content

Commit a6656fe

Browse files
feat: add passage deletion route to sdk
1 parent f644e48 commit a6656fe

File tree

12 files changed

+268
-174
lines changed

12 files changed

+268
-174
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 114
1+
configured_endpoints: 115
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/letta-ai%2Fletta-sdk-26312e06e05b7fa971782db5f8edbbbe2d3c13e0073fe9481b966d8edd6fedc7.yml
33
openapi_spec_hash: 41d6c5e06810ee240202f8e4dd1142cf
4-
config_hash: a81f1a6c73e9aadbac66af8534ce8edc
4+
config_hash: d290a6d98369e3135a785ad352fb2996

api.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -230,16 +230,22 @@ Methods:
230230

231231
Types:
232232

233-
- <code><a href="./src/resources/archives.ts">Archive</a></code>
234-
- <code><a href="./src/resources/archives.ts">VectorDBProvider</a></code>
233+
- <code><a href="./src/resources/archives/archives.ts">Archive</a></code>
234+
- <code><a href="./src/resources/archives/archives.ts">VectorDBProvider</a></code>
235235

236236
Methods:
237237

238-
- <code title="post /v1/archives/">client.archives.<a href="./src/resources/archives.ts">create</a>({ ...params }) -> Archive</code>
239-
- <code title="get /v1/archives/{archive_id}">client.archives.<a href="./src/resources/archives.ts">retrieve</a>(archiveID) -> Archive</code>
240-
- <code title="get /v1/archives/">client.archives.<a href="./src/resources/archives.ts">list</a>({ ...params }) -> ArchivesArrayPage</code>
241-
- <code title="delete /v1/archives/{archive_id}">client.archives.<a href="./src/resources/archives.ts">delete</a>(archiveID) -> Archive</code>
242-
- <code title="patch /v1/archives/{archive_id}">client.archives.<a href="./src/resources/archives.ts">modify</a>(archiveID, { ...params }) -> Archive</code>
238+
- <code title="post /v1/archives/">client.archives.<a href="./src/resources/archives/archives.ts">create</a>({ ...params }) -> Archive</code>
239+
- <code title="get /v1/archives/{archive_id}">client.archives.<a href="./src/resources/archives/archives.ts">retrieve</a>(archiveID) -> Archive</code>
240+
- <code title="get /v1/archives/">client.archives.<a href="./src/resources/archives/archives.ts">list</a>({ ...params }) -> ArchivesArrayPage</code>
241+
- <code title="delete /v1/archives/{archive_id}">client.archives.<a href="./src/resources/archives/archives.ts">delete</a>(archiveID) -> Archive</code>
242+
- <code title="patch /v1/archives/{archive_id}">client.archives.<a href="./src/resources/archives/archives.ts">modify</a>(archiveID, { ...params }) -> Archive</code>
243+
244+
## Passages
245+
246+
Methods:
247+
248+
- <code title="delete /v1/archives/{archive_id}/passages/{passage_id}">client.archives.passages.<a href="./src/resources/archives/passages.ts">delete</a>(passageID, { ...params }) -> void</code>
243249

244250
# Folders
245251

src/client.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,6 @@ import * as API from './resources/index';
2929
import * as TopLevelAPI from './resources/top-level';
3030
import { HealthResponse } from './resources/top-level';
3131
import { APIPromise } from './core/api-promise';
32-
import {
33-
Archive,
34-
ArchiveCreateParams,
35-
ArchiveListParams,
36-
ArchiveModifyParams,
37-
Archives,
38-
ArchivesArrayPage,
39-
VectorDBProvider,
40-
} from './resources/archives';
4132
import { TagListParams, TagListResponse, Tags } from './resources/tags';
4233
import {
4334
NpmRequirement,
@@ -85,6 +76,15 @@ import {
8576
TerminalToolRule,
8677
TextResponseFormat,
8778
} from './resources/agents/agents';
79+
import {
80+
Archive,
81+
ArchiveCreateParams,
82+
ArchiveListParams,
83+
ArchiveModifyParams,
84+
Archives,
85+
ArchivesArrayPage,
86+
VectorDBProvider,
87+
} from './resources/archives/archives';
8888
import {
8989
BatchCancelResponse,
9090
BatchCreateParams,

src/resources/agents/agents.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
import { APIResource } from '../../core/resource';
44
import * as AgentsAPI from './agents';
5-
import * as ArchivesAPI from '../archives';
65
import * as ToolsAPI from '../tools';
7-
import * as AgentsArchivesAPI from './archives';
6+
import * as ArchivesAPI from './archives';
87
import {
98
ArchiveAttachParams,
109
ArchiveAttachResponse,
@@ -110,6 +109,7 @@ import {
110109
} from './messages';
111110
import * as AgentsToolsAPI from './tools';
112111
import { ToolAttachParams, ToolDetachParams, ToolListParams, ToolUpdateApprovalParams, Tools } from './tools';
112+
import * as ArchivesArchivesAPI from '../archives/archives';
113113
import * as BlocksBlocksAPI from '../blocks/blocks';
114114
import * as GroupsGroupsAPI from '../groups/groups';
115115
import * as IdentitiesIdentitiesAPI from '../identities/identities';
@@ -130,7 +130,7 @@ export class Agents extends APIResource {
130130
folders: FoldersAPI.Folders = new FoldersAPI.Folders(this._client);
131131
files: FilesAPI.Files = new FilesAPI.Files(this._client);
132132
groups: GroupsAPI.Groups = new GroupsAPI.Groups(this._client);
133-
archives: AgentsArchivesAPI.Archives = new AgentsArchivesAPI.Archives(this._client);
133+
archives: ArchivesAPI.Archives = new ArchivesAPI.Archives(this._client);
134134
identities: IdentitiesAPI.Identities = new IdentitiesAPI.Identities(this._client);
135135

136136
/**
@@ -720,7 +720,7 @@ export namespace AgentState {
720720
/**
721721
* The vector database provider used for this source's passages
722722
*/
723-
vector_db_provider?: ArchivesAPI.VectorDBProvider;
723+
vector_db_provider?: ArchivesArchivesAPI.VectorDBProvider;
724724
}
725725

726726
export interface OpenAIModelSettings {

src/resources/agents/folders.ts

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

33
import { APIResource } from '../../core/resource';
4-
import * as ArchivesAPI from '../archives';
54
import * as AgentsAPI from './agents';
5+
import * as ArchivesAPI from '../archives/archives';
66
import * as ModelsAPI from '../models/models';
77
import { APIPromise } from '../../core/api-promise';
88
import { ArrayPage, type ArrayPageParams, PagePromise } from '../../core/pagination';

src/resources/archives.ts

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

3-
import { APIResource } from '../core/resource';
4-
import * as ModelsAPI from './models/models';
5-
import { APIPromise } from '../core/api-promise';
6-
import { ArrayPage, type ArrayPageParams, PagePromise } from '../core/pagination';
7-
import { RequestOptions } from '../internal/request-options';
8-
import { path } from '../internal/utils/path';
9-
10-
export class Archives extends APIResource {
11-
/**
12-
* Create a new archive.
13-
*/
14-
create(body: ArchiveCreateParams, options?: RequestOptions): APIPromise<Archive> {
15-
return this._client.post('/v1/archives/', { body, ...options });
16-
}
17-
18-
/**
19-
* Get a single archive by its ID.
20-
*/
21-
retrieve(archiveID: string, options?: RequestOptions): APIPromise<Archive> {
22-
return this._client.get(path`/v1/archives/${archiveID}`, options);
23-
}
24-
25-
/**
26-
* Get a list of all archives for the current organization with optional filters
27-
* and pagination.
28-
*/
29-
list(
30-
query: ArchiveListParams | null | undefined = {},
31-
options?: RequestOptions,
32-
): PagePromise<ArchivesArrayPage, Archive> {
33-
return this._client.getAPIList('/v1/archives/', ArrayPage<Archive>, { query, ...options });
34-
}
35-
36-
/**
37-
* Delete an archive by its ID.
38-
*/
39-
delete(archiveID: string, options?: RequestOptions): APIPromise<Archive> {
40-
return this._client.delete(path`/v1/archives/${archiveID}`, options);
41-
}
42-
43-
/**
44-
* Update an existing archive's name and/or description.
45-
*/
46-
modify(archiveID: string, body: ArchiveModifyParams, options?: RequestOptions): APIPromise<Archive> {
47-
return this._client.patch(path`/v1/archives/${archiveID}`, { body, ...options });
48-
}
49-
}
50-
51-
export type ArchivesArrayPage = ArrayPage<Archive>;
52-
53-
/**
54-
* Representation of an archive - a collection of archival passages that can be
55-
* shared between agents.
56-
*/
57-
export interface Archive {
58-
/**
59-
* The human-friendly ID of the Archive
60-
*/
61-
id: string;
62-
63-
/**
64-
* The creation date of the archive
65-
*/
66-
created_at: string;
67-
68-
/**
69-
* Embedding configuration for passages in this archive
70-
*/
71-
embedding_config: ModelsAPI.EmbeddingConfig;
72-
73-
/**
74-
* The name of the archive
75-
*/
76-
name: string;
77-
78-
/**
79-
* The id of the user that made this object.
80-
*/
81-
created_by_id?: string | null;
82-
83-
/**
84-
* A description of the archive
85-
*/
86-
description?: string | null;
87-
88-
/**
89-
* The id of the user that made this object.
90-
*/
91-
last_updated_by_id?: string | null;
92-
93-
/**
94-
* Additional metadata
95-
*/
96-
metadata?: { [key: string]: unknown } | null;
97-
98-
/**
99-
* The timestamp when the object was last updated.
100-
*/
101-
updated_at?: string | null;
102-
103-
/**
104-
* The vector database provider used for this archive's passages
105-
*/
106-
vector_db_provider?: VectorDBProvider;
107-
}
108-
109-
/**
110-
* Supported vector database providers for archival memory
111-
*/
112-
export type VectorDBProvider = 'native' | 'tpuf' | 'pinecone';
113-
114-
export interface ArchiveCreateParams {
115-
/**
116-
* Embedding configuration for the archive
117-
*/
118-
embedding_config: ModelsAPI.EmbeddingConfig;
119-
120-
name: string;
121-
122-
description?: string | null;
123-
}
124-
125-
export interface ArchiveListParams extends ArrayPageParams {
126-
/**
127-
* Only archives attached to this agent ID
128-
*/
129-
agent_id?: string | null;
130-
131-
/**
132-
* Filter by archive name (exact match)
133-
*/
134-
name?: string | null;
135-
}
136-
137-
export interface ArchiveModifyParams {
138-
description?: string | null;
139-
140-
name?: string | null;
141-
}
142-
143-
export declare namespace Archives {
144-
export {
145-
type Archive as Archive,
146-
type VectorDBProvider as VectorDBProvider,
147-
type ArchivesArrayPage as ArchivesArrayPage,
148-
type ArchiveCreateParams as ArchiveCreateParams,
149-
type ArchiveListParams as ArchiveListParams,
150-
type ArchiveModifyParams as ArchiveModifyParams,
151-
};
152-
}
3+
export * from './archives/index';

0 commit comments

Comments
 (0)