UNPKG

@arizeai/phoenix-client

Version:
29 lines 1.04 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.listPrompts = listPrompts; const tiny_invariant_1 = __importDefault(require("tiny-invariant")); const client_1 = require("../client"); /** * List all prompts available to the client. * * @example * ```ts * import { listPrompts } from "@arizeai/phoenix-client/prompts"; * * const prompts = await listPrompts({}); * console.log(prompts); * ``` * * @throws {Error} If the prompts cannot be listed or the response is invalid. */ async function listPrompts({ client: _client, }) { var _a; const client = _client || (0, client_1.createClient)(); const response = await client.GET("/v1/prompts"); (0, tiny_invariant_1.default)((_a = response.data) === null || _a === void 0 ? void 0 : _a.data, "Failed to list prompts"); return response.data.data; } //# sourceMappingURL=listPrompts.js.map