@redis-iris/agent-memory 0.1.0 → 0.2.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/README.md +10 -20
- package/dist/commonjs/funcs/get-session-memory.d.ts +1 -1
- package/dist/commonjs/funcs/get-session-memory.d.ts.map +1 -1
- package/dist/commonjs/funcs/get-session-memory.js +8 -3
- package/dist/commonjs/funcs/get-session-memory.js.map +1 -1
- package/dist/commonjs/funcs/list-sessions.d.ts +1 -1
- package/dist/commonjs/funcs/list-sessions.d.ts.map +1 -1
- package/dist/commonjs/funcs/list-sessions.js +7 -3
- package/dist/commonjs/funcs/list-sessions.js.map +1 -1
- package/dist/commonjs/funcs/store-health.d.ts +16 -0
- package/dist/commonjs/funcs/store-health.d.ts.map +1 -0
- package/dist/commonjs/funcs/store-health.js +114 -0
- package/dist/commonjs/funcs/store-health.js.map +1 -0
- package/dist/commonjs/funcs/update-long-term-memory-fields.d.ts +15 -0
- package/dist/commonjs/funcs/update-long-term-memory-fields.d.ts.map +1 -0
- package/dist/commonjs/funcs/update-long-term-memory-fields.js +132 -0
- package/dist/commonjs/funcs/update-long-term-memory-fields.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/http.d.ts +1 -1
- package/dist/commonjs/lib/http.d.ts.map +1 -1
- package/dist/commonjs/lib/http.js +1 -1
- package/dist/commonjs/lib/http.js.map +1 -1
- package/dist/commonjs/lib/security.d.ts +5 -4
- package/dist/commonjs/lib/security.d.ts.map +1 -1
- package/dist/commonjs/lib/security.js +6 -7
- package/dist/commonjs/lib/security.js.map +1 -1
- package/dist/commonjs/models/add-session-event-request-content.d.ts +9 -0
- package/dist/commonjs/models/add-session-event-request-content.d.ts.map +1 -1
- package/dist/commonjs/models/add-session-event-request-content.js +1 -0
- package/dist/commonjs/models/add-session-event-request-content.js.map +1 -1
- package/dist/commonjs/models/attribute-filter-clause.d.ts +63 -0
- package/dist/commonjs/models/attribute-filter-clause.d.ts.map +1 -0
- package/dist/commonjs/models/attribute-filter-clause.js +85 -0
- package/dist/commonjs/models/attribute-filter-clause.js.map +1 -0
- package/dist/commonjs/models/create-memory-record.d.ts +14 -6
- package/dist/commonjs/models/create-memory-record.d.ts.map +1 -1
- package/dist/commonjs/models/create-memory-record.js +3 -3
- package/dist/commonjs/models/create-memory-record.js.map +1 -1
- package/dist/commonjs/models/get-long-term-memory-response-content.d.ts +9 -4
- package/dist/commonjs/models/get-long-term-memory-response-content.d.ts.map +1 -1
- package/dist/commonjs/models/get-long-term-memory-response-content.js +2 -2
- package/dist/commonjs/models/get-long-term-memory-response-content.js.map +1 -1
- package/dist/commonjs/models/get-session-memory-response-content.d.ts +14 -1
- package/dist/commonjs/models/get-session-memory-response-content.d.ts.map +1 -1
- package/dist/commonjs/models/get-session-memory-response-content.js +3 -0
- package/dist/commonjs/models/get-session-memory-response-content.js.map +1 -1
- package/dist/commonjs/models/index.d.ts +6 -1
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +6 -1
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/long-term-memory-filter.d.ts +21 -5
- package/dist/commonjs/models/long-term-memory-filter.d.ts.map +1 -1
- package/dist/commonjs/models/long-term-memory-filter.js +2 -0
- package/dist/commonjs/models/long-term-memory-filter.js.map +1 -1
- package/dist/commonjs/models/memory-record.d.ts +9 -4
- package/dist/commonjs/models/memory-record.d.ts.map +1 -1
- package/dist/commonjs/models/memory-record.js +2 -2
- package/dist/commonjs/models/memory-record.js.map +1 -1
- package/dist/commonjs/models/memory-type-filter.d.ts +1 -1
- package/dist/commonjs/models/namespace-filter.d.ts +7 -1
- package/dist/commonjs/models/namespace-filter.d.ts.map +1 -1
- package/dist/commonjs/models/namespace-filter.js.map +1 -1
- package/dist/commonjs/models/operations/get-session-memory.d.ts +5 -0
- package/dist/commonjs/models/operations/get-session-memory.d.ts.map +1 -1
- package/dist/commonjs/models/operations/get-session-memory.js +1 -0
- package/dist/commonjs/models/operations/get-session-memory.js.map +1 -1
- package/dist/commonjs/models/operations/index.d.ts +2 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +2 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/list-sessions.d.ts +10 -0
- package/dist/commonjs/models/operations/list-sessions.d.ts.map +1 -1
- package/dist/commonjs/models/operations/list-sessions.js +2 -0
- package/dist/commonjs/models/operations/list-sessions.js.map +1 -1
- package/dist/commonjs/models/operations/store-health.d.ts +11 -0
- package/dist/commonjs/models/operations/store-health.d.ts.map +1 -0
- package/dist/commonjs/models/operations/store-health.js +48 -0
- package/dist/commonjs/models/operations/store-health.js.map +1 -0
- package/dist/commonjs/models/operations/update-long-term-memory-fields.d.ts +21 -0
- package/dist/commonjs/models/operations/update-long-term-memory-fields.d.ts.map +1 -0
- package/dist/commonjs/models/operations/update-long-term-memory-fields.js +52 -0
- package/dist/commonjs/models/operations/update-long-term-memory-fields.js.map +1 -0
- package/dist/commonjs/models/owner-id-filter.d.ts +1 -1
- package/dist/commonjs/models/session-id-filter.d.ts +1 -1
- package/dist/commonjs/models/session-summary.d.ts +40 -0
- package/dist/commonjs/models/session-summary.d.ts.map +1 -0
- package/dist/commonjs/models/session-summary.js +56 -0
- package/dist/commonjs/models/session-summary.js.map +1 -0
- package/dist/commonjs/models/store-health-feature.d.ts +17 -0
- package/dist/commonjs/models/store-health-feature.d.ts.map +1 -0
- package/dist/commonjs/models/store-health-feature.js +52 -0
- package/dist/commonjs/models/store-health-feature.js.map +1 -0
- package/dist/commonjs/models/store-health-response-content.d.ts +21 -0
- package/dist/commonjs/models/store-health-response-content.d.ts.map +1 -0
- package/dist/commonjs/models/store-health-response-content.js +54 -0
- package/dist/commonjs/models/store-health-response-content.js.map +1 -0
- package/dist/commonjs/models/store-health-status.d.ts +17 -0
- package/dist/commonjs/models/store-health-status.d.ts.map +1 -0
- package/dist/commonjs/models/{memory-type.js → store-health-status.js} +9 -11
- package/dist/commonjs/models/store-health-status.js.map +1 -0
- package/dist/commonjs/models/topics-filter.d.ts +1 -1
- package/dist/commonjs/models/update-long-term-memory-fields-request-content.d.ts +41 -0
- package/dist/commonjs/models/update-long-term-memory-fields-request-content.d.ts.map +1 -0
- package/dist/commonjs/models/update-long-term-memory-fields-request-content.js +53 -0
- package/dist/commonjs/models/update-long-term-memory-fields-request-content.js.map +1 -0
- package/dist/commonjs/models/update-long-term-memory-request-content.d.ts +7 -4
- package/dist/commonjs/models/update-long-term-memory-request-content.d.ts.map +1 -1
- package/dist/commonjs/models/update-long-term-memory-request-content.js +1 -2
- package/dist/commonjs/models/update-long-term-memory-request-content.js.map +1 -1
- package/dist/commonjs/models/update-long-term-memory-response-content.d.ts +9 -4
- package/dist/commonjs/models/update-long-term-memory-response-content.d.ts.map +1 -1
- package/dist/commonjs/models/update-long-term-memory-response-content.js +2 -2
- package/dist/commonjs/models/update-long-term-memory-response-content.js.map +1 -1
- package/dist/commonjs/sdk/sdk.d.ts +11 -2
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +18 -4
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/esm/funcs/get-session-memory.d.ts +1 -1
- package/dist/esm/funcs/get-session-memory.d.ts.map +1 -1
- package/dist/esm/funcs/get-session-memory.js +9 -4
- package/dist/esm/funcs/get-session-memory.js.map +1 -1
- package/dist/esm/funcs/list-sessions.d.ts +1 -1
- package/dist/esm/funcs/list-sessions.d.ts.map +1 -1
- package/dist/esm/funcs/list-sessions.js +7 -3
- package/dist/esm/funcs/list-sessions.js.map +1 -1
- package/dist/esm/funcs/store-health.d.ts +16 -0
- package/dist/esm/funcs/store-health.d.ts.map +1 -0
- package/dist/esm/funcs/store-health.js +78 -0
- package/dist/esm/funcs/store-health.js.map +1 -0
- package/dist/esm/funcs/update-long-term-memory-fields.d.ts +15 -0
- package/dist/esm/funcs/update-long-term-memory-fields.d.ts.map +1 -0
- package/dist/esm/funcs/update-long-term-memory-fields.js +96 -0
- package/dist/esm/funcs/update-long-term-memory-fields.js.map +1 -0
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/http.d.ts +1 -1
- package/dist/esm/lib/http.d.ts.map +1 -1
- package/dist/esm/lib/http.js +1 -1
- package/dist/esm/lib/http.js.map +1 -1
- package/dist/esm/lib/security.d.ts +5 -4
- package/dist/esm/lib/security.d.ts.map +1 -1
- package/dist/esm/lib/security.js +4 -6
- package/dist/esm/lib/security.js.map +1 -1
- package/dist/esm/models/add-session-event-request-content.d.ts +9 -0
- package/dist/esm/models/add-session-event-request-content.d.ts.map +1 -1
- package/dist/esm/models/add-session-event-request-content.js +1 -0
- package/dist/esm/models/add-session-event-request-content.js.map +1 -1
- package/dist/esm/models/attribute-filter-clause.d.ts +63 -0
- package/dist/esm/models/attribute-filter-clause.d.ts.map +1 -0
- package/dist/esm/models/attribute-filter-clause.js +44 -0
- package/dist/esm/models/attribute-filter-clause.js.map +1 -0
- package/dist/esm/models/create-memory-record.d.ts +14 -6
- package/dist/esm/models/create-memory-record.d.ts.map +1 -1
- package/dist/esm/models/create-memory-record.js +3 -3
- package/dist/esm/models/create-memory-record.js.map +1 -1
- package/dist/esm/models/get-long-term-memory-response-content.d.ts +9 -4
- package/dist/esm/models/get-long-term-memory-response-content.d.ts.map +1 -1
- package/dist/esm/models/get-long-term-memory-response-content.js +2 -2
- package/dist/esm/models/get-long-term-memory-response-content.js.map +1 -1
- package/dist/esm/models/get-session-memory-response-content.d.ts +14 -1
- package/dist/esm/models/get-session-memory-response-content.d.ts.map +1 -1
- package/dist/esm/models/get-session-memory-response-content.js +3 -0
- package/dist/esm/models/get-session-memory-response-content.js.map +1 -1
- package/dist/esm/models/index.d.ts +6 -1
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +6 -1
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/long-term-memory-filter.d.ts +21 -5
- package/dist/esm/models/long-term-memory-filter.d.ts.map +1 -1
- package/dist/esm/models/long-term-memory-filter.js +2 -0
- package/dist/esm/models/long-term-memory-filter.js.map +1 -1
- package/dist/esm/models/memory-record.d.ts +9 -4
- package/dist/esm/models/memory-record.d.ts.map +1 -1
- package/dist/esm/models/memory-record.js +2 -2
- package/dist/esm/models/memory-record.js.map +1 -1
- package/dist/esm/models/memory-type-filter.d.ts +1 -1
- package/dist/esm/models/namespace-filter.d.ts +7 -1
- package/dist/esm/models/namespace-filter.d.ts.map +1 -1
- package/dist/esm/models/namespace-filter.js.map +1 -1
- package/dist/esm/models/operations/get-session-memory.d.ts +5 -0
- package/dist/esm/models/operations/get-session-memory.d.ts.map +1 -1
- package/dist/esm/models/operations/get-session-memory.js +1 -0
- package/dist/esm/models/operations/get-session-memory.js.map +1 -1
- package/dist/esm/models/operations/index.d.ts +2 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +2 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/list-sessions.d.ts +10 -0
- package/dist/esm/models/operations/list-sessions.d.ts.map +1 -1
- package/dist/esm/models/operations/list-sessions.js +2 -0
- package/dist/esm/models/operations/list-sessions.js.map +1 -1
- package/dist/esm/models/operations/store-health.d.ts +11 -0
- package/dist/esm/models/operations/store-health.d.ts.map +1 -0
- package/dist/esm/models/operations/store-health.js +11 -0
- package/dist/esm/models/operations/store-health.js.map +1 -0
- package/dist/esm/models/operations/update-long-term-memory-fields.d.ts +21 -0
- package/dist/esm/models/operations/update-long-term-memory-fields.d.ts.map +1 -0
- package/dist/esm/models/operations/update-long-term-memory-fields.js +15 -0
- package/dist/esm/models/operations/update-long-term-memory-fields.js.map +1 -0
- package/dist/esm/models/owner-id-filter.d.ts +1 -1
- package/dist/esm/models/session-id-filter.d.ts +1 -1
- package/dist/esm/models/session-summary.d.ts +40 -0
- package/dist/esm/models/session-summary.d.ts.map +1 -0
- package/dist/esm/models/session-summary.js +19 -0
- package/dist/esm/models/session-summary.js.map +1 -0
- package/dist/esm/models/store-health-feature.d.ts +17 -0
- package/dist/esm/models/store-health-feature.d.ts.map +1 -0
- package/dist/esm/models/store-health-feature.js +15 -0
- package/dist/esm/models/store-health-feature.js.map +1 -0
- package/dist/esm/models/store-health-response-content.d.ts +21 -0
- package/dist/esm/models/store-health-response-content.d.ts.map +1 -0
- package/dist/esm/models/store-health-response-content.js +17 -0
- package/dist/esm/models/store-health-response-content.js.map +1 -0
- package/dist/esm/models/store-health-status.d.ts +17 -0
- package/dist/esm/models/store-health-status.d.ts.map +1 -0
- package/dist/esm/models/store-health-status.js +16 -0
- package/dist/esm/models/store-health-status.js.map +1 -0
- package/dist/esm/models/topics-filter.d.ts +1 -1
- package/dist/esm/models/update-long-term-memory-fields-request-content.d.ts +41 -0
- package/dist/esm/models/update-long-term-memory-fields-request-content.d.ts.map +1 -0
- package/dist/esm/models/update-long-term-memory-fields-request-content.js +16 -0
- package/dist/esm/models/update-long-term-memory-fields-request-content.js.map +1 -0
- package/dist/esm/models/update-long-term-memory-request-content.d.ts +7 -4
- package/dist/esm/models/update-long-term-memory-request-content.d.ts.map +1 -1
- package/dist/esm/models/update-long-term-memory-request-content.js +1 -2
- package/dist/esm/models/update-long-term-memory-request-content.js.map +1 -1
- package/dist/esm/models/update-long-term-memory-response-content.d.ts +9 -4
- package/dist/esm/models/update-long-term-memory-response-content.d.ts.map +1 -1
- package/dist/esm/models/update-long-term-memory-response-content.js +2 -2
- package/dist/esm/models/update-long-term-memory-response-content.js.map +1 -1
- package/dist/esm/sdk/sdk.d.ts +11 -2
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +18 -4
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +3 -3
- package/src/funcs/get-session-memory.ts +10 -1
- package/src/funcs/list-sessions.ts +10 -0
- package/src/funcs/store-health.ts +194 -0
- package/src/funcs/update-long-term-memory-fields.ts +220 -0
- package/src/lib/config.ts +3 -3
- package/src/lib/http.ts +3 -1
- package/src/lib/security.ts +10 -5
- package/src/models/add-session-event-request-content.ts +10 -0
- package/src/models/attribute-filter-clause.ts +135 -0
- package/src/models/create-memory-record.ts +13 -8
- package/src/models/get-long-term-memory-response-content.ts +9 -5
- package/src/models/get-session-memory-response-content.ts +19 -1
- package/src/models/index.ts +6 -1
- package/src/models/long-term-memory-filter.ts +22 -5
- package/src/models/memory-record.ts +9 -5
- package/src/models/memory-type-filter.ts +1 -1
- package/src/models/namespace-filter.ts +7 -1
- package/src/models/operations/get-session-memory.ts +6 -0
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/list-sessions.ts +12 -0
- package/src/models/operations/store-health.ts +30 -0
- package/src/models/operations/update-long-term-memory-fields.ts +45 -0
- package/src/models/owner-id-filter.ts +1 -1
- package/src/models/session-id-filter.ts +1 -1
- package/src/models/session-summary.ts +67 -0
- package/src/models/store-health-feature.ts +42 -0
- package/src/models/store-health-response-content.ts +48 -0
- package/src/models/store-health-status.ts +28 -0
- package/src/models/topics-filter.ts +1 -1
- package/src/models/update-long-term-memory-fields-request-content.ts +63 -0
- package/src/models/update-long-term-memory-request-content.ts +8 -5
- package/src/models/update-long-term-memory-response-content.ts +9 -5
- package/src/sdk/sdk.ts +39 -0
- package/dist/commonjs/models/memory-type.d.ts +0 -19
- package/dist/commonjs/models/memory-type.d.ts.map +0 -1
- package/dist/commonjs/models/memory-type.js.map +0 -1
- package/dist/esm/models/memory-type.d.ts +0 -19
- package/dist/esm/models/memory-type.d.ts.map +0 -1
- package/dist/esm/models/memory-type.js +0 -18
- package/dist/esm/models/memory-type.js.map +0 -1
- package/src/models/memory-type.ts +0 -34
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: e08db4fff588
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod/v3";
|
|
7
|
+
import { AgentMemoryCore } from "../core.js";
|
|
8
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
9
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
10
|
+
import * as M from "../lib/matchers.js";
|
|
11
|
+
import { compactMap } from "../lib/primitives.js";
|
|
12
|
+
import { safeParse } from "../lib/schemas.js";
|
|
13
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
14
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
15
|
+
import { pathToFunc } from "../lib/url.js";
|
|
16
|
+
import { AgentMemoryError } from "../models/errors/agent-memory-error.js";
|
|
17
|
+
import {
|
|
18
|
+
ConnectionError,
|
|
19
|
+
InvalidRequestError,
|
|
20
|
+
RequestAbortedError,
|
|
21
|
+
RequestTimeoutError,
|
|
22
|
+
UnexpectedClientError,
|
|
23
|
+
} from "../models/errors/http-client-errors.js";
|
|
24
|
+
import * as errors from "../models/errors/index.js";
|
|
25
|
+
import { ResponseValidationError } from "../models/errors/response-validation-error.js";
|
|
26
|
+
import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
|
|
27
|
+
import * as models from "../models/index.js";
|
|
28
|
+
import * as operations from "../models/operations/index.js";
|
|
29
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
30
|
+
import { Result } from "../types/fp.js";
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Atomically updates a custom-typed long-term memory's text and/or attributes, scoped to the caller's bound memory type. Used by the custom-extraction worker.
|
|
34
|
+
*/
|
|
35
|
+
export function updateLongTermMemoryFields(
|
|
36
|
+
client: AgentMemoryCore,
|
|
37
|
+
memoryId: string,
|
|
38
|
+
body: models.UpdateLongTermMemoryFieldsRequestContent,
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): APIPromise<
|
|
41
|
+
Result<
|
|
42
|
+
void,
|
|
43
|
+
| errors.BadRequestErrorResponseContent
|
|
44
|
+
| errors.AuthenticationErrorResponseContent
|
|
45
|
+
| errors.ForbiddenErrorResponseContent
|
|
46
|
+
| errors.NotFoundErrorResponseContent
|
|
47
|
+
| errors.TimeoutErrorResponseContent
|
|
48
|
+
| errors.FailedDependencyErrorResponseContent
|
|
49
|
+
| errors.TooManyRequestsErrorResponseContent
|
|
50
|
+
| errors.UnexpectedErrorResponseContent
|
|
51
|
+
| AgentMemoryError
|
|
52
|
+
| ResponseValidationError
|
|
53
|
+
| ConnectionError
|
|
54
|
+
| RequestAbortedError
|
|
55
|
+
| RequestTimeoutError
|
|
56
|
+
| InvalidRequestError
|
|
57
|
+
| UnexpectedClientError
|
|
58
|
+
| SDKValidationError
|
|
59
|
+
>
|
|
60
|
+
> {
|
|
61
|
+
return new APIPromise($do(
|
|
62
|
+
client,
|
|
63
|
+
memoryId,
|
|
64
|
+
body,
|
|
65
|
+
options,
|
|
66
|
+
));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async function $do(
|
|
70
|
+
client: AgentMemoryCore,
|
|
71
|
+
memoryId: string,
|
|
72
|
+
body: models.UpdateLongTermMemoryFieldsRequestContent,
|
|
73
|
+
options?: RequestOptions,
|
|
74
|
+
): Promise<
|
|
75
|
+
[
|
|
76
|
+
Result<
|
|
77
|
+
void,
|
|
78
|
+
| errors.BadRequestErrorResponseContent
|
|
79
|
+
| errors.AuthenticationErrorResponseContent
|
|
80
|
+
| errors.ForbiddenErrorResponseContent
|
|
81
|
+
| errors.NotFoundErrorResponseContent
|
|
82
|
+
| errors.TimeoutErrorResponseContent
|
|
83
|
+
| errors.FailedDependencyErrorResponseContent
|
|
84
|
+
| errors.TooManyRequestsErrorResponseContent
|
|
85
|
+
| errors.UnexpectedErrorResponseContent
|
|
86
|
+
| AgentMemoryError
|
|
87
|
+
| ResponseValidationError
|
|
88
|
+
| ConnectionError
|
|
89
|
+
| RequestAbortedError
|
|
90
|
+
| RequestTimeoutError
|
|
91
|
+
| InvalidRequestError
|
|
92
|
+
| UnexpectedClientError
|
|
93
|
+
| SDKValidationError
|
|
94
|
+
>,
|
|
95
|
+
APICall,
|
|
96
|
+
]
|
|
97
|
+
> {
|
|
98
|
+
const input: operations.UpdateLongTermMemoryFieldsRequest = {
|
|
99
|
+
memoryId: memoryId,
|
|
100
|
+
body: body,
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const parsed = safeParse(
|
|
104
|
+
input,
|
|
105
|
+
(value) =>
|
|
106
|
+
operations.UpdateLongTermMemoryFieldsRequest$outboundSchema.parse(value),
|
|
107
|
+
"Input validation failed",
|
|
108
|
+
);
|
|
109
|
+
if (!parsed.ok) {
|
|
110
|
+
return [parsed, { status: "invalid" }];
|
|
111
|
+
}
|
|
112
|
+
const payload = parsed.value;
|
|
113
|
+
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
114
|
+
|
|
115
|
+
const pathParams = {
|
|
116
|
+
memoryId: encodeSimple("memoryId", payload.memoryId, {
|
|
117
|
+
explode: false,
|
|
118
|
+
charEncoding: "percent",
|
|
119
|
+
}),
|
|
120
|
+
storeId: encodeSimple("storeId", client._options.storeId, {
|
|
121
|
+
explode: false,
|
|
122
|
+
charEncoding: "percent",
|
|
123
|
+
}),
|
|
124
|
+
};
|
|
125
|
+
const path = pathToFunc(
|
|
126
|
+
"/v1/stores/{storeId}/long-term-memory/{memoryId}/fields",
|
|
127
|
+
)(pathParams);
|
|
128
|
+
|
|
129
|
+
const headers = new Headers(compactMap({
|
|
130
|
+
"Content-Type": "application/json",
|
|
131
|
+
Accept: "application/json",
|
|
132
|
+
}));
|
|
133
|
+
|
|
134
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
135
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
136
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
137
|
+
|
|
138
|
+
const context = {
|
|
139
|
+
options: client._options,
|
|
140
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
141
|
+
operationID: "UpdateLongTermMemoryFields",
|
|
142
|
+
oAuth2Scopes: null,
|
|
143
|
+
|
|
144
|
+
resolvedSecurity: requestSecurity,
|
|
145
|
+
|
|
146
|
+
securitySource: client._options.apiKey,
|
|
147
|
+
retryConfig: options?.retries
|
|
148
|
+
|| client._options.retryConfig
|
|
149
|
+
|| { strategy: "none" },
|
|
150
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
const requestRes = client._createRequest(context, {
|
|
154
|
+
security: requestSecurity,
|
|
155
|
+
method: "PATCH",
|
|
156
|
+
baseURL: options?.serverURL,
|
|
157
|
+
path: path,
|
|
158
|
+
headers: headers,
|
|
159
|
+
body: body$,
|
|
160
|
+
userAgent: client._options.userAgent,
|
|
161
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
162
|
+
}, options);
|
|
163
|
+
if (!requestRes.ok) {
|
|
164
|
+
return [requestRes, { status: "invalid" }];
|
|
165
|
+
}
|
|
166
|
+
const req = requestRes.value;
|
|
167
|
+
|
|
168
|
+
const doResult = await client._do(req, {
|
|
169
|
+
context,
|
|
170
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
171
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
172
|
+
retryConfig: context.retryConfig,
|
|
173
|
+
retryCodes: context.retryCodes,
|
|
174
|
+
});
|
|
175
|
+
if (!doResult.ok) {
|
|
176
|
+
return [doResult, { status: "request-error", request: req }];
|
|
177
|
+
}
|
|
178
|
+
const response = doResult.value;
|
|
179
|
+
|
|
180
|
+
const responseFields = {
|
|
181
|
+
HttpMeta: { Response: response, Request: req },
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
const [result] = await M.match<
|
|
185
|
+
void,
|
|
186
|
+
| errors.BadRequestErrorResponseContent
|
|
187
|
+
| errors.AuthenticationErrorResponseContent
|
|
188
|
+
| errors.ForbiddenErrorResponseContent
|
|
189
|
+
| errors.NotFoundErrorResponseContent
|
|
190
|
+
| errors.TimeoutErrorResponseContent
|
|
191
|
+
| errors.FailedDependencyErrorResponseContent
|
|
192
|
+
| errors.TooManyRequestsErrorResponseContent
|
|
193
|
+
| errors.UnexpectedErrorResponseContent
|
|
194
|
+
| AgentMemoryError
|
|
195
|
+
| ResponseValidationError
|
|
196
|
+
| ConnectionError
|
|
197
|
+
| RequestAbortedError
|
|
198
|
+
| RequestTimeoutError
|
|
199
|
+
| InvalidRequestError
|
|
200
|
+
| UnexpectedClientError
|
|
201
|
+
| SDKValidationError
|
|
202
|
+
>(
|
|
203
|
+
M.nil(200, z.void()),
|
|
204
|
+
M.jsonErr(400, errors.BadRequestErrorResponseContent$inboundSchema),
|
|
205
|
+
M.jsonErr(401, errors.AuthenticationErrorResponseContent$inboundSchema),
|
|
206
|
+
M.jsonErr(403, errors.ForbiddenErrorResponseContent$inboundSchema),
|
|
207
|
+
M.jsonErr(404, errors.NotFoundErrorResponseContent$inboundSchema),
|
|
208
|
+
M.jsonErr(408, errors.TimeoutErrorResponseContent$inboundSchema),
|
|
209
|
+
M.jsonErr(424, errors.FailedDependencyErrorResponseContent$inboundSchema),
|
|
210
|
+
M.jsonErr(429, errors.TooManyRequestsErrorResponseContent$inboundSchema),
|
|
211
|
+
M.jsonErr(500, errors.UnexpectedErrorResponseContent$inboundSchema),
|
|
212
|
+
M.fail("4XX"),
|
|
213
|
+
M.fail("5XX"),
|
|
214
|
+
)(response, req, { extraFields: responseFields });
|
|
215
|
+
if (!result.ok) {
|
|
216
|
+
return [result, { status: "complete", request: req, response }];
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
return [result, { status: "complete", request: req, response }];
|
|
220
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -49,8 +49,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
49
49
|
export const SDK_METADATA = {
|
|
50
50
|
language: "typescript",
|
|
51
51
|
openapiDocVersion: "1.0.0",
|
|
52
|
-
sdkVersion: "0.
|
|
53
|
-
genVersion: "2.
|
|
52
|
+
sdkVersion: "0.2.0",
|
|
53
|
+
genVersion: "2.926.8",
|
|
54
54
|
userAgent:
|
|
55
|
-
"speakeasy-sdk/typescript 0.
|
|
55
|
+
"speakeasy-sdk/typescript 0.2.0 2.926.8 1.0.0 @redis-iris/agent-memory",
|
|
56
56
|
} as const;
|
package/src/lib/http.ts
CHANGED
|
@@ -46,8 +46,10 @@ export class HTTPClient {
|
|
|
46
46
|
private requestHooks: BeforeRequestHook[] = [];
|
|
47
47
|
private requestErrorHooks: RequestErrorHook[] = [];
|
|
48
48
|
private responseHooks: ResponseHook[] = [];
|
|
49
|
+
private options: HTTPClientOptions;
|
|
49
50
|
|
|
50
|
-
constructor(
|
|
51
|
+
constructor(options: HTTPClientOptions = {}) {
|
|
52
|
+
this.options = options;
|
|
51
53
|
this.fetcher = options.fetcher || DEFAULT_FETCHER;
|
|
52
54
|
}
|
|
53
55
|
|
package/src/lib/security.ts
CHANGED
|
@@ -14,17 +14,22 @@ type OAuth2PasswordFlow = {
|
|
|
14
14
|
tokenURL: string;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
export
|
|
18
|
-
Incomplete
|
|
19
|
-
UnrecognisedSecurityType
|
|
20
|
-
}
|
|
17
|
+
export const SecurityErrorCode = {
|
|
18
|
+
Incomplete: "incomplete",
|
|
19
|
+
UnrecognisedSecurityType: "unrecognized_security_type",
|
|
20
|
+
} as const;
|
|
21
|
+
export type SecurityErrorCode =
|
|
22
|
+
(typeof SecurityErrorCode)[keyof typeof SecurityErrorCode];
|
|
21
23
|
|
|
22
24
|
export class SecurityError extends Error {
|
|
25
|
+
public code: SecurityErrorCode;
|
|
26
|
+
|
|
23
27
|
constructor(
|
|
24
|
-
|
|
28
|
+
code: SecurityErrorCode,
|
|
25
29
|
message: string,
|
|
26
30
|
) {
|
|
27
31
|
super(message);
|
|
32
|
+
this.code = code;
|
|
28
33
|
this.name = "SecurityError";
|
|
29
34
|
}
|
|
30
35
|
|
|
@@ -20,6 +20,14 @@ export type AddSessionEventRequestContent = {
|
|
|
20
20
|
* Unique actor identifier (1-255 chars). Can represent a user, agent, or any participant.
|
|
21
21
|
*/
|
|
22
22
|
actorId: string;
|
|
23
|
+
/**
|
|
24
|
+
* Optional namespace for the session, used as the namespace of every long-term memory extracted from it.
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
*
|
|
28
|
+
* Like `ownerId`, this is a session-level value taken from the first event: the value sent with the first event of a session is stored on the session, and values sent with later events are ignored. Omit it to leave extracted memories without a namespace.
|
|
29
|
+
*/
|
|
30
|
+
namespace?: string | undefined;
|
|
23
31
|
/**
|
|
24
32
|
* Message role for session events.
|
|
25
33
|
*/
|
|
@@ -42,6 +50,7 @@ export type AddSessionEventRequestContent = {
|
|
|
42
50
|
export type AddSessionEventRequestContent$Outbound = {
|
|
43
51
|
sessionId?: string | undefined;
|
|
44
52
|
actorId: string;
|
|
53
|
+
namespace?: string | undefined;
|
|
45
54
|
role: string;
|
|
46
55
|
content: Array<Content$Outbound>;
|
|
47
56
|
createdAt: string;
|
|
@@ -56,6 +65,7 @@ export const AddSessionEventRequestContent$outboundSchema: z.ZodType<
|
|
|
56
65
|
> = z.object({
|
|
57
66
|
sessionId: z.string().optional(),
|
|
58
67
|
actorId: z.string(),
|
|
68
|
+
namespace: z.string().optional(),
|
|
59
69
|
role: MessageRole$outboundSchema,
|
|
60
70
|
content: z.array(Content$outboundSchema),
|
|
61
71
|
createdAt: z.date().transform(v => v.toISOString()),
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 9e2e283a0e23
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod/v3";
|
|
7
|
+
|
|
8
|
+
export type List = {
|
|
9
|
+
/**
|
|
10
|
+
* Match a list attribute that contains all of these values.
|
|
11
|
+
*/
|
|
12
|
+
list: Array<string>;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type Boolean = {
|
|
16
|
+
/**
|
|
17
|
+
* Match a boolean attribute equal to this value.
|
|
18
|
+
*/
|
|
19
|
+
boolean: boolean;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type NumberT = {
|
|
23
|
+
/**
|
|
24
|
+
* Match a numeric attribute equal to this value.
|
|
25
|
+
*/
|
|
26
|
+
number: number;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type String = {
|
|
30
|
+
/**
|
|
31
|
+
* Match a string attribute equal to this value.
|
|
32
|
+
*/
|
|
33
|
+
string: string;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Filter clause for a single record attribute. Exactly one member is set; the member must match the attribute's declared field type.
|
|
38
|
+
*/
|
|
39
|
+
export type AttributeFilterClause = String | NumberT | Boolean | List;
|
|
40
|
+
|
|
41
|
+
/** @internal */
|
|
42
|
+
export type List$Outbound = {
|
|
43
|
+
list: Array<string>;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/** @internal */
|
|
47
|
+
export const List$outboundSchema: z.ZodType<List$Outbound, z.ZodTypeDef, List> =
|
|
48
|
+
z.object({
|
|
49
|
+
list: z.array(z.string()),
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export function listToJSON(list: List): string {
|
|
53
|
+
return JSON.stringify(List$outboundSchema.parse(list));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** @internal */
|
|
57
|
+
export type Boolean$Outbound = {
|
|
58
|
+
boolean: boolean;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/** @internal */
|
|
62
|
+
export const Boolean$outboundSchema: z.ZodType<
|
|
63
|
+
Boolean$Outbound,
|
|
64
|
+
z.ZodTypeDef,
|
|
65
|
+
Boolean
|
|
66
|
+
> = z.object({
|
|
67
|
+
boolean: z.boolean(),
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
export function booleanToJSON(value: Boolean): string {
|
|
71
|
+
return JSON.stringify(Boolean$outboundSchema.parse(value));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** @internal */
|
|
75
|
+
export type NumberT$Outbound = {
|
|
76
|
+
number: number;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/** @internal */
|
|
80
|
+
export const NumberT$outboundSchema: z.ZodType<
|
|
81
|
+
NumberT$Outbound,
|
|
82
|
+
z.ZodTypeDef,
|
|
83
|
+
NumberT
|
|
84
|
+
> = z.object({
|
|
85
|
+
number: z.number(),
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
export function numberToJSON(numberT: NumberT): string {
|
|
89
|
+
return JSON.stringify(NumberT$outboundSchema.parse(numberT));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** @internal */
|
|
93
|
+
export type String$Outbound = {
|
|
94
|
+
string: string;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/** @internal */
|
|
98
|
+
export const String$outboundSchema: z.ZodType<
|
|
99
|
+
String$Outbound,
|
|
100
|
+
z.ZodTypeDef,
|
|
101
|
+
String
|
|
102
|
+
> = z.object({
|
|
103
|
+
string: z.string(),
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
export function stringToJSON(string: String): string {
|
|
107
|
+
return JSON.stringify(String$outboundSchema.parse(string));
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** @internal */
|
|
111
|
+
export type AttributeFilterClause$Outbound =
|
|
112
|
+
| String$Outbound
|
|
113
|
+
| NumberT$Outbound
|
|
114
|
+
| Boolean$Outbound
|
|
115
|
+
| List$Outbound;
|
|
116
|
+
|
|
117
|
+
/** @internal */
|
|
118
|
+
export const AttributeFilterClause$outboundSchema: z.ZodType<
|
|
119
|
+
AttributeFilterClause$Outbound,
|
|
120
|
+
z.ZodTypeDef,
|
|
121
|
+
AttributeFilterClause
|
|
122
|
+
> = z.union([
|
|
123
|
+
z.lazy(() => String$outboundSchema),
|
|
124
|
+
z.lazy(() => NumberT$outboundSchema),
|
|
125
|
+
z.lazy(() => Boolean$outboundSchema),
|
|
126
|
+
z.lazy(() => List$outboundSchema),
|
|
127
|
+
]);
|
|
128
|
+
|
|
129
|
+
export function attributeFilterClauseToJSON(
|
|
130
|
+
attributeFilterClause: AttributeFilterClause,
|
|
131
|
+
): string {
|
|
132
|
+
return JSON.stringify(
|
|
133
|
+
AttributeFilterClause$outboundSchema.parse(attributeFilterClause),
|
|
134
|
+
);
|
|
135
|
+
}
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import * as z from "zod/v3";
|
|
7
|
-
import { MemoryType, MemoryType$outboundSchema } from "./memory-type.js";
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* A memory record to create.
|
|
@@ -19,9 +18,9 @@ export type CreateMemoryRecord = {
|
|
|
19
18
|
*/
|
|
20
19
|
text: string;
|
|
21
20
|
/**
|
|
22
|
-
* Type of
|
|
21
|
+
* Type of memory. Built-in or a custom type registered on the store.
|
|
23
22
|
*/
|
|
24
|
-
memoryType?:
|
|
23
|
+
memoryType?: string | undefined;
|
|
25
24
|
/**
|
|
26
25
|
* Session ID associated with this memory (1-64 chars, alphanumeric and dashes).
|
|
27
26
|
*/
|
|
@@ -29,15 +28,19 @@ export type CreateMemoryRecord = {
|
|
|
29
28
|
/**
|
|
30
29
|
* Owner ID associated with this memory (1-64 chars, alphanumeric and dashes).
|
|
31
30
|
*/
|
|
32
|
-
ownerId
|
|
31
|
+
ownerId: string;
|
|
33
32
|
/**
|
|
34
|
-
*
|
|
33
|
+
* Optional namespace for logical grouping (1-64 chars, alphanumeric and dashes). Omit to create the record without a namespace. Records created here are explicit writes, so this value is taken as given; extraction instead inherits the source session's namespace.
|
|
35
34
|
*/
|
|
36
35
|
namespace?: string | undefined;
|
|
37
36
|
/**
|
|
38
37
|
* Topic tags for categorization (max 50 topics, each 1-100 chars).
|
|
39
38
|
*/
|
|
40
39
|
topics?: Array<string> | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Structured record attributes: a map from the custom memory type's field name to that field's value. Values are arbitrary JSON matching the field's declared type (str, int, float, bool, list[str], list[float], or object).
|
|
42
|
+
*/
|
|
43
|
+
attributes?: { [k: string]: any } | undefined;
|
|
41
44
|
};
|
|
42
45
|
|
|
43
46
|
/** @internal */
|
|
@@ -46,9 +49,10 @@ export type CreateMemoryRecord$Outbound = {
|
|
|
46
49
|
text: string;
|
|
47
50
|
memoryType?: string | undefined;
|
|
48
51
|
sessionId?: string | undefined;
|
|
49
|
-
ownerId
|
|
52
|
+
ownerId: string;
|
|
50
53
|
namespace?: string | undefined;
|
|
51
54
|
topics?: Array<string> | undefined;
|
|
55
|
+
attributes?: { [k: string]: any } | undefined;
|
|
52
56
|
};
|
|
53
57
|
|
|
54
58
|
/** @internal */
|
|
@@ -59,11 +63,12 @@ export const CreateMemoryRecord$outboundSchema: z.ZodType<
|
|
|
59
63
|
> = z.object({
|
|
60
64
|
id: z.string(),
|
|
61
65
|
text: z.string(),
|
|
62
|
-
memoryType:
|
|
66
|
+
memoryType: z.string().optional(),
|
|
63
67
|
sessionId: z.string().optional(),
|
|
64
|
-
ownerId: z.string()
|
|
68
|
+
ownerId: z.string(),
|
|
65
69
|
namespace: z.string().optional(),
|
|
66
70
|
topics: z.array(z.string()).optional(),
|
|
71
|
+
attributes: z.record(z.any()).optional(),
|
|
67
72
|
});
|
|
68
73
|
|
|
69
74
|
export function createMemoryRecordToJSON(
|
|
@@ -7,7 +7,6 @@ import * as z from "zod/v3";
|
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
8
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
9
9
|
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
10
|
-
import { MemoryType, MemoryType$inboundSchema } from "./memory-type.js";
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* A long-term memory record.
|
|
@@ -22,9 +21,9 @@ export type GetLongTermMemoryResponseContent = {
|
|
|
22
21
|
*/
|
|
23
22
|
text: string;
|
|
24
23
|
/**
|
|
25
|
-
* Type of
|
|
24
|
+
* Type of memory. Built-in or a custom type registered on the store.
|
|
26
25
|
*/
|
|
27
|
-
memoryType?:
|
|
26
|
+
memoryType?: string | undefined;
|
|
28
27
|
/**
|
|
29
28
|
* Session ID associated with this memory.
|
|
30
29
|
*/
|
|
@@ -34,13 +33,17 @@ export type GetLongTermMemoryResponseContent = {
|
|
|
34
33
|
*/
|
|
35
34
|
ownerId?: string | undefined;
|
|
36
35
|
/**
|
|
37
|
-
* Namespace for logical grouping.
|
|
36
|
+
* Namespace for logical grouping. Absent when the record has none: either it was written directly without one, or it was extracted from a session that has no namespace.
|
|
38
37
|
*/
|
|
39
38
|
namespace?: string | undefined;
|
|
40
39
|
/**
|
|
41
40
|
* Topic tags for categorization.
|
|
42
41
|
*/
|
|
43
42
|
topics?: Array<string> | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Structured record attributes: a map from the custom memory type's field name to that field's value. Values are arbitrary JSON matching the field's declared type (str, int, float, bool, list[str], list[float], or object).
|
|
45
|
+
*/
|
|
46
|
+
attributes?: { [k: string]: any } | undefined;
|
|
44
47
|
/**
|
|
45
48
|
* Timestamp when the memory was created (UTC).
|
|
46
49
|
*/
|
|
@@ -59,11 +62,12 @@ export const GetLongTermMemoryResponseContent$inboundSchema: z.ZodType<
|
|
|
59
62
|
> = z.object({
|
|
60
63
|
id: z.string(),
|
|
61
64
|
text: z.string(),
|
|
62
|
-
memoryType:
|
|
65
|
+
memoryType: z.string().optional(),
|
|
63
66
|
sessionId: z.string().optional(),
|
|
64
67
|
ownerId: z.string().optional(),
|
|
65
68
|
namespace: z.string().optional(),
|
|
66
69
|
topics: z.array(z.string()).optional(),
|
|
70
|
+
attributes: z.record(z.any()).optional(),
|
|
67
71
|
createdAt: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
68
72
|
updatedAt: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
69
73
|
});
|
|
@@ -8,6 +8,10 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
8
8
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
9
9
|
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
10
10
|
import { SessionEvent, SessionEvent$inboundSchema } from "./session-event.js";
|
|
11
|
+
import {
|
|
12
|
+
SessionSummary,
|
|
13
|
+
SessionSummary$inboundSchema,
|
|
14
|
+
} from "./session-summary.js";
|
|
11
15
|
|
|
12
16
|
/**
|
|
13
17
|
* Session memory state for a session.
|
|
@@ -22,9 +26,21 @@ export type GetSessionMemoryResponseContent = {
|
|
|
22
26
|
*/
|
|
23
27
|
ownerId: string;
|
|
24
28
|
/**
|
|
25
|
-
*
|
|
29
|
+
* The namespace of the session, set from the namespace of the first event. Absent when the first event did not supply one; long-term memories extracted from this session then carry no namespace.
|
|
30
|
+
*/
|
|
31
|
+
namespace?: string | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Conversation events retained for this session. When summarization is enabled, events already covered by the summary are excluded unless `includeSummarisedEvents` is set; the compacted summary is returned separately in `summary`.
|
|
26
34
|
*/
|
|
27
35
|
events: Array<SessionEvent>;
|
|
36
|
+
/**
|
|
37
|
+
* Compacted summary of older session history for a session.
|
|
38
|
+
*
|
|
39
|
+
* @remarks
|
|
40
|
+
*
|
|
41
|
+
* This is derived session state maintained by the background summarization workflow, not a conversation event. It is present only after at least one summarization cycle has completed.
|
|
42
|
+
*/
|
|
43
|
+
summary?: SessionSummary | undefined;
|
|
28
44
|
};
|
|
29
45
|
|
|
30
46
|
/** @internal */
|
|
@@ -35,7 +51,9 @@ export const GetSessionMemoryResponseContent$inboundSchema: z.ZodType<
|
|
|
35
51
|
> = z.object({
|
|
36
52
|
sessionId: z.string(),
|
|
37
53
|
ownerId: z.string(),
|
|
54
|
+
namespace: z.string().optional(),
|
|
38
55
|
events: z.array(SessionEvent$inboundSchema),
|
|
56
|
+
summary: SessionSummary$inboundSchema.optional(),
|
|
39
57
|
});
|
|
40
58
|
|
|
41
59
|
export function getSessionMemoryResponseContentFromJSON(
|
package/src/models/index.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
export * from "./add-session-event-request-content.js";
|
|
7
7
|
export * from "./add-session-event-response-content.js";
|
|
8
|
+
export * from "./attribute-filter-clause.js";
|
|
8
9
|
export * from "./authentication-error-type.js";
|
|
9
10
|
export * from "./bad-request-error-type.js";
|
|
10
11
|
export * from "./bulk-create-long-term-memories-request-content.js";
|
|
@@ -28,7 +29,6 @@ export * from "./list-sessions-response-content.js";
|
|
|
28
29
|
export * from "./long-term-memory-filter.js";
|
|
29
30
|
export * from "./memory-record.js";
|
|
30
31
|
export * from "./memory-type-filter.js";
|
|
31
|
-
export * from "./memory-type.js";
|
|
32
32
|
export * from "./message-role.js";
|
|
33
33
|
export * from "./namespace-filter.js";
|
|
34
34
|
export * from "./not-found-error-type.js";
|
|
@@ -39,9 +39,14 @@ export * from "./search-long-term-memory-response-content.js";
|
|
|
39
39
|
export * from "./security.js";
|
|
40
40
|
export * from "./session-event.js";
|
|
41
41
|
export * from "./session-id-filter.js";
|
|
42
|
+
export * from "./session-summary.js";
|
|
43
|
+
export * from "./store-health-feature.js";
|
|
44
|
+
export * from "./store-health-response-content.js";
|
|
45
|
+
export * from "./store-health-status.js";
|
|
42
46
|
export * from "./timeout-error-type.js";
|
|
43
47
|
export * from "./too-many-requests-error-type.js";
|
|
44
48
|
export * from "./topics-filter.js";
|
|
45
49
|
export * from "./unexpected-error-type.js";
|
|
50
|
+
export * from "./update-long-term-memory-fields-request-content.js";
|
|
46
51
|
export * from "./update-long-term-memory-request-content.js";
|
|
47
52
|
export * from "./update-long-term-memory-response-content.js";
|