@getzep/zep-cloud 3.4.1 → 3.5.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.
@@ -47,8 +47,8 @@ class ZepClient {
47
47
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
48
48
  "X-Fern-Language": "JavaScript",
49
49
  "X-Fern-SDK-Name": "zep-cloud",
50
- "X-Fern-SDK-Version": "3.4.1",
51
- "User-Agent": "zep-cloud/3.4.1",
50
+ "X-Fern-SDK-Version": "3.5.0",
51
+ "User-Agent": "zep-cloud/3.5.0",
52
52
  "X-Fern-Runtime": core.RUNTIME.type,
53
53
  "X-Fern-Runtime-Version": core.RUNTIME.version,
54
54
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -129,6 +129,20 @@ export declare class User {
129
129
  */
130
130
  getThreads(userId: string, requestOptions?: User.RequestOptions): core.HttpResponsePromise<Zep.Thread[]>;
131
131
  private __getThreads;
132
+ /**
133
+ * Hints Zep to warm a user's graph for low-latency search
134
+ *
135
+ * @param {string} userId - User ID
136
+ * @param {User.RequestOptions} requestOptions - Request-specific configuration.
137
+ *
138
+ * @throws {@link Zep.NotFoundError}
139
+ * @throws {@link Zep.InternalServerError}
140
+ *
141
+ * @example
142
+ * await client.user.warm("userId")
143
+ */
144
+ warm(userId: string, requestOptions?: User.RequestOptions): core.HttpResponsePromise<Zep.SuccessResponse>;
145
+ private __warm;
132
146
  protected _getCustomAuthorizationHeaders(): Promise<{
133
147
  Authorization: string;
134
148
  }>;
@@ -647,6 +647,87 @@ class User {
647
647
  }
648
648
  });
649
649
  }
650
+ /**
651
+ * Hints Zep to warm a user's graph for low-latency search
652
+ *
653
+ * @param {string} userId - User ID
654
+ * @param {User.RequestOptions} requestOptions - Request-specific configuration.
655
+ *
656
+ * @throws {@link Zep.NotFoundError}
657
+ * @throws {@link Zep.InternalServerError}
658
+ *
659
+ * @example
660
+ * await client.user.warm("userId")
661
+ */
662
+ warm(userId, requestOptions) {
663
+ return core.HttpResponsePromise.fromPromise(this.__warm(userId, requestOptions));
664
+ }
665
+ __warm(userId, requestOptions) {
666
+ return __awaiter(this, void 0, void 0, function* () {
667
+ var _a, _b, _c, _d;
668
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
669
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ZepEnvironment.Default, `users/${encodeURIComponent(userId)}/warm`),
670
+ method: "GET",
671
+ headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
672
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
673
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
674
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
675
+ });
676
+ if (_response.ok) {
677
+ return {
678
+ data: serializers.SuccessResponse.parseOrThrow(_response.body, {
679
+ unrecognizedObjectKeys: "passthrough",
680
+ allowUnrecognizedUnionMembers: true,
681
+ allowUnrecognizedEnumValues: true,
682
+ skipValidation: true,
683
+ breadcrumbsPrefix: ["response"],
684
+ }),
685
+ rawResponse: _response.rawResponse,
686
+ };
687
+ }
688
+ if (_response.error.reason === "status-code") {
689
+ switch (_response.error.statusCode) {
690
+ case 404:
691
+ throw new Zep.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
692
+ unrecognizedObjectKeys: "passthrough",
693
+ allowUnrecognizedUnionMembers: true,
694
+ allowUnrecognizedEnumValues: true,
695
+ skipValidation: true,
696
+ breadcrumbsPrefix: ["response"],
697
+ }), _response.rawResponse);
698
+ case 500:
699
+ throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
700
+ unrecognizedObjectKeys: "passthrough",
701
+ allowUnrecognizedUnionMembers: true,
702
+ allowUnrecognizedEnumValues: true,
703
+ skipValidation: true,
704
+ breadcrumbsPrefix: ["response"],
705
+ }), _response.rawResponse);
706
+ default:
707
+ throw new errors.ZepError({
708
+ statusCode: _response.error.statusCode,
709
+ body: _response.error.body,
710
+ rawResponse: _response.rawResponse,
711
+ });
712
+ }
713
+ }
714
+ switch (_response.error.reason) {
715
+ case "non-json":
716
+ throw new errors.ZepError({
717
+ statusCode: _response.error.statusCode,
718
+ body: _response.error.rawBody,
719
+ rawResponse: _response.rawResponse,
720
+ });
721
+ case "timeout":
722
+ throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /users/{userId}/warm.");
723
+ case "unknown":
724
+ throw new errors.ZepError({
725
+ message: _response.error.errorMessage,
726
+ rawResponse: _response.rawResponse,
727
+ });
728
+ }
729
+ });
730
+ }
650
731
  _getCustomAuthorizationHeaders() {
651
732
  return __awaiter(this, void 0, void 0, function* () {
652
733
  var _a;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "3.4.1";
1
+ export declare const SDK_VERSION = "3.5.0";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "3.4.1";
4
+ exports.SDK_VERSION = "3.5.0";
@@ -11,8 +11,8 @@ export class ZepClient {
11
11
  this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
12
12
  "X-Fern-Language": "JavaScript",
13
13
  "X-Fern-SDK-Name": "zep-cloud",
14
- "X-Fern-SDK-Version": "3.4.1",
15
- "User-Agent": "zep-cloud/3.4.1",
14
+ "X-Fern-SDK-Version": "3.5.0",
15
+ "User-Agent": "zep-cloud/3.5.0",
16
16
  "X-Fern-Runtime": core.RUNTIME.type,
17
17
  "X-Fern-Runtime-Version": core.RUNTIME.version,
18
18
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -129,6 +129,20 @@ export declare class User {
129
129
  */
130
130
  getThreads(userId: string, requestOptions?: User.RequestOptions): core.HttpResponsePromise<Zep.Thread[]>;
131
131
  private __getThreads;
132
+ /**
133
+ * Hints Zep to warm a user's graph for low-latency search
134
+ *
135
+ * @param {string} userId - User ID
136
+ * @param {User.RequestOptions} requestOptions - Request-specific configuration.
137
+ *
138
+ * @throws {@link Zep.NotFoundError}
139
+ * @throws {@link Zep.InternalServerError}
140
+ *
141
+ * @example
142
+ * await client.user.warm("userId")
143
+ */
144
+ warm(userId: string, requestOptions?: User.RequestOptions): core.HttpResponsePromise<Zep.SuccessResponse>;
145
+ private __warm;
132
146
  protected _getCustomAuthorizationHeaders(): Promise<{
133
147
  Authorization: string;
134
148
  }>;
@@ -611,6 +611,87 @@ export class User {
611
611
  }
612
612
  });
613
613
  }
614
+ /**
615
+ * Hints Zep to warm a user's graph for low-latency search
616
+ *
617
+ * @param {string} userId - User ID
618
+ * @param {User.RequestOptions} requestOptions - Request-specific configuration.
619
+ *
620
+ * @throws {@link Zep.NotFoundError}
621
+ * @throws {@link Zep.InternalServerError}
622
+ *
623
+ * @example
624
+ * await client.user.warm("userId")
625
+ */
626
+ warm(userId, requestOptions) {
627
+ return core.HttpResponsePromise.fromPromise(this.__warm(userId, requestOptions));
628
+ }
629
+ __warm(userId, requestOptions) {
630
+ return __awaiter(this, void 0, void 0, function* () {
631
+ var _a, _b, _c, _d;
632
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
633
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ZepEnvironment.Default, `users/${encodeURIComponent(userId)}/warm`),
634
+ method: "GET",
635
+ headers: mergeHeaders((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
636
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
637
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
638
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
639
+ });
640
+ if (_response.ok) {
641
+ return {
642
+ data: serializers.SuccessResponse.parseOrThrow(_response.body, {
643
+ unrecognizedObjectKeys: "passthrough",
644
+ allowUnrecognizedUnionMembers: true,
645
+ allowUnrecognizedEnumValues: true,
646
+ skipValidation: true,
647
+ breadcrumbsPrefix: ["response"],
648
+ }),
649
+ rawResponse: _response.rawResponse,
650
+ };
651
+ }
652
+ if (_response.error.reason === "status-code") {
653
+ switch (_response.error.statusCode) {
654
+ case 404:
655
+ throw new Zep.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
656
+ unrecognizedObjectKeys: "passthrough",
657
+ allowUnrecognizedUnionMembers: true,
658
+ allowUnrecognizedEnumValues: true,
659
+ skipValidation: true,
660
+ breadcrumbsPrefix: ["response"],
661
+ }), _response.rawResponse);
662
+ case 500:
663
+ throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
664
+ unrecognizedObjectKeys: "passthrough",
665
+ allowUnrecognizedUnionMembers: true,
666
+ allowUnrecognizedEnumValues: true,
667
+ skipValidation: true,
668
+ breadcrumbsPrefix: ["response"],
669
+ }), _response.rawResponse);
670
+ default:
671
+ throw new errors.ZepError({
672
+ statusCode: _response.error.statusCode,
673
+ body: _response.error.body,
674
+ rawResponse: _response.rawResponse,
675
+ });
676
+ }
677
+ }
678
+ switch (_response.error.reason) {
679
+ case "non-json":
680
+ throw new errors.ZepError({
681
+ statusCode: _response.error.statusCode,
682
+ body: _response.error.rawBody,
683
+ rawResponse: _response.rawResponse,
684
+ });
685
+ case "timeout":
686
+ throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /users/{userId}/warm.");
687
+ case "unknown":
688
+ throw new errors.ZepError({
689
+ message: _response.error.errorMessage,
690
+ rawResponse: _response.rawResponse,
691
+ });
692
+ }
693
+ });
694
+ }
614
695
  _getCustomAuthorizationHeaders() {
615
696
  return __awaiter(this, void 0, void 0, function* () {
616
697
  var _a;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "3.4.1";
1
+ export declare const SDK_VERSION = "3.5.0";
@@ -1 +1 @@
1
- export const SDK_VERSION = "3.4.1";
1
+ export const SDK_VERSION = "3.5.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getzep/zep-cloud",
3
- "version": "3.4.1",
3
+ "version": "3.5.0",
4
4
  "private": false,
5
5
  "repository": "https://github.com/getzep/zep-js",
6
6
  "description": "Zep: Fast, scalable building blocks for production LLM apps",
package/reference.md CHANGED
@@ -1729,6 +1729,69 @@ await client.user.getThreads("userId");
1729
1729
  </dl>
1730
1730
  </details>
1731
1731
 
1732
+ <details><summary><code>client.user.<a href="/src/api/resources/user/client/Client.ts">warm</a>(userId) -> Zep.SuccessResponse</code></summary>
1733
+ <dl>
1734
+ <dd>
1735
+
1736
+ #### 📝 Description
1737
+
1738
+ <dl>
1739
+ <dd>
1740
+
1741
+ <dl>
1742
+ <dd>
1743
+
1744
+ Hints Zep to warm a user's graph for low-latency search
1745
+
1746
+ </dd>
1747
+ </dl>
1748
+ </dd>
1749
+ </dl>
1750
+
1751
+ #### 🔌 Usage
1752
+
1753
+ <dl>
1754
+ <dd>
1755
+
1756
+ <dl>
1757
+ <dd>
1758
+
1759
+ ```typescript
1760
+ await client.user.warm("userId");
1761
+ ```
1762
+
1763
+ </dd>
1764
+ </dl>
1765
+ </dd>
1766
+ </dl>
1767
+
1768
+ #### ⚙️ Parameters
1769
+
1770
+ <dl>
1771
+ <dd>
1772
+
1773
+ <dl>
1774
+ <dd>
1775
+
1776
+ **userId:** `string` — User ID
1777
+
1778
+ </dd>
1779
+ </dl>
1780
+
1781
+ <dl>
1782
+ <dd>
1783
+
1784
+ **requestOptions:** `User.RequestOptions`
1785
+
1786
+ </dd>
1787
+ </dl>
1788
+ </dd>
1789
+ </dl>
1790
+
1791
+ </dd>
1792
+ </dl>
1793
+ </details>
1794
+
1732
1795
  ## Graph Edge
1733
1796
 
1734
1797
  <details><summary><code>client.graph.edge.<a href="/src/api/resources/graph/resources/edge/client/Client.ts">getByGraphId</a>(graphId, { ...params }) -> Zep.EntityEdge[]</code></summary>