@arizeai/phoenix-client 5.7.0 → 5.8.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.
@@ -1,4 +1,5 @@
1
1
  export * from "./getPrompt.js";
2
2
  export * from "./createPrompt.js";
3
+ export * from "./listPrompts.js";
3
4
  export * from "./sdks/index.js";
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/prompts/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/prompts/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export * from "./getPrompt.js";
2
2
  export * from "./createPrompt.js";
3
+ export * from "./listPrompts.js";
3
4
  export * from "./sdks/index.js";
4
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/prompts/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/prompts/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { ClientFn } from "../types/core.js";
2
+ import { Prompt } from "../types/prompts.js";
3
+ export type ListPromptsParams = ClientFn;
4
+ /**
5
+ * List all prompts available to the client.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * import { listPrompts } from "@arizeai/phoenix-client/prompts";
10
+ *
11
+ * const prompts = await listPrompts({});
12
+ * console.log(prompts);
13
+ * ```
14
+ *
15
+ * @throws {Error} If the prompts cannot be listed or the response is invalid.
16
+ */
17
+ export declare function listPrompts({ client: _client, }: ListPromptsParams): Promise<Prompt[]>;
18
+ //# sourceMappingURL=listPrompts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listPrompts.d.ts","sourceRoot":"","sources":["../../../src/prompts/listPrompts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAI1C,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;AAEzC;;;;;;;;;;;;GAYG;AACH,wBAAsB,WAAW,CAAC,EAChC,MAAM,EAAE,OAAO,GAChB,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAKvC"}
@@ -0,0 +1,22 @@
1
+ import { createClient } from "../client.js";
2
+ import invariant from "tiny-invariant";
3
+ /**
4
+ * List all prompts available to the client.
5
+ *
6
+ * @example
7
+ * ```ts
8
+ * import { listPrompts } from "@arizeai/phoenix-client/prompts";
9
+ *
10
+ * const prompts = await listPrompts({});
11
+ * console.log(prompts);
12
+ * ```
13
+ *
14
+ * @throws {Error} If the prompts cannot be listed or the response is invalid.
15
+ */
16
+ export async function listPrompts({ client: _client, }) {
17
+ const client = _client || createClient();
18
+ const response = await client.GET("/v1/prompts");
19
+ invariant(response.data?.data, "Failed to list prompts");
20
+ return response.data.data;
21
+ }
22
+ //# sourceMappingURL=listPrompts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listPrompts.js","sourceRoot":"","sources":["../../../src/prompts/listPrompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAIzC,OAAO,SAAS,MAAM,gBAAgB,CAAC;AAIvC;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,EAChC,MAAM,EAAE,OAAO,GACG;IAClB,MAAM,MAAM,GAAG,OAAO,IAAI,YAAY,EAAE,CAAC;IACzC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IACjD,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,wBAAwB,CAAC,CAAC;IACzD,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;AAC5B,CAAC"}