langsmith 0.7.2 → 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.
package/dist/client.cjs CHANGED
@@ -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
@@ -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);
package/dist/index.cjs CHANGED
@@ -18,4 +18,4 @@ Object.defineProperty(exports, "PromptCache", { enumerable: true, get: function
18
18
  Object.defineProperty(exports, "configureGlobalPromptCache", { enumerable: true, get: function () { return index_js_1.configureGlobalPromptCache; } });
19
19
  Object.defineProperty(exports, "promptCacheSingleton", { enumerable: true, get: function () { return index_js_1.promptCacheSingleton; } });
20
20
  // Update using pnpm bump-version
21
- exports.__version__ = "0.7.2";
21
+ exports.__version__ = "0.7.3";
package/dist/index.d.ts CHANGED
@@ -5,4 +5,4 @@ export { overrideFetchImplementation } from "./singletons/fetch.js";
5
5
  export { getDefaultProjectName } from "./utils/project.js";
6
6
  export { uuid7, uuid7FromTime } from "./uuid.js";
7
7
  export { Cache, PromptCache, type CacheConfig, type CacheMetrics, configureGlobalPromptCache, promptCacheSingleton, } from "./utils/prompt_cache/index.js";
8
- export declare const __version__ = "0.7.2";
8
+ export declare const __version__ = "0.7.3";
package/dist/index.js CHANGED
@@ -5,4 +5,4 @@ export { getDefaultProjectName } from "./utils/project.js";
5
5
  export { uuid7, uuid7FromTime } from "./uuid.js";
6
6
  export { Cache, PromptCache, configureGlobalPromptCache, promptCacheSingleton, } from "./utils/prompt_cache/index.js";
7
7
  // Update using pnpm bump-version
8
- export const __version__ = "0.7.2";
8
+ export const __version__ = "0.7.3";
package/dist/schemas.d.ts CHANGED
@@ -543,7 +543,9 @@ export interface FeedbackConfigSchema {
543
543
  /** Whether a lower score is considered better for this feedback key. */
544
544
  is_lower_score_better?: boolean | null;
545
545
  }
546
- export interface RunWithAnnotationQueueInfo extends BaseRun {
546
+ export interface RunWithAnnotationQueueInfo extends Exclude<BaseRun, "id"> {
547
+ /** An unique identifier for the run. */
548
+ id: string;
547
549
  /** The last time this run was reviewed. */
548
550
  last_reviewed_time?: string;
549
551
  /** The time this run was added to the queue. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "langsmith",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "description": "Client library to connect to the LangSmith Observability and Evaluation Platform.",
5
5
  "packageManager": "pnpm@10.33.0",
6
6
  "files": [