@getzep/zep-cloud 2.2.0 → 2.3.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/Client.d.ts +10 -5
- package/api/errors/BadRequestError.js +17 -7
- package/api/errors/ConflictError.js +17 -7
- package/api/errors/InternalServerError.js +17 -7
- package/api/errors/NotFoundError.js +17 -7
- package/api/errors/UnauthorizedError.js +17 -7
- package/api/resources/document/client/Client.d.ts +18 -13
- package/api/resources/document/client/Client.js +158 -141
- package/api/resources/graph/client/Client.d.ts +13 -8
- package/api/resources/graph/client/Client.js +50 -38
- package/api/resources/graph/resources/edge/client/Client.d.ts +9 -4
- package/api/resources/graph/resources/edge/client/Client.js +51 -37
- package/api/resources/graph/resources/episode/client/Client.d.ts +8 -3
- package/api/resources/graph/resources/episode/client/Client.js +46 -33
- package/api/resources/graph/resources/index.js +17 -7
- package/api/resources/graph/resources/node/client/Client.d.ts +8 -3
- package/api/resources/graph/resources/node/client/Client.js +43 -30
- package/api/resources/group/client/Client.d.ts +7 -2
- package/api/resources/group/client/Client.js +36 -24
- package/api/resources/index.js +17 -7
- package/api/resources/memory/client/Client.d.ts +28 -23
- package/api/resources/memory/client/Client.js +225 -195
- package/api/resources/memory/client/requests/AddMemoryRequest.d.ts +1 -1
- package/api/resources/user/client/Client.d.ts +12 -7
- package/api/resources/user/client/Client.js +82 -65
- package/api/types/GraphDataType.d.ts +1 -1
- package/api/types/GraphSearchScope.d.ts +1 -1
- package/api/types/Reranker.d.ts +1 -1
- package/api/types/RoleType.d.ts +1 -1
- package/api/types/SearchScope.d.ts +1 -1
- package/api/types/SearchType.d.ts +1 -1
- package/core/fetcher/APIResponse.d.ts +1 -1
- package/core/fetcher/Fetcher.d.ts +5 -2
- package/core/fetcher/Fetcher.js +18 -175
- package/core/fetcher/Supplier.d.ts +1 -1
- package/core/fetcher/createRequestUrl.d.ts +1 -0
- package/core/fetcher/createRequestUrl.js +12 -0
- package/core/fetcher/getFetchFn.d.ts +4 -0
- package/core/fetcher/getFetchFn.js +68 -0
- package/core/fetcher/getHeader.js +1 -2
- package/core/fetcher/getRequestBody.d.ts +7 -0
- package/core/fetcher/getRequestBody.js +22 -0
- package/core/fetcher/getResponseBody.d.ts +1 -0
- package/core/fetcher/getResponseBody.js +54 -0
- package/core/fetcher/makeRequest.d.ts +1 -0
- package/core/fetcher/makeRequest.js +42 -0
- package/core/fetcher/requestWithRetries.d.ts +1 -0
- package/core/fetcher/requestWithRetries.js +40 -0
- package/core/fetcher/signals.d.ts +11 -0
- package/core/fetcher/signals.js +36 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +247 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +21 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +126 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +229 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +59 -0
- package/core/index.js +17 -7
- package/core/runtime/runtime.d.ts +2 -1
- package/core/runtime/runtime.js +12 -1
- package/core/schemas/Schema.d.ts +13 -9
- package/core/schemas/Schema.js +1 -0
- package/core/schemas/builders/bigint/bigint.d.ts +2 -0
- package/core/schemas/builders/bigint/bigint.js +49 -0
- package/core/schemas/builders/bigint/index.d.ts +1 -0
- package/core/schemas/builders/bigint/index.js +5 -0
- package/core/schemas/builders/date/date.js +1 -2
- package/core/schemas/builders/enum/enum.js +1 -2
- package/core/schemas/builders/index.d.ts +1 -0
- package/core/schemas/builders/index.js +1 -0
- package/core/schemas/builders/lazy/lazy.d.ts +2 -2
- package/core/schemas/builders/lazy/lazy.js +11 -23
- package/core/schemas/builders/lazy/lazyObject.js +2 -12
- package/core/schemas/builders/list/list.js +32 -46
- package/core/schemas/builders/literals/booleanLiteral.js +1 -2
- package/core/schemas/builders/literals/stringLiteral.js +1 -2
- package/core/schemas/builders/object/object.d.ts +1 -1
- package/core/schemas/builders/object/object.js +120 -114
- package/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +3 -3
- package/core/schemas/builders/object/objectWithoutOptionalProperties.js +1 -2
- package/core/schemas/builders/object/property.js +2 -3
- package/core/schemas/builders/object/types.d.ts +18 -13
- package/core/schemas/builders/object-like/getObjectLikeUtils.js +5 -15
- package/core/schemas/builders/object-like/types.d.ts +1 -1
- package/core/schemas/builders/record/record.js +50 -62
- package/core/schemas/builders/record/types.d.ts +2 -2
- package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
- package/core/schemas/builders/schema-utils/getSchemaUtils.js +21 -25
- package/core/schemas/builders/schema-utils/stringifyValidationErrors.js +1 -2
- package/core/schemas/builders/set/set.js +7 -17
- package/core/schemas/builders/undiscriminated-union/types.d.ts +4 -4
- package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +22 -34
- package/core/schemas/builders/union/discriminant.js +1 -2
- package/core/schemas/builders/union/types.d.ts +6 -6
- package/core/schemas/builders/union/union.d.ts +1 -1
- package/core/schemas/builders/union/union.js +52 -64
- package/core/schemas/utils/MaybePromise.d.ts +1 -1
- package/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +3 -3
- package/core/schemas/utils/createIdentitySchemaCreator.js +1 -2
- package/core/schemas/utils/entries.d.ts +1 -1
- package/core/schemas/utils/entries.js +1 -2
- package/core/schemas/utils/filterObject.d.ts +1 -1
- package/core/schemas/utils/filterObject.js +1 -2
- package/core/schemas/utils/getErrorMessageForIncorrectType.js +5 -2
- package/core/schemas/utils/isPlainObject.js +1 -2
- package/core/schemas/utils/keys.d.ts +1 -1
- package/core/schemas/utils/keys.js +1 -2
- package/core/schemas/utils/maybeSkipValidation.js +4 -14
- package/core/schemas/utils/partition.js +1 -2
- package/dist/Client.d.ts +10 -5
- package/dist/api/errors/BadRequestError.js +17 -7
- package/dist/api/errors/ConflictError.js +17 -7
- package/dist/api/errors/InternalServerError.js +17 -7
- package/dist/api/errors/NotFoundError.js +17 -7
- package/dist/api/errors/UnauthorizedError.js +17 -7
- package/dist/api/resources/document/client/Client.d.ts +18 -13
- package/dist/api/resources/document/client/Client.js +158 -141
- package/dist/api/resources/graph/client/Client.d.ts +13 -8
- package/dist/api/resources/graph/client/Client.js +50 -38
- package/dist/api/resources/graph/resources/edge/client/Client.d.ts +9 -4
- package/dist/api/resources/graph/resources/edge/client/Client.js +51 -37
- package/dist/api/resources/graph/resources/episode/client/Client.d.ts +8 -3
- package/dist/api/resources/graph/resources/episode/client/Client.js +46 -33
- package/dist/api/resources/graph/resources/index.js +17 -7
- package/dist/api/resources/graph/resources/node/client/Client.d.ts +8 -3
- package/dist/api/resources/graph/resources/node/client/Client.js +43 -30
- package/dist/api/resources/group/client/Client.d.ts +7 -2
- package/dist/api/resources/group/client/Client.js +36 -24
- package/dist/api/resources/index.js +17 -7
- package/dist/api/resources/memory/client/Client.d.ts +28 -23
- package/dist/api/resources/memory/client/Client.js +225 -195
- package/dist/api/resources/memory/client/requests/AddMemoryRequest.d.ts +1 -1
- package/dist/api/resources/user/client/Client.d.ts +12 -7
- package/dist/api/resources/user/client/Client.js +82 -65
- package/dist/api/types/GraphDataType.d.ts +1 -1
- package/dist/api/types/GraphSearchScope.d.ts +1 -1
- package/dist/api/types/Reranker.d.ts +1 -1
- package/dist/api/types/RoleType.d.ts +1 -1
- package/dist/api/types/SearchScope.d.ts +1 -1
- package/dist/api/types/SearchType.d.ts +1 -1
- package/dist/core/fetcher/APIResponse.d.ts +1 -1
- package/dist/core/fetcher/Fetcher.d.ts +5 -2
- package/dist/core/fetcher/Fetcher.js +18 -175
- package/dist/core/fetcher/Supplier.d.ts +1 -1
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/core/fetcher/createRequestUrl.js +12 -0
- package/dist/core/fetcher/getFetchFn.d.ts +4 -0
- package/dist/core/fetcher/getFetchFn.js +68 -0
- package/dist/core/fetcher/getHeader.js +1 -2
- package/dist/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/core/fetcher/getRequestBody.js +22 -0
- package/dist/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/core/fetcher/getResponseBody.js +54 -0
- package/dist/core/fetcher/makeRequest.d.ts +1 -0
- package/dist/core/fetcher/makeRequest.js +42 -0
- package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/core/fetcher/requestWithRetries.js +40 -0
- package/dist/core/fetcher/signals.d.ts +11 -0
- package/dist/core/fetcher/signals.js +36 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +247 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +21 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +126 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +229 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +59 -0
- package/dist/core/index.js +17 -7
- package/dist/core/runtime/runtime.d.ts +2 -1
- package/dist/core/runtime/runtime.js +12 -1
- package/dist/core/schemas/Schema.d.ts +13 -9
- package/dist/core/schemas/Schema.js +1 -0
- package/dist/core/schemas/builders/bigint/bigint.d.ts +2 -0
- package/dist/core/schemas/builders/bigint/bigint.js +49 -0
- package/dist/core/schemas/builders/bigint/index.d.ts +1 -0
- package/dist/core/schemas/builders/bigint/index.js +5 -0
- package/dist/core/schemas/builders/date/date.js +1 -2
- package/dist/core/schemas/builders/enum/enum.js +1 -2
- package/dist/core/schemas/builders/index.d.ts +1 -0
- package/dist/core/schemas/builders/index.js +1 -0
- package/dist/core/schemas/builders/lazy/lazy.d.ts +2 -2
- package/dist/core/schemas/builders/lazy/lazy.js +11 -23
- package/dist/core/schemas/builders/lazy/lazyObject.js +2 -12
- package/dist/core/schemas/builders/list/list.js +32 -46
- package/dist/core/schemas/builders/literals/booleanLiteral.js +1 -2
- package/dist/core/schemas/builders/literals/stringLiteral.js +1 -2
- package/dist/core/schemas/builders/object/object.d.ts +1 -1
- package/dist/core/schemas/builders/object/object.js +120 -114
- package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +3 -3
- package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.js +1 -2
- package/dist/core/schemas/builders/object/property.js +2 -3
- package/dist/core/schemas/builders/object/types.d.ts +18 -13
- package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +5 -15
- package/dist/core/schemas/builders/object-like/types.d.ts +1 -1
- package/dist/core/schemas/builders/record/record.js +50 -62
- package/dist/core/schemas/builders/record/types.d.ts +2 -2
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +21 -25
- package/dist/core/schemas/builders/schema-utils/stringifyValidationErrors.js +1 -2
- package/dist/core/schemas/builders/set/set.js +7 -17
- package/dist/core/schemas/builders/undiscriminated-union/types.d.ts +4 -4
- package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +22 -34
- package/dist/core/schemas/builders/union/discriminant.js +1 -2
- package/dist/core/schemas/builders/union/types.d.ts +6 -6
- package/dist/core/schemas/builders/union/union.d.ts +1 -1
- package/dist/core/schemas/builders/union/union.js +52 -64
- package/dist/core/schemas/utils/MaybePromise.d.ts +1 -1
- package/dist/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +3 -3
- package/dist/core/schemas/utils/createIdentitySchemaCreator.js +1 -2
- package/dist/core/schemas/utils/entries.d.ts +1 -1
- package/dist/core/schemas/utils/entries.js +1 -2
- package/dist/core/schemas/utils/filterObject.d.ts +1 -1
- package/dist/core/schemas/utils/filterObject.js +1 -2
- package/dist/core/schemas/utils/getErrorMessageForIncorrectType.js +5 -2
- package/dist/core/schemas/utils/isPlainObject.js +1 -2
- package/dist/core/schemas/utils/keys.d.ts +1 -1
- package/dist/core/schemas/utils/keys.js +1 -2
- package/dist/core/schemas/utils/maybeSkipValidation.js +4 -14
- package/dist/core/schemas/utils/partition.js +1 -2
- package/dist/environments.d.ts +1 -1
- package/dist/errors/ZepTimeoutError.d.ts +1 -1
- package/dist/errors/ZepTimeoutError.js +2 -2
- package/dist/extractor/base.js +1 -1
- package/dist/extractor/index.d.ts +2 -2
- package/dist/index.js +17 -7
- package/dist/serialization/resources/document/client/addDocuments.js +17 -7
- package/dist/serialization/resources/document/client/batchDeleteDocuments.js +17 -7
- package/dist/serialization/resources/document/client/batchGetDocuments.js +17 -7
- package/dist/serialization/resources/document/client/batchUpdateDocuments.js +17 -7
- package/dist/serialization/resources/document/client/index.js +17 -7
- package/dist/serialization/resources/document/client/listCollections.js +17 -7
- package/dist/serialization/resources/document/client/requests/CreateDocumentCollectionRequest.js +17 -7
- package/dist/serialization/resources/document/client/requests/DocumentSearchPayload.js +17 -7
- package/dist/serialization/resources/document/client/requests/GetDocumentListRequest.js +17 -7
- package/dist/serialization/resources/document/client/requests/UpdateDocumentCollectionRequest.js +17 -7
- package/dist/serialization/resources/document/client/requests/UpdateDocumentRequest.js +17 -7
- package/dist/serialization/resources/graph/client/requests/AddDataRequest.js +17 -7
- package/dist/serialization/resources/graph/client/requests/GraphSearchQuery.js +17 -7
- package/dist/serialization/resources/graph/resources/edge/client/getByGroupId.js +17 -7
- package/dist/serialization/resources/graph/resources/edge/client/getByUserId.js +17 -7
- package/dist/serialization/resources/graph/resources/edge/client/index.js +17 -7
- package/dist/serialization/resources/graph/resources/index.js +17 -7
- package/dist/serialization/resources/graph/resources/node/client/getByGroupId.js +17 -7
- package/dist/serialization/resources/graph/resources/node/client/getByUserId.js +17 -7
- package/dist/serialization/resources/graph/resources/node/client/index.js +17 -7
- package/dist/serialization/resources/group/client/requests/CreateGroupRequest.js +17 -7
- package/dist/serialization/resources/index.js +17 -7
- package/dist/serialization/resources/memory/client/extractData.js +17 -7
- package/dist/serialization/resources/memory/client/index.js +17 -7
- package/dist/serialization/resources/memory/client/requests/AddFactsRequest.js +17 -7
- package/dist/serialization/resources/memory/client/requests/AddMemoryRequest.js +17 -7
- package/dist/serialization/resources/memory/client/requests/CreateSessionRequest.js +17 -7
- package/dist/serialization/resources/memory/client/requests/EndSessionRequest.js +17 -7
- package/dist/serialization/resources/memory/client/requests/EndSessionsRequest.js +17 -7
- package/dist/serialization/resources/memory/client/requests/ExtractDataRequest.js +17 -7
- package/dist/serialization/resources/memory/client/requests/MemorySearchPayload.js +17 -7
- package/dist/serialization/resources/memory/client/requests/ModelsMessageMetadataUpdate.js +17 -7
- package/dist/serialization/resources/memory/client/requests/SessionSearchQuery.js +17 -7
- package/dist/serialization/resources/memory/client/requests/UpdateSessionRequest.js +17 -7
- package/dist/serialization/resources/memory/client/search.js +17 -7
- package/dist/serialization/resources/user/client/getSessions.js +17 -7
- package/dist/serialization/resources/user/client/index.js +17 -7
- package/dist/serialization/resources/user/client/requests/CreateUserRequest.js +17 -7
- package/dist/serialization/resources/user/client/requests/UpdateUserRequest.js +17 -7
- package/dist/serialization/types/AddMemoryResponse.js +17 -7
- package/dist/serialization/types/ApiError.js +17 -7
- package/dist/serialization/types/ApidataDocument.js +17 -7
- package/dist/serialization/types/ApidataDocumentCollection.js +17 -7
- package/dist/serialization/types/ApidataDocumentSearchResponse.js +17 -7
- package/dist/serialization/types/ApidataDocumentWithScore.js +17 -7
- package/dist/serialization/types/ApidataFactRatingExamples.js +17 -7
- package/dist/serialization/types/ApidataFactRatingInstruction.js +17 -7
- package/dist/serialization/types/ClassifySessionRequest.js +17 -7
- package/dist/serialization/types/CreateDocumentRequest.js +17 -7
- package/dist/serialization/types/EndSessionResponse.js +17 -7
- package/dist/serialization/types/EndSessionsResponse.js +17 -7
- package/dist/serialization/types/EntityEdge.js +17 -7
- package/dist/serialization/types/EntityNode.js +17 -7
- package/dist/serialization/types/Episode.js +17 -7
- package/dist/serialization/types/EpisodeResponse.js +17 -7
- package/dist/serialization/types/Fact.js +17 -7
- package/dist/serialization/types/FactRatingExamples.js +17 -7
- package/dist/serialization/types/FactRatingInstruction.js +17 -7
- package/dist/serialization/types/FactResponse.js +17 -7
- package/dist/serialization/types/FactsResponse.js +17 -7
- package/dist/serialization/types/GraphDataType.js +17 -7
- package/dist/serialization/types/GraphSearchResults.js +17 -7
- package/dist/serialization/types/GraphSearchScope.js +17 -7
- package/dist/serialization/types/Group.js +17 -7
- package/dist/serialization/types/Memory.js +17 -7
- package/dist/serialization/types/MemorySearchResult.js +17 -7
- package/dist/serialization/types/Message.js +17 -7
- package/dist/serialization/types/MessageListResponse.js +17 -7
- package/dist/serialization/types/NewFact.js +17 -7
- package/dist/serialization/types/Question.js +17 -7
- package/dist/serialization/types/Reranker.js +17 -7
- package/dist/serialization/types/RoleType.js +17 -7
- package/dist/serialization/types/SearchScope.js +17 -7
- package/dist/serialization/types/SearchType.js +17 -7
- package/dist/serialization/types/Session.js +17 -7
- package/dist/serialization/types/SessionClassification.js +17 -7
- package/dist/serialization/types/SessionListResponse.js +17 -7
- package/dist/serialization/types/SessionSearchResponse.js +17 -7
- package/dist/serialization/types/SessionSearchResult.js +17 -7
- package/dist/serialization/types/SuccessResponse.js +17 -7
- package/dist/serialization/types/Summary.js +17 -7
- package/dist/serialization/types/SummaryListResponse.js +17 -7
- package/dist/serialization/types/UpdateDocumentListRequest.js +17 -7
- package/dist/serialization/types/User.js +17 -7
- package/dist/serialization/types/UserListResponse.js +17 -7
- package/dist/version.d.ts +1 -0
- package/dist/version.js +4 -0
- package/environments.d.ts +1 -1
- package/errors/ZepTimeoutError.d.ts +1 -1
- package/errors/ZepTimeoutError.js +2 -2
- package/extractor/base.js +1 -1
- package/extractor/index.d.ts +2 -2
- package/index.js +17 -7
- package/{jest.config.js → jest.config.mjs} +4 -1
- package/package.json +25 -16
- package/reference.md +3801 -0
- package/scripts/rename-to-esm-files.js +115 -0
- package/serialization/resources/document/client/addDocuments.js +17 -7
- package/serialization/resources/document/client/batchDeleteDocuments.js +17 -7
- package/serialization/resources/document/client/batchGetDocuments.js +17 -7
- package/serialization/resources/document/client/batchUpdateDocuments.js +17 -7
- package/serialization/resources/document/client/index.js +17 -7
- package/serialization/resources/document/client/listCollections.js +17 -7
- package/serialization/resources/document/client/requests/CreateDocumentCollectionRequest.js +17 -7
- package/serialization/resources/document/client/requests/DocumentSearchPayload.js +17 -7
- package/serialization/resources/document/client/requests/GetDocumentListRequest.js +17 -7
- package/serialization/resources/document/client/requests/UpdateDocumentCollectionRequest.js +17 -7
- package/serialization/resources/document/client/requests/UpdateDocumentRequest.js +17 -7
- package/serialization/resources/graph/client/requests/AddDataRequest.js +17 -7
- package/serialization/resources/graph/client/requests/GraphSearchQuery.js +17 -7
- package/serialization/resources/graph/resources/edge/client/getByGroupId.js +17 -7
- package/serialization/resources/graph/resources/edge/client/getByUserId.js +17 -7
- package/serialization/resources/graph/resources/edge/client/index.js +17 -7
- package/serialization/resources/graph/resources/index.js +17 -7
- package/serialization/resources/graph/resources/node/client/getByGroupId.js +17 -7
- package/serialization/resources/graph/resources/node/client/getByUserId.js +17 -7
- package/serialization/resources/graph/resources/node/client/index.js +17 -7
- package/serialization/resources/group/client/requests/CreateGroupRequest.js +17 -7
- package/serialization/resources/index.js +17 -7
- package/serialization/resources/memory/client/extractData.js +17 -7
- package/serialization/resources/memory/client/index.js +17 -7
- package/serialization/resources/memory/client/requests/AddFactsRequest.js +17 -7
- package/serialization/resources/memory/client/requests/AddMemoryRequest.js +17 -7
- package/serialization/resources/memory/client/requests/CreateSessionRequest.js +17 -7
- package/serialization/resources/memory/client/requests/EndSessionRequest.js +17 -7
- package/serialization/resources/memory/client/requests/EndSessionsRequest.js +17 -7
- package/serialization/resources/memory/client/requests/ExtractDataRequest.js +17 -7
- package/serialization/resources/memory/client/requests/MemorySearchPayload.js +17 -7
- package/serialization/resources/memory/client/requests/ModelsMessageMetadataUpdate.js +17 -7
- package/serialization/resources/memory/client/requests/SessionSearchQuery.js +17 -7
- package/serialization/resources/memory/client/requests/UpdateSessionRequest.js +17 -7
- package/serialization/resources/memory/client/search.js +17 -7
- package/serialization/resources/user/client/getSessions.js +17 -7
- package/serialization/resources/user/client/index.js +17 -7
- package/serialization/resources/user/client/requests/CreateUserRequest.js +17 -7
- package/serialization/resources/user/client/requests/UpdateUserRequest.js +17 -7
- package/serialization/types/AddMemoryResponse.js +17 -7
- package/serialization/types/ApiError.js +17 -7
- package/serialization/types/ApidataDocument.js +17 -7
- package/serialization/types/ApidataDocumentCollection.js +17 -7
- package/serialization/types/ApidataDocumentSearchResponse.js +17 -7
- package/serialization/types/ApidataDocumentWithScore.js +17 -7
- package/serialization/types/ApidataFactRatingExamples.js +17 -7
- package/serialization/types/ApidataFactRatingInstruction.js +17 -7
- package/serialization/types/ClassifySessionRequest.js +17 -7
- package/serialization/types/CreateDocumentRequest.js +17 -7
- package/serialization/types/EndSessionResponse.js +17 -7
- package/serialization/types/EndSessionsResponse.js +17 -7
- package/serialization/types/EntityEdge.js +17 -7
- package/serialization/types/EntityNode.js +17 -7
- package/serialization/types/Episode.js +17 -7
- package/serialization/types/EpisodeResponse.js +17 -7
- package/serialization/types/Fact.js +17 -7
- package/serialization/types/FactRatingExamples.js +17 -7
- package/serialization/types/FactRatingInstruction.js +17 -7
- package/serialization/types/FactResponse.js +17 -7
- package/serialization/types/FactsResponse.js +17 -7
- package/serialization/types/GraphDataType.js +17 -7
- package/serialization/types/GraphSearchResults.js +17 -7
- package/serialization/types/GraphSearchScope.js +17 -7
- package/serialization/types/Group.js +17 -7
- package/serialization/types/Memory.js +17 -7
- package/serialization/types/MemorySearchResult.js +17 -7
- package/serialization/types/Message.js +17 -7
- package/serialization/types/MessageListResponse.js +17 -7
- package/serialization/types/NewFact.js +17 -7
- package/serialization/types/Question.js +17 -7
- package/serialization/types/Reranker.js +17 -7
- package/serialization/types/RoleType.js +17 -7
- package/serialization/types/SearchScope.js +17 -7
- package/serialization/types/SearchType.js +17 -7
- package/serialization/types/Session.js +17 -7
- package/serialization/types/SessionClassification.js +17 -7
- package/serialization/types/SessionListResponse.js +17 -7
- package/serialization/types/SessionSearchResponse.js +17 -7
- package/serialization/types/SessionSearchResult.js +17 -7
- package/serialization/types/SuccessResponse.js +17 -7
- package/serialization/types/Summary.js +17 -7
- package/serialization/types/SummaryListResponse.js +17 -7
- package/serialization/types/UpdateDocumentListRequest.js +17 -7
- package/serialization/types/User.js +17 -7
- package/serialization/types/UserListResponse.js +17 -7
- package/version.d.ts +1 -0
- package/version.js +4 -0
|
@@ -18,13 +18,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
18
18
|
}) : function(o, v) {
|
|
19
19
|
o["default"] = v;
|
|
20
20
|
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
28
38
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
39
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
40
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -70,22 +80,23 @@ class Memory {
|
|
|
70
80
|
* @throws {@link Zep.InternalServerError}
|
|
71
81
|
*
|
|
72
82
|
* @example
|
|
73
|
-
* await
|
|
83
|
+
* await client.memory.getFact("factUUID")
|
|
74
84
|
*/
|
|
75
85
|
getFact(factUuid, requestOptions) {
|
|
76
|
-
var _a, _b;
|
|
77
86
|
return __awaiter(this, void 0, void 0, function* () {
|
|
87
|
+
var _a, _b;
|
|
78
88
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
79
89
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `facts/${encodeURIComponent(factUuid)}`),
|
|
80
90
|
method: "GET",
|
|
81
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
91
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
82
92
|
contentType: "application/json",
|
|
93
|
+
requestType: "json",
|
|
83
94
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
84
95
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
85
96
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
86
97
|
});
|
|
87
98
|
if (_response.ok) {
|
|
88
|
-
return
|
|
99
|
+
return serializers.FactResponse.parseOrThrow(_response.body, {
|
|
89
100
|
unrecognizedObjectKeys: "passthrough",
|
|
90
101
|
allowUnrecognizedUnionMembers: true,
|
|
91
102
|
allowUnrecognizedEnumValues: true,
|
|
@@ -96,7 +107,7 @@ class Memory {
|
|
|
96
107
|
if (_response.error.reason === "status-code") {
|
|
97
108
|
switch (_response.error.statusCode) {
|
|
98
109
|
case 404:
|
|
99
|
-
throw new Zep.NotFoundError(
|
|
110
|
+
throw new Zep.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
100
111
|
unrecognizedObjectKeys: "passthrough",
|
|
101
112
|
allowUnrecognizedUnionMembers: true,
|
|
102
113
|
allowUnrecognizedEnumValues: true,
|
|
@@ -104,7 +115,7 @@ class Memory {
|
|
|
104
115
|
breadcrumbsPrefix: ["response"],
|
|
105
116
|
}));
|
|
106
117
|
case 500:
|
|
107
|
-
throw new Zep.InternalServerError(
|
|
118
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
108
119
|
unrecognizedObjectKeys: "passthrough",
|
|
109
120
|
allowUnrecognizedUnionMembers: true,
|
|
110
121
|
allowUnrecognizedEnumValues: true,
|
|
@@ -125,7 +136,7 @@ class Memory {
|
|
|
125
136
|
body: _response.error.rawBody,
|
|
126
137
|
});
|
|
127
138
|
case "timeout":
|
|
128
|
-
throw new errors.ZepTimeoutError();
|
|
139
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /facts/{factUUID}.");
|
|
129
140
|
case "unknown":
|
|
130
141
|
throw new errors.ZepError({
|
|
131
142
|
message: _response.error.errorMessage,
|
|
@@ -143,22 +154,23 @@ class Memory {
|
|
|
143
154
|
* @throws {@link Zep.InternalServerError}
|
|
144
155
|
*
|
|
145
156
|
* @example
|
|
146
|
-
* await
|
|
157
|
+
* await client.memory.deleteFact("factUUID")
|
|
147
158
|
*/
|
|
148
159
|
deleteFact(factUuid, requestOptions) {
|
|
149
|
-
var _a, _b;
|
|
150
160
|
return __awaiter(this, void 0, void 0, function* () {
|
|
161
|
+
var _a, _b;
|
|
151
162
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
152
163
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `facts/${encodeURIComponent(factUuid)}`),
|
|
153
164
|
method: "DELETE",
|
|
154
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
165
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
155
166
|
contentType: "application/json",
|
|
167
|
+
requestType: "json",
|
|
156
168
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
157
169
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
158
170
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
159
171
|
});
|
|
160
172
|
if (_response.ok) {
|
|
161
|
-
return
|
|
173
|
+
return serializers.SuccessResponse.parseOrThrow(_response.body, {
|
|
162
174
|
unrecognizedObjectKeys: "passthrough",
|
|
163
175
|
allowUnrecognizedUnionMembers: true,
|
|
164
176
|
allowUnrecognizedEnumValues: true,
|
|
@@ -169,7 +181,7 @@ class Memory {
|
|
|
169
181
|
if (_response.error.reason === "status-code") {
|
|
170
182
|
switch (_response.error.statusCode) {
|
|
171
183
|
case 404:
|
|
172
|
-
throw new Zep.NotFoundError(
|
|
184
|
+
throw new Zep.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
173
185
|
unrecognizedObjectKeys: "passthrough",
|
|
174
186
|
allowUnrecognizedUnionMembers: true,
|
|
175
187
|
allowUnrecognizedEnumValues: true,
|
|
@@ -177,7 +189,7 @@ class Memory {
|
|
|
177
189
|
breadcrumbsPrefix: ["response"],
|
|
178
190
|
}));
|
|
179
191
|
case 500:
|
|
180
|
-
throw new Zep.InternalServerError(
|
|
192
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
181
193
|
unrecognizedObjectKeys: "passthrough",
|
|
182
194
|
allowUnrecognizedUnionMembers: true,
|
|
183
195
|
allowUnrecognizedEnumValues: true,
|
|
@@ -198,7 +210,7 @@ class Memory {
|
|
|
198
210
|
body: _response.error.rawBody,
|
|
199
211
|
});
|
|
200
212
|
case "timeout":
|
|
201
|
-
throw new errors.ZepTimeoutError();
|
|
213
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling DELETE /facts/{factUUID}.");
|
|
202
214
|
case "unknown":
|
|
203
215
|
throw new errors.ZepError({
|
|
204
216
|
message: _response.error.errorMessage,
|
|
@@ -216,26 +228,27 @@ class Memory {
|
|
|
216
228
|
* @throws {@link Zep.InternalServerError}
|
|
217
229
|
*
|
|
218
230
|
* @example
|
|
219
|
-
* await
|
|
231
|
+
* await client.memory.addSession({
|
|
220
232
|
* sessionId: "session_id",
|
|
221
233
|
* userId: "user_id"
|
|
222
234
|
* })
|
|
223
235
|
*/
|
|
224
236
|
addSession(request, requestOptions) {
|
|
225
|
-
var _a, _b;
|
|
226
237
|
return __awaiter(this, void 0, void 0, function* () {
|
|
238
|
+
var _a, _b;
|
|
227
239
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
228
240
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, "sessions"),
|
|
229
241
|
method: "POST",
|
|
230
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
242
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
231
243
|
contentType: "application/json",
|
|
232
|
-
|
|
244
|
+
requestType: "json",
|
|
245
|
+
body: serializers.CreateSessionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
233
246
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
234
247
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
235
248
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
236
249
|
});
|
|
237
250
|
if (_response.ok) {
|
|
238
|
-
return
|
|
251
|
+
return serializers.Session.parseOrThrow(_response.body, {
|
|
239
252
|
unrecognizedObjectKeys: "passthrough",
|
|
240
253
|
allowUnrecognizedUnionMembers: true,
|
|
241
254
|
allowUnrecognizedEnumValues: true,
|
|
@@ -246,7 +259,7 @@ class Memory {
|
|
|
246
259
|
if (_response.error.reason === "status-code") {
|
|
247
260
|
switch (_response.error.statusCode) {
|
|
248
261
|
case 400:
|
|
249
|
-
throw new Zep.BadRequestError(
|
|
262
|
+
throw new Zep.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
250
263
|
unrecognizedObjectKeys: "passthrough",
|
|
251
264
|
allowUnrecognizedUnionMembers: true,
|
|
252
265
|
allowUnrecognizedEnumValues: true,
|
|
@@ -254,7 +267,7 @@ class Memory {
|
|
|
254
267
|
breadcrumbsPrefix: ["response"],
|
|
255
268
|
}));
|
|
256
269
|
case 500:
|
|
257
|
-
throw new Zep.InternalServerError(
|
|
270
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
258
271
|
unrecognizedObjectKeys: "passthrough",
|
|
259
272
|
allowUnrecognizedUnionMembers: true,
|
|
260
273
|
allowUnrecognizedEnumValues: true,
|
|
@@ -275,7 +288,7 @@ class Memory {
|
|
|
275
288
|
body: _response.error.rawBody,
|
|
276
289
|
});
|
|
277
290
|
case "timeout":
|
|
278
|
-
throw new errors.ZepTimeoutError();
|
|
291
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling POST /sessions.");
|
|
279
292
|
case "unknown":
|
|
280
293
|
throw new errors.ZepError({
|
|
281
294
|
message: _response.error.errorMessage,
|
|
@@ -293,11 +306,11 @@ class Memory {
|
|
|
293
306
|
* @throws {@link Zep.InternalServerError}
|
|
294
307
|
*
|
|
295
308
|
* @example
|
|
296
|
-
* await
|
|
309
|
+
* await client.memory.listSessions()
|
|
297
310
|
*/
|
|
298
|
-
listSessions(
|
|
299
|
-
|
|
300
|
-
|
|
311
|
+
listSessions() {
|
|
312
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
313
|
+
var _a, _b;
|
|
301
314
|
const { pageNumber, pageSize, orderBy, asc } = request;
|
|
302
315
|
const _queryParams = {};
|
|
303
316
|
if (pageNumber != null) {
|
|
@@ -315,15 +328,16 @@ class Memory {
|
|
|
315
328
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
316
329
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, "sessions-ordered"),
|
|
317
330
|
method: "GET",
|
|
318
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
331
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
319
332
|
contentType: "application/json",
|
|
320
333
|
queryParameters: _queryParams,
|
|
334
|
+
requestType: "json",
|
|
321
335
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
322
336
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
323
337
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
324
338
|
});
|
|
325
339
|
if (_response.ok) {
|
|
326
|
-
return
|
|
340
|
+
return serializers.SessionListResponse.parseOrThrow(_response.body, {
|
|
327
341
|
unrecognizedObjectKeys: "passthrough",
|
|
328
342
|
allowUnrecognizedUnionMembers: true,
|
|
329
343
|
allowUnrecognizedEnumValues: true,
|
|
@@ -334,7 +348,7 @@ class Memory {
|
|
|
334
348
|
if (_response.error.reason === "status-code") {
|
|
335
349
|
switch (_response.error.statusCode) {
|
|
336
350
|
case 400:
|
|
337
|
-
throw new Zep.BadRequestError(
|
|
351
|
+
throw new Zep.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
338
352
|
unrecognizedObjectKeys: "passthrough",
|
|
339
353
|
allowUnrecognizedUnionMembers: true,
|
|
340
354
|
allowUnrecognizedEnumValues: true,
|
|
@@ -342,7 +356,7 @@ class Memory {
|
|
|
342
356
|
breadcrumbsPrefix: ["response"],
|
|
343
357
|
}));
|
|
344
358
|
case 500:
|
|
345
|
-
throw new Zep.InternalServerError(
|
|
359
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
346
360
|
unrecognizedObjectKeys: "passthrough",
|
|
347
361
|
allowUnrecognizedUnionMembers: true,
|
|
348
362
|
allowUnrecognizedEnumValues: true,
|
|
@@ -363,7 +377,7 @@ class Memory {
|
|
|
363
377
|
body: _response.error.rawBody,
|
|
364
378
|
});
|
|
365
379
|
case "timeout":
|
|
366
|
-
throw new errors.ZepTimeoutError();
|
|
380
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /sessions-ordered.");
|
|
367
381
|
case "unknown":
|
|
368
382
|
throw new errors.ZepError({
|
|
369
383
|
message: _response.error.errorMessage,
|
|
@@ -382,25 +396,26 @@ class Memory {
|
|
|
382
396
|
* @throws {@link Zep.InternalServerError}
|
|
383
397
|
*
|
|
384
398
|
* @example
|
|
385
|
-
* await
|
|
399
|
+
* await client.memory.endSessions({
|
|
386
400
|
* sessionIds: ["session_ids"]
|
|
387
401
|
* })
|
|
388
402
|
*/
|
|
389
403
|
endSessions(request, requestOptions) {
|
|
390
|
-
var _a, _b;
|
|
391
404
|
return __awaiter(this, void 0, void 0, function* () {
|
|
405
|
+
var _a, _b;
|
|
392
406
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
393
407
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, "sessions/end"),
|
|
394
408
|
method: "POST",
|
|
395
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
409
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
396
410
|
contentType: "application/json",
|
|
397
|
-
|
|
411
|
+
requestType: "json",
|
|
412
|
+
body: serializers.EndSessionsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
398
413
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
399
414
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
400
415
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
401
416
|
});
|
|
402
417
|
if (_response.ok) {
|
|
403
|
-
return
|
|
418
|
+
return serializers.EndSessionsResponse.parseOrThrow(_response.body, {
|
|
404
419
|
unrecognizedObjectKeys: "passthrough",
|
|
405
420
|
allowUnrecognizedUnionMembers: true,
|
|
406
421
|
allowUnrecognizedEnumValues: true,
|
|
@@ -411,7 +426,7 @@ class Memory {
|
|
|
411
426
|
if (_response.error.reason === "status-code") {
|
|
412
427
|
switch (_response.error.statusCode) {
|
|
413
428
|
case 400:
|
|
414
|
-
throw new Zep.BadRequestError(
|
|
429
|
+
throw new Zep.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
415
430
|
unrecognizedObjectKeys: "passthrough",
|
|
416
431
|
allowUnrecognizedUnionMembers: true,
|
|
417
432
|
allowUnrecognizedEnumValues: true,
|
|
@@ -419,7 +434,7 @@ class Memory {
|
|
|
419
434
|
breadcrumbsPrefix: ["response"],
|
|
420
435
|
}));
|
|
421
436
|
case 404:
|
|
422
|
-
throw new Zep.NotFoundError(
|
|
437
|
+
throw new Zep.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
423
438
|
unrecognizedObjectKeys: "passthrough",
|
|
424
439
|
allowUnrecognizedUnionMembers: true,
|
|
425
440
|
allowUnrecognizedEnumValues: true,
|
|
@@ -427,7 +442,7 @@ class Memory {
|
|
|
427
442
|
breadcrumbsPrefix: ["response"],
|
|
428
443
|
}));
|
|
429
444
|
case 500:
|
|
430
|
-
throw new Zep.InternalServerError(
|
|
445
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
431
446
|
unrecognizedObjectKeys: "passthrough",
|
|
432
447
|
allowUnrecognizedUnionMembers: true,
|
|
433
448
|
allowUnrecognizedEnumValues: true,
|
|
@@ -448,7 +463,7 @@ class Memory {
|
|
|
448
463
|
body: _response.error.rawBody,
|
|
449
464
|
});
|
|
450
465
|
case "timeout":
|
|
451
|
-
throw new errors.ZepTimeoutError();
|
|
466
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling POST /sessions/end.");
|
|
452
467
|
case "unknown":
|
|
453
468
|
throw new errors.ZepError({
|
|
454
469
|
message: _response.error.errorMessage,
|
|
@@ -465,13 +480,13 @@ class Memory {
|
|
|
465
480
|
* @throws {@link Zep.InternalServerError}
|
|
466
481
|
*
|
|
467
482
|
* @example
|
|
468
|
-
* await
|
|
483
|
+
* await client.memory.searchSessions({
|
|
469
484
|
* text: "text"
|
|
470
485
|
* })
|
|
471
486
|
*/
|
|
472
487
|
searchSessions(request, requestOptions) {
|
|
473
|
-
var _a, _b;
|
|
474
488
|
return __awaiter(this, void 0, void 0, function* () {
|
|
489
|
+
var _a, _b;
|
|
475
490
|
const { limit } = request, _body = __rest(request, ["limit"]);
|
|
476
491
|
const _queryParams = {};
|
|
477
492
|
if (limit != null) {
|
|
@@ -480,16 +495,17 @@ class Memory {
|
|
|
480
495
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
481
496
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, "sessions/search"),
|
|
482
497
|
method: "POST",
|
|
483
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
498
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
484
499
|
contentType: "application/json",
|
|
485
500
|
queryParameters: _queryParams,
|
|
486
|
-
|
|
501
|
+
requestType: "json",
|
|
502
|
+
body: serializers.SessionSearchQuery.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
487
503
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
488
504
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
489
505
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
490
506
|
});
|
|
491
507
|
if (_response.ok) {
|
|
492
|
-
return
|
|
508
|
+
return serializers.SessionSearchResponse.parseOrThrow(_response.body, {
|
|
493
509
|
unrecognizedObjectKeys: "passthrough",
|
|
494
510
|
allowUnrecognizedUnionMembers: true,
|
|
495
511
|
allowUnrecognizedEnumValues: true,
|
|
@@ -500,7 +516,7 @@ class Memory {
|
|
|
500
516
|
if (_response.error.reason === "status-code") {
|
|
501
517
|
switch (_response.error.statusCode) {
|
|
502
518
|
case 500:
|
|
503
|
-
throw new Zep.InternalServerError(
|
|
519
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
504
520
|
unrecognizedObjectKeys: "passthrough",
|
|
505
521
|
allowUnrecognizedUnionMembers: true,
|
|
506
522
|
allowUnrecognizedEnumValues: true,
|
|
@@ -521,7 +537,7 @@ class Memory {
|
|
|
521
537
|
body: _response.error.rawBody,
|
|
522
538
|
});
|
|
523
539
|
case "timeout":
|
|
524
|
-
throw new errors.ZepTimeoutError();
|
|
540
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling POST /sessions/search.");
|
|
525
541
|
case "unknown":
|
|
526
542
|
throw new errors.ZepError({
|
|
527
543
|
message: _response.error.errorMessage,
|
|
@@ -539,22 +555,23 @@ class Memory {
|
|
|
539
555
|
* @throws {@link Zep.InternalServerError}
|
|
540
556
|
*
|
|
541
557
|
* @example
|
|
542
|
-
* await
|
|
558
|
+
* await client.memory.getSession("sessionId")
|
|
543
559
|
*/
|
|
544
560
|
getSession(sessionId, requestOptions) {
|
|
545
|
-
var _a, _b;
|
|
546
561
|
return __awaiter(this, void 0, void 0, function* () {
|
|
562
|
+
var _a, _b;
|
|
547
563
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
548
564
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}`),
|
|
549
565
|
method: "GET",
|
|
550
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
566
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
551
567
|
contentType: "application/json",
|
|
568
|
+
requestType: "json",
|
|
552
569
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
553
570
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
554
571
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
555
572
|
});
|
|
556
573
|
if (_response.ok) {
|
|
557
|
-
return
|
|
574
|
+
return serializers.Session.parseOrThrow(_response.body, {
|
|
558
575
|
unrecognizedObjectKeys: "passthrough",
|
|
559
576
|
allowUnrecognizedUnionMembers: true,
|
|
560
577
|
allowUnrecognizedEnumValues: true,
|
|
@@ -565,7 +582,7 @@ class Memory {
|
|
|
565
582
|
if (_response.error.reason === "status-code") {
|
|
566
583
|
switch (_response.error.statusCode) {
|
|
567
584
|
case 404:
|
|
568
|
-
throw new Zep.NotFoundError(
|
|
585
|
+
throw new Zep.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
569
586
|
unrecognizedObjectKeys: "passthrough",
|
|
570
587
|
allowUnrecognizedUnionMembers: true,
|
|
571
588
|
allowUnrecognizedEnumValues: true,
|
|
@@ -573,7 +590,7 @@ class Memory {
|
|
|
573
590
|
breadcrumbsPrefix: ["response"],
|
|
574
591
|
}));
|
|
575
592
|
case 500:
|
|
576
|
-
throw new Zep.InternalServerError(
|
|
593
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
577
594
|
unrecognizedObjectKeys: "passthrough",
|
|
578
595
|
allowUnrecognizedUnionMembers: true,
|
|
579
596
|
allowUnrecognizedEnumValues: true,
|
|
@@ -594,7 +611,7 @@ class Memory {
|
|
|
594
611
|
body: _response.error.rawBody,
|
|
595
612
|
});
|
|
596
613
|
case "timeout":
|
|
597
|
-
throw new errors.ZepTimeoutError();
|
|
614
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /sessions/{sessionId}.");
|
|
598
615
|
case "unknown":
|
|
599
616
|
throw new errors.ZepError({
|
|
600
617
|
message: _response.error.errorMessage,
|
|
@@ -615,27 +632,28 @@ class Memory {
|
|
|
615
632
|
* @throws {@link Zep.InternalServerError}
|
|
616
633
|
*
|
|
617
634
|
* @example
|
|
618
|
-
* await
|
|
635
|
+
* await client.memory.updateSession("sessionId", {
|
|
619
636
|
* metadata: {
|
|
620
637
|
* "key": "value"
|
|
621
638
|
* }
|
|
622
639
|
* })
|
|
623
640
|
*/
|
|
624
641
|
updateSession(sessionId, request, requestOptions) {
|
|
625
|
-
var _a, _b;
|
|
626
642
|
return __awaiter(this, void 0, void 0, function* () {
|
|
643
|
+
var _a, _b;
|
|
627
644
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
628
645
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}`),
|
|
629
646
|
method: "PATCH",
|
|
630
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
647
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
631
648
|
contentType: "application/json",
|
|
632
|
-
|
|
649
|
+
requestType: "json",
|
|
650
|
+
body: serializers.UpdateSessionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
633
651
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
634
652
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
635
653
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
636
654
|
});
|
|
637
655
|
if (_response.ok) {
|
|
638
|
-
return
|
|
656
|
+
return serializers.Session.parseOrThrow(_response.body, {
|
|
639
657
|
unrecognizedObjectKeys: "passthrough",
|
|
640
658
|
allowUnrecognizedUnionMembers: true,
|
|
641
659
|
allowUnrecognizedEnumValues: true,
|
|
@@ -646,7 +664,7 @@ class Memory {
|
|
|
646
664
|
if (_response.error.reason === "status-code") {
|
|
647
665
|
switch (_response.error.statusCode) {
|
|
648
666
|
case 400:
|
|
649
|
-
throw new Zep.BadRequestError(
|
|
667
|
+
throw new Zep.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
650
668
|
unrecognizedObjectKeys: "passthrough",
|
|
651
669
|
allowUnrecognizedUnionMembers: true,
|
|
652
670
|
allowUnrecognizedEnumValues: true,
|
|
@@ -654,7 +672,7 @@ class Memory {
|
|
|
654
672
|
breadcrumbsPrefix: ["response"],
|
|
655
673
|
}));
|
|
656
674
|
case 404:
|
|
657
|
-
throw new Zep.NotFoundError(
|
|
675
|
+
throw new Zep.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
658
676
|
unrecognizedObjectKeys: "passthrough",
|
|
659
677
|
allowUnrecognizedUnionMembers: true,
|
|
660
678
|
allowUnrecognizedEnumValues: true,
|
|
@@ -662,7 +680,7 @@ class Memory {
|
|
|
662
680
|
breadcrumbsPrefix: ["response"],
|
|
663
681
|
}));
|
|
664
682
|
case 409:
|
|
665
|
-
throw new Zep.ConflictError(
|
|
683
|
+
throw new Zep.ConflictError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
666
684
|
unrecognizedObjectKeys: "passthrough",
|
|
667
685
|
allowUnrecognizedUnionMembers: true,
|
|
668
686
|
allowUnrecognizedEnumValues: true,
|
|
@@ -670,7 +688,7 @@ class Memory {
|
|
|
670
688
|
breadcrumbsPrefix: ["response"],
|
|
671
689
|
}));
|
|
672
690
|
case 500:
|
|
673
|
-
throw new Zep.InternalServerError(
|
|
691
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
674
692
|
unrecognizedObjectKeys: "passthrough",
|
|
675
693
|
allowUnrecognizedUnionMembers: true,
|
|
676
694
|
allowUnrecognizedEnumValues: true,
|
|
@@ -691,7 +709,7 @@ class Memory {
|
|
|
691
709
|
body: _response.error.rawBody,
|
|
692
710
|
});
|
|
693
711
|
case "timeout":
|
|
694
|
-
throw new errors.ZepTimeoutError();
|
|
712
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling PATCH /sessions/{sessionId}.");
|
|
695
713
|
case "unknown":
|
|
696
714
|
throw new errors.ZepError({
|
|
697
715
|
message: _response.error.errorMessage,
|
|
@@ -710,26 +728,27 @@ class Memory {
|
|
|
710
728
|
* @throws {@link Zep.InternalServerError}
|
|
711
729
|
*
|
|
712
730
|
* @example
|
|
713
|
-
* await
|
|
731
|
+
* await client.memory.classifySession("sessionId", {
|
|
714
732
|
* classes: ["classes"],
|
|
715
733
|
* name: "name"
|
|
716
734
|
* })
|
|
717
735
|
*/
|
|
718
736
|
classifySession(sessionId, request, requestOptions) {
|
|
719
|
-
var _a, _b;
|
|
720
737
|
return __awaiter(this, void 0, void 0, function* () {
|
|
738
|
+
var _a, _b;
|
|
721
739
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
722
740
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/classify`),
|
|
723
741
|
method: "POST",
|
|
724
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
742
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
725
743
|
contentType: "application/json",
|
|
726
|
-
|
|
744
|
+
requestType: "json",
|
|
745
|
+
body: serializers.ClassifySessionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
727
746
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
728
747
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
729
748
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
730
749
|
});
|
|
731
750
|
if (_response.ok) {
|
|
732
|
-
return
|
|
751
|
+
return serializers.SessionClassification.parseOrThrow(_response.body, {
|
|
733
752
|
unrecognizedObjectKeys: "passthrough",
|
|
734
753
|
allowUnrecognizedUnionMembers: true,
|
|
735
754
|
allowUnrecognizedEnumValues: true,
|
|
@@ -740,7 +759,7 @@ class Memory {
|
|
|
740
759
|
if (_response.error.reason === "status-code") {
|
|
741
760
|
switch (_response.error.statusCode) {
|
|
742
761
|
case 404:
|
|
743
|
-
throw new Zep.NotFoundError(
|
|
762
|
+
throw new Zep.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
744
763
|
unrecognizedObjectKeys: "passthrough",
|
|
745
764
|
allowUnrecognizedUnionMembers: true,
|
|
746
765
|
allowUnrecognizedEnumValues: true,
|
|
@@ -748,7 +767,7 @@ class Memory {
|
|
|
748
767
|
breadcrumbsPrefix: ["response"],
|
|
749
768
|
}));
|
|
750
769
|
case 500:
|
|
751
|
-
throw new Zep.InternalServerError(
|
|
770
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
752
771
|
unrecognizedObjectKeys: "passthrough",
|
|
753
772
|
allowUnrecognizedUnionMembers: true,
|
|
754
773
|
allowUnrecognizedEnumValues: true,
|
|
@@ -769,7 +788,7 @@ class Memory {
|
|
|
769
788
|
body: _response.error.rawBody,
|
|
770
789
|
});
|
|
771
790
|
case "timeout":
|
|
772
|
-
throw new errors.ZepTimeoutError();
|
|
791
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling POST /sessions/{sessionId}/classify.");
|
|
773
792
|
case "unknown":
|
|
774
793
|
throw new errors.ZepError({
|
|
775
794
|
message: _response.error.errorMessage,
|
|
@@ -789,23 +808,24 @@ class Memory {
|
|
|
789
808
|
* @throws {@link Zep.InternalServerError}
|
|
790
809
|
*
|
|
791
810
|
* @example
|
|
792
|
-
* await
|
|
811
|
+
* await client.memory.endSession("sessionId")
|
|
793
812
|
*/
|
|
794
|
-
endSession(
|
|
795
|
-
|
|
796
|
-
|
|
813
|
+
endSession(sessionId_1) {
|
|
814
|
+
return __awaiter(this, arguments, void 0, function* (sessionId, request = {}, requestOptions) {
|
|
815
|
+
var _a, _b;
|
|
797
816
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
798
817
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/end`),
|
|
799
818
|
method: "POST",
|
|
800
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
819
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
801
820
|
contentType: "application/json",
|
|
802
|
-
|
|
821
|
+
requestType: "json",
|
|
822
|
+
body: serializers.EndSessionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
803
823
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
804
824
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
805
825
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
806
826
|
});
|
|
807
827
|
if (_response.ok) {
|
|
808
|
-
return
|
|
828
|
+
return serializers.EndSessionResponse.parseOrThrow(_response.body, {
|
|
809
829
|
unrecognizedObjectKeys: "passthrough",
|
|
810
830
|
allowUnrecognizedUnionMembers: true,
|
|
811
831
|
allowUnrecognizedEnumValues: true,
|
|
@@ -816,7 +836,7 @@ class Memory {
|
|
|
816
836
|
if (_response.error.reason === "status-code") {
|
|
817
837
|
switch (_response.error.statusCode) {
|
|
818
838
|
case 400:
|
|
819
|
-
throw new Zep.BadRequestError(
|
|
839
|
+
throw new Zep.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
820
840
|
unrecognizedObjectKeys: "passthrough",
|
|
821
841
|
allowUnrecognizedUnionMembers: true,
|
|
822
842
|
allowUnrecognizedEnumValues: true,
|
|
@@ -824,7 +844,7 @@ class Memory {
|
|
|
824
844
|
breadcrumbsPrefix: ["response"],
|
|
825
845
|
}));
|
|
826
846
|
case 404:
|
|
827
|
-
throw new Zep.NotFoundError(
|
|
847
|
+
throw new Zep.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
828
848
|
unrecognizedObjectKeys: "passthrough",
|
|
829
849
|
allowUnrecognizedUnionMembers: true,
|
|
830
850
|
allowUnrecognizedEnumValues: true,
|
|
@@ -832,7 +852,7 @@ class Memory {
|
|
|
832
852
|
breadcrumbsPrefix: ["response"],
|
|
833
853
|
}));
|
|
834
854
|
case 500:
|
|
835
|
-
throw new Zep.InternalServerError(
|
|
855
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
836
856
|
unrecognizedObjectKeys: "passthrough",
|
|
837
857
|
allowUnrecognizedUnionMembers: true,
|
|
838
858
|
allowUnrecognizedEnumValues: true,
|
|
@@ -853,7 +873,7 @@ class Memory {
|
|
|
853
873
|
body: _response.error.rawBody,
|
|
854
874
|
});
|
|
855
875
|
case "timeout":
|
|
856
|
-
throw new errors.ZepTimeoutError();
|
|
876
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling POST /sessions/{sessionId}/end.");
|
|
857
877
|
case "unknown":
|
|
858
878
|
throw new errors.ZepError({
|
|
859
879
|
message: _response.error.errorMessage,
|
|
@@ -873,26 +893,27 @@ class Memory {
|
|
|
873
893
|
* @throws {@link Zep.InternalServerError}
|
|
874
894
|
*
|
|
875
895
|
* @example
|
|
876
|
-
* await
|
|
896
|
+
* await client.memory.extractData("sessionId", {
|
|
877
897
|
* lastN: 1,
|
|
878
898
|
* modelSchema: "model_schema"
|
|
879
899
|
* })
|
|
880
900
|
*/
|
|
881
901
|
extractData(sessionId, request, requestOptions) {
|
|
882
|
-
var _a, _b;
|
|
883
902
|
return __awaiter(this, void 0, void 0, function* () {
|
|
903
|
+
var _a, _b;
|
|
884
904
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
885
905
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/extract`),
|
|
886
906
|
method: "POST",
|
|
887
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
907
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
888
908
|
contentType: "application/json",
|
|
889
|
-
|
|
909
|
+
requestType: "json",
|
|
910
|
+
body: serializers.ExtractDataRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
890
911
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
891
912
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
892
913
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
893
914
|
});
|
|
894
915
|
if (_response.ok) {
|
|
895
|
-
return
|
|
916
|
+
return serializers.memory.extractData.Response.parseOrThrow(_response.body, {
|
|
896
917
|
unrecognizedObjectKeys: "passthrough",
|
|
897
918
|
allowUnrecognizedUnionMembers: true,
|
|
898
919
|
allowUnrecognizedEnumValues: true,
|
|
@@ -903,7 +924,7 @@ class Memory {
|
|
|
903
924
|
if (_response.error.reason === "status-code") {
|
|
904
925
|
switch (_response.error.statusCode) {
|
|
905
926
|
case 400:
|
|
906
|
-
throw new Zep.BadRequestError(
|
|
927
|
+
throw new Zep.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
907
928
|
unrecognizedObjectKeys: "passthrough",
|
|
908
929
|
allowUnrecognizedUnionMembers: true,
|
|
909
930
|
allowUnrecognizedEnumValues: true,
|
|
@@ -911,7 +932,7 @@ class Memory {
|
|
|
911
932
|
breadcrumbsPrefix: ["response"],
|
|
912
933
|
}));
|
|
913
934
|
case 404:
|
|
914
|
-
throw new Zep.NotFoundError(
|
|
935
|
+
throw new Zep.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
915
936
|
unrecognizedObjectKeys: "passthrough",
|
|
916
937
|
allowUnrecognizedUnionMembers: true,
|
|
917
938
|
allowUnrecognizedEnumValues: true,
|
|
@@ -919,7 +940,7 @@ class Memory {
|
|
|
919
940
|
breadcrumbsPrefix: ["response"],
|
|
920
941
|
}));
|
|
921
942
|
case 500:
|
|
922
|
-
throw new Zep.InternalServerError(
|
|
943
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
923
944
|
unrecognizedObjectKeys: "passthrough",
|
|
924
945
|
allowUnrecognizedUnionMembers: true,
|
|
925
946
|
allowUnrecognizedEnumValues: true,
|
|
@@ -940,7 +961,7 @@ class Memory {
|
|
|
940
961
|
body: _response.error.rawBody,
|
|
941
962
|
});
|
|
942
963
|
case "timeout":
|
|
943
|
-
throw new errors.ZepTimeoutError();
|
|
964
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling POST /sessions/{sessionId}/extract.");
|
|
944
965
|
case "unknown":
|
|
945
966
|
throw new errors.ZepError({
|
|
946
967
|
message: _response.error.errorMessage,
|
|
@@ -959,11 +980,11 @@ class Memory {
|
|
|
959
980
|
* @throws {@link Zep.InternalServerError}
|
|
960
981
|
*
|
|
961
982
|
* @example
|
|
962
|
-
* await
|
|
983
|
+
* await client.memory.getSessionFacts("sessionId")
|
|
963
984
|
*/
|
|
964
|
-
getSessionFacts(
|
|
965
|
-
|
|
966
|
-
|
|
985
|
+
getSessionFacts(sessionId_1) {
|
|
986
|
+
return __awaiter(this, arguments, void 0, function* (sessionId, request = {}, requestOptions) {
|
|
987
|
+
var _a, _b;
|
|
967
988
|
const { minRating } = request;
|
|
968
989
|
const _queryParams = {};
|
|
969
990
|
if (minRating != null) {
|
|
@@ -972,15 +993,16 @@ class Memory {
|
|
|
972
993
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
973
994
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/facts`),
|
|
974
995
|
method: "GET",
|
|
975
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
996
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
976
997
|
contentType: "application/json",
|
|
977
998
|
queryParameters: _queryParams,
|
|
999
|
+
requestType: "json",
|
|
978
1000
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
979
1001
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
980
1002
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
981
1003
|
});
|
|
982
1004
|
if (_response.ok) {
|
|
983
|
-
return
|
|
1005
|
+
return serializers.FactsResponse.parseOrThrow(_response.body, {
|
|
984
1006
|
unrecognizedObjectKeys: "passthrough",
|
|
985
1007
|
allowUnrecognizedUnionMembers: true,
|
|
986
1008
|
allowUnrecognizedEnumValues: true,
|
|
@@ -991,7 +1013,7 @@ class Memory {
|
|
|
991
1013
|
if (_response.error.reason === "status-code") {
|
|
992
1014
|
switch (_response.error.statusCode) {
|
|
993
1015
|
case 404:
|
|
994
|
-
throw new Zep.NotFoundError(
|
|
1016
|
+
throw new Zep.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
995
1017
|
unrecognizedObjectKeys: "passthrough",
|
|
996
1018
|
allowUnrecognizedUnionMembers: true,
|
|
997
1019
|
allowUnrecognizedEnumValues: true,
|
|
@@ -999,7 +1021,7 @@ class Memory {
|
|
|
999
1021
|
breadcrumbsPrefix: ["response"],
|
|
1000
1022
|
}));
|
|
1001
1023
|
case 500:
|
|
1002
|
-
throw new Zep.InternalServerError(
|
|
1024
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1003
1025
|
unrecognizedObjectKeys: "passthrough",
|
|
1004
1026
|
allowUnrecognizedUnionMembers: true,
|
|
1005
1027
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1020,7 +1042,7 @@ class Memory {
|
|
|
1020
1042
|
body: _response.error.rawBody,
|
|
1021
1043
|
});
|
|
1022
1044
|
case "timeout":
|
|
1023
|
-
throw new errors.ZepTimeoutError();
|
|
1045
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /sessions/{sessionId}/facts.");
|
|
1024
1046
|
case "unknown":
|
|
1025
1047
|
throw new errors.ZepError({
|
|
1026
1048
|
message: _response.error.errorMessage,
|
|
@@ -1039,23 +1061,24 @@ class Memory {
|
|
|
1039
1061
|
* @throws {@link Zep.InternalServerError}
|
|
1040
1062
|
*
|
|
1041
1063
|
* @example
|
|
1042
|
-
* await
|
|
1064
|
+
* await client.memory.addSessionFacts("sessionId")
|
|
1043
1065
|
*/
|
|
1044
|
-
addSessionFacts(
|
|
1045
|
-
|
|
1046
|
-
|
|
1066
|
+
addSessionFacts(sessionId_1) {
|
|
1067
|
+
return __awaiter(this, arguments, void 0, function* (sessionId, request = {}, requestOptions) {
|
|
1068
|
+
var _a, _b;
|
|
1047
1069
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1048
1070
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/facts`),
|
|
1049
1071
|
method: "POST",
|
|
1050
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1072
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1051
1073
|
contentType: "application/json",
|
|
1052
|
-
|
|
1074
|
+
requestType: "json",
|
|
1075
|
+
body: serializers.AddFactsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
1053
1076
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1054
1077
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1055
1078
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1056
1079
|
});
|
|
1057
1080
|
if (_response.ok) {
|
|
1058
|
-
return
|
|
1081
|
+
return serializers.SuccessResponse.parseOrThrow(_response.body, {
|
|
1059
1082
|
unrecognizedObjectKeys: "passthrough",
|
|
1060
1083
|
allowUnrecognizedUnionMembers: true,
|
|
1061
1084
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1066,7 +1089,7 @@ class Memory {
|
|
|
1066
1089
|
if (_response.error.reason === "status-code") {
|
|
1067
1090
|
switch (_response.error.statusCode) {
|
|
1068
1091
|
case 404:
|
|
1069
|
-
throw new Zep.NotFoundError(
|
|
1092
|
+
throw new Zep.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1070
1093
|
unrecognizedObjectKeys: "passthrough",
|
|
1071
1094
|
allowUnrecognizedUnionMembers: true,
|
|
1072
1095
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1074,7 +1097,7 @@ class Memory {
|
|
|
1074
1097
|
breadcrumbsPrefix: ["response"],
|
|
1075
1098
|
}));
|
|
1076
1099
|
case 500:
|
|
1077
|
-
throw new Zep.InternalServerError(
|
|
1100
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1078
1101
|
unrecognizedObjectKeys: "passthrough",
|
|
1079
1102
|
allowUnrecognizedUnionMembers: true,
|
|
1080
1103
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1095,7 +1118,7 @@ class Memory {
|
|
|
1095
1118
|
body: _response.error.rawBody,
|
|
1096
1119
|
});
|
|
1097
1120
|
case "timeout":
|
|
1098
|
-
throw new errors.ZepTimeoutError();
|
|
1121
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling POST /sessions/{sessionId}/facts.");
|
|
1099
1122
|
case "unknown":
|
|
1100
1123
|
throw new errors.ZepError({
|
|
1101
1124
|
message: _response.error.errorMessage,
|
|
@@ -1114,11 +1137,11 @@ class Memory {
|
|
|
1114
1137
|
* @throws {@link Zep.InternalServerError}
|
|
1115
1138
|
*
|
|
1116
1139
|
* @example
|
|
1117
|
-
* await
|
|
1140
|
+
* await client.memory.get("sessionId")
|
|
1118
1141
|
*/
|
|
1119
|
-
get(
|
|
1120
|
-
|
|
1121
|
-
|
|
1142
|
+
get(sessionId_1) {
|
|
1143
|
+
return __awaiter(this, arguments, void 0, function* (sessionId, request = {}, requestOptions) {
|
|
1144
|
+
var _a, _b;
|
|
1122
1145
|
const { lastn, minRating } = request;
|
|
1123
1146
|
const _queryParams = {};
|
|
1124
1147
|
if (lastn != null) {
|
|
@@ -1130,15 +1153,16 @@ class Memory {
|
|
|
1130
1153
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1131
1154
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/memory`),
|
|
1132
1155
|
method: "GET",
|
|
1133
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1156
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1134
1157
|
contentType: "application/json",
|
|
1135
1158
|
queryParameters: _queryParams,
|
|
1159
|
+
requestType: "json",
|
|
1136
1160
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1137
1161
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1138
1162
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1139
1163
|
});
|
|
1140
1164
|
if (_response.ok) {
|
|
1141
|
-
return
|
|
1165
|
+
return serializers.Memory.parseOrThrow(_response.body, {
|
|
1142
1166
|
unrecognizedObjectKeys: "passthrough",
|
|
1143
1167
|
allowUnrecognizedUnionMembers: true,
|
|
1144
1168
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1149,7 +1173,7 @@ class Memory {
|
|
|
1149
1173
|
if (_response.error.reason === "status-code") {
|
|
1150
1174
|
switch (_response.error.statusCode) {
|
|
1151
1175
|
case 404:
|
|
1152
|
-
throw new Zep.NotFoundError(
|
|
1176
|
+
throw new Zep.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1153
1177
|
unrecognizedObjectKeys: "passthrough",
|
|
1154
1178
|
allowUnrecognizedUnionMembers: true,
|
|
1155
1179
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1157,7 +1181,7 @@ class Memory {
|
|
|
1157
1181
|
breadcrumbsPrefix: ["response"],
|
|
1158
1182
|
}));
|
|
1159
1183
|
case 500:
|
|
1160
|
-
throw new Zep.InternalServerError(
|
|
1184
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1161
1185
|
unrecognizedObjectKeys: "passthrough",
|
|
1162
1186
|
allowUnrecognizedUnionMembers: true,
|
|
1163
1187
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1178,7 +1202,7 @@ class Memory {
|
|
|
1178
1202
|
body: _response.error.rawBody,
|
|
1179
1203
|
});
|
|
1180
1204
|
case "timeout":
|
|
1181
|
-
throw new errors.ZepTimeoutError();
|
|
1205
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /sessions/{sessionId}/memory.");
|
|
1182
1206
|
case "unknown":
|
|
1183
1207
|
throw new errors.ZepError({
|
|
1184
1208
|
message: _response.error.errorMessage,
|
|
@@ -1196,28 +1220,29 @@ class Memory {
|
|
|
1196
1220
|
* @throws {@link Zep.InternalServerError}
|
|
1197
1221
|
*
|
|
1198
1222
|
* @example
|
|
1199
|
-
* await
|
|
1223
|
+
* await client.memory.add("sessionId", {
|
|
1200
1224
|
* messages: [{
|
|
1201
1225
|
* content: "content",
|
|
1202
|
-
* roleType:
|
|
1226
|
+
* roleType: "norole"
|
|
1203
1227
|
* }]
|
|
1204
1228
|
* })
|
|
1205
1229
|
*/
|
|
1206
1230
|
add(sessionId, request, requestOptions) {
|
|
1207
|
-
var _a, _b;
|
|
1208
1231
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1232
|
+
var _a, _b;
|
|
1209
1233
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1210
1234
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/memory`),
|
|
1211
1235
|
method: "POST",
|
|
1212
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1236
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1213
1237
|
contentType: "application/json",
|
|
1214
|
-
|
|
1238
|
+
requestType: "json",
|
|
1239
|
+
body: serializers.AddMemoryRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
1215
1240
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1216
1241
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1217
1242
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1218
1243
|
});
|
|
1219
1244
|
if (_response.ok) {
|
|
1220
|
-
return
|
|
1245
|
+
return serializers.AddMemoryResponse.parseOrThrow(_response.body, {
|
|
1221
1246
|
unrecognizedObjectKeys: "passthrough",
|
|
1222
1247
|
allowUnrecognizedUnionMembers: true,
|
|
1223
1248
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1228,7 +1253,7 @@ class Memory {
|
|
|
1228
1253
|
if (_response.error.reason === "status-code") {
|
|
1229
1254
|
switch (_response.error.statusCode) {
|
|
1230
1255
|
case 500:
|
|
1231
|
-
throw new Zep.InternalServerError(
|
|
1256
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1232
1257
|
unrecognizedObjectKeys: "passthrough",
|
|
1233
1258
|
allowUnrecognizedUnionMembers: true,
|
|
1234
1259
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1249,7 +1274,7 @@ class Memory {
|
|
|
1249
1274
|
body: _response.error.rawBody,
|
|
1250
1275
|
});
|
|
1251
1276
|
case "timeout":
|
|
1252
|
-
throw new errors.ZepTimeoutError();
|
|
1277
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling POST /sessions/{sessionId}/memory.");
|
|
1253
1278
|
case "unknown":
|
|
1254
1279
|
throw new errors.ZepError({
|
|
1255
1280
|
message: _response.error.errorMessage,
|
|
@@ -1267,22 +1292,23 @@ class Memory {
|
|
|
1267
1292
|
* @throws {@link Zep.InternalServerError}
|
|
1268
1293
|
*
|
|
1269
1294
|
* @example
|
|
1270
|
-
* await
|
|
1295
|
+
* await client.memory.delete("sessionId")
|
|
1271
1296
|
*/
|
|
1272
1297
|
delete(sessionId, requestOptions) {
|
|
1273
|
-
var _a, _b;
|
|
1274
1298
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1299
|
+
var _a, _b;
|
|
1275
1300
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1276
1301
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/memory`),
|
|
1277
1302
|
method: "DELETE",
|
|
1278
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1303
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1279
1304
|
contentType: "application/json",
|
|
1305
|
+
requestType: "json",
|
|
1280
1306
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1281
1307
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1282
1308
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1283
1309
|
});
|
|
1284
1310
|
if (_response.ok) {
|
|
1285
|
-
return
|
|
1311
|
+
return serializers.SuccessResponse.parseOrThrow(_response.body, {
|
|
1286
1312
|
unrecognizedObjectKeys: "passthrough",
|
|
1287
1313
|
allowUnrecognizedUnionMembers: true,
|
|
1288
1314
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1293,7 +1319,7 @@ class Memory {
|
|
|
1293
1319
|
if (_response.error.reason === "status-code") {
|
|
1294
1320
|
switch (_response.error.statusCode) {
|
|
1295
1321
|
case 404:
|
|
1296
|
-
throw new Zep.NotFoundError(
|
|
1322
|
+
throw new Zep.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1297
1323
|
unrecognizedObjectKeys: "passthrough",
|
|
1298
1324
|
allowUnrecognizedUnionMembers: true,
|
|
1299
1325
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1301,7 +1327,7 @@ class Memory {
|
|
|
1301
1327
|
breadcrumbsPrefix: ["response"],
|
|
1302
1328
|
}));
|
|
1303
1329
|
case 500:
|
|
1304
|
-
throw new Zep.InternalServerError(
|
|
1330
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1305
1331
|
unrecognizedObjectKeys: "passthrough",
|
|
1306
1332
|
allowUnrecognizedUnionMembers: true,
|
|
1307
1333
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1322,7 +1348,7 @@ class Memory {
|
|
|
1322
1348
|
body: _response.error.rawBody,
|
|
1323
1349
|
});
|
|
1324
1350
|
case "timeout":
|
|
1325
|
-
throw new errors.ZepTimeoutError();
|
|
1351
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling DELETE /sessions/{sessionId}/memory.");
|
|
1326
1352
|
case "unknown":
|
|
1327
1353
|
throw new errors.ZepError({
|
|
1328
1354
|
message: _response.error.errorMessage,
|
|
@@ -1341,11 +1367,11 @@ class Memory {
|
|
|
1341
1367
|
* @throws {@link Zep.InternalServerError}
|
|
1342
1368
|
*
|
|
1343
1369
|
* @example
|
|
1344
|
-
* await
|
|
1370
|
+
* await client.memory.getSessionMessages("sessionId")
|
|
1345
1371
|
*/
|
|
1346
|
-
getSessionMessages(
|
|
1347
|
-
|
|
1348
|
-
|
|
1372
|
+
getSessionMessages(sessionId_1) {
|
|
1373
|
+
return __awaiter(this, arguments, void 0, function* (sessionId, request = {}, requestOptions) {
|
|
1374
|
+
var _a, _b;
|
|
1349
1375
|
const { limit, cursor } = request;
|
|
1350
1376
|
const _queryParams = {};
|
|
1351
1377
|
if (limit != null) {
|
|
@@ -1357,15 +1383,16 @@ class Memory {
|
|
|
1357
1383
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1358
1384
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/messages`),
|
|
1359
1385
|
method: "GET",
|
|
1360
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1386
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1361
1387
|
contentType: "application/json",
|
|
1362
1388
|
queryParameters: _queryParams,
|
|
1389
|
+
requestType: "json",
|
|
1363
1390
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1364
1391
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1365
1392
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1366
1393
|
});
|
|
1367
1394
|
if (_response.ok) {
|
|
1368
|
-
return
|
|
1395
|
+
return serializers.MessageListResponse.parseOrThrow(_response.body, {
|
|
1369
1396
|
unrecognizedObjectKeys: "passthrough",
|
|
1370
1397
|
allowUnrecognizedUnionMembers: true,
|
|
1371
1398
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1376,7 +1403,7 @@ class Memory {
|
|
|
1376
1403
|
if (_response.error.reason === "status-code") {
|
|
1377
1404
|
switch (_response.error.statusCode) {
|
|
1378
1405
|
case 404:
|
|
1379
|
-
throw new Zep.NotFoundError(
|
|
1406
|
+
throw new Zep.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1380
1407
|
unrecognizedObjectKeys: "passthrough",
|
|
1381
1408
|
allowUnrecognizedUnionMembers: true,
|
|
1382
1409
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1384,7 +1411,7 @@ class Memory {
|
|
|
1384
1411
|
breadcrumbsPrefix: ["response"],
|
|
1385
1412
|
}));
|
|
1386
1413
|
case 500:
|
|
1387
|
-
throw new Zep.InternalServerError(
|
|
1414
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1388
1415
|
unrecognizedObjectKeys: "passthrough",
|
|
1389
1416
|
allowUnrecognizedUnionMembers: true,
|
|
1390
1417
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1405,7 +1432,7 @@ class Memory {
|
|
|
1405
1432
|
body: _response.error.rawBody,
|
|
1406
1433
|
});
|
|
1407
1434
|
case "timeout":
|
|
1408
|
-
throw new errors.ZepTimeoutError();
|
|
1435
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /sessions/{sessionId}/messages.");
|
|
1409
1436
|
case "unknown":
|
|
1410
1437
|
throw new errors.ZepError({
|
|
1411
1438
|
message: _response.error.errorMessage,
|
|
@@ -1424,22 +1451,23 @@ class Memory {
|
|
|
1424
1451
|
* @throws {@link Zep.InternalServerError}
|
|
1425
1452
|
*
|
|
1426
1453
|
* @example
|
|
1427
|
-
* await
|
|
1454
|
+
* await client.memory.getSessionMessage("sessionId", "messageUUID")
|
|
1428
1455
|
*/
|
|
1429
1456
|
getSessionMessage(sessionId, messageUuid, requestOptions) {
|
|
1430
|
-
var _a, _b;
|
|
1431
1457
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1458
|
+
var _a, _b;
|
|
1432
1459
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1433
1460
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/messages/${encodeURIComponent(messageUuid)}`),
|
|
1434
1461
|
method: "GET",
|
|
1435
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1462
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1436
1463
|
contentType: "application/json",
|
|
1464
|
+
requestType: "json",
|
|
1437
1465
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1438
1466
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1439
1467
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1440
1468
|
});
|
|
1441
1469
|
if (_response.ok) {
|
|
1442
|
-
return
|
|
1470
|
+
return serializers.Message.parseOrThrow(_response.body, {
|
|
1443
1471
|
unrecognizedObjectKeys: "passthrough",
|
|
1444
1472
|
allowUnrecognizedUnionMembers: true,
|
|
1445
1473
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1450,7 +1478,7 @@ class Memory {
|
|
|
1450
1478
|
if (_response.error.reason === "status-code") {
|
|
1451
1479
|
switch (_response.error.statusCode) {
|
|
1452
1480
|
case 404:
|
|
1453
|
-
throw new Zep.NotFoundError(
|
|
1481
|
+
throw new Zep.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1454
1482
|
unrecognizedObjectKeys: "passthrough",
|
|
1455
1483
|
allowUnrecognizedUnionMembers: true,
|
|
1456
1484
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1458,7 +1486,7 @@ class Memory {
|
|
|
1458
1486
|
breadcrumbsPrefix: ["response"],
|
|
1459
1487
|
}));
|
|
1460
1488
|
case 500:
|
|
1461
|
-
throw new Zep.InternalServerError(
|
|
1489
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1462
1490
|
unrecognizedObjectKeys: "passthrough",
|
|
1463
1491
|
allowUnrecognizedUnionMembers: true,
|
|
1464
1492
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1479,7 +1507,7 @@ class Memory {
|
|
|
1479
1507
|
body: _response.error.rawBody,
|
|
1480
1508
|
});
|
|
1481
1509
|
case "timeout":
|
|
1482
|
-
throw new errors.ZepTimeoutError();
|
|
1510
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /sessions/{sessionId}/messages/{messageUUID}.");
|
|
1483
1511
|
case "unknown":
|
|
1484
1512
|
throw new errors.ZepError({
|
|
1485
1513
|
message: _response.error.errorMessage,
|
|
@@ -1499,29 +1527,28 @@ class Memory {
|
|
|
1499
1527
|
* @throws {@link Zep.InternalServerError}
|
|
1500
1528
|
*
|
|
1501
1529
|
* @example
|
|
1502
|
-
* await
|
|
1530
|
+
* await client.memory.updateMessageMetadata("sessionId", "messageUUID", {
|
|
1503
1531
|
* metadata: {
|
|
1504
1532
|
* "key": "value"
|
|
1505
1533
|
* }
|
|
1506
1534
|
* })
|
|
1507
1535
|
*/
|
|
1508
1536
|
updateMessageMetadata(sessionId, messageUuid, request, requestOptions) {
|
|
1509
|
-
var _a, _b;
|
|
1510
1537
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1538
|
+
var _a, _b;
|
|
1511
1539
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1512
1540
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/messages/${encodeURIComponent(messageUuid)}`),
|
|
1513
1541
|
method: "PATCH",
|
|
1514
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1542
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1515
1543
|
contentType: "application/json",
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
}),
|
|
1544
|
+
requestType: "json",
|
|
1545
|
+
body: serializers.ModelsMessageMetadataUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
1519
1546
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1520
1547
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1521
1548
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1522
1549
|
});
|
|
1523
1550
|
if (_response.ok) {
|
|
1524
|
-
return
|
|
1551
|
+
return serializers.Message.parseOrThrow(_response.body, {
|
|
1525
1552
|
unrecognizedObjectKeys: "passthrough",
|
|
1526
1553
|
allowUnrecognizedUnionMembers: true,
|
|
1527
1554
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1532,7 +1559,7 @@ class Memory {
|
|
|
1532
1559
|
if (_response.error.reason === "status-code") {
|
|
1533
1560
|
switch (_response.error.statusCode) {
|
|
1534
1561
|
case 404:
|
|
1535
|
-
throw new Zep.NotFoundError(
|
|
1562
|
+
throw new Zep.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1536
1563
|
unrecognizedObjectKeys: "passthrough",
|
|
1537
1564
|
allowUnrecognizedUnionMembers: true,
|
|
1538
1565
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1540,7 +1567,7 @@ class Memory {
|
|
|
1540
1567
|
breadcrumbsPrefix: ["response"],
|
|
1541
1568
|
}));
|
|
1542
1569
|
case 500:
|
|
1543
|
-
throw new Zep.InternalServerError(
|
|
1570
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1544
1571
|
unrecognizedObjectKeys: "passthrough",
|
|
1545
1572
|
allowUnrecognizedUnionMembers: true,
|
|
1546
1573
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1561,7 +1588,7 @@ class Memory {
|
|
|
1561
1588
|
body: _response.error.rawBody,
|
|
1562
1589
|
});
|
|
1563
1590
|
case "timeout":
|
|
1564
|
-
throw new errors.ZepTimeoutError();
|
|
1591
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling PATCH /sessions/{sessionId}/messages/{messageUUID}.");
|
|
1565
1592
|
case "unknown":
|
|
1566
1593
|
throw new errors.ZepError({
|
|
1567
1594
|
message: _response.error.errorMessage,
|
|
@@ -1580,11 +1607,11 @@ class Memory {
|
|
|
1580
1607
|
* @throws {@link Zep.InternalServerError}
|
|
1581
1608
|
*
|
|
1582
1609
|
* @example
|
|
1583
|
-
* await
|
|
1610
|
+
* await client.memory.search("sessionId")
|
|
1584
1611
|
*/
|
|
1585
|
-
search(
|
|
1586
|
-
|
|
1587
|
-
|
|
1612
|
+
search(sessionId_1) {
|
|
1613
|
+
return __awaiter(this, arguments, void 0, function* (sessionId, request = {}, requestOptions) {
|
|
1614
|
+
var _a, _b;
|
|
1588
1615
|
const { limit } = request, _body = __rest(request, ["limit"]);
|
|
1589
1616
|
const _queryParams = {};
|
|
1590
1617
|
if (limit != null) {
|
|
@@ -1593,16 +1620,17 @@ class Memory {
|
|
|
1593
1620
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1594
1621
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/search`),
|
|
1595
1622
|
method: "POST",
|
|
1596
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1623
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1597
1624
|
contentType: "application/json",
|
|
1598
1625
|
queryParameters: _queryParams,
|
|
1599
|
-
|
|
1626
|
+
requestType: "json",
|
|
1627
|
+
body: serializers.MemorySearchPayload.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
1600
1628
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1601
1629
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1602
1630
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1603
1631
|
});
|
|
1604
1632
|
if (_response.ok) {
|
|
1605
|
-
return
|
|
1633
|
+
return serializers.memory.search.Response.parseOrThrow(_response.body, {
|
|
1606
1634
|
unrecognizedObjectKeys: "passthrough",
|
|
1607
1635
|
allowUnrecognizedUnionMembers: true,
|
|
1608
1636
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1613,7 +1641,7 @@ class Memory {
|
|
|
1613
1641
|
if (_response.error.reason === "status-code") {
|
|
1614
1642
|
switch (_response.error.statusCode) {
|
|
1615
1643
|
case 404:
|
|
1616
|
-
throw new Zep.NotFoundError(
|
|
1644
|
+
throw new Zep.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1617
1645
|
unrecognizedObjectKeys: "passthrough",
|
|
1618
1646
|
allowUnrecognizedUnionMembers: true,
|
|
1619
1647
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1621,7 +1649,7 @@ class Memory {
|
|
|
1621
1649
|
breadcrumbsPrefix: ["response"],
|
|
1622
1650
|
}));
|
|
1623
1651
|
case 500:
|
|
1624
|
-
throw new Zep.InternalServerError(
|
|
1652
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1625
1653
|
unrecognizedObjectKeys: "passthrough",
|
|
1626
1654
|
allowUnrecognizedUnionMembers: true,
|
|
1627
1655
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1642,7 +1670,7 @@ class Memory {
|
|
|
1642
1670
|
body: _response.error.rawBody,
|
|
1643
1671
|
});
|
|
1644
1672
|
case "timeout":
|
|
1645
|
-
throw new errors.ZepTimeoutError();
|
|
1673
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling POST /sessions/{sessionId}/search.");
|
|
1646
1674
|
case "unknown":
|
|
1647
1675
|
throw new errors.ZepError({
|
|
1648
1676
|
message: _response.error.errorMessage,
|
|
@@ -1660,22 +1688,23 @@ class Memory {
|
|
|
1660
1688
|
* @throws {@link Zep.InternalServerError}
|
|
1661
1689
|
*
|
|
1662
1690
|
* @example
|
|
1663
|
-
* await
|
|
1691
|
+
* await client.memory.getSummaries("sessionId")
|
|
1664
1692
|
*/
|
|
1665
1693
|
getSummaries(sessionId, requestOptions) {
|
|
1666
|
-
var _a, _b;
|
|
1667
1694
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1695
|
+
var _a, _b;
|
|
1668
1696
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1669
1697
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/summary`),
|
|
1670
1698
|
method: "GET",
|
|
1671
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1699
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1672
1700
|
contentType: "application/json",
|
|
1701
|
+
requestType: "json",
|
|
1673
1702
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1674
1703
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1675
1704
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1676
1705
|
});
|
|
1677
1706
|
if (_response.ok) {
|
|
1678
|
-
return
|
|
1707
|
+
return serializers.SummaryListResponse.parseOrThrow(_response.body, {
|
|
1679
1708
|
unrecognizedObjectKeys: "passthrough",
|
|
1680
1709
|
allowUnrecognizedUnionMembers: true,
|
|
1681
1710
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1686,7 +1715,7 @@ class Memory {
|
|
|
1686
1715
|
if (_response.error.reason === "status-code") {
|
|
1687
1716
|
switch (_response.error.statusCode) {
|
|
1688
1717
|
case 404:
|
|
1689
|
-
throw new Zep.NotFoundError(
|
|
1718
|
+
throw new Zep.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1690
1719
|
unrecognizedObjectKeys: "passthrough",
|
|
1691
1720
|
allowUnrecognizedUnionMembers: true,
|
|
1692
1721
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1694,7 +1723,7 @@ class Memory {
|
|
|
1694
1723
|
breadcrumbsPrefix: ["response"],
|
|
1695
1724
|
}));
|
|
1696
1725
|
case 500:
|
|
1697
|
-
throw new Zep.InternalServerError(
|
|
1726
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1698
1727
|
unrecognizedObjectKeys: "passthrough",
|
|
1699
1728
|
allowUnrecognizedUnionMembers: true,
|
|
1700
1729
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1715,7 +1744,7 @@ class Memory {
|
|
|
1715
1744
|
body: _response.error.rawBody,
|
|
1716
1745
|
});
|
|
1717
1746
|
case "timeout":
|
|
1718
|
-
throw new errors.ZepTimeoutError();
|
|
1747
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /sessions/{sessionId}/summary.");
|
|
1719
1748
|
case "unknown":
|
|
1720
1749
|
throw new errors.ZepError({
|
|
1721
1750
|
message: _response.error.errorMessage,
|
|
@@ -1734,11 +1763,11 @@ class Memory {
|
|
|
1734
1763
|
* @throws {@link Zep.InternalServerError}
|
|
1735
1764
|
*
|
|
1736
1765
|
* @example
|
|
1737
|
-
* await
|
|
1766
|
+
* await client.memory.synthesizeQuestion("sessionId")
|
|
1738
1767
|
*/
|
|
1739
|
-
synthesizeQuestion(
|
|
1740
|
-
|
|
1741
|
-
|
|
1768
|
+
synthesizeQuestion(sessionId_1) {
|
|
1769
|
+
return __awaiter(this, arguments, void 0, function* (sessionId, request = {}, requestOptions) {
|
|
1770
|
+
var _a, _b;
|
|
1742
1771
|
const { lastNMessages } = request;
|
|
1743
1772
|
const _queryParams = {};
|
|
1744
1773
|
if (lastNMessages != null) {
|
|
@@ -1747,15 +1776,16 @@ class Memory {
|
|
|
1747
1776
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1748
1777
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/synthesize_question`),
|
|
1749
1778
|
method: "GET",
|
|
1750
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1779
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1751
1780
|
contentType: "application/json",
|
|
1752
1781
|
queryParameters: _queryParams,
|
|
1782
|
+
requestType: "json",
|
|
1753
1783
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1754
1784
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1755
1785
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1756
1786
|
});
|
|
1757
1787
|
if (_response.ok) {
|
|
1758
|
-
return
|
|
1788
|
+
return serializers.Question.parseOrThrow(_response.body, {
|
|
1759
1789
|
unrecognizedObjectKeys: "passthrough",
|
|
1760
1790
|
allowUnrecognizedUnionMembers: true,
|
|
1761
1791
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1766,7 +1796,7 @@ class Memory {
|
|
|
1766
1796
|
if (_response.error.reason === "status-code") {
|
|
1767
1797
|
switch (_response.error.statusCode) {
|
|
1768
1798
|
case 404:
|
|
1769
|
-
throw new Zep.NotFoundError(
|
|
1799
|
+
throw new Zep.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1770
1800
|
unrecognizedObjectKeys: "passthrough",
|
|
1771
1801
|
allowUnrecognizedUnionMembers: true,
|
|
1772
1802
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1774,7 +1804,7 @@ class Memory {
|
|
|
1774
1804
|
breadcrumbsPrefix: ["response"],
|
|
1775
1805
|
}));
|
|
1776
1806
|
case 500:
|
|
1777
|
-
throw new Zep.InternalServerError(
|
|
1807
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1778
1808
|
unrecognizedObjectKeys: "passthrough",
|
|
1779
1809
|
allowUnrecognizedUnionMembers: true,
|
|
1780
1810
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1795,7 +1825,7 @@ class Memory {
|
|
|
1795
1825
|
body: _response.error.rawBody,
|
|
1796
1826
|
});
|
|
1797
1827
|
case "timeout":
|
|
1798
|
-
throw new errors.ZepTimeoutError();
|
|
1828
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /sessions/{sessionId}/synthesize_question.");
|
|
1799
1829
|
case "unknown":
|
|
1800
1830
|
throw new errors.ZepError({
|
|
1801
1831
|
message: _response.error.errorMessage,
|
|
@@ -1804,8 +1834,8 @@ class Memory {
|
|
|
1804
1834
|
});
|
|
1805
1835
|
}
|
|
1806
1836
|
_getCustomAuthorizationHeaders() {
|
|
1807
|
-
var _a;
|
|
1808
1837
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1838
|
+
var _a;
|
|
1809
1839
|
const apiKeyValue = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["ZEP_API_KEY"];
|
|
1810
1840
|
return { Authorization: `Api-Key ${apiKeyValue}` };
|
|
1811
1841
|
});
|