UNPKG

@maximai/maxim-js

Version:

Maxim AI JS SDK. Visit https://getmaxim.ai for more info.

28 lines 1.39 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const dotenv_1 = require("dotenv"); const index_1 = require("../../index"); const queryBuilder_1 = require("./models/queryBuilder"); (0, dotenv_1.config)(); const MAXIM_API_KEY = process.env['MAXIM_API_KEY']; const MAXIM_BASE_URL = process.env["MAXIM_BASE_URL"]; async function main() { if (!MAXIM_API_KEY || !MAXIM_BASE_URL) { console.error("No key found: ", { MAXIM_API_KEY, MAXIM_BASE_URL }); return; } ; const maxim = new index_1.Maxim({ baseUrl: MAXIM_BASE_URL, apiKey: MAXIM_API_KEY, promptManagement: true }); const prompt = await maxim.getPrompt("cme9xdi830179d2j99ue5lmoo", new queryBuilder_1.QueryBuilder().and().deploymentVar("Env", "Production").build()); const promptRun = await (prompt === null || prompt === void 0 ? void 0 : prompt.run("Hello")); console.log("Run: ", promptRun === null || promptRun === void 0 ? void 0 : promptRun.choices[0].message); // const promptChain = await maxim.getPromptChain("cmbupqd6u0003mlbkgn3k2lxy", new QueryBuilder().and().deploymentVar("Test multi select", ["part1", "part2", "part3"]).build()); // const promptChainRun = await promptChain?.run("What is Cosmos about?"); // console.log("Chain run: ", promptChainRun?.response); } main(); //# sourceMappingURL=promptTest.js.map