langsmith 0.7.1 → 0.7.3

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.
Files changed (37) hide show
  1. package/dist/client.cjs +31 -7
  2. package/dist/client.d.ts +13 -0
  3. package/dist/client.js +31 -7
  4. package/dist/experimental/vercel/index.cjs +18 -637
  5. package/dist/experimental/vercel/index.d.ts +3 -257
  6. package/dist/experimental/vercel/index.js +2 -635
  7. package/dist/experimental/vercel/middleware.cjs +2 -78
  8. package/dist/experimental/vercel/middleware.js +1 -77
  9. package/dist/experimental/vercel/telemetry.cjs +462 -0
  10. package/dist/experimental/vercel/telemetry.d.ts +89 -0
  11. package/dist/experimental/vercel/telemetry.js +459 -0
  12. package/dist/experimental/vercel/utils.cjs +142 -35
  13. package/dist/experimental/vercel/utils.d.ts +28 -3
  14. package/dist/experimental/vercel/utils.js +140 -34
  15. package/dist/experimental/vercel/wrap.cjs +639 -0
  16. package/dist/experimental/vercel/wrap.d.ts +257 -0
  17. package/dist/experimental/vercel/wrap.js +635 -0
  18. package/dist/index.cjs +1 -1
  19. package/dist/index.d.ts +1 -1
  20. package/dist/index.js +1 -1
  21. package/dist/sandbox/client.cjs +21 -0
  22. package/dist/sandbox/client.d.ts +1 -0
  23. package/dist/sandbox/client.js +21 -0
  24. package/dist/sandbox/sandbox.cjs +12 -1
  25. package/dist/sandbox/sandbox.js +12 -1
  26. package/dist/sandbox/types.d.ts +12 -0
  27. package/dist/sandbox/ws_execute.cjs +11 -7
  28. package/dist/sandbox/ws_execute.d.ts +2 -1
  29. package/dist/sandbox/ws_execute.js +11 -7
  30. package/dist/schemas.d.ts +3 -1
  31. package/dist/utils/types.cjs +13 -0
  32. package/dist/utils/types.d.ts +2 -0
  33. package/dist/utils/types.js +8 -0
  34. package/dist/utils/vercel.cjs +68 -10
  35. package/dist/utils/vercel.d.ts +17 -2
  36. package/dist/utils/vercel.js +68 -10
  37. package/package.json +9 -7
package/dist/client.cjs CHANGED
@@ -675,7 +675,7 @@ class Client {
675
675
  enumerable: true,
676
676
  configurable: true,
677
677
  writable: true,
678
- value: false
678
+ value: (0, env_js_1.getLangSmithEnvironmentVariable)("DISABLE_MULTIPART_STREAMING") === "true"
679
679
  });
680
680
  Object.defineProperty(this, "_multipartDisabled", {
681
681
  enumerable: true,
@@ -4013,6 +4013,35 @@ class Client {
4013
4013
  const run = await response.json();
4014
4014
  return _normalizeRunTimestamps(run);
4015
4015
  }
4016
+ /**
4017
+ * List the runs in an annotation queue.
4018
+ * @param queueId - The ID of the annotation queue
4019
+ * @param options - The options for listing runs in the annotation queue
4020
+ * @param options.status - Filter runs by review status. If omitted, returns
4021
+ * runs across all review states.
4022
+ * @param options.limit - The maximum number of runs to return
4023
+ * @returns An iterator of RunWithAnnotationQueueInfo objects
4024
+ */
4025
+ async *listRunsFromAnnotationQueue(queueId, options = {}) {
4026
+ const { status, limit: userLimit } = options;
4027
+ const params = new URLSearchParams();
4028
+ const limit = userLimit !== undefined && Number.isFinite(userLimit)
4029
+ ? Math.min(userLimit, 100)
4030
+ : 100;
4031
+ if (status)
4032
+ params.append("status", status);
4033
+ params.append("limit", limit.toString());
4034
+ let count = 0;
4035
+ const path = `/annotation-queues/${(0, _uuid_js_1.assertUuid)(queueId, "queueId")}/runs`;
4036
+ for await (const runs of this._getPaginated(path, params)) {
4037
+ for (const run of runs) {
4038
+ yield _normalizeRunTimestamps(run);
4039
+ count++;
4040
+ if (count >= limit)
4041
+ return;
4042
+ }
4043
+ }
4044
+ }
4016
4045
  /**
4017
4046
  * Delete a run from an an annotation queue.
4018
4047
  * @param queueId - The ID of the annotation queue to delete the run from
@@ -4898,12 +4927,7 @@ class Client {
4898
4927
  });
4899
4928
  const data = (await response.json());
4900
4929
  const commitHash = data.commit.commit_hash;
4901
- let ownerForUrl = owner;
4902
- if (owner === "-") {
4903
- const settings = await this._getSettings();
4904
- ownerForUrl = settings.tenant_handle || owner;
4905
- }
4906
- return `${this.getHostUrl()}/hub/${ownerForUrl}/${name}:${commitHash.slice(0, 8)}`;
4930
+ return `${this.getHostUrl()}/context/${name}/${commitHash.slice(0, 8)}`;
4907
4931
  }
4908
4932
  async _deleteDirectory(identifier) {
4909
4933
  const [owner, name] = (0, prompts_js_1.parseHubIdentifier)(identifier);
package/dist/client.d.ts CHANGED
@@ -1100,6 +1100,19 @@ export declare class Client implements LangSmithTracingClientInterface {
1100
1100
  * @throws {Error} If the run is not found at the given index or for other API-related errors
1101
1101
  */
1102
1102
  getRunFromAnnotationQueue(queueId: string, index: number): Promise<RunWithAnnotationQueueInfo>;
1103
+ /**
1104
+ * List the runs in an annotation queue.
1105
+ * @param queueId - The ID of the annotation queue
1106
+ * @param options - The options for listing runs in the annotation queue
1107
+ * @param options.status - Filter runs by review status. If omitted, returns
1108
+ * runs across all review states.
1109
+ * @param options.limit - The maximum number of runs to return
1110
+ * @returns An iterator of RunWithAnnotationQueueInfo objects
1111
+ */
1112
+ listRunsFromAnnotationQueue(queueId: string, options?: {
1113
+ status?: "needs_my_review" | "needs_others_review" | "completed";
1114
+ limit?: number;
1115
+ }): AsyncIterableIterator<RunWithAnnotationQueueInfo>;
1103
1116
  /**
1104
1117
  * Delete a run from an an annotation queue.
1105
1118
  * @param queueId - The ID of the annotation queue to delete the run from
package/dist/client.js CHANGED
@@ -637,7 +637,7 @@ export class Client {
637
637
  enumerable: true,
638
638
  configurable: true,
639
639
  writable: true,
640
- value: false
640
+ value: getLangSmithEnvironmentVariable("DISABLE_MULTIPART_STREAMING") === "true"
641
641
  });
642
642
  Object.defineProperty(this, "_multipartDisabled", {
643
643
  enumerable: true,
@@ -3975,6 +3975,35 @@ export class Client {
3975
3975
  const run = await response.json();
3976
3976
  return _normalizeRunTimestamps(run);
3977
3977
  }
3978
+ /**
3979
+ * List the runs in an annotation queue.
3980
+ * @param queueId - The ID of the annotation queue
3981
+ * @param options - The options for listing runs in the annotation queue
3982
+ * @param options.status - Filter runs by review status. If omitted, returns
3983
+ * runs across all review states.
3984
+ * @param options.limit - The maximum number of runs to return
3985
+ * @returns An iterator of RunWithAnnotationQueueInfo objects
3986
+ */
3987
+ async *listRunsFromAnnotationQueue(queueId, options = {}) {
3988
+ const { status, limit: userLimit } = options;
3989
+ const params = new URLSearchParams();
3990
+ const limit = userLimit !== undefined && Number.isFinite(userLimit)
3991
+ ? Math.min(userLimit, 100)
3992
+ : 100;
3993
+ if (status)
3994
+ params.append("status", status);
3995
+ params.append("limit", limit.toString());
3996
+ let count = 0;
3997
+ const path = `/annotation-queues/${assertUuid(queueId, "queueId")}/runs`;
3998
+ for await (const runs of this._getPaginated(path, params)) {
3999
+ for (const run of runs) {
4000
+ yield _normalizeRunTimestamps(run);
4001
+ count++;
4002
+ if (count >= limit)
4003
+ return;
4004
+ }
4005
+ }
4006
+ }
3978
4007
  /**
3979
4008
  * Delete a run from an an annotation queue.
3980
4009
  * @param queueId - The ID of the annotation queue to delete the run from
@@ -4860,12 +4889,7 @@ export class Client {
4860
4889
  });
4861
4890
  const data = (await response.json());
4862
4891
  const commitHash = data.commit.commit_hash;
4863
- let ownerForUrl = owner;
4864
- if (owner === "-") {
4865
- const settings = await this._getSettings();
4866
- ownerForUrl = settings.tenant_handle || owner;
4867
- }
4868
- return `${this.getHostUrl()}/hub/${ownerForUrl}/${name}:${commitHash.slice(0, 8)}`;
4892
+ return `${this.getHostUrl()}/context/${name}/${commitHash.slice(0, 8)}`;
4869
4893
  }
4870
4894
  async _deleteDirectory(identifier) {
4871
4895
  const [owner, name] = parseHubIdentifier(identifier);