{"_id":"@bekzod/openai-helpers","_rev":"4-c36e9e1965db8b2e30a5efa0c4a6cb5a","name":"@bekzod/openai-helpers","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"@bekzod/openai-helpers","version":"1.0.0","license":"MIT","scripts":{"build":""},"dependencies":{"bluebird":"3.7.2","debug":"4.3.4"},"volta":{"node":"20.10.0","yarn":"1.22.19"},"engines":{"node":"20.x","yarn":"1.22.x"},"_id":"@bekzod/openai-helpers@1.0.0","gitHead":"33be9d5b783efcf35d256e12eba526b5bdfb0471","description":"## Description","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-99sSPeV7vCv2zdOQLdf0hY+ANovTskCU1KnTstWRXOEGtlR8WebIbuGJv7qKgrXJi6+y2ghzLnsFkPb1ZVF+PA==","shasum":"d3f0f6adb59b6e9931dd3010dc8f446052f9f9ef","tarball":"https://registry.npmjs.org/@bekzod/openai-helpers/-/openai-helpers-1.0.0.tgz","fileCount":4,"unpackedSize":7409,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGasCLs4gZIGtfvHsoXPEYg26BnMBJENzXxROscD9oJTAiEAgEVGM6fZg2aT+o1xpnPgizKrXbCCWq7nBABPikIhysY="}]},"_npmUser":{"name":"bekzod","email":"bekzod@me.com"},"directories":{},"maintainers":[{"name":"bekzod","email":"bekzod@me.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-helpers_1.0.0_1706768394681_0.3786030319596765"},"_hasShrinkwrap":false},"1.0.1":{"name":"@bekzod/openai-helpers","version":"1.0.1","license":"MIT","scripts":{"build":""},"dependencies":{"bluebird":"3.7.2","debug":"4.3.4"},"volta":{"node":"20.10.0","yarn":"1.22.19"},"engines":{"node":"20.x","yarn":"1.22.x"},"_id":"@bekzod/openai-helpers@1.0.1","gitHead":"b5f57433169032479bd9275b0a3344daab35177a","description":"## Description","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-2S6HIv8c3tgAzKwtT21q1MLZvxhPcrJOOoiuTK/BY3T5HXuli0hs4di2S7UFq7o6mkAkoMooj5bam5ydsIFGNA==","shasum":"f7a9434fe585563807ba9fe24191000320279382","tarball":"https://registry.npmjs.org/@bekzod/openai-helpers/-/openai-helpers-1.0.1.tgz","fileCount":4,"unpackedSize":7404,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD1Ih+0BylSsfKKjthHrS2zblUe3A7so/C8is3CzRn5bAIgIw6WuHCoF7OPpc7Clvu3njhDSXunH88XqkBOCsByX9Y="}]},"_npmUser":{"name":"bekzod","email":"bekzod@me.com"},"directories":{},"maintainers":[{"name":"bekzod","email":"bekzod@me.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-helpers_1.0.1_1706812588965_0.18839763275667187"},"_hasShrinkwrap":false},"1.0.2":{"name":"@bekzod/openai-helpers","version":"1.0.2","license":"MIT","scripts":{"build":""},"dependencies":{"bluebird":"3.7.2","debug":"4.3.4"},"volta":{"node":"20.10.0","yarn":"1.22.19"},"engines":{"node":"20.x","yarn":"1.22.x"},"_id":"@bekzod/openai-helpers@1.0.2","gitHead":"ea82032d563e967d073fdce02a489f5a3d43faf2","description":"## Description","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-wMCtCsCeYXZ3slBMGcT1Oqlq473/wrxd5EBeWhzoFQX8ahn5Un4bkdhnvk3BvaMhq6l+SP31CzY1KPbWHB1kng==","shasum":"df3a6c2ee12c9fb5a5a4bb463fc2509ff8ae0aee","tarball":"https://registry.npmjs.org/@bekzod/openai-helpers/-/openai-helpers-1.0.2.tgz","fileCount":4,"unpackedSize":7654,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCX5ursNItkNunOTVx76VPe5lyS0b7YDkGaK1YUEwkkAwIgBvESFU1df7Qqz2x4fw5M9c+E+XjM2s/jreV4BKQgCB8="}]},"_npmUser":{"name":"bekzod","email":"bekzod@me.com"},"directories":{},"maintainers":[{"name":"bekzod","email":"bekzod@me.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-helpers_1.0.2_1706984557019_0.9822193594611026"},"_hasShrinkwrap":false},"1.1.0":{"name":"@bekzod/openai-helpers","version":"1.1.0","license":"MIT","scripts":{"build":""},"dependencies":{"bluebird":"3.7.2","debug":"4.3.4"},"volta":{"node":"20.10.0","yarn":"1.22.19"},"engines":{"node":"20.x","yarn":"1.22.x"},"_id":"@bekzod/openai-helpers@1.1.0","gitHead":"51e4256a7ebdf1c7d9fb948ef81a8bc419f079b7","description":"## Description","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-fiO5sg7FN21r/j8uCApgi7xJju5KpUm3KeUQY0aPpKjqWmwHegnH07OUNQRoNjr0QMMc7auVuBwVciBcK83EQA==","shasum":"c7f0844e8c1168e951dd3ecd4e7760e660cdffa4","tarball":"https://registry.npmjs.org/@bekzod/openai-helpers/-/openai-helpers-1.1.0.tgz","fileCount":4,"unpackedSize":7438,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCyWhLnmplgJ/e6ZSWN0eIzl/1Cqh7eOKgS98WINo7L4wIgOjBSgGL4LgoSKZ+xfL5ydUpwPSNPwRx6KYVysv0Rd2s="}]},"_npmUser":{"name":"bekzod","email":"bekzod@me.com"},"directories":{},"maintainers":[{"name":"bekzod","email":"bekzod@me.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-helpers_1.1.0_1707024660947_0.6900954114041196"},"_hasShrinkwrap":false},"1.1.1":{"name":"@bekzod/openai-helpers","version":"1.1.1","license":"MIT","scripts":{"build":""},"dependencies":{"bluebird":"3.7.2","debug":"4.3.4"},"volta":{"node":"20.10.0","yarn":"1.22.19"},"engines":{"node":">=20.10.0","yarn":"1.22.x"},"_id":"@bekzod/openai-helpers@1.1.1","gitHead":"e79840b1ac3e355dbd1e8f0a1e26927a25a3574e","description":"## Description","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-202cuJnarVjOf0Cm6dU8jn7XnQrE9Lb2ONZuVop+W/3XVo4H/58OCrwNWi7vqbUnBPXsZp2SNiTnceJf7K3yAA==","shasum":"c693885e1fbb58a253fbb1f2b033653ddb1216a2","tarball":"https://registry.npmjs.org/@bekzod/openai-helpers/-/openai-helpers-1.1.1.tgz","fileCount":4,"unpackedSize":7443,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDcR+p4iHb45EjImo+tT3MF7OdwxeIbN09aDqomEJWwtQIgfNQ5hFbPHSELeucLNbHfBErUmJT2d+wsFXfpujXr15w="}]},"_npmUser":{"name":"bekzod","email":"bekzod@me.com"},"directories":{},"maintainers":[{"name":"bekzod","email":"bekzod@me.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-helpers_1.1.1_1708156507670_0.4954252698297066"},"_hasShrinkwrap":false}},"time":{"created":"2024-02-01T06:19:54.621Z","1.0.0":"2024-02-01T06:19:54.812Z","modified":"2024-02-17T07:55:08.728Z","1.0.1":"2024-02-01T18:36:29.114Z","1.0.2":"2024-02-03T18:22:37.207Z","1.1.0":"2024-02-04T05:31:01.122Z","1.1.1":"2024-02-17T07:55:07.884Z"},"maintainers":[{"name":"bekzod","email":"bekzod@me.com"}],"description":"## Description","license":"MIT","readme":"\n# OpenAI Helpers\n\n## Description\n\nThis repository contains a Node.js module that facilitates interaction with the OpenAI API. It provides a range of functionalities, including running queries, transcribing audio, managing messages in threads, and getting responses from OpenAI's models. The library utilizes `openai`, `bluebird`, and `debug` npm packages to handle API requests, promises, and debugging, respectively.\n\n## Key Features\n\n1. **Run Query**: Supports running queries in threads with the OpenAI API, handling both existing and new threads.\n2. **Transcribe**: Functionality for transcribing audio files using OpenAI's transcription models.\n3. **Get Answer**: Fetches responses from OpenAI's chat models.\n4. **Thread Message Management**: Functions to handle and retrieve messages within a thread.\n5. **Run Observations**: Observe and manage the status of ongoing runs in a thread.\n6. **Cancel Run**: Ability to cancel ongoing runs within a thread.\n7. **Error and Status Handling**: Provides comprehensive error and status handling during interactions with the OpenAI API.\n\n## Installation\n\nTo use this library, you'll need to have Node.js installed on your system. Clone this repository and install the required dependencies using npm:\n\n```bash\nyarn add openai-helpers\n```\n\n## Usage\n\nTo use the functions provided by this library, require it in your Node.js application:\n\n```javascript\nconst { runQuery, transcribe, getAnswer, cancelRun, observeRun, lastThreadMessages } = require('path-to-library');\n```\n\nEnsure that your OpenAI API key is set in your environment variables as `OPENAI_API_KEY`.\n\n## Examples\n\n*Example usage of the `transcribe` function:*\n\n```javascript\nconst audioBuffer = ...; // Your audio data here\ntranscribe(audioBuffer).then(transcription => {\n  console.log(transcription);\n});\n```\n\n*Example usage of the `getAnswer` function:*\n\n```javascript\nconst query = \"What is the capital of France?\";\ngetAnswer(query).then(answer => {\n  console.log(answer);\n});\n```\n\n## Contributing\n\nFeel free to fork this repository and submit pull requests. For major changes, please open an issue first to discuss what you would like to change.\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n","readmeFilename":"README.md"}