{"_id":"@completionhq/completion-node","_rev":"3-e7c13c3a80d63119be92846c29ca541c","name":"@completionhq/completion-node","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.1":{"name":"@completionhq/completion-node","version":"0.0.1","description":"The Completion Node SDK is a fast and lightweight way to interact with the Completion API.","author":{"name":"Completion Team","email":"help@completionhq.com"},"license":"MIT","engines":{"node":">=12.*"},"devDependencies":{"@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/eslint":"^8","@types/mocha":"^10.0.6","@types/qs":"^6.9.7","@types/sinon":"^17","@typescript-eslint/eslint-plugin":"^7.4.0","@typescript-eslint/parser":"^7.4.0","chai":"^4.3.6","chai-as-promised":"~7.1.1","eslint":"^8.57.0","eslint-config-prettier":"^8.5.0","eslint-plugin-chai-friendly":"^0.7.2","eslint-plugin-import":"^2.28","eslint-plugin-prettier":"^3.4.1","husky":"^9.0.11","lint-staged":"^15.2.2","mocha":"^8.4.0","mocha-junit-reporter":"^2.1.0","nock":"^13.2.9","node-fetch":"^2.6.7","nyc":"^15.1.0","pkgroll":"^2.0.2","prettier":"^1.16.4","sinon":"^17.0.1","ts-node":"^10.9.1","typescript":"^4.9.4"},"resolutions":{"minimist":"1.2.6","nanoid":"^3.2.0"},"dependencies":{"@types/node":">=8.1.0","@types/uuid":"^9.0.8","axios":"^1.6.8","openai":"^4.30.0","uuid":"^9.0.1"},"scripts":{"build":"pkgroll","clean":"rm -rf ./.nyc_output ./node_modules/.cache ./coverage ./esm ./cjs","prepack":"yarn install && yarn build","mocha":"nyc mocha --verbose","mocha-only":"mocha","test":"yarn build && yarn mocha","lint":"eslint --ext .js,.jsx,.ts .","fix":"yarn lint --fix && ./scripts/updateAPIVersion.js","report":"nyc -r text -r lcov report","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","prepare":"husky"},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.cts","exports":{"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"}},"packageManager":"yarn@4.1.1","_id":"@completionhq/completion-node@0.0.1","gitHead":"72e351d0a0d39b1840266a5e4d815eaa10e51c73","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-tWBYWmppfn19/NnqR6g01W6IUwIQlT9cThoeOMrwS7nRGt6Icz+vM37E0k6/5mVx9Xybcf/BQAkDlvKl4JClfA==","shasum":"f826d7ab783ae2e85ed4bff62311ecbfffb7a99b","tarball":"https://registry.npmjs.org/@completionhq/completion-node/-/completion-node-0.0.1.tgz","fileCount":6,"unpackedSize":21212,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdbO542LyUCWhp4oy8fx/xV+9s/PH1X59VMKMALVHGIwIgNGeeIYgZGx47Iztd/vCjMtMEvb66JSIkV2kvBqSkHOE="}]},"_npmUser":{"name":"completion-wizard","email":"team@superdrop.xyz"},"directories":{},"maintainers":[{"name":"completion-wizard","email":"team@superdrop.xyz"},{"name":"theodormarcu","email":"marcu.theodor@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/completion-node_0.0.1_1713138636474_0.2912619471877447"},"_hasShrinkwrap":false},"0.0.2":{"name":"@completionhq/completion-node","version":"0.0.2","description":"The Completion Node SDK is a fast and lightweight way to interact with the Completion API.","author":{"name":"Completion Team","email":"help@completionhq.com"},"license":"MIT","engines":{"node":">=12.*"},"devDependencies":{"@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/eslint":"^8","@types/mocha":"^10.0.6","@types/qs":"^6.9.7","@types/sinon":"^17","@typescript-eslint/eslint-plugin":"^7.4.0","@typescript-eslint/parser":"^7.4.0","chai":"^4.3.6","chai-as-promised":"~7.1.1","eslint":"^8.57.0","eslint-config-prettier":"^8.5.0","eslint-plugin-chai-friendly":"^0.7.2","eslint-plugin-import":"^2.28","eslint-plugin-prettier":"^3.4.1","husky":"^9.0.11","lint-staged":"^15.2.2","mocha":"^8.4.0","mocha-junit-reporter":"^2.1.0","nock":"^13.2.9","node-fetch":"^2.6.7","nyc":"^15.1.0","pkgroll":"^2.0.2","prettier":"^1.16.4","sinon":"^17.0.1","ts-node":"^10.9.1","typescript":"^4.9.4"},"resolutions":{"minimist":"1.2.6","nanoid":"^3.2.0"},"dependencies":{"@types/node":">=8.1.0","@types/uuid":"^9.0.8","axios":"^1.6.8","openai":"^4.30.0","uuid":"^9.0.1"},"scripts":{"build":"pkgroll","clean":"rm -rf ./.nyc_output ./node_modules/.cache ./coverage ./esm ./cjs","prepack":"yarn install && yarn build","mocha":"nyc mocha --verbose","mocha-only":"mocha","test":"yarn build && yarn mocha","lint":"eslint --ext .js,.jsx,.ts .","fix":"yarn lint --fix && ./scripts/updateAPIVersion.js","report":"nyc -r text -r lcov report","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","prepare":"husky"},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.cts","exports":{"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"}},"packageManager":"yarn@4.1.1","_id":"@completionhq/completion-node@0.0.2","gitHead":"8e89ee447ef7750d1cc3ade029e29d9cef337128","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-K5+zfis1zbuZbNdYWFi6OA6LvDG0ZKqLiruqsPqEq7ib8ER9EcEL/ucDY4IEthkK21lGKF3+VZ6HQ0dQLSJTnw==","shasum":"c3112d1442a25d99f5dc4e55b407e91dfbd7fc90","tarball":"https://registry.npmjs.org/@completionhq/completion-node/-/completion-node-0.0.2.tgz","fileCount":6,"unpackedSize":21454,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCpgNyeTGqWsi3j2vZ/uE3fnuhbzqVu1Os2IEceccYiSwIgeUtSNlne4TYvuVtDBUMnuILHSLnRqCM2o41BLNMWFIc="}]},"_npmUser":{"name":"completion-wizard","email":"team@superdrop.xyz"},"directories":{},"maintainers":[{"name":"completion-wizard","email":"team@superdrop.xyz"},{"name":"theodormarcu","email":"marcu.theodor@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/completion-node_0.0.2_1713139004974_0.21226256033419943"},"_hasShrinkwrap":false},"0.0.3":{"name":"@completionhq/completion-node","version":"0.0.3","description":"The Completion Node SDK is a fast and lightweight way to interact with the Completion API.","author":{"name":"Completion Team","email":"help@completionhq.com"},"license":"MIT","engines":{"node":">=12.*"},"devDependencies":{"@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/eslint":"^8","@types/mocha":"^10.0.6","@types/qs":"^6.9.7","@types/sinon":"^17","@typescript-eslint/eslint-plugin":"^7.4.0","@typescript-eslint/parser":"^7.4.0","chai":"^4.3.6","chai-as-promised":"~7.1.1","eslint":"^8.57.0","eslint-config-prettier":"^8.5.0","eslint-plugin-chai-friendly":"^0.7.2","eslint-plugin-import":"^2.28","eslint-plugin-prettier":"^3.4.1","husky":"^9.0.11","lint-staged":"^15.2.2","mocha":"^8.4.0","mocha-junit-reporter":"^2.1.0","nock":"^13.2.9","node-fetch":"^2.6.7","nyc":"^15.1.0","pkgroll":"^2.0.2","prettier":"^1.16.4","sinon":"^17.0.1","ts-node":"^10.9.1","typescript":"^4.9.4"},"resolutions":{"minimist":"1.2.6","nanoid":"^3.2.0"},"dependencies":{"@types/node":">=8.1.0","@types/uuid":"^9.0.8","axios":"^1.6.8","openai":"^4.30.0","uuid":"^9.0.1"},"scripts":{"build":"pkgroll","clean":"rm -rf ./.nyc_output ./node_modules/.cache ./coverage ./esm ./cjs","prepack":"yarn install && yarn build","mocha":"nyc mocha --verbose","mocha-only":"mocha","test":"yarn build && yarn mocha","lint":"eslint --ext .js,.jsx,.ts .","fix":"yarn lint --fix && ./scripts/updateAPIVersion.js","report":"nyc -r text -r lcov report","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","prepare":"husky"},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.cts","exports":{"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"}},"packageManager":"yarn@4.1.1","_id":"@completionhq/completion-node@0.0.3","gitHead":"8e89ee447ef7750d1cc3ade029e29d9cef337128","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-rj8xxellAhejyUwEGioYwNwG3hZz9/zO7l10yFN5rD53I+R6uARnZALrUR90MVyb1w5a8m7k2rzNJZ6czDpSZQ==","shasum":"dc4637476963692644755b595b743ea15406deba","tarball":"https://registry.npmjs.org/@completionhq/completion-node/-/completion-node-0.0.3.tgz","fileCount":6,"unpackedSize":21458,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC3mjfDb9+kYKh8guau6Qn87sdRL0tVmRSRKh5AOjn1RwIhAPc4Vuua6NUpFKjM2NPqoX/YUdDXIPWC3naHCiAzA7UB"}]},"_npmUser":{"name":"completion-wizard","email":"team@superdrop.xyz"},"directories":{},"maintainers":[{"name":"completion-wizard","email":"team@superdrop.xyz"},{"name":"theodormarcu","email":"marcu.theodor@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/completion-node_0.0.3_1713139479107_0.9367501077855114"},"_hasShrinkwrap":false},"0.0.4":{"name":"@completionhq/completion-node","version":"0.0.4","description":"The Completion Node SDK is a fast and lightweight way to interact with the Completion API.","author":{"name":"Completion Team","email":"help@completionhq.com"},"license":"MIT","engines":{"node":">=12.*"},"keywords":["completion-node","completion","openai","anthropic","prompt monitoring","prompt tracking","model cost tracking"],"devDependencies":{"@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/eslint":"^8","@types/mocha":"^10.0.6","@types/qs":"^6.9.7","@types/sinon":"^17","@typescript-eslint/eslint-plugin":"^7.4.0","@typescript-eslint/parser":"^7.4.0","chai":"^4.3.6","chai-as-promised":"~7.1.1","eslint":"^8.57.0","eslint-config-prettier":"^8.5.0","eslint-plugin-chai-friendly":"^0.7.2","eslint-plugin-import":"^2.28","eslint-plugin-prettier":"^3.4.1","husky":"^9.0.11","lint-staged":"^15.2.2","mocha":"^8.4.0","mocha-junit-reporter":"^2.1.0","nock":"^13.2.9","node-fetch":"^2.6.7","nyc":"^15.1.0","pkgroll":"^2.0.2","prettier":"^1.16.4","sinon":"^17.0.1","ts-node":"^10.9.1","typescript":"^4.9.4"},"resolutions":{"minimist":"1.2.6","nanoid":"^3.2.0"},"dependencies":{"@types/node":">=8.1.0","@types/uuid":"^9.0.8","axios":"^1.6.8","openai":"^4.30.0","uuid":"^9.0.1"},"scripts":{"build":"pkgroll","clean":"rm -rf ./.nyc_output ./node_modules/.cache ./coverage ./esm ./cjs","prepack":"yarn install && yarn build","mocha":"nyc mocha --verbose","mocha-only":"mocha","test":"yarn build && yarn mocha","lint":"eslint --ext .js,.jsx,.ts .","fix":"yarn lint --fix && ./scripts/updateAPIVersion.js","report":"nyc -r text -r lcov report","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","prepare":"husky"},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.cts","exports":{"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"}},"packageManager":"yarn@4.1.1","_id":"@completionhq/completion-node@0.0.4","gitHead":"bc4c77405cb11bb7eaa996c0659097668191d248","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-1VmLey9BEL52vLnLG2xLgjmBMrZJ9Wvj2hAm/Ep22nl2rOpfP/SPL+OaMeqjbHzGRzzM3LvcW83FsKTFhqx6yQ==","shasum":"2d4c114d32dfc1e2df0a255468bc885898f513b3","tarball":"https://registry.npmjs.org/@completionhq/completion-node/-/completion-node-0.0.4.tgz","fileCount":6,"unpackedSize":21625,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC/uu3rqQs5VgiBnkTRhtB8QGG9tyrNyxefeprcC6pttwIhAKNiFjEd7ENIzO/kIbbOhM8oOz0pfKk47z6w8ZcmYbai"}]},"_npmUser":{"name":"completion-wizard","email":"team@superdrop.xyz"},"directories":{},"maintainers":[{"name":"completion-wizard","email":"team@superdrop.xyz"},{"name":"theodormarcu","email":"marcu.theodor@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/completion-node_0.0.4_1713139742640_0.5082833877004191"},"_hasShrinkwrap":false}},"time":{"created":"2024-04-14T23:50:36.375Z","0.0.1":"2024-04-14T23:50:36.621Z","modified":"2024-04-15T00:09:03.116Z","0.0.2":"2024-04-14T23:56:45.115Z","0.0.3":"2024-04-15T00:04:39.299Z","0.0.4":"2024-04-15T00:09:02.785Z"},"maintainers":[{"name":"completion-wizard","email":"team@superdrop.xyz"},{"name":"theodormarcu","email":"marcu.theodor@gmail.com"}],"description":"The Completion Node SDK is a fast and lightweight way to interact with the Completion API.","author":{"name":"Completion Team","email":"help@completionhq.com"},"license":"MIT","readme":"# Completion Library\n\nCompletion lets you:\n\n- Monitor and debug your LLM prompts in production.\n- Track the usage and cost of your LLM models.\n\n## Key Features\n\n- **Monitor Prompts**: Track the prompts sent to your LLM models in real-time. We intentionally separate prompt arguments from the prompt template to ensure that you can monitor the prompts, automatically detect version changes, and debug issues on historical data.\n- **Cost Tracking**: Track the usage and cost of your LLM models. We provide a detailed breakdown of the cost of each prompt, including the cost of the model, the cost of the prompt, and the total cost.\n- **Version Control**: Manage the versions of your prompts. We automatically detect changes in the prompt template and arguments, allowing you to track the evolution of your prompts over time.\n\n## Installation\n\nInstall the Completion Node library using npm or yarn:\n\n```bash\nnpm install @completionhq/completion-node\n\n# or\n\nyarn add @completionhq/completion-node\n```\n\n## Usage\n\nBelow are examples demonstrating how to use Completion in your Node.js application.\n\nCompletion is LLM-agnostic, meaning it can be used with any LLM model, including those from OpenAI, Anthropic, Google, Mistral etc.\n\n### Basic Logging\n\n```typescript\nimport { Completion } from '@completionhq/completion-node';\n\nconst completion = new Completion({\n  apiKey: 'abc123',\n});\n\nconst messagesTemplate = [\n  {\n    role: 'User',\n    message: 'Hello, how are you {name}?',\n  },\n  {\n    role: 'Assistant',\n    message: 'I am good, thank you. How can I help you today?',\n  },\n];\n\nconst promptArguments = {\n  name: 'Alice',\n};\n\nconst output = \"Is there anything I can help you with today?\";\n\nawait completion.log({\n  templateName: 'greeting',\n  messagesTemplate,\n  promptArguments,\n  output,\n  model: 'gpt-3.5-turbo',\n});\n```\n\n### Log with compiled prompt\n\n```typescript\n\nconst compiledMessages = [\n  {\n    role: 'User',\n    message: 'Hello, how are you Alice?',\n  },\n  {\n    role: 'Assistant',\n    message: 'I am good, thank you. How can I help you today?',\n  },\n];\nawait completion.log({\n  templateName: 'greeting',\n  compiledMessages,\n  output,\n  model: 'gpt-3.5-turbo',\n});\n```\n\n### Use compiled prompt to log\n\n```typescript\nconst compiledPrompt = \"User: Hello, how are you Alice?\\nAssistant: I am good, thank you. How can I help you today?\";\n\nawait completion.log({\n  templateName: 'greeting',\n  compiledPrompt,\n  output,\n  model: 'gpt-3.5-turbo',\n});\n```\n","readmeFilename":"README.md","keywords":["completion-node","completion","openai","anthropic","prompt monitoring","prompt tracking","model cost tracking"]}