Skip to content

Commit b740b53

Browse files
authored
Merge pull request #12 from Alchemyst-ai/release-please--branches--main--changes--next--components--sdk
release: 0.8.1
2 parents 8202720 + b0741cb commit b740b53

14 files changed

Lines changed: 478 additions & 99 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 11
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/alchemyst-ai%2Falchemyst-ai-sdk-3bbf1da3b59343b13d09dd6b1a60599b44e6ed6e30d058964791d0b7ef3505c6.yml
3-
openapi_spec_hash: be5b9d746896b451310b285ceb5702b3
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/alchemyst-ai%2Falchemyst-ai-sdk-17acc86e90b7e5144765b920da4f19b65dd5d97a8bcd0b104e029a103ebbd76e.yml
3+
openapi_spec_hash: 49f1b913c3cb7b279766e8dfa78b6237
44
config_hash: 5aa39dd4797ce0dacbe19c69fcf11be6

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## 0.8.1 (2026-01-06)
4+
5+
Full Changelog: [v0.8.1...v0.8.1](https://github.com/Alchemyst-ai/alchemyst-sdk/compare/v0.8.1...v0.8.1)
6+
7+
### Features
8+
9+
* **api:** api update ([05fe05c](https://github.com/Alchemyst-ai/alchemyst-sdk/commit/05fe05ca7bf90118f5cac577cc213c9c28e895d8))
10+
* **api:** api update ([ca932f0](https://github.com/Alchemyst-ai/alchemyst-sdk/commit/ca932f0573bb8f1ce84e1aaff54716d86287ff95))
11+
* **api:** api update ([8571599](https://github.com/Alchemyst-ai/alchemyst-sdk/commit/8571599c107df1c60f7ea2ea38c14d344f26a2fd))
12+
* **api:** manual updates ([edef4d3](https://github.com/Alchemyst-ai/alchemyst-sdk/commit/edef4d3a73fa45e717d918adb1ec8c47a0c44ee4))
13+
* **api:** manual updates ([275c1fb](https://github.com/Alchemyst-ai/alchemyst-sdk/commit/275c1fbac8ff536aa34744f77c3340c50abd7ccd))
14+
315
## 0.8.1 (2025-12-21)
416

517
Full Changelog: [v0.8.0...v0.8.1](https://github.com/Alchemyst-ai/alchemyst-sdk/compare/v0.8.0...v0.8.1)

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2025 Alchemyst AI
189+
Copyright 2026 Alchemyst AI
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,17 @@ const client = new AlchemystAI({
2929
const response = await client.v1.context.add({
3030
context_type: 'resource',
3131
documents: [{ content: 'The content of the document' }],
32+
scope: 'internal',
33+
source: 'platform.api.context.add',
3234
metadata: {
3335
fileName: 'notes.txt',
3436
fileType: 'text/plain',
3537
lastModified: '2025-10-01T18:42:40.419Z',
3638
fileSize: 1024,
3739
},
38-
scope: 'internal',
39-
source: 'platform.api.context.add',
4040
});
41+
42+
console.log(response.context_id);
4143
```
4244

4345
### Request & Response types
@@ -55,16 +57,16 @@ const client = new AlchemystAI({
5557
const params: AlchemystAI.V1.ContextAddParams = {
5658
context_type: 'resource',
5759
documents: [{ content: 'The content of the document' }],
60+
scope: 'internal',
61+
source: 'platform.api.context.add',
5862
metadata: {
5963
fileName: 'notes.txt',
6064
fileType: 'text/plain',
6165
lastModified: '2025-10-01T18:42:40.419Z',
6266
fileSize: 1024,
6367
},
64-
scope: 'internal',
65-
source: 'platform.api.context.add',
6668
};
67-
const response: unknown = await client.v1.context.add(params);
69+
const response: AlchemystAI.V1.ContextAddResponse = await client.v1.context.add(params);
6870
```
6971

7072
Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
@@ -81,14 +83,14 @@ const response = await client.v1.context
8183
.add({
8284
context_type: 'resource',
8385
documents: [{ content: 'The content of the document' }],
86+
scope: 'internal',
87+
source: 'platform.api.context.add',
8488
metadata: {
8589
fileName: 'notes.txt',
8690
fileType: 'text/plain',
8791
lastModified: '2025-10-01T18:42:40.419Z',
8892
fileSize: 1024,
8993
},
90-
scope: 'internal',
91-
source: 'platform.api.context.add',
9294
})
9395
.catch(async (err) => {
9496
if (err instanceof AlchemystAI.APIError) {
@@ -130,7 +132,7 @@ const client = new AlchemystAI({
130132
});
131133

132134
// Or, configure per-request:
133-
await client.v1.context.add({ context_type: 'resource', documents: [{ content: 'The content of the document' }], metadata: { fileName: 'notes.txt', fileType: 'text/plain', lastModified: '2025-10-01T18:42:40.419Z', fileSize: 1024 }, scope: 'internal', source: 'platform.api.context.add' }, {
135+
await client.v1.context.add({ context_type: 'resource', documents: [{ content: 'The content of the document' }], scope: 'internal', source: 'platform.api.context.add', metadata: { fileName: 'notes.txt', fileType: 'text/plain', lastModified: '2025-10-01T18:42:40.419Z', fileSize: 1024 } }, {
134136
maxRetries: 5,
135137
});
136138
```
@@ -147,7 +149,7 @@ const client = new AlchemystAI({
147149
});
148150

149151
// Override per-request:
150-
await client.v1.context.add({ context_type: 'resource', documents: [{ content: 'The content of the document' }], metadata: { fileName: 'notes.txt', fileType: 'text/plain', lastModified: '2025-10-01T18:42:40.419Z', fileSize: 1024 }, scope: 'internal', source: 'platform.api.context.add' }, {
152+
await client.v1.context.add({ context_type: 'resource', documents: [{ content: 'The content of the document' }], scope: 'internal', source: 'platform.api.context.add', metadata: { fileName: 'notes.txt', fileType: 'text/plain', lastModified: '2025-10-01T18:42:40.419Z', fileSize: 1024 } }, {
151153
timeout: 5 * 1000,
152154
});
153155
```
@@ -174,14 +176,14 @@ const response = await client.v1.context
174176
.add({
175177
context_type: 'resource',
176178
documents: [{ content: 'The content of the document' }],
179+
scope: 'internal',
180+
source: 'platform.api.context.add',
177181
metadata: {
178182
fileName: 'notes.txt',
179183
fileType: 'text/plain',
180184
lastModified: '2025-10-01T18:42:40.419Z',
181185
fileSize: 1024,
182186
},
183-
scope: 'internal',
184-
source: 'platform.api.context.add',
185187
})
186188
.asResponse();
187189
console.log(response.headers.get('X-My-Header'));
@@ -191,18 +193,18 @@ const { data: response, response: raw } = await client.v1.context
191193
.add({
192194
context_type: 'resource',
193195
documents: [{ content: 'The content of the document' }],
196+
scope: 'internal',
197+
source: 'platform.api.context.add',
194198
metadata: {
195199
fileName: 'notes.txt',
196200
fileType: 'text/plain',
197201
lastModified: '2025-10-01T18:42:40.419Z',
198202
fileSize: 1024,
199203
},
200-
scope: 'internal',
201-
source: 'platform.api.context.add',
202204
})
203205
.withResponse();
204206
console.log(raw.headers.get('X-My-Header'));
205-
console.log(response);
207+
console.log(response.context_id);
206208
```
207209

208210
### Logging

api.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Types:
1111
Methods:
1212

1313
- <code title="post /api/v1/context/delete">client.v1.context.<a href="./src/resources/v1/context/context.ts">delete</a>({ ...params }) -> unknown</code>
14-
- <code title="post /api/v1/context/add">client.v1.context.<a href="./src/resources/v1/context/context.ts">add</a>({ ...params }) -> unknown</code>
14+
- <code title="post /api/v1/context/add">client.v1.context.<a href="./src/resources/v1/context/context.ts">add</a>({ ...params }) -> ContextAddResponse</code>
1515
- <code title="post /api/v1/context/search">client.v1.context.<a href="./src/resources/v1/context/context.ts">search</a>({ ...params }) -> ContextSearchResponse</code>
1616

1717
### Traces
@@ -23,7 +23,7 @@ Types:
2323

2424
Methods:
2525

26-
- <code title="get /api/v1/context/traces">client.v1.context.traces.<a href="./src/resources/v1/context/traces.ts">list</a>() -> TraceListResponse</code>
26+
- <code title="get /api/v1/context/traces">client.v1.context.traces.<a href="./src/resources/v1/context/traces.ts">list</a>({ ...params }) -> TraceListResponse</code>
2727
- <code title="delete /api/v1/context/traces/{traceId}/delete">client.v1.context.traces.<a href="./src/resources/v1/context/traces.ts">delete</a>(traceID) -> TraceDeleteResponse</code>
2828

2929
### View
@@ -36,15 +36,20 @@ Types:
3636
Methods:
3737

3838
- <code title="get /api/v1/context/view">client.v1.context.view.<a href="./src/resources/v1/context/view.ts">retrieve</a>({ ...params }) -> ViewRetrieveResponse</code>
39-
- <code title="get /api/v1/context/view/docs">client.v1.context.view.<a href="./src/resources/v1/context/view.ts">docs</a>() -> unknown</code>
39+
- <code title="get /api/v1/context/view/docs">client.v1.context.view.<a href="./src/resources/v1/context/view.ts">docs</a>({ ...params }) -> ViewDocsResponse</code>
4040

4141
### Memory
4242

43+
Types:
44+
45+
- <code><a href="./src/resources/v1/context/memory.ts">MemoryUpdateResponse</a></code>
46+
- <code><a href="./src/resources/v1/context/memory.ts">MemoryAddResponse</a></code>
47+
4348
Methods:
4449

45-
- <code title="post /api/v1/context/memory/update">client.v1.context.memory.<a href="./src/resources/v1/context/memory.ts">update</a>({ ...params }) -> void</code>
50+
- <code title="post /api/v1/context/memory/update">client.v1.context.memory.<a href="./src/resources/v1/context/memory.ts">update</a>({ ...params }) -> MemoryUpdateResponse</code>
4651
- <code title="post /api/v1/context/memory/delete">client.v1.context.memory.<a href="./src/resources/v1/context/memory.ts">delete</a>({ ...params }) -> void</code>
47-
- <code title="post /api/v1/context/memory/add">client.v1.context.memory.<a href="./src/resources/v1/context/memory.ts">add</a>({ ...params }) -> void</code>
52+
- <code title="post /api/v1/context/memory/add">client.v1.context.memory.<a href="./src/resources/v1/context/memory.ts">add</a>({ ...params }) -> MemoryAddResponse</code>
4853

4954
## Org
5055

src/resources/v1/context/context.ts

Lines changed: 44 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,18 @@
22

33
import { APIResource } from '../../../core/resource';
44
import * as MemoryAPI from './memory';
5-
import { Memory, MemoryAddParams, MemoryDeleteParams, MemoryUpdateParams } from './memory';
5+
import {
6+
Memory,
7+
MemoryAddParams,
8+
MemoryAddResponse,
9+
MemoryDeleteParams,
10+
MemoryUpdateParams,
11+
MemoryUpdateResponse,
12+
} from './memory';
613
import * as TracesAPI from './traces';
7-
import { TraceDeleteResponse, TraceListResponse, Traces } from './traces';
14+
import { TraceDeleteResponse, TraceListParams, TraceListResponse, Traces } from './traces';
815
import * as ViewAPI from './view';
9-
import { View, ViewDocsResponse, ViewRetrieveParams, ViewRetrieveResponse } from './view';
16+
import { View, ViewDocsParams, ViewDocsResponse, ViewRetrieveParams, ViewRetrieveResponse } from './view';
1017
import { APIPromise } from '../../../core/api-promise';
1118
import { RequestOptions } from '../../../internal/request-options';
1219

@@ -16,13 +23,15 @@ export class Context extends APIResource {
1623
memory: MemoryAPI.Memory = new MemoryAPI.Memory(this._client);
1724

1825
/**
19-
* Deletes context data based on provided parameters
26+
* This endpoint deletes context data based on the provided parameters. It returns
27+
* a success or error response depending on the result from the context processor.
2028
*
2129
* @example
2230
* ```ts
2331
* const context = await client.v1.context.delete({
24-
* by_doc: true,
32+
* organization_id: 'org_01HXYZABC',
2533
* source: 'support-inbox',
34+
* by_doc: true,
2635
* });
2736
* ```
2837
*/
@@ -47,19 +56,19 @@ export class Context extends APIResource {
4756
* ticketId: 'TCK-1234',
4857
* },
4958
* ],
59+
* scope: 'internal',
60+
* source: 'support-inbox',
5061
* metadata: {
5162
* fileName: 'support_thread_TCK-1234.txt',
5263
* fileType: 'text/plain',
5364
* groupName: ['support', 'pricing'],
5465
* lastModified: '2025-01-10T12:34:56.000Z',
5566
* fileSize: 2048,
5667
* },
57-
* scope: 'internal',
58-
* source: 'support-inbox',
5968
* });
6069
* ```
6170
*/
62-
add(body: ContextAddParams, options?: RequestOptions): APIPromise<unknown> {
71+
add(body: ContextAddParams, options?: RequestOptions): APIPromise<ContextAddResponse> {
6372
return this._client.post('/api/v1/context/add', { body, ...options });
6473
}
6574

@@ -86,7 +95,13 @@ export class Context extends APIResource {
8695

8796
export type ContextDeleteResponse = unknown;
8897

89-
export type ContextAddResponse = unknown;
98+
export interface ContextAddResponse {
99+
context_id: string;
100+
101+
success: boolean;
102+
103+
processed_documents?: number;
104+
}
90105

91106
export interface ContextSearchResponse {
92107
contexts?: Array<ContextSearchResponse.Context>;
@@ -111,24 +126,24 @@ export namespace ContextSearchResponse {
111126

112127
export interface ContextDeleteParams {
113128
/**
114-
* Flag to delete by document
129+
* Organization ID
115130
*/
116-
by_doc?: boolean | null;
131+
organization_id: string;
117132

118133
/**
119-
* Flag to delete by ID
134+
* Source identifier for the context
120135
*/
121-
by_id?: boolean | null;
136+
source: string;
122137

123138
/**
124-
* Optional organization ID
139+
* Flag to delete by document
125140
*/
126-
organization_id?: string | null;
141+
by_doc?: boolean | null;
127142

128143
/**
129-
* Source identifier for the context
144+
* Flag to delete by ID
130145
*/
131-
source?: string;
146+
by_id?: boolean | null;
132147

133148
/**
134149
* @deprecated Optional user ID
@@ -140,27 +155,27 @@ export interface ContextAddParams {
140155
/**
141156
* Type of context being added
142157
*/
143-
context_type?: 'resource' | 'conversation' | 'instruction';
158+
context_type: 'resource' | 'conversation' | 'instruction';
144159

145160
/**
146161
* Array of documents with content and additional metadata
147162
*/
148-
documents?: Array<ContextAddParams.Document>;
163+
documents: Array<ContextAddParams.Document>;
149164

150165
/**
151-
* Additional metadata for the context
166+
* Scope of the context
152167
*/
153-
metadata?: ContextAddParams.Metadata;
168+
scope: 'internal' | 'external';
154169

155170
/**
156-
* Scope of the context
171+
* The source of the context data
157172
*/
158-
scope?: 'internal' | 'external';
173+
source: string;
159174

160175
/**
161-
* The source of the context data
176+
* Additional metadata for the context
162177
*/
163-
source?: string;
178+
metadata?: ContextAddParams.Metadata;
164179
}
165180

166181
export namespace ContextAddParams {
@@ -273,17 +288,21 @@ export declare namespace Context {
273288
Traces as Traces,
274289
type TraceListResponse as TraceListResponse,
275290
type TraceDeleteResponse as TraceDeleteResponse,
291+
type TraceListParams as TraceListParams,
276292
};
277293

278294
export {
279295
View as View,
280296
type ViewRetrieveResponse as ViewRetrieveResponse,
281297
type ViewDocsResponse as ViewDocsResponse,
282298
type ViewRetrieveParams as ViewRetrieveParams,
299+
type ViewDocsParams as ViewDocsParams,
283300
};
284301

285302
export {
286303
Memory as Memory,
304+
type MemoryUpdateResponse as MemoryUpdateResponse,
305+
type MemoryAddResponse as MemoryAddResponse,
287306
type MemoryUpdateParams as MemoryUpdateParams,
288307
type MemoryDeleteParams as MemoryDeleteParams,
289308
type MemoryAddParams as MemoryAddParams,

src/resources/v1/context/index.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,19 @@ export {
99
type ContextAddParams,
1010
type ContextSearchParams,
1111
} from './context';
12-
export { Memory, type MemoryUpdateParams, type MemoryDeleteParams, type MemoryAddParams } from './memory';
13-
export { Traces, type TraceListResponse, type TraceDeleteResponse } from './traces';
14-
export { View, type ViewRetrieveResponse, type ViewDocsResponse, type ViewRetrieveParams } from './view';
12+
export {
13+
Memory,
14+
type MemoryUpdateResponse,
15+
type MemoryAddResponse,
16+
type MemoryUpdateParams,
17+
type MemoryDeleteParams,
18+
type MemoryAddParams,
19+
} from './memory';
20+
export { Traces, type TraceListResponse, type TraceDeleteResponse, type TraceListParams } from './traces';
21+
export {
22+
View,
23+
type ViewRetrieveResponse,
24+
type ViewDocsResponse,
25+
type ViewRetrieveParams,
26+
type ViewDocsParams,
27+
} from './view';

0 commit comments

Comments
 (0)