{"_id":"openai-streams","_rev":"106-93ade35fd18aa62d8df36b6db924d016","name":"openai-streams","dist-tags":{"latest":"6.2.0","canary":"5.22.1-canary.0","cjs":"6.2.1-0"},"versions":{"1.0.0":{"name":"openai-streams","description":"Streams-first OpenAI API client, written in TypeScript.","version":"1.0.0","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","build":"tsmodule build","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","openai":"^3.1.0","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^1.0.0"},"keywords":["openai","openai-ts","streams","gpt-3"],"licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@1.0.0","dist":{"shasum":"5f95022c4b805951594b0f3f0c47ad9219d8ceb9","integrity":"sha512-hF7qirYEr8dqm8os8ddjmQckasq2Lc/RpPh0zd0E1cuBGk7dHbcuSlTnsqj1i5bEnzSuKB2mX/UUFoGbd5Q2eA==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.0.tgz","fileCount":30,"unpackedSize":8356,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCGJ8mbFY7XXsELTBty5DBLpoDHZVPITcGSINCOpre+JgIgGWXddZwCNKca1jyaFNu8Vx9aNVGGntHItm+lHBkgbQ8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj7ChRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrclxAAlWb95OxXjMSXUTINuyV7dqQerULuk9a1WYGK4dkbutGsUVTH\r\n07mnmk8KINgaU/Mauo9BlCRoEmYEmAthYbWeGa6QUEW+vqGx6V0mqMKprFR8\r\n1olP3xrKF7t2KnJDwH2jKqoA0sMyw7Y+vOTr4CAwku20j/P2stGX8iKn3Q+B\r\njq2vEvfnTa32cyni0yPML7Weo51IC1jr1o7zdSi5YKfpmiIlSuYuHyzoXlW4\r\ntjAae54+sFRDsaWss9jGYnAF2p/wszIZ0tnN8N+rZdGecv1RvjQKo3jdbEd3\r\noycMD1fV5WueukrvLe2PG7abZHEeXToMJKWZ7c02BmVSLj09Nxmtv9FBRafm\r\nOqP88FWfHk8//xr7GPJlvQa9lgLwgvo71vcc9GzULebI65yquyhk/vJjVRg0\r\nK5aD4VVZRCcpzl9kg7jEXzrAlSu8TucfKrYP6jdWyGgTNTz9VnCj86mR8l7r\r\nRs4KoEGZnFSA+Sl+EaF4WzfavxPlD+4UqI6lr9Ay84ge9b2gAH5cR6pvA+v0\r\noy56KyhRfso+kKwGF7KTJX4bRNZb8EQnxzEmGw3Dqdk5KJA2leh7h2njVK1f\r\nolfaUhvCl8ojeIXLXIQpHWFnhHLCDUm+FmSq1h/tQHCnkCJFA97sJrA5oF2p\r\nsuau4daW2r+tdz5APR9Pubt1f7Qc17nsVd4=\r\n=Sn6U\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.0_1676421201402_0.0033605877600104694"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.1":{"name":"openai-streams","description":"Streams-first OpenAI API client, written in TypeScript.","version":"1.0.1","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","build":"tsmodule build","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","openai":"^3.1.0","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^1.0.0"},"keywords":["openai","openai-ts","streams","gpt-3"],"licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@1.0.1","dist":{"shasum":"5e11490f8d94e0b05bcf925c406831a99f918ac8","integrity":"sha512-5Fskacn8iJYvzNNH4pJ2tXQwu8zb9drQ7bOnf9eLyF1Kq/I+LzdI1hEtqbvh/IKmJxN3FbzPdp8dW4l8ODa/3g==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.1.tgz","fileCount":30,"unpackedSize":8356,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB15euJ1Sruzrw8f84HkA8Qp3DpwfxY48Xqrb4+PhWKNAiBzsluDGK8PUoCZeNT5dGCcajHfjSRMxFshjSt7s87XCQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj7DR1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqGaQ/8CHfZCduSJgvRxEoaHHdOJmN5eGq3+f6yMo/I8pFsBOCFuF8t\r\np7YxkktrcnU0tigv7dBwbPOwDMWooJFBNiaPQPjwR7XYMkL6k62Q/GP7HWcV\r\nFkYH9btdZXWumsVmgSej7fmejI2Hxb4JbKyLKAtK8u8tQW1DMEPQrlHt9M7j\r\n9Mls9AQO9DcIucsiNWrIeEDy8+8XOVT2fkUAQcboKKAz3BBtlIaG8NvIEn2B\r\nC64B0EFfNRvBSpZigeN+uik4FxzdLjpJG05ekN3F/Ljda24mUN4+PMZmX6rT\r\nxmAT85LMJVzsSy8xcVyHoFrXD6QaAtnynrYA5XtWLnks4TwgzIkJ/bIUCfHI\r\n31UFQdKJoz6RhFIT0GauDlDuc+wY/wTNigHpPV5OzAAaizfWmnP/d9bJUKLV\r\nmpI93FfguRVosg5sfQbGILP0iDfMudbAgv899j2xRYLSIH96MWI0c/bHh6Ln\r\n46sh1QCR2PIchb2+xl9thXb6yT/tZQS32Ci6IfXUuBsk4XtQjsKS3qicfmtH\r\ndY1vVgaRbpkYuxwD+EHMXGJ+dFi4lJyH+odVdz2XMvI60oqIih/eG7KJ3qbi\r\nIHRSGR5nxmtAevHo/etA3ZZAdhXSGTWEUV0ePz7Rl65Ry90VmUcBrezCeK9X\r\nlmW1lijhZRQ9Swe6/RQ0cIBi+ArAaqwNBAs=\r\n=yyvl\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.1_1676424308818_0.058061247810483385"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.2":{"name":"openai-streams","description":"Streams-first OpenAI API client, written in TypeScript.","version":"1.0.2","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","build":"tsmodule build","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","openai":"^3.1.0","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^1.0.0"},"keywords":["openai","openai-ts","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@1.0.2","dist":{"shasum":"91dc5fef78f161c58be43b60806408df938648ba","integrity":"sha512-S7uGjE0/rgX3qwjAsWTESKjfrgITr2Tfaj/xLDz0bxhm+9G0ZX1RbMQp+4loBkY61ccDcge2FtqakHOstYKYxw==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.2.tgz","fileCount":30,"unpackedSize":8415,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICxkBp93ah+IDAX7IE7SaouDBE7LOYMHmn0WoqRq7wE6AiEAuzEelU3dK9GxYX4rQEyL53sxRezCr8497YdGGMp4d8k="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj7E6BACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr/dg/8DTXR2tpzKm7gpBfDhZZG/ahHmz94vkwI3NMXYdS8KgLwPEWt\r\nvgySfrcLl1JS9sCjU8b1Dtej+wg3wfgejRrriZZoOPZcOydlj/+fXQYJZPnM\r\nZ4uW3Ns2A5sbA7C72tQmXqFmkY5BuYAtX/SB7SAfBYamUDq0BXdO4pOWIR4k\r\nP3le+APrGjDQddJj2pqLScaXczOz1ZkVqnunnv/7HrrMKOks9XK7AeSj1yiR\r\ncgA0ejKPfBAhveE7LWi5eLRu4ncsIxQfmdGqA/xtLrH8o0e+pFwHUd23PzVa\r\nFCUi0FeliNS5dwd9EtSFhWbJcllCfjjVRFozjdNMlDw3wexXAfxFlA808QMv\r\nBhLN8V4Ul+XJAqgUo4qhRBnkJFsaui5rdWYaYy+acaUa919TVsr5GDcJXOZV\r\nWhW0p5REP0kwh+dtkAewlDJp1Qb5r2753l6soR1R3MHvzJxOlNulBJFVdjYz\r\nyrupZWaEv2EVDstYjCef5tzp92F4aZsbMFdR9EDG1oRsy8VrPCbUvaiiImWV\r\nSpCVRBsO0xzRk9PND+/5nbTB9oZR89wt/xJMdJoizMxnETEOZSV7jNC/WPoG\r\nvYkEhFtMgWmdC4ghxiq/ADyo0CaIcAq6XXu8RKu4Vah+kHt6XQ3d3sDRBBfj\r\nwYJ3TAre6g4FjnklgZnCr9jJwFLep5CVlRM=\r\n=sqpa\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.2_1676430977624_0.28675011105809456"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.3":{"name":"openai-streams","description":"Streams-first OpenAI API client, written in TypeScript.","version":"1.0.3","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","docs":"yarn typedoc src","prebuild":"yarn docs","build":"tsmodule build","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","openai":"^3.1.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^1.0.0"},"keywords":["openai","openai-ts","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@1.0.3","dist":{"shasum":"1c2b9982850c8eefde93381696c1880ef21f0b5a","integrity":"sha512-9JSyMzVxr6SAqLMduxlUD/vwPZhOvi65SlJ/xMkWxeGX/bum51C6zF5CI0IcgWe8WH+sNyVuvQYRSmnNcEytGA==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.3.tgz","fileCount":30,"unpackedSize":8550,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFXlLiByr/W31eaqZV6kef7t+gKYxEtsWOkHW4W68agVAiBTdfPO4rF88q5uB0AjeZsG0h+iSH0k3mucKtOk56ITeQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj7FNUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqKbRAAm0BG82nFzxffkPQ542llSXJm5MRaQSfUFQZY7FfUq74Otard\r\n+5GJcPjuokvr4TCCLvKy2kPPKK7p7M0OyeISwEfKzJ0XlXpiFLIF+LYGZQHU\r\n4kAA2EFs0eGeXO2N0HuHcd3cZX+nT/9oEb/RtF09sgJFYbxpj8hFpJ3Tme1n\r\nHJa9HnXOTUAmXwE5XYPp0eKIqyzBfjjBLEGadyEgq4hQQpFu9zs77wK210jp\r\n3OEIKE2G9aAOYLwIZK/MUD3Vx6PDY5cQvQOoO08vxzKZMar3lu8EKlPPdkOX\r\nHK84YbYP8aIkK4oDEZjN6a1ri5Q1ZRpafr79WEAG5/LWipDpzNL3zVBWBBsz\r\nUNGSMqaBl/54vD5owzGk3j5/MmGNtqzQYJ4vOc5aDmavqAVlkW7f/0E2I7rM\r\nwhvhfSJOPFhRSAxPFiPyK53Y7Ow2+olzfKPHup8Yr8Vvie/caQZdPcgCJEbm\r\n+1iUa32+P2bRvWFlj9uC7XR5/zTTlcjZSjU3OZYOOaHGYxT4/R9yBuHCs9ap\r\n6NRK9QfotdlD7HQ/8NJKEoLGlyPtbAfEd63S3LiLnwWELuTQ1kT3AptTDoTM\r\nxezs7uS9qrLH3ZfkmN3u7USbrC/WwgY9ttI3ZBtX0joNH/dzzTc+yuQz66rH\r\ndVgd6dvhrIqEmYGsUR8KOeH62IbXAYM6zH4=\r\n=CJo8\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.3_1676432212158_0.5685026608968082"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.4":{"name":"openai-streams","description":"Streams-first OpenAI API client, written in TypeScript.","version":"1.0.4","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","docs":"yarn typedoc src","prebuild":"yarn docs","build":"tsmodule build","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","openai":"^3.1.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^1.0.0"},"keywords":["openai","openai-ts","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@1.0.4","dist":{"shasum":"0a10614057867af2e92d48f96561d82c6bdd01b5","integrity":"sha512-DH2InWJCzcgy/Nziy9snsSla7mRip9EOnJ1Hx9gJglUMxsx4EpdlA+haWNKpI3sOtIRc+bYIX4qasySFqZRJ6g==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.4.tgz","fileCount":30,"unpackedSize":8550,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCwnc7zrv5o33wcOBHHx4t2LopqHxLWQI1t0/hxio7cOQIgDIvpiZK3lXF+adczf9dH6uZKvruICEJ5NVyrgHPJdZA="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj7FPoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqtUQ//YW34rzC7N+QWjq4ZVXSwR97CJsjdqV76npSKPBSlCc+bya4Z\r\nTwXF/4vGoCWzbAJAoNQGZ6KccdUv1tUW6pwq3KqfMANSMfpAMP4jOJO5rSl+\r\nkinqDiZckRQdV3tcgNumrsZNBtGRBlZ8eSsczB8Y5eelXTJnZxdLe59YPm5C\r\nfox65Ag0AFcr3xRrRgk7SO5mMjGwzgXMvbUwCA7Yaux5uASm/H35cpELHlwK\r\nMsagd3Kz77mqnVYzwx7gMNKSINbq4S28kuGufpf+cxe4SqDsqnaNtkotiQ45\r\ndHMdr4r3tZKZ49GO6BO1lSTUCBs9LDLjIvm2oSWrcDTkF6Uvj1ic2VSlCwpx\r\noPdx3HP3A0lYQ4chS7TFLdACGno1L4pvswUWvVe09GmtqIE4pp8wZrxgAL/Y\r\npNM7UGnD8RHQlDj6Ttt349MqyPB0Z9nma/9IswrOoGOwkIJ3FOn0fN+oIzD1\r\nfQJKFh3Wsaldxg6L0SQ20c/mOo3x9+e7lqIgCswYDO3XBfAjjvomOE7TzH6/\r\nLxjTTw755FHMSfNNSofPDeTVvBPHtIdSwY5qYFcV1I1ZE117vPV1SoG1Ypxg\r\nMR38eSLH2M3DBFj7y2QisOXxNR1uKnhzSY9mzk3iwGAizZweTRfHkRXBSyXY\r\ngLwMFkTl1qyF+XNO80vigbI25WBrJYvpMDA=\r\n=77/H\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.4_1676432360393_0.6417371583919504"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.5":{"name":"openai-streams","description":"Streams-first OpenAI API client, written in TypeScript.","version":"1.0.5","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","docs":"yarn typedoc src","prebuild":"yarn docs","build":"tsmodule build","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","openai":"^3.1.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^1.0.0"},"keywords":["openai","openai-ts","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@1.0.5","dist":{"shasum":"7b77959ca6526f80d660f7c0b8229c1904226a15","integrity":"sha512-qMqUNRwaOeTvKC4+VC2xA+dJKncmJr2gcbZ6NV+tQRTkfMKc69nczeRrK0aDCa1JkjG48OYCx/u8b3vdI2iUzQ==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.5.tgz","fileCount":30,"unpackedSize":8541,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDK3UT40c/zK18uIgpxBNG9wE+34JNZcp9Hm5gkN8IgLAiBeem6HvmR63+AN7CA5bpAqIAQaPJktoR8/sHA/MV4Ksw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj7FUfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpV7A/+JtXa8wjD4IwcqO6RFzUi/JOou8rYOdTVLkHt67HTlht8UEc3\r\n+XRWSejmNhyalDTb2FisWwx/Brpq2fQDsk+NUDVQ9VOWnEsUXBIKLkeLRy+L\r\nxhg0JDgq/328JhUNm8XUcqYKAl+uz9mM02gVd1ApYb/E+QekOHUaGmWJ6qNY\r\nQdsR3BO/rKi0nWbf1lJFiEKUFPSP153cVMjTLAKg7OrCbNbPS0uOMyNoqLqa\r\nxGIyEvwE4Odl0wnEDFhRM5rs2zybW9TDs5/eos7LLp/9Mw3XBoE6fHctY9XT\r\nD52F+fDrkIQEoG7g0FnvkscETFUPRP/ZFxel5MMIxwhifb/Sgj8Ag218tze6\r\nTJv2wzVZKYXIR0Tkr45fo2oqSWcPz926nwlBhWOzEiNNbZJ2VPCi3LZthUnd\r\nPMr+mcDSLfOnUvnRmxEQBldmIJHMLSgNlC419x08LtTkPLyWrg41KJjH+6k+\r\nVAAb8zGE3//+HrflJOXenNwr14BcYZ6YQJFfaHXSEKENR+Qno56XOkEbqzSk\r\nKN7BYBUrBDDFhfVPnvvFgVpC6ok9u82en70xpdb+HRSEUeR+i5UyANA4ZgJX\r\nywzjnKzLRBdrTCcM5+0SVb+RjDJwbYc8r+jHm/2r2Dzb7hi374kdMILDyEmI\r\n9eP1mgC2DgObuZ+Fu4I6yWfla71sukf+7qI=\r\n=UP5q\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.5_1676432670966_0.24302621250603584"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.6":{"name":"openai-streams","description":"Streams-first OpenAI API client, written in TypeScript.","version":"1.0.6","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","docs":"yarn typedoc src","prebuild":"yarn docs","build":"tsmodule build","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","openai":"^3.1.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.3"},"keywords":["openai","openai-ts","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@1.0.6","dist":{"shasum":"43c1a7d95e72ed5af39f5f6d98d38230143bbc6b","integrity":"sha512-eMuvEGt8ytsNnVlMU3LC5DpIDHnbVfDu741kLapNJkFWo2yzPGfKw0RA0LVk+uS8wTemnjlgg0jyaKYgJ9da8A==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.6.tgz","fileCount":30,"unpackedSize":8541,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCgyljXEkO8e72Qr3vvAJj8n3txK7sxP70RA/dm2dIMWgIgKsfUZ4gvfC92EGM/sbT+yLpnDsYJAPs/gjFLFa1Sz8w="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj7rNbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq6/g//ZGMv6lY+DMmWnjgdcxF9J3/aOpO2jfaugJUOAB7osYBiNoTd\r\n+WpObVpF6zPmZgLqI2+yJ8drXSTzGWNyecSzA/cwp4BEO+45QMVULOcRplTK\r\nD8f+MmsB57/Ur6jta0iXpN1p8r4HpmNGsAfGophCu2qG1i2g1HNZjE77YiRI\r\n5CdAlxSvIenyphqKDf2zYi2qUL8DWp5zrcQ4GXpADNSWUaODcQPmyXwCywTe\r\nh/mvYfP3ee0RbNPoXqtFR4gfoyEsCSbGhmNaA3hoy9G/PC3I0uWgpnRycdg3\r\neXIvwm7kECxvCN2h119a280+6A3sp4VeudBzNZPzqzb/xKQZ9v194GJofZ5h\r\nyUQz3ScD6QGBQnxlOXKq4ntCKNvXPZjoZfjZ1GQ28Yb/9QcHxD2PBypMGd08\r\nEwAUI9SYYTxH/5lArmKGeUGk186pqXKuPo0vxbp0PCMPbU1wrxM49aRkrQ/4\r\n5xmB/JYhQLzG8G+qb/hmfPiBmUJb8gM30LrrZn4fL+dcy/jRTgmt66Ftxsy4\r\n7IKGG8gTxofa0c4uXvSkaE0uqD/iM1BSYglNCg9Kl4MPQ2aGGCGw+ugTHt9a\r\nz+CNBu1COEbVeOrJEGl1sxet/ZRJdJTzdjbAnYC707o143VQgRkUMtEr86DJ\r\n5IestaHMmSytj84EqF5d2Dk+mEAZpFYqlUs=\r\n=L4RL\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.6_1676587867027_0.5897524098093123"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.7":{"name":"openai-streams","description":"Streams-first OpenAI API client, written in TypeScript.","version":"1.0.7","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","docs":"yarn typedoc src","prebuild":"yarn docs","build":"tsmodule build","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","openai":"^3.1.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","openai-ts","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@1.0.7","dist":{"shasum":"005f8b23c12cfd4de1d1f473c8dac5ae33068634","integrity":"sha512-1zwkWFkf1otcxMY7uHdywU6BTQYBv13boQntuR3alFrccLVspOHM3Mt2xCSBgU1hmqQ0f1Kws6HMDo6a8ukcxg==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.7.tgz","fileCount":30,"unpackedSize":8541,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDeT+tKJoihh97v6GCrmw81TcYK9dNQ7Tgx7ClHJmL5TAIgUQ4zwcmmFDb4qsJOa+m1aym/Bxiv3S5mv5RIUnwhE7k="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj7rbHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrBsg//Q72H/k8B8P5k0lSQ6tT29+ejbgG8YXv9OvY7DPRdMyJq7u2E\r\nS7qZlsWgtA6M+g3+Z64SVsIO1t60eYMy5eUEUoKiCu/GQr5N8nBmPgu2ZfBg\r\nIPvGQdDOHZ8HVBOK1loxl9MTrvjb9051f3PccYx0elARy04pqaMElnWQplSm\r\nJmXAPa1bdVBfKUmy/syJWs5GdUFjeZHecvp7opviWlCGQD+4cKlXNPAYUs/3\r\n42MsUHGO2IPXhx7rBr2A8qRRiX2swq3kFX0/2UDoJvTygQaJhYL4XdzBDryt\r\nYt99CZQ9kmxflpPMpuX0Wev286+BiWyKwtgKKgL2SixuIDs5lwn/0P1wyBim\r\nDfxBqzrx+6aw+ftAREZ9hASczET9+B/BcpzW+HgNdjSEJvfJhLGadaGUcGq5\r\nIA4kfwA59Hl25y9hj6tHEmr0OolQIMT4eccVOv98/kkiR4ZOnottCnuFXeeu\r\nAoKtAhaIDux9a4rRRA4vPnnANXB6wETVH5LyqVY+IMkYq0ARMFZ/iC9TFmKO\r\nfB9RBd7IUCqXxRkGtUpUucaZV5vK8tNnpSDXAzVpSvq0Sq+vcprKxQIjKxpg\r\n5qZzQ1QrdfvBHw0rR7cO4LjByS7hegTPmZC0tF9oK+rsT+8uHiqkx7tkvJD8\r\nBfcdJHX+xfspWN+uH2roVgp4JafNE1pwMyE=\r\n=n7rf\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.7_1676588743264_0.31568022115067795"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.8":{"name":"openai-streams","description":"Streams-first OpenAI API client, written in TypeScript.","version":"1.0.8","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","docs":"yarn typedoc src","prebuild":"yarn docs","build":"tsmodule build","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","openai":"^3.1.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","openai-ts","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@1.0.8","dist":{"shasum":"e4ccfbf996f3a12bd5ae15620abf1629dff8e7af","integrity":"sha512-iCb1jgs5B7J+EEBpu6spXxRxKIKbKu4efd1hCMaJmz+D0lUEVUH7DGkR2X+VpxTYHt92RjE+PmrpK5Bj400nKA==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.8.tgz","fileCount":30,"unpackedSize":8619,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA5iapCsv1mJdNwHn1q3RhVOL6PuAIwytqIBK0s9Iu4MAiBpNuOkBTPFj5Ut/tj9cWDuEBXmNsOPhvitzh1EoJc6CA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj7tbOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqx5Q/7BvuRLqwPyhaE0RwELIpwNElx0SGX/e17C0ieb/LdEoSORGMZ\r\nvLy/6/eotwxRyTqpsC8dBqQhjgGO8Eep4My0TwK1OPSMaHcipGcbu61S9c1c\r\nuWP77B++As2KXPYlSUZfeB3Afmc3RS9dFuQRBGMGcvGybIvguGCwn5cPotcr\r\nK0WQMIqqvrDH8Y+G2JwvEIb512sUFzNmaqgdce/st5oiE/nev3BeQXwtX+J5\r\nzR0bN2uytbocEIS8lVIl9y6/aY7vMguwA8kieLZiSJXZ669LgyrQkaQk9+vZ\r\nqkdrmkON2xcYptTqPoAwf/30PKPGTpRSYBOrmuzXpgmpCCN/gSmlv/63HbDg\r\nHHZQ3I4HkCMtMcBYIfDaKfLfXdKFSoWQ3tp8MbdYfseZv4RD01EMIpt0J4uz\r\nZM6Ey95YWHPv4Xs11RJm01ZNKnjPlurO81/RrbH5oFv+m7jP8DSdL8akmuC/\r\nzkJpSB+uAoaRRC7UaKDfNS2AQYOB3BehyBftG/J9BsBe3ETrecFt40+Oldi0\r\noao22OUTPmqRkKflBfF1Mmi67Y0OQBGMZFuzwuSAv4aa7H02LQJbsXgXngxD\r\ndw6jo4NSe2zB5lUaPcq2mgGHetGaWg1wStflPABXxPCl+Hpa4H+qWKO2/v3n\r\n1nk3Afj84RV8ZxnBg8JC0Vz3KPI57RkhKcs=\r\n=tRrS\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.8_1676596942116_0.7233840129881335"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.9":{"name":"openai-streams","description":"Streams-first OpenAI API client, written in TypeScript.","version":"1.0.9","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","docs":"yarn typedoc src","prebuild":"yarn docs","build":"tsmodule build","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","openai":"^3.1.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","openai-ts","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@1.0.9","dist":{"shasum":"6abf0cff4d597c85a386b384435071efb0274940","integrity":"sha512-4f6kuGyQgoKD2pmhTyOw0flfPWmEF26kzQUa0VeO1EEl4eWZ+Qd6yfcbTn8OwrJerGkkZZlTZ3igyPXjzVorxw==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.9.tgz","fileCount":30,"unpackedSize":8597,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDkyzfIgsmWEa7gEybzGpqqwa6cKXaMa/S9BqtNY5ZCUwIhAN2emSx2i66zUAlXUgnD3KETOju32LCURnGcY6fA2EZV"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj7tcRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmppvg/8Db4BV41losFXtA4WSpFeay85XX+NyvW+5YGzST6B+KCtMSMA\r\nEEgEkJVak/zq+v7zLrRF7OdLuvwP1L+ANP2DjdDjMtJoTjEqakLEe17v7KkY\r\nBoCxHn+kRUdgin1/JdAkBUv42F0W8Y5n8+xZfpIL2gJJjM/MJmvuY5ZV3lhM\r\nhpS5u3jLZB0ACOkEJAeXl+yz8QxFmrpqTvOn1QfVmAcaEg3ZbGBkdkkZFCVQ\r\nsPNJyy+4ABV6zPDZHpl7tspegUXa7i+rupFxdh0WsU0X39EDPCb0eXveM7kS\r\nSm/ieJqJ1HZr+99MHW8h6SiIAKkBNrIyQShxCtN9HsNBbXQVcj1pvD9Cm9TX\r\nw6w8EEj/OEogaN9UWlfnlr4o+bIqrKBuHn8JucpKGEVVIuvrffrtpxFGwycA\r\nwFWHVUZevhyOXdrKANPpi8JOHsrEp4NcSOD2BXq4ivIHeGLPV7cPOks/SPTl\r\n9qUSedNsEmEz27wGS+tPO2pEQxV/aqBfXVzHybO7cyGzMuhuqXg4ENo9smVl\r\n7K4v1UDfX4LFHfV8INNiv41tyfvsrshfPA2lLjCPHuXDD8CdA9QCGTC7B2nM\r\nSbWtQR7uq8R85Y+3RjWLy6pVoTEu/HDTLlspCbyOixB/4TaJ+Rri3sFEndxY\r\nl5iALYK7fA/bbatYtU+Kq2F6wsDQcWyV+cg=\r\n=Qkzp\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.9_1676597009112_0.4975618550151024"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.10":{"name":"openai-streams","description":"Streams-first OpenAI API client, written in TypeScript.","version":"1.0.10","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","docs":"yarn typedoc src","prebuild":"yarn docs","build":"tsmodule build","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","openai":"^3.1.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","openai-ts","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@1.0.10","dist":{"shasum":"734d8de49f286c56bc122ca0f3a2a02a2e0f3557","integrity":"sha512-uFeVRqnEBzu9ywFhlEGNvmRKHo3CI7ixmyRqyjCEN5+HU+EFg3aIHsUrRoYF19DuBt8ZjYfO+VGjVsvxSeKa4A==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.10.tgz","fileCount":30,"unpackedSize":8653,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCIGgmwdGgn9S9BoIYW/5VFBWnEQRaQQT0V+A+nSSfezQIhAIOyHK5bN/ftSeYRmllcFqGGJkgf8n4srYigiLOKXrXm"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj7tmQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmotKBAAil4VuRipO9fFEcZk4geaIdo6n+HfRCHNMHIriZm3pLkldOAF\r\nAlg1KDVkJMkbGf+21oYoKG4nMhsd60FRdrRvNXKvwgcomLS7Yi70mGt1X6d/\r\nkoFreBscHEXeTvMp0gBnQfgBcx2yemAVBKFC5JQeMMaAIEtnnWnP3Ru8arN/\r\ne7ZiXWFSkrrKVifn4ng5MkkOvs23Q5psS+ap3ZIVIXSwuseXZAmv2eulwePJ\r\nGh9WnCs8qzE57b+4qkEm7z727Epj2s21TsI1N9zStH5zgebMaVXlDwarfh5W\r\nJ2XNAje2avz2z2WTIWrzRTxVLXT8dfWhXB0ph+h7G539ZwWN9gyXxdk8Yuhk\r\n54LbbJGkFWv47fEnfGpbRaNGxPOOMEFQsz0l96Nz8kLol0o+leDjrZlQT01R\r\n/mNeTIUMrU51lWZIAjgrJXGkSPvpyNpn3MRIAGOw96tSygk7WJuorUoJ2Gcg\r\nXzuYkuUPoJpka6iqTjJGQAb/d1di0u5/I45l/6XRH7BP8IR19ogvDbfbfw6O\r\nNYcyEqST00KMKjaC8Qro6fa83L4S7L8/UtXry9o71vEfRGK4HUYDMdSy+3Ck\r\nhlTLMNGBXvrraNU6csj7AJ7b350DJbjaaEk9h6W3UjLAlJQbPJHuYuyQCzsG\r\nL1u8fnsUb6iNA3dmJdUv9kvSvM/nio2Z7BU=\r\n=PwgN\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.10_1676597647928_0.828393475854881"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.11":{"name":"openai-streams","description":"Streams-first OpenAI API client, written in TypeScript.","version":"1.0.11","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","docs":"yarn typedoc src","prebuild":"yarn docs","build":"tsmodule build","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","openai":"^3.1.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","openai-ts","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@1.0.11","dist":{"shasum":"f9e03294522141935e9c55d358a559be5d33973e","integrity":"sha512-SOtANP4ju0gMrUm0NpRlN3xnyafCsC6KgWZXcONL5m39jmn7Ec1svwrQz/FS8KxJXiZcmkfIW3vCnldu+2keqQ==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.11.tgz","fileCount":30,"unpackedSize":8650,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAmoZE4hE0AUhANRhBrtXQ5sjB5Tl5+fci8PTmQ12c26AiEAhIbY+ryqt+7Q1ZRpHfqzZ6qX6uOSqd4XC2GT4aILeSI="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj8agcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrORRAAnR4ATdT01BSMstG3x9O9uZJFXsQ47DlHyKEa9wwycnremzwS\r\nu5N1s48xb82ZK0v4DqnyDxVbyjJN5d3w8d+fZquSy1MgEFmtqH61D8c9xjp4\r\n6Vva0eLRZuBBlzqXx9HUwqcwFE1D4wS51WpokMg3A0DSCHwoZLcx6J0IUAzU\r\nwT079jY8Mx3TcoidUlym4hajqqiYlIzREHw2MX8awf3OtzuNrGzB2YC9eCVK\r\nM65wetCzkaN6brZIyNp/QOiL5pXVBCRd+o6w/JEVyG+evhXlt/vt751itw+j\r\n/k8BZKn6DcE7Jk5n/n4RFu3kx5/dqw1MbqW9yuhIhBCWJRWvtJ9G9OoOzscN\r\nzxHDMRi39Nk9vJEebuGLmkpkDcFwU0P3WTow4aNycY/M9Q6k3MsihqjfaaT8\r\nFnxM/zfzGpdomMc2xtMbtnqgdZy6t98sG9udqNJyaJScJcT+2/jOnuAm8Id5\r\n3BxnxGlXbiVBYiF5LCMZXU+IVJXBEY1P7NaxZ1r0eat1XuH3BoFCJm1oojqp\r\n6RjE1NY76TW7RDjY4qWM5a+1LZtC6EerpPElhIyEIUCMasHCiS/OTVPIZAUU\r\n4NMTmqpCCu2+TxGW7HCZyRGDFsnFg/xfZWEvwKTmsB1p0ERjFFpGsvNBicny\r\nzaBd6T0qq0Au3Dz5axd2tKsdmFFmQNOFnuk=\r\n=z9cx\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.11_1676781596253_0.6873116389810789"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.12":{"name":"openai-streams","description":"Streams-first OpenAI API client, written in TypeScript.","version":"1.0.12","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","docs":"yarn typedoc src","prebuild":"yarn docs","build":"tsmodule build","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","openai":"^3.1.0","yield-stream":"^2.0.4"},"keywords":["openai","openai-ts","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@1.0.12","dist":{"shasum":"2a92767ff8f2e7c63c4dbf1d0b4dd9fb3173462e","integrity":"sha512-Ht9jyp2/OVVjJyS6Aad4vV3gUwX13FozUYNH3QuutcPZmbsV8diyhmv1wxap6CZZi6z3vRcPd395rOS6s4l2nQ==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.12.tgz","fileCount":30,"unpackedSize":8650,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8f8K0oERg+Pt0eam6vs1+NllUEKWYO2gVKqANDcdNvwIgMwR7SBuehPMaYZhdeO7LFthS/o6R6GP5XBpsHf45aV4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj8ahIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr/UA/+L8+ltAPsrK6SQOG2LrdocA2ZRbB/u0uZSO4hD/y8q7bPucU4\r\ndYpg+wC30qUdQeRVpBM2gEcoDpbTTdjTzky2+nnJsmIDkWYPajszTbswTS5w\r\n2CqMhX/YAZLeRbtfbEsfdOmywcjdoQHP4cDJw/HQL+c3zV/we2FdNwtC4nJF\r\nsUYdu10SgRhMEAG+JHQPIfUuGYdX68jEKuih/ob8uXY0FY3OpZU77i44Agcj\r\ns8zUpKYW4b6K5UHQ2FbUUhTgMNvzu+DK1FYTKygCCqn6HudLoXx7NVBstres\r\n6o2zM0z6LrSynlpBOttXqOXGkws9U4XOyf/f51Uov+YbeqvtHo3uSRdWyTbb\r\ny4AeA5w0FOpjJPvL3s/VxlE0WN4eAy3wKZYc/yIMnWQ3nqYkLhXYOYxpCzFK\r\nklxDeHf49zg+CdI1dLiXteEPuCEXQ6Eucr+6+UkKNdtIvgYqNhtpdOey/kuD\r\neqxh2/SEa5GA9mYLXoP5bVnra9d/xYvqhoB4iISfjpX0M39OIMqPrXeedxv1\r\nKcCL3ijM15jLtfO00T8kgFJ8DJkhZMKFY+/L/fejXTdRPeIB1Fl/dffEEjek\r\nLhzgX7wxAGs2DsMpxPfG5/v5pHUHtRrFQ8PMcn2DMnqqsAkc9KwZo7T8EnoJ\r\nYExOKoL8exfctxuGNgZiLekkpmQQe2gJgvQ=\r\n=EgSX\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.12_1676781640637_0.890449840770273"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.14":{"name":"openai-streams","description":"Streams-first OpenAI API client, written in TypeScript.","version":"1.0.14","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","docs":"yarn typedoc src","prebuild":"yarn docs","build":"tsmodule build","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","openai":"^3.1.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","openai-ts","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@1.0.14","dist":{"shasum":"01f42fc67c9fa7209b44b6bd35e49983906ca0e7","integrity":"sha512-z+c7I7A+N6RuzifdRo467NrL9R10AvmZ0TJwQ1WtRxuhM4e4bsip2deonrAS52XWDHl7JxO0m4mo2JaD1qfKIw==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.14.tgz","fileCount":30,"unpackedSize":8650,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCotHqV/LGdR4c5qmk+aR/FDvJKlJKn+fToySEkVHaMmQIgJ9wAtGm2ViHcL1JU6K7FTtS/Fr/L0dqIovslmkzbd+U="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj8ajkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrylg/8DRr8QkQPahzN7eldl0G2TYA+MjET3ZVWE8faITUu+JpfHHuo\r\nq3fS2GGXTUixQcHQUL75aOITrjrrCercXe6dMxAH5gsck1e7X//elJursErE\r\n4THbn7fuoOTBkr7d2+pJy2t+Vp9lj+f6g4AigCcokEu8t4rxogq82Fvz34hG\r\nIBobxw2F2Vn3pWEu2xQS4SfIqwCOEf57q8RZ0BhGfQWgTZFuaI9ZOszbmCm3\r\nCaqKaR5PCxqS4JMQ4s/dkgGMhOfcCj264X5QD+TnMQwQvsCKgJmInqwyULFG\r\nBD/WWgqekG8idim/GEBOk+fqdjVBy5ND/ZtheHpJ22PS/DFBWxGVOlwqt/B/\r\nfaPApl/k+QhWb+9r+Pek3RfLxJi0SE9DwVe9gX3Yw1JAfxPpKgEh2I0DOb6Y\r\nXm8s243PrCr3UIo2zLwQ2IkbPp1NwsAIszU6odRwXyCR70vaeVOkf6/6BSUn\r\nt/tft94JQxU5sEmYMlgGZHYDMyDg0CuOI6DclQ4Rkbm9rra6L/1tdx0D3SsY\r\nmkBqZhvMGX6D92AOXMfHYotvcqo+mClQH37YYRMsJXCuX04q0zhPoRrn1MTL\r\nII/eCRBC18mmTl81rXNWQgPHEhdT9pXgl0h0lpvjReCz8vSAuM8LsizNlSI+\r\nagvDqllffNkW49rFim1G82CkQfuVyHqmJU8=\r\n=Ukou\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.14_1676781796397_0.4361099778019788"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.15":{"name":"openai-streams","description":"Streams-first OpenAI API client, written in TypeScript.","version":"1.0.15","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","docs":"yarn typedoc src","prebuild":"yarn docs","build":"tsmodule build","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@1.0.15","dist":{"shasum":"4a89ac0d2bc2682e5a3b3250547c5dcd3c56f085","integrity":"sha512-qABhNjUuaAdstqQ7ESRGPdPlPtJr/oLUx3E9awsMsnE14Hu7qd+Sjms6RAXLFjXB4SKIkpeMMbQ65GgSZB6d5g==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.15.tgz","fileCount":32,"unpackedSize":62302,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCR5kJEzWCfqwXuJ3iFvpaYb4smJdS187jP1e99mp9PlAIhAMh4T4iWcROwLyJ3oqK+U5TrFUlAWikB5nk+e34joYUZ"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj8avUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrx5A//WgpKo4ooi387OmHWjwX1NGS7HafIEHE2EHOhoZGh67BCKKUu\r\nL8VBiYf1utCjNaN1++g3aeoZhvmYFyh1t6jq29Cff8q9LDBOb257Fz+N4Fj5\r\nsMjFrtKHwvGr3V6KpIQ42mIKOlQ5UQrGB+aWsbr9x7qQgLy8TQNLx0HoN7oP\r\nAVFEjFWOQPtEasZ1PNNI+25hmgvqXRw9CO1jp/1P83BBEQmQMEac6w6ae8oA\r\nhaEmyiM+wI4EwNi3fNWymkISJhBlJPa0RibqcEeC9eb+z+qP3KZVeS2Qa0y0\r\n1PRZugWY5pd+OXiiJd84Cvq94Ss4nqCFBPC0i8g53WXXa+7NsB0J/fq6ol+N\r\nCvhw4t/jicn4twH/5oc7wk74KlRhTExICzhXxqGQPeFToGmhchp9FdxlyqL5\r\nBXazOBATESPbSa/fA0qxTNMqPv95IHDtXqi0qwNWwIiaEsUVDANo1txZpx9a\r\nyXHLJM++55fl7Rg5FVwNW2eP6tUU0FBvPLDFTpZ391XpIFTkafPq+SpsyM5M\r\nV6EpCWYtCTO80Q1YHQWW5O4uPqV3M8gW183W7U4qeqLRTmt65/0ozFhqKSMS\r\nHmQg0Skk9OjNEUZvSxWBQ7dFkIRNwGA5+ri15DX4KVA6slHKoVDIYzBhV47E\r\nPSa12Ki2sL3Hey5N4azyaXfV+W797JvIPBw=\r\n=S507\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.15_1676782548403_0.01898045352730593"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.16":{"name":"openai-streams","description":"Streams-first OpenAI API client, written in TypeScript.","version":"1.0.16","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","docs":"yarn typedoc src","prebuild":"yarn docs","build":"tsmodule build","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@1.0.16","dist":{"shasum":"f8cd0d884682e7c05fb2bea58905198c420c26fc","integrity":"sha512-Pz1pkNP5XUPJSyN9HTI5f0Om+cRudWyl2GplaJ1n08LK4hroIIYZjxLmQwl9nYaz99ffSuYeqYTA4nLj9eEdvw==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.16.tgz","fileCount":32,"unpackedSize":62465,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvDC6YfN/k9JnbJ0GDTiLEaz1rGsq2d8Hm4iHT4RclngIgGXzEM50pffzP8oczc5a8lLMJsUGxfou3x9syKLBjRD0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj8a/TACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp1wA/+NyqjP1cAGNIChCN6jO2j1a5+wTTdzwsw+Zmxyr8yERQwb5MR\r\nfqoZ5IxXg5yGDIvx4EO0N5wbmvJKGWcDjm8Zwp6zykYM0Wy6ZjFBgldwWdYx\r\nKKMIbgB1RHo5hzVA+1//04XShNRSJnKIh5B/Gjn24jvKYqj9kg7ZNmF4A/jW\r\n/P0xMisGuYakRmE9WjV0EQZtUTCmho5D5ow4c54EgsrIO2yaoYiYpNjg9whq\r\n1n8UGnR5/TFFMKwRARKhoKLN6yRPJsJDwE8Ngf2IlC7rIF1rSDLtQArjQ4m+\r\nuro95kTKMv+mGtPiicOG1/lFtiWARVRGwkNK4ntwgkE1X7C9sLgL0SSEPEHt\r\nByy33dHHUTUHWcgNCRMqLnTuExosWEJn2nP2tpIhMufA+zomTjfmvPIcyADx\r\nY4Ve2vFyQpZx8gn7I+V5Zd0BV9lnMLeRrxUvhA9ngwSR4JETvMsozKEvSsZ4\r\nD8GegzzHQQZ4oy/UPtxppRWC87lPiD6p0qNZDlAxBP0TO1l8ZGbW0QZiRNLV\r\nRs6vPwjZfTYuPAx2RkdHW90IvENoChDm21Q33IX6yhOsgyvHJ9MlyBN5zS51\r\noNUjKN2RWY6DOP9zMjCkm5tyLer22+5pt8GL0J+AaBFc36AoKKuXFsslXhg5\r\nnujTVVdJ6OES6GqBVQTzG968LJI+JJGv7bU=\r\n=ggtU\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.16_1676783571287_0.5708328510107716"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.17":{"name":"openai-streams","description":"Streams-first OpenAI API client, written in TypeScript.","version":"1.0.17","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","docs":"yarn typedoc src","prebuild":"yarn docs","build":"tsmodule build","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@1.0.17","dist":{"shasum":"62e57da02dc49cbfb74fabb858f63ff554884830","integrity":"sha512-pU34jIrZKj8AaxZlQsEY6SMJ4zu5v1622693QTdETTWYb0ayXESl7poguGVJl+uMSB7J2k9q13p18+fHKdRJ2A==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.17.tgz","fileCount":32,"unpackedSize":63020,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDEWipcM48cECx27ZCygcOS85PHNOPAN/jfcPIKvGeYpwIhAJcH6tbmFt8278aeQ1AjHmWG+4uuqogfHV6guUrzq7jw"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj8baaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoxHhAAmBq+3PE+z849HTPVjgzEGhSwNX0fp9dVH3bdN8oRMnerHgGd\r\nPxubhUnmrxuizONq0VSRr3tGTf8ffHzMfpfiUGUu/sxtJ6ZsfAPlVSZIhuqF\r\niy3DROWe8j5jSEpSlzZOeQ0hOdqx0OoImxzQ3Nd/g8JriAo43iS9egck1krf\r\n6yKCnpuAI8thTOBS1K6gXMPgn8ymHaMt7To0mTlRCTzdQepg6ukBvW+1HLnG\r\nvNreg2pK4lhFES//sHxIlLINKlLlFefnWmQP9o88+TbqiLQYy30cgnUfU1te\r\ntmfAopkuCpY6AiaWtJ1bNdhuPR2aAvUQz+RQMRruw96Okkw1IOECtmHhcyl9\r\nQSFC4rK65gS3J0uvZDgoCGMoZeTjiU/10gd+ZHMLquArl239e1zMJns5D5Hx\r\nmEnVJMD4QRLIgdW3EdiVkLXexeEXWA22zKDUp1m8VO3z+tFjm95JyoNtNS1t\r\nv5TF5n6XwnuOjhB48AnZtoiF2IzsZSmCbYSey8RxczTD3e8KY0gNNQLeRova\r\n4Razxhnaqh9y9Oy+QPZEUNZ/gG7dfSuJxkWNfJAW/XxVkkdKNl+ZNYSPzfXu\r\ntJCbsSH+/giJnGnMLGHQyxkp29/LuDd2NDqspZoiH5aPuSOU2Fyqk71jPpSY\r\njvIC3pPa8JccEAwXpP5EUI4HjhEz1DMAf5U=\r\n=LQVt\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.17_1676785306504_0.8691002389048679"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.18":{"name":"openai-streams","description":"Streams-first OpenAI API client, written in TypeScript.","version":"1.0.18","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","docs":"yarn typedoc src","prebuild":"yarn docs","build":"tsmodule build","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@1.0.18","dist":{"shasum":"3f0610c3361c059e53a1d81da485a423ee69f6e1","integrity":"sha512-inMVGKP9EMU41dHRGrYcAfYQmM3iY6zZv/pvLfG3EnD95OJhEy0SiKZMc1c5jOdaIEoUshE5iWwdNUROuVLC4g==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.18.tgz","fileCount":32,"unpackedSize":63058,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/b87DrzAbIzIoyQYZvx7UjSMYmEf+dHMrXTxkSVE8vQIgLXFFSuLskneEuuDjsX7YH1XBAcxaNEcLhD224IEtqy8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj8bo9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqZjQ//YP2jqgcA9xVMIRvvkXC66A0wigUuZhMyF9uPmpthqb8WQzvy\r\n8oxoedfmX6DR0yrY3nf2xToMWjTZChwBlG2aJeW/n9atzL7TsLWyPJe9v9mj\r\nta0dpAFJgEzLtc/eAi+mgfiSsyXjKjm5Ay8hMrg8Cz0mdAYl3C/7Do6gTDEX\r\nDXllFeK58pTXhEpyu/fq3M7u5Yo9VPTTrOCx1rrqfehx6pccRBYMNCjYw2VJ\r\neN1YM0Av/l/kFOF9jh9MNwDrX5nWFgiYjyrTMslK86YHSgrpAtig7W6X9e1c\r\n3/iuKyPzkP74NGb/Ce1AAX0/a8gRmfphnYlqdoXccBK/pUJPDrUrZpVfMEzX\r\n8cZO8BHXzbYAV8qjGApLavsU/cZW8+CIPTNjhp6wu45xHZh/6XSdDQmGrUFi\r\nhaebEZT5tAAxK/4RztBB71Mwcw7mIQy1Vet3fxF0ZxYPY6y79zLFl6S1GxKf\r\nB6x4lL0dXRtUBk0ympOcE8ofR54hMZWYDBczqEJy9SPUsPBGT3S6LSU1E/vf\r\nCzZ5uUoyUSu7MdecxF2xuE8cYojwPRIP6bqMLDmYcOOp/voxdAqQbnvwigV9\r\nmIjcxeRZT4awIu4AsGwjWx0omZ35VQst/bldFeG0QwdqGNBdOYniQWgsZdIv\r\njWoDtVGrvbJ0mK2d8jnwzHu/aZJzBDF/j7M=\r\n=oncm\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.18_1676786236935_0.3832870757137925"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.19":{"name":"openai-streams","description":"Streams-first OpenAI API client, written in TypeScript.","version":"1.0.19","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","docs":"yarn typedoc src","prebuild":"yarn docs","build":"tsmodule build","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@1.0.19","dist":{"shasum":"04247fdb83a6102b9518db0eff48912f1bea2632","integrity":"sha512-Gc6fAxbJwqpj+Rm0Ueg4zQGrXlkaziUci6QrfrIki/HC50HrlNlPy6CuUvDfepuOOCC5m1CGNPpiX9wrcr9X+g==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.19.tgz","fileCount":32,"unpackedSize":63213,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEBqldScODo0ENi4JM1zf8qBN1sHW0ZsBYZP6TM4KYGUAiEAhzlwRyyY4ZmKz85s7ltDMjRRrGMQjCZKZ/tnFPTLGa4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj8btfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmom6xAAjzrE+Hx3FEvpsDm0SbWMOxLqNobNCf1/bj06L2QGM+hyFvOH\r\n0DH/imKVM8dQQxhl34ouiwKeBnk9lg61tO0WJHke8GhGP3Fzy9ziDx5I5BNr\r\nMhamHXUZXkZB5/RLm5OxFUnr8x9v30cztmZnhc3cdNrmFhxvMWrhljA9yLNY\r\neAePHMsbohJNYC5ogzIkOel0hdFgDqv6TuDFmK1K9fgxIDsNufMetxAL6U0H\r\npLVMqxF5qb5ilNu4C3nQCsAnERjh1iJEUgD5qB+BlatU5UcnkX7P2nqZdoOD\r\ntFbfpKRiOgcj09A6UZRB/AB/hA59y/yJi3xdZY6CgXv4K72T6E87cyGotaUZ\r\nMCWlu9rb12Ke854fJRdBUJ/tvvMXn3gUqyUYU2G1a9bIAQlIJNVl9n9Di+iy\r\nXTsb/+abUu7iBYLmsAFjxDAeiojvuQIYRuIIEX2H/9vzW+5y7w7F3nZRQGg0\r\n61ucFny0OeXE7z9G3wUeT+XvIuiaMNLSZfEPbMpUgL4avkCW+PoJAz7wRwOQ\r\nIZcSAeq1ye/2STtNGeooWVn/A+znSpX7s4SHNrGYUUOvxSP5N/bW0caFKrZo\r\n8VpGDiQvAoDBzxqlX907j0ApQjxvT+5UMqSPGQj8rP9By29ywDyV3n6iKwGr\r\nUoSQL4iwzaxLYSzRsvTZT3RVekNXunsnZr8=\r\n=kfPV\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.19_1676786527112_0.5935107158349344"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.20":{"name":"openai-streams","description":"Streams-first OpenAI API client, written in TypeScript.","version":"1.0.20","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","docs":"yarn typedoc src","prebuild":"yarn docs","build":"tsmodule build","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@1.0.20","dist":{"shasum":"ca219576317cd720efcfe6d547da932c17fc9360","integrity":"sha512-fKwO8qcsRFM8p63dM4Ljuw9ePPcAJ//x26RGDIpm2yBMkXFPr8oFKimzqdg7C7elHxkXPZuVpE5lYrhSbc2Gzg==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.20.tgz","fileCount":30,"unpackedSize":63179,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAxhJVb38AJ1NeQbKjVhRyduLygh6nzGmy77Ba6aJrhWAiBGWbzwCdpDIZM4pK6PzwxafeBsZwbe7e41kvyus8CxCg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj8ue/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrOHg//WxxgQrWcEuy0sW9mRWK5vn9NP0dZzbMKAoGA/OYbcWS4B3Rc\r\nvlL8ElHmgTlQHhrlM4CxM65IOeJqHMA8ijiDcXLR1h3es8k0kXHz/OcTH0z5\r\nHTbgsTFU/7KB8bJIYAQOd56fi3sXodiYvTEC2oIhnONsbwn9Ul09GjP4PIWV\r\nWEfE80PhRREZcx4Z6H1fO8AZVubgtUJOTimHqV+O9a8lGlNQIapdGFNF9ni/\r\nWT7e49IwRqx7o43t2EjFLDzJkbRODJgctsEUYr8DyVI15xcY9u6H5bcTRzHy\r\n74ySPtDCyQAmdIBvWA7jf3Xw3vVRD8F4CbdhdubPnghymto/Juhozqb8rEb0\r\nzwHhl/lC4g4M4Bw+6ApiwmH9kYQ4ii19S/83rCbaBhsQzdr2G5ZWHythunu0\r\nNMRB7ewxsXrZxVw1fATGhqsDOZwwwprdttxpQXN1s4RlsOAjw/oiMLy7IdWM\r\nbIm3XZ/gQfIigHLg00O1PnS9dQRyvNbUluBuM9h6sefTI8kywomBh48Qrhno\r\nEsJViOqwbnjoLnZnFB+DUtJ0kf23gxOGIg1TQzYmea061v9nA2Nkl9CkHqb0\r\nyFTImqDxQIeFoe5//SpTdlUw4+m4IF1dDYtty77GV4YYsd+dOH8u9hobBK3J\r\nA5mHXGTjW392TS1SG1DDc1WSOgKoPoOzXHI=\r\n=TFxe\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.20_1676863423449_0.15659760077789886"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.21":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"1.0.21","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","docs":"yarn typedoc src","prebuild":"yarn docs","build":"tsmodule build","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@1.0.21","dist":{"shasum":"240aaa824e06cd86f015a0877a9399ee1e7cfd42","integrity":"sha512-RGZsP7dUHS3ehOFrfzf4tfZBOHHXwq3H7hsN2xrgBpCSq40/tyYPCSSretriD/Lf5OQ/U1sPrHwhYdWS4oeaeQ==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.21.tgz","fileCount":30,"unpackedSize":63188,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB6SxlHG8hMqFWXisykxK8MksavB13VX8IrZSGiTFnKFAiEAkuKLg642QzySdR41+L9qYlanGje05URcZ1qNbZqk3jw="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj8xuYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrysA/+NatDz9I8EdcuZ2y7pm1tZV02qwLVNwIk3OK7SImDELMHyPA2\r\nhnJeg7mYdYf/Rb2aZ4YNvbAZstmTaj2giVD060slGugJ0Ya/8HMUkQYBh5jJ\r\nOgOvto8YC3829iDcsTBlq5zY7/bNhoIaJ5JsaTPCu0tFBbZeLnNAYtx80izx\r\nhzHqeZtfu9VMIjjGSjDePZks55G/e2fNLz+YhNaiHoLUJOKehSB4d8c8nhHF\r\nxIC9hKPnINE4AndFpMfWwHYjKqOHCzLO/PAE6X2BjBXty06jXtHHwemj5xxk\r\n4/ZnINg4Jrzvkth9Stutc3dyadBL+s494UR64DGW1AreU32uAbtQjuccN1ny\r\nt/9G3ra6ZND5uZlkYPnl4ElZyxbd0abdb1OBTUHAUmRaKnybXnXArxNbEW9Z\r\nmGnk9GKfQOA9b3LKOVJOs0i/h39VNJuezRY8dIBPSjgXNiAzRp1tNqqpgZ3C\r\nWvzk1MBQdZJ+QqnAGeE45hChT4JK4KioK30VuhHSRveBH2tAOFKVuglbEX+G\r\nE3h5VOBD9betAE3BpUoghQmxtYiaEDbM81sy6p1Mny8kk+1dVPIU3cvuZLQK\r\nTOIY1i/aMA1ExL/EYwlCXZibyBbkOozsVw4GJC9ApAtrYlQ7RqpumI+NJuQl\r\n478E2J2U6WDqxAn65XBjvR/gX0UBGWSUz2s=\r\n=Vr8g\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.21_1676876696022_0.05369779197896718"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.22-canary.2":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"1.0.22-canary.2","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","readme":"# OpenAI Streams\n\n[**Github**](https://github.com/gptlabs/openai-streams) |\n[**NPM**](https://npmjs.com/package/nextjs-openai) |\n[**Docs**](https://openai-streams.vercel.app)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update. \n\nIt simplifies the following:\n\n1. Prioritizing streaming and type inference.\n2. Auto-loads `OPENAI_API_KEY` from `process.env`.\n3. Uses the same function for all endpoints, and switches the type based on the\n   `OpenAI(endpoint, ...)` signature.\n\nOverall, the library aims to make it as simple to call the API as possible and\nstream updates in.\n\n### Installation\n\n```bash\nyarn add openai-streams\n\n# or\n\nnpm i --save openai-streams\n```\n\n### Usage\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\", \n     {/* params */}, \n     { apiKey: process.env.MY_SECRET_API_KEY }\n   )\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n#### Example: Consuming streams in Next.js Edge functions\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\n    \"completions\",\n    {\n      model: \"text-davinci-003\",\n      prompt: \"Write a sentence.\\n\\n\",\n      max_tokens: 100\n    },\n  );\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\"\n};\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/gptlabs/openai-streams/blob/master/src/pages/api/hello.ts).</sub>\n<sub>See also\n[`src/pages/api/demo.ts`](https://github.com/gptlabs/nextjs-openai/blob/master/src/pages/api/demo.ts)\nin `nextjs-openai`.</sub>\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n   (const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.","readmeFilename":"README.md","gitHead":"a2efc110e264e3cd6a6f6ff40f83687f51fb0131","_id":"openai-streams@1.0.22-canary.2","_nodeVersion":"18.8.0","_npmVersion":"9.5.0","dist":{"integrity":"sha512-OBjD4o26Cx5BLY9xzQrhMLSOFGfh6m5Z7DGqxchrJRzsaqz2eIku/ZqgGDOz7Pe32bTvyoUjDCOIFE9pksUFeg==","shasum":"63ac53fea93287a96ba7459f830870809b17fc81","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.22-canary.2.tgz","fileCount":28,"unpackedSize":63897,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEm3JPL7U9JC9Hm+Ri93fR+lrVqk7CYs/1qx56nM5OjEAiAKnFC6OQ/GojPIxCkr0e6yjpcjOM3jcyZGT79kBkLn7A=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj90hWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrXAw//TuromBJhVw2BMAteu+DeYsh0nzCqvs3comZBcNA6+cmU9MqJ\r\n4o2wl1Amk6Rpfk4PYxVCaCkSLJLQWfDjLEHWon89ZD1bcoXt71cGjmGDe86k\r\nGybjVWYuTFfcA/vQW1vSyvqaVVaBq2O64PhYezUOA7h4QcbIu0UIOgVScdnI\r\nybECt1hbN/jsxjmpHcvT+CUVyJzfVsW6OunL7gRLC4WHeaGQIZjjLb5SHIzp\r\nUXUTS9iYNXarNNEgUMKsQiEWD/a7so8V6N3yTYxKEBQwJyw8lbRYygTiksNp\r\nhbTvOomP8Zsbeo0ppsDe02nY1xAdmemKpC/+qVXQ8X0s8T/3usCtCHpJGRUE\r\n3VzGuY3vHXXEOLC7PxR/rWRJq3HlzkOcHosj0O6z6KLsDDZUyL+ESVEjmfbJ\r\nQBl2SyQTnGbkDBfEVI82RNUbXtei0fiCJrIHT3L0kTmyhIWyw4e2p9MEvzQ5\r\nFNTP09rmRTb7V3K7yi6cvdlaubwqBsehcA+znXMYblm36TUr1/3c1PnO78QE\r\niPjaSOKVwDFfsYmSAvvRsn/l/SB1MnCX+J+zEQcZc4T/l1I9iHyLHxRK+z9O\r\n+qLmA9TP9OEk7u66Muq1V13UYzuefY4fb/2I3AZWKbKnJWtnOq2ZSgyo5GIr\r\nO0VOKgXD/9sFIKXVc9imVs4sOuK8T3z6ehI=\r\n=0Q/M\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.22-canary.2_1677150293903_0.5045558109763832"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.22-canary.3":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"1.0.22-canary.3","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","readme":"# OpenAI Streams\n\n[**Github**](https://github.com/gptlabs/openai-streams) |\n[**NPM**](https://npmjs.com/package/nextjs-openai) |\n[**Docs**](https://openai-streams.vercel.app)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\nNow supports WHATWG *and* Node.js streams via `OpenAI()` and `OpenAI.Node()`.\n\nIt simplifies the following:\n\n1. Prioritizing streaming and type inference.\n2. Auto-loads `OPENAI_API_KEY` from `process.env`.\n3. Uses the same function for all endpoints, and switches the type based on the\n   `OpenAI(endpoint, ...)` signature.\n\nOverall, the library aims to make it as simple to call the API as possible and\nstream updates in.\n\n### Installation\n\n```bash\nyarn add openai-streams\n\n# or\n\nnpm i --save openai-streams\n```\n\n### Usage\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\", \n     {/* params */}, \n     { apiKey: process.env.MY_SECRET_API_KEY }\n   )\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n### Example: Consuming streams using Next.js API Route (Node)\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI.Node(\n    \"completions\",\n    {\n      model: \"text-davinci-003\",\n      prompt: \"Write a sentence.\\n\\n\",\n      max_tokens: 100\n    },\n  );\n\n  stream.pipe(res);\n}\n```\n\n#### Example: Consuming streams in Next.js Edge functions\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\n    \"completions\",\n    {\n      model: \"text-davinci-003\",\n      prompt: \"Write a sentence.\\n\\n\",\n      max_tokens: 100\n    },\n  );\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\"\n};\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/gptlabs/openai-streams/blob/master/src/pages/api/hello.ts).</sub>\n<sub>See also\n[`src/pages/api/demo.ts`](https://github.com/gptlabs/nextjs-openai/blob/master/src/pages/api/demo.ts)\nin `nextjs-openai`.</sub>\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n   (const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.","readmeFilename":"README.md","gitHead":"a6a46efd05078bc2be850f9d42804ca6f34fd48c","_id":"openai-streams@1.0.22-canary.3","_nodeVersion":"18.8.0","_npmVersion":"9.5.0","dist":{"integrity":"sha512-9d28ZK+XhJh4N4mrR0QLUP7fBCqRC2uHxTvr3PUs4Hc8izW9Zbfm83j3pPoLrr6ovTwPyFaOxzjQESIP2jHzWQ==","shasum":"7871c0c747d80c54dcd394af388e028b9ce1e28d","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.22-canary.3.tgz","fileCount":24,"unpackedSize":64176,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDCxlW82n6VMZkzERh6bGNzLBt68lMuv4YiEGP+rCDlDgIhALt5+iWffMPliDqwfpo4238r1UHIrDidlOPuGidWQ513"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj90wFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoblQ/9EOaCgf0qCwXbbF7IpIilwznyqjRN2GUb4Xb1LIkxlSlSYGpe\r\n0G+0jupVOMTDoLvKSqP1hSZbQlCzJuAyzusNn8V83F+uzELzhCz45YFOz8Tm\r\nug4Xwb/d2coXk2e8E/HnzhTDscaQqvPlDePjIt9+KuJ7L/UKaR+rPbSCywdv\r\nFB/I8dv/QN1NKi4dqoJAcyo0daaQhXIlnsBHqWypvxrEUlN4dIEujsAc+4PU\r\n6UuNYnqRo1mnx8Q6TUJPOLvnjqv+8IdIl0+jM+nYsTn3m3nXH7vCiixxx0Gv\r\nn/LmznED2RL/QS7ijg1XAamNGfHbITB+NChQXLto6h/OdbPWFS8DYG4pQ3TX\r\nVonRS0F/Jq1b6FzYoV7ilmJHiJ2DyWOGIhYqD0A81KeH0DExkHUl627lWfVX\r\nswThR0jB5s9C7TQ1cXMhpI5gVdDq4eLdYM++VfQaMZH0/3arh9LlElY403xx\r\nYJjHV2uTdQ7Rbd0w/6IC9Bi2nMfgLKjbErkTG2Nk/xF77Rj/8t71y03YnIf5\r\nrGDlG1WMhjVBFr/DIrQRSAeJJ5oTC0V/y3+vvV68hsQDAwdN3TcAVUn7RVGB\r\nHeb5D7yzhzU9HpR+Zw8oCh00+KrtJTacgU6ZC0etOfwNfWmf/8oSjtlEPqYc\r\n729MSGrABY2DwMpkMGFrVY4xF5D78tPulh0=\r\n=P1l9\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.22-canary.3_1677151237008_0.11921613564568867"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.22-canary.4":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"1.0.22-canary.4","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","readme":"# OpenAI Streams\n\n[**Github**](https://github.com/gptlabs/openai-streams) |\n[**NPM**](https://npmjs.com/package/nextjs-openai) |\n[**Docs**](https://openai-streams.vercel.app)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\nNow supports WHATWG *and* Node.js streams via `OpenAI()` and `OpenAI.Node()`.\n\nIt simplifies the following:\n\n1. Prioritizing streaming and type inference.\n2. Auto-loads `OPENAI_API_KEY` from `process.env`.\n3. Uses the same function for all endpoints, and switches the type based on the\n   `OpenAI(endpoint, ...)` signature.\n\nOverall, the library aims to make it as simple to call the API as possible and\nstream updates in.\n\n### Installation\n\n```bash\nyarn add openai-streams\n\n# or\n\nnpm i --save openai-streams\n```\n\n### Usage\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\", \n     {/* params */}, \n     { apiKey: process.env.MY_SECRET_API_KEY }\n   )\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n### Example: Consuming streams using Next.js API Route (Node)\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI.Node(\n    \"completions\",\n    {\n      model: \"text-davinci-003\",\n      prompt: \"Write a sentence.\\n\\n\",\n      max_tokens: 100\n    },\n  );\n\n  stream.pipe(res);\n}\n```\n\n#### Example: Consuming streams in Next.js Edge functions\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\n    \"completions\",\n    {\n      model: \"text-davinci-003\",\n      prompt: \"Write a sentence.\\n\\n\",\n      max_tokens: 100\n    },\n  );\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\"\n};\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/gptlabs/openai-streams/blob/master/src/pages/api/hello.ts).</sub>\n<sub>See also\n[`src/pages/api/demo.ts`](https://github.com/gptlabs/nextjs-openai/blob/master/src/pages/api/demo.ts)\nin `nextjs-openai`.</sub>\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n   (const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.","readmeFilename":"README.md","gitHead":"29390d4eac209e1afc76525d4c2fc6308760eb46","_id":"openai-streams@1.0.22-canary.4","_nodeVersion":"18.8.0","_npmVersion":"9.5.0","dist":{"integrity":"sha512-UCiUuJdKjMtpEu0pwrieF8DysmaOBioYWc/jseQxDFht7hK+TbKdPZyGRnqnNMlhKOzhsF2e8WLFMQd/1aYzgQ==","shasum":"ef2c067d964365936bc519da7528b8c5f79b0db4","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.22-canary.4.tgz","fileCount":26,"unpackedSize":64557,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCDtDAEv8IGymlbMyjaaW9+vTZCfXL8kW/5knhtU6tDngIhAKJbJaSH+rXiJoSwCC+yHu6JxFXd9+7+zEnboGGPVanX"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj904PACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqDAQ//QGMlXRrbf1F3tl6Dsf1nrYjVRZlG1XHGj57ocnw2Ian0R7T5\r\n6AZ9pdD45ugE1/f3fJZgF+BhhoeJRRamV2rkc5hDZSOpfxuJnlTgxwCa8CjB\r\nDmTlQ0oK1h9uCN3pYuyAPCsADvkuKqC/tb7pWQxloHMXUJT5gk0EtK/iL3eX\r\nJ7Mj3FBCp80E3SzbCqU/zyk43NbhHTSCTKPCu18gnYD9TNzdcKg21yeffd7l\r\nriMx3en5nTUTDPb5+wClRfXhSuIea79Gz0UQvTkMcVlhWYS6uaEHzTH1XQkk\r\n/QYjxsMlB3Ogx1CdAR9XH6JEiFoL3f01iITwqdQW8bayyj8eLu50e1SYey+8\r\nwLtOZqqy6D0MZcExK+wzwGkVUs4D+vh+EjEcyoxItDJH/4ToKl05EsxnxFEm\r\nPXudTp9+9klDVyuDFW7VIkLxgj+7vXDN4HJQcgdfyZU0CPFh29Y2OCDm8V6l\r\nauIpvZJtk6oooOww4LRzGCKlYflQLdutSy9K4eMtDHKFEEj+5bEhNIx/vC2R\r\ncnZ69/ZHRI6EXVAWL5iHuxWhhSWurhnpQSFeJ1BpvaOqQscK7Fj72LlLVpRa\r\nqFdgs0YpCA5RHv75ZAq8TFvHFNrSpDxYqGLCG0NAYbHNAUWnHl/+RCxCz1Z/\r\nmBPVwEqYbMY6iSKF34SCxyIuUNe9ffonZJM=\r\n=Y2IT\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.22-canary.4_1677151758950_0.6530904474440702"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.22-canary.6":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"1.0.22-canary.6","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","readme":"# OpenAI Streams\n\n[**Github**](https://github.com/gptlabs/openai-streams) |\n[**NPM**](https://npmjs.com/package/nextjs-openai) |\n[**Docs**](https://openai-streams.vercel.app)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\nNow supports WHATWG *and* Node.js streams via `OpenAI()` and `OpenAI.Node()`.\n\nIt simplifies the following:\n\n1. Prioritizing streaming and type inference.\n2. Auto-loads `OPENAI_API_KEY` from `process.env`.\n3. Uses the same function for all endpoints, and switches the type based on the\n   `OpenAI(endpoint, ...)` signature.\n\nOverall, the library aims to make it as simple to call the API as possible and\nstream updates in.\n\n### Installation\n\n```bash\nyarn add openai-streams\n\n# or\n\nnpm i --save openai-streams\n```\n\n### Usage\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\", \n     {/* params */}, \n     { apiKey: process.env.MY_SECRET_API_KEY }\n   )\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n### Example: Consuming streams using Next.js API Route (Node)\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI.Node(\n    \"completions\",\n    {\n      model: \"text-davinci-003\",\n      prompt: \"Write a sentence.\\n\\n\",\n      max_tokens: 100\n    },\n  );\n\n  stream.pipe(res);\n}\n```\n\n#### Example: Consuming streams in Next.js Edge functions\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\n    \"completions\",\n    {\n      model: \"text-davinci-003\",\n      prompt: \"Write a sentence.\\n\\n\",\n      max_tokens: 100\n    },\n  );\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\"\n};\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/gptlabs/openai-streams/blob/master/src/pages/api/hello.ts).</sub>\n<sub>See also\n[`src/pages/api/demo.ts`](https://github.com/gptlabs/nextjs-openai/blob/master/src/pages/api/demo.ts)\nin `nextjs-openai`.</sub>\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n   (const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.","readmeFilename":"README.md","gitHead":"f6e8918df78026d04fbaa4005cd5296afcb253d1","_id":"openai-streams@1.0.22-canary.6","_nodeVersion":"18.8.0","_npmVersion":"9.5.0","dist":{"integrity":"sha512-j5rNV4twGs9ZWuap0nSVNhgIky/gCBFd4WAFQH8bYjaTSOQ8RX3VenphrIIlYyBEIqbnzae8M2Xqz7oKJzQxhw==","shasum":"1094b0be8f87cab97bb61a94421c7b6f93c46bbe","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.22-canary.6.tgz","fileCount":26,"unpackedSize":64656,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDvVsHRKdkCyhM9UezvgEAUX+sJq0VdshUe4SgO0V3RggIhAJVTzulxBjlbcwEf/NB/uIFhby6Bq5g7VYOhtHyxX/7f"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj908TACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr53Q/9EQeuq9KftHD5lBkG5mpUiOfB724NUAMdU6DchIQodIbc2pZH\r\nDMkaXV3baRBQrBhfeI/YWdjs4RGmDZqLvDqimtcrHqKY8NBOHXBxwMvAhAXM\r\nXBkU26s8zaJN+snQRlFZM+CLOVjgVCKj8+xFm6TM+pMDH2tXQVOHHjrYBZb9\r\nrfuUhkWSTgmpvoHZpzY/1MSJDeH82BUMzair4Mnt81XwoIQfvrrnIUPlctMd\r\n6PG+yIrPlf75JmkYvpjMsq6z6ntb4UO518IuwU0FvfEsNAigTIe/KwRoYUTw\r\nUNPKf/zcPGKr4YXUGxsV7dpxtUz0GDOfB2jVllvT+zRh8iiY787/2hlCVrQI\r\nh6tGTaA7RLsuz4SPEHUw5gqUlhbzrVuie9jHluVPqOgylens2nwR6ZmDECzl\r\nKRvTgIZNH8+rWLppxULL51Jw2g98FouuE2DzRwrqUrPLAUTNI083xDXqnf5Q\r\n6/p33Tdd5fPWJX/uYFYZiLYaf/6AQpJAvEXgXM/3fvjVaapADGuVhI+jamKY\r\nYdqc/BPf7g1QMO+ant9ZYH9mq8F3XbYcSwlXIm+nuOcPYMWQkG+Jo01B6R9s\r\nuEWR+WGz7ggACUpkChccoqOt39FtkytX+1D5COzjo+od9/QsLikYq/v5KRLu\r\n/mFj/QS8r6HET2FSO0ma6NG5vCcKID5QWAQ=\r\n=p77I\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.22-canary.6_1677152019405_0.9456078127904086"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.22-canary.7":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"1.0.22-canary.7","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","readme":"# OpenAI Streams\n\n[**Github**](https://github.com/gptlabs/openai-streams) |\n[**NPM**](https://npmjs.com/package/nextjs-openai) |\n[**Docs**](https://openai-streams.vercel.app)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\nNow supports WHATWG *and* Node.js streams via `OpenAI()` and `OpenAI.Node()`.\n\nIt simplifies the following:\n\n1. Prioritizing streaming and type inference.\n2. Auto-loads `OPENAI_API_KEY` from `process.env`.\n3. Uses the same function for all endpoints, and switches the type based on the\n   `OpenAI(endpoint, ...)` signature.\n\nOverall, the library aims to make it as simple to call the API as possible and\nstream updates in.\n\n### Installation\n\n```bash\nyarn add openai-streams\n\n# or\n\nnpm i --save openai-streams\n```\n\n### Usage\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\", \n     {/* params */}, \n     { apiKey: process.env.MY_SECRET_API_KEY }\n   )\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n### Example: Consuming streams using Next.js API Route (Node)\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI.Node(\n    \"completions\",\n    {\n      model: \"text-davinci-003\",\n      prompt: \"Write a sentence.\\n\\n\",\n      max_tokens: 100\n    },\n  );\n\n  stream.pipe(res);\n}\n```\n\n#### Example: Consuming streams in Next.js Edge functions\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\n    \"completions\",\n    {\n      model: \"text-davinci-003\",\n      prompt: \"Write a sentence.\\n\\n\",\n      max_tokens: 100\n    },\n  );\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\"\n};\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/gptlabs/openai-streams/blob/master/src/pages/api/hello.ts).</sub>\n<sub>See also\n[`src/pages/api/demo.ts`](https://github.com/gptlabs/nextjs-openai/blob/master/src/pages/api/demo.ts)\nin `nextjs-openai`.</sub>\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n   (const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.","readmeFilename":"README.md","gitHead":"b688d7dbfca47f234ddf6164466ca38d4104289d","_id":"openai-streams@1.0.22-canary.7","_nodeVersion":"18.8.0","_npmVersion":"9.5.0","dist":{"integrity":"sha512-uS94TEIpbrzV88H2eKmFGNmdMRpVYftmSgWiEr3/IqpBDCd5SBZwPQUM/T6pGBhhOevK0v72XBCwyUbdDT6Yug==","shasum":"d283d7cc5663e5940f7dc9fbbb899663e382fe05","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.22-canary.7.tgz","fileCount":28,"unpackedSize":64766,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCNi7MrXQfY1fkVUYCHPT3AXiGFEv59smKVgvj3pR09awIhAK3117+wodzrwIKLlF5ew0xlkP5aOiYurpg4HlHgbeev"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj91BQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqokw//VxD2feeXZzgPJqzKjVTZ4S683wt5keNFk5YCl7cFe4q53lhL\r\neWXhgsqd6rbTacSMTPlIK+XYUFDwE26NWjrLStleOwl4gtK/kmBbOcG5kCaU\r\n9ZvIb3ZikITOQaXNrB472lYlShEH3M5X7tW/vfjrTfZDayJWc9u+Qq/99mDC\r\ngogmABERFBfHdnq50uUYdZaiSrJbeyU3+tgqpr2J/O2AHWqqHftGFhN06C6E\r\nYdXl3D/2mLqKjCAxk9uWObmve4SCakcii6XzMJ+vfpEvPwgFc5D83WPuCshi\r\nBWM3yWj6flViFF4T9Kz8YwFlPrhlKsanW0jQ4F0jp502ZA068nlMdIfxRAmE\r\nJg911VKcV8yXZgJO/B2/1r2wsRp6sGtfK+suYB3cfHp7792baUGOx/GaVAWb\r\nIKJ8lI3kZc1nc7gIhS3RPPzblL4mn74qRTzEjTIMAtDWlqztMwx27Q0o/BGW\r\nZeYk35V8H7t0w1Mj/3gavHwjnXczjhNno2RASU1kjEc/7036Shkmg7HSZLOz\r\nPS+uxwVv3d4078UHF9JR2rFWKpxohZon8pzmUOtxqcjJPU4WRH+68cBDyOMV\r\nn13jyFpuWcRBSSWGyCvxi19OBizgsHZ+LSnSFT/q/xrPYrM9WsHbw5u9P2v9\r\n8hbP3+D0LZQww7R7E6t6A8yv2rhRvc/HndE=\r\n=dasj\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.22-canary.7_1677152335997_0.8877610053454881"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.22-canary.8":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"1.0.22-canary.8","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","readme":"# OpenAI Streams\n\n[**Github**](https://github.com/gptlabs/openai-streams) |\n[**NPM**](https://npmjs.com/package/nextjs-openai) |\n[**Docs**](https://openai-streams.vercel.app)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\nNow supports WHATWG *and* Node.js streams via `OpenAI()` and `OpenAI.Node()`.\n\nIt simplifies the following:\n\n1. Prioritizing streaming and type inference.\n2. Auto-loads `OPENAI_API_KEY` from `process.env`.\n3. Uses the same function for all endpoints, and switches the type based on the\n   `OpenAI(endpoint, ...)` signature.\n\nOverall, the library aims to make it as simple to call the API as possible and\nstream updates in.\n\n### Installation\n\n```bash\nyarn add openai-streams\n\n# or\n\nnpm i --save openai-streams\n```\n\n### Usage\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\", \n     {/* params */}, \n     { apiKey: process.env.MY_SECRET_API_KEY }\n   )\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n### Example: Consuming streams using Next.js API Route (Node)\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI.Node(\n    \"completions\",\n    {\n      model: \"text-davinci-003\",\n      prompt: \"Write a sentence.\\n\\n\",\n      max_tokens: 100\n    },\n  );\n\n  stream.pipe(res);\n}\n```\n\n#### Example: Consuming streams in Next.js Edge functions\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\n    \"completions\",\n    {\n      model: \"text-davinci-003\",\n      prompt: \"Write a sentence.\\n\\n\",\n      max_tokens: 100\n    },\n  );\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\"\n};\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/gptlabs/openai-streams/blob/master/src/pages/api/hello.ts).</sub>\n<sub>See also\n[`src/pages/api/demo.ts`](https://github.com/gptlabs/nextjs-openai/blob/master/src/pages/api/demo.ts)\nin `nextjs-openai`.</sub>\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n   (const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.","readmeFilename":"README.md","gitHead":"8690ff928cf23016c0d808290e8fe7606a2dd2e8","_id":"openai-streams@1.0.22-canary.8","_nodeVersion":"18.8.0","_npmVersion":"9.5.0","dist":{"integrity":"sha512-a3AbrTJ4AI9Mj0lLRMMyNTNdJ8PT5FatOU2RzCmF2/7HctlRRb9Pr++4P+Na+bZZOcRQPmszYZDFooJCwh5dsQ==","shasum":"2af47ddb6f667e72c9551485c29361cc5c58545a","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.22-canary.8.tgz","fileCount":28,"unpackedSize":64719,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEOG2VtDmOplRcG8disPMit0XVy6c1FPacrONgk9GQroAiBk+U6tCkQZYbegn1x9U44lNPDe1LBBD2JU05s7635uPg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj91DYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoZhRAAix8jPD3GlenhzYoCTo+JcHHRnLAM9+vBsvI6kObMbcNWgrrU\r\n7slIi9rBD2BJdKb3b5NtKx5M2+DziZQz54DFNrSj2ZSf3LqOEwxDxs3fuVbj\r\nr5j3iD2I+DL3lbaVXRjpAckOshxbB3I+7Rzp4KCc86Tz6o9lBDor6kOLScoV\r\nbn/30oRBjM/jpUQNm3BoyVUxgNofs/Lb6Lcwf5GnuAoa0em7ooOTbalCuTIT\r\n1kMCV51+U++xOorHYJU1VcvEiIr86wBkpNW/MTNN8ocvYEcCbycWb8LlXJOu\r\n3rVuF3S0fE9qS/yQKLyIT+xAv3pWJRrKOe9cUK4Hr79T0EZ1OXVzbP59yBQn\r\n73bH5JXFVIA3RBig5B6E/2uU1JLl95l23Ge+Px4GOanSNp+jk2MzwS/ei0AE\r\nXxy/ELUq+i4n/LHyMx8xEab+v9kZTvcd3AtwgJMQ16qeTSpo64bP7f62CoC8\r\nzzD3Qf6Y8FLTt/q2A1eJ7aOqHCB0OHBjuRESXq4fije3fECoSJeEExgqyuA7\r\nT8xl1jaWpI0lhOSfc/d1brb+dfRjTqsVMXxuF7dSrVSAG9N5StrEjHemvq9y\r\ncxTy8llyam+R/flrli0YEnJ/5jogYUy3wkRnJjo+JOY/1zk9JWlny3Q6SuCw\r\nWjosoMhom5OMFCWrJ2t/aU1foPkLK2PJA54=\r\n=DQP/\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.22-canary.8_1677152472026_0.4105845619362274"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.22-canary.9":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"1.0.22-canary.9","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./edge":"./dist/edge.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","readme":"# OpenAI Streams\n\n[**Github**](https://github.com/gptlabs/openai-streams) |\n[**NPM**](https://npmjs.com/package/nextjs-openai) |\n[**Docs**](https://openai-streams.vercel.app)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\nNow supports WHATWG *and* Node.js streams via `OpenAI()` and `OpenAI.Node()`.\n\nIt simplifies the following:\n\n1. Prioritizing streaming and type inference.\n2. Auto-loads `OPENAI_API_KEY` from `process.env`.\n3. Uses the same function for all endpoints, and switches the type based on the\n   `OpenAI(endpoint, ...)` signature.\n\nOverall, the library aims to make it as simple to call the API as possible and\nstream updates in.\n\n### Installation\n\n```bash\nyarn add openai-streams\n\n# or\n\nnpm i --save openai-streams\n```\n\n### Usage\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\", \n     {/* params */}, \n     { apiKey: process.env.MY_SECRET_API_KEY }\n   )\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n### Example: Consuming streams using Next.js API Route (Node)\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI.Node(\n    \"completions\",\n    {\n      model: \"text-davinci-003\",\n      prompt: \"Write a sentence.\\n\\n\",\n      max_tokens: 100\n    },\n  );\n\n  stream.pipe(res);\n}\n```\n\n#### Example: Consuming streams in Next.js Edge functions\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\n    \"completions\",\n    {\n      model: \"text-davinci-003\",\n      prompt: \"Write a sentence.\\n\\n\",\n      max_tokens: 100\n    },\n  );\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\"\n};\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/gptlabs/openai-streams/blob/master/src/pages/api/hello.ts).</sub>\n<sub>See also\n[`src/pages/api/demo.ts`](https://github.com/gptlabs/nextjs-openai/blob/master/src/pages/api/demo.ts)\nin `nextjs-openai`.</sub>\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n   (const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.","readmeFilename":"README.md","gitHead":"37a665ce0f91f3ffbca1b904de13860516d97fdc","_id":"openai-streams@1.0.22-canary.9","_nodeVersion":"18.8.0","_npmVersion":"9.5.0","dist":{"integrity":"sha512-oHXKhvPzj6KrQzp8dpw/LHBBto+paX8d5BBKlAQXyOOMW1ZgOpYZstI5auKT90T4QxbDnAGWyQ2D+5sEYaEIFg==","shasum":"87c8e6890a5c92e8438592eb52cbce890b613942","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.22-canary.9.tgz","fileCount":28,"unpackedSize":64751,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAPvTLSdbTZXj0DMMjRfuCUuHU70cOYEfsXLYeSheUiiAiA6HCFSm+4BxpkSxtHvGncaZ7VnCRF3o3fYrxYRpJE/HQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj91G0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqftA/5AYau83PFN/tfx4KD6V9MxA+s6Xtxf7s83U+slJnVYLTE9Qtt\r\npm2mPEQTdrM9IBlFvXSAK3VsUiEE6HF9cfxU0lG7JgupqkYAdDLa8qNbPdFU\r\noxnZxF3MKDBJbXzNUT05SgMJXSXGCbdlBf44kZqEeXynGZiGYK9xGUXnId4/\r\nwGkyV/VQSF76Etl86mZO9J7h4cHCVBd99+aD0hSYcalP4Mk8F3ihqGwsz2Mv\r\nXPE4idA9eX46FrlaTnvIxBuBJUKEwDp3ACmSNcRb251EUKmKZYp9M7tmEax2\r\ngVqzTwIquLYMWr/Ct1qT/8VH+Crko3t5pvOwB0M/TprVD2M9pQhTIeOuPs9y\r\nu0D9LrtmZDXdsgkulKYO1al9vwMby+oBTUg7WzJu89BjoQR+p8KXUw/rAQwn\r\nkO5aww34xHswYqTxLzEkr08AWAWaTkwDWZPJWyQixMfYGglgOzTGp+NX/Gz6\r\nPr8tFr8m/DOaF+D0mmNBxo9iB9DzAuW49skeUUIF+6Q4ntqEZKavVUF6jBnQ\r\nNRAaRcxuHvT8b8/gnoMGGG0oRlhkuhqNWVCNRaPalFy2xRhOeiRjo2vVbIAo\r\nYMdZx8SVblb8eG6oj4GL0SwoaRR19J595u2Yk7SkFwRr7vmKlhhDxV2ZxIZd\r\nef7kE2eFzgvfa9wCPccTCmibW1U0hwQdQj0=\r\n=e2vD\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.22-canary.9_1677152691952_0.05094765854416239"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.22-canary.10":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"1.0.22-canary.10","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./edge":"./edge.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","readme":"# OpenAI Streams\n\n[**Github**](https://github.com/gptlabs/openai-streams) |\n[**NPM**](https://npmjs.com/package/nextjs-openai) |\n[**Docs**](https://openai-streams.vercel.app)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\nNow supports WHATWG *and* Node.js streams via `OpenAI()` and `OpenAI.Node()`.\n\nIt simplifies the following:\n\n1. Prioritizing streaming and type inference.\n2. Auto-loads `OPENAI_API_KEY` from `process.env`.\n3. Uses the same function for all endpoints, and switches the type based on the\n   `OpenAI(endpoint, ...)` signature.\n\nOverall, the library aims to make it as simple to call the API as possible and\nstream updates in.\n\n### Installation\n\n```bash\nyarn add openai-streams\n\n# or\n\nnpm i --save openai-streams\n```\n\n### Usage\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\", \n     {/* params */}, \n     { apiKey: process.env.MY_SECRET_API_KEY }\n   )\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n### Example: Consuming streams using Next.js API Route (Node)\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI.Node(\n    \"completions\",\n    {\n      model: \"text-davinci-003\",\n      prompt: \"Write a sentence.\\n\\n\",\n      max_tokens: 100\n    },\n  );\n\n  stream.pipe(res);\n}\n```\n\n#### Example: Consuming streams in Next.js Edge functions\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\n    \"completions\",\n    {\n      model: \"text-davinci-003\",\n      prompt: \"Write a sentence.\\n\\n\",\n      max_tokens: 100\n    },\n  );\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\"\n};\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/gptlabs/openai-streams/blob/master/src/pages/api/hello.ts).</sub>\n<sub>See also\n[`src/pages/api/demo.ts`](https://github.com/gptlabs/nextjs-openai/blob/master/src/pages/api/demo.ts)\nin `nextjs-openai`.</sub>\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n   (const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.","readmeFilename":"README.md","gitHead":"5e43c9a93bb201cd532daa6f33de381ce5d7ad51","_id":"openai-streams@1.0.22-canary.10","_nodeVersion":"18.8.0","_npmVersion":"9.5.0","dist":{"integrity":"sha512-FNlKpYwQYI+GPMxmBhErwYHiGTQgl0VlOgpT2EkSHn10lqHdux6U0XM0/hZOtpn+c6uyJfzXdRTOTTBLK4qHjA==","shasum":"d8bde35e6f275767959d07df739efffe26d2d901","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.22-canary.10.tgz","fileCount":28,"unpackedSize":64747,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDXtzz8jx63ktggOY58fo+DGKztkEE3LaXnRysvSGSo8AIhANv9wgq+2dHm6GFA8KD1PqQ2l07lO3UAjPKpp7bmLTle"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj91I+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpF5Q/8CJCtR7u/Q9kx0p34XpKeQkc1ADbyzVd8VpXBFTXC50Iuipkq\r\nsVOWh3X+tTpxcHdvio+JcEswCYAZWIRXC6fVy8i4c0/dR3rUCM60p557CfeA\r\nB9JSG88LvUSKf+1MNWYvVM1FDPVGlv0SVqxvzdLm+EXGr2o+E9NE3BQnS9mZ\r\nMKfBWoIuEtfToHv/YIDlNPX+viw6hvWQ/7bOrSfh8zlhs2cgbsmi8nRkbyzc\r\niIJPkwd9KFb1CbenbxFvpLiLdGyZoyPj3uWTw42RaWYXdSVqcnUAb2bfCUJr\r\nu5RYJAi6UAIfSLLGKMBaJp1kjKroAjkp9qQsu/xPApRPiajOYfe6KtDvLWf9\r\nvIc4+W6qx7fzGh0OXK9s1R6BdUGpoNdON8KPYsMppD32ydQWjmTg2VdNlu6V\r\nQ6IUIwn5jchS5aPD78mEHGHPFLtccRkXNzK33cryiHw6GkVfIdVbAldBheph\r\n275KPwNWcUaGnQUP7Jej4Rgx2cmUi78aVy2X+nvrdrk22fMfKKiIwHcUc9xU\r\nH/jEqNRpv9iPRaBwSVZDy5lQ+7OPgwK8rI7zQby+ZoK4KkaqqFUV6HVQUD10\r\nYlfy98Optp/fqKpDBG0uOJkBzDWFuHLAsEpjetssk6u5Fe/8AMlxKOqP+Hcz\r\nAi1kakzJpd8+Mp6czG+i1REb0oxhgFoVSuM=\r\n=BHMR\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.22-canary.10_1677152830223_0.6191688614856834"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.22-canary.11":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"1.0.22-canary.11","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./edge":"./edge.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","readme":"# OpenAI Streams\n\n[**Github**](https://github.com/gptlabs/openai-streams) |\n[**NPM**](https://npmjs.com/package/nextjs-openai) |\n[**Docs**](https://openai-streams.vercel.app)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\nNow supports WHATWG *and* Node.js streams via `OpenAI()` and `OpenAI.Node()`.\n\nIt simplifies the following:\n\n1. Prioritizing streaming and type inference.\n2. Auto-loads `OPENAI_API_KEY` from `process.env`.\n3. Uses the same function for all endpoints, and switches the type based on the\n   `OpenAI(endpoint, ...)` signature.\n\nOverall, the library aims to make it as simple to call the API as possible and\nstream updates in.\n\n### Installation\n\n```bash\nyarn add openai-streams\n\n# or\n\nnpm i --save openai-streams\n```\n\n### Usage\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\", \n     {/* params */}, \n     { apiKey: process.env.MY_SECRET_API_KEY }\n   )\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n### Example: Consuming streams using Next.js API Route (Node)\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI.Node(\n    \"completions\",\n    {\n      model: \"text-davinci-003\",\n      prompt: \"Write a sentence.\\n\\n\",\n      max_tokens: 100\n    },\n  );\n\n  stream.pipe(res);\n}\n```\n\n#### Example: Consuming streams in Next.js Edge functions\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\n    \"completions\",\n    {\n      model: \"text-davinci-003\",\n      prompt: \"Write a sentence.\\n\\n\",\n      max_tokens: 100\n    },\n  );\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\"\n};\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/gptlabs/openai-streams/blob/master/src/pages/api/hello.ts).</sub>\n<sub>See also\n[`src/pages/api/demo.ts`](https://github.com/gptlabs/nextjs-openai/blob/master/src/pages/api/demo.ts)\nin `nextjs-openai`.</sub>\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n   (const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.","readmeFilename":"README.md","gitHead":"3139c5fd63df99e41e52cfc4989d32bf2af53ac8","_id":"openai-streams@1.0.22-canary.11","_nodeVersion":"18.8.0","_npmVersion":"9.5.0","dist":{"integrity":"sha512-fjWqnMQcQ7okPa1bw8phZtwBdqpWmtBUTVdIdzbxC1DsTA6BzWO0nD2ibviez5cpCZXE9R3aGL+ngoYWGV2MTQ==","shasum":"60bcfe07d14c99cfc29234721dbfe7ade9e40360","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.22-canary.11.tgz","fileCount":28,"unpackedSize":64739,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQmTmgLxsS2Sk/1OmTlkCp1fRW5tEulyYUKZxQ56PEfAIhAP7vrRVYzxuQqFOov45GPoirPLmf61jSBeBmr8MGhPbC"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj91LcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp6mRAAhwXbWOsTKEdg9sJVHA3p7EawRedkPTBKQRmz76O2zcCbyl9Q\r\nXmPH75HhpvRNSDKgiuunA2QWALEzCmxUyBQ1VLSCuO8sRAAGgpUcMbWTEVfb\r\n9mpgmG/T2L+dIHey3zIHwDEA1VnDTn13YCmZOmuU21gLg4rnxzE5qVkKQMr0\r\negWHcXcdWuTHA8YyNdoCxF6+FXTKLt/j+KDJSTkju7wVDJjeDRikZGhFHDI/\r\n92fvq8teiEch7/67y1XU03iXMYEAcEl+02bENT8yXI+7qPW/ld2cQfL31+Jg\r\nGzFhsscTn0JuKZ04LJuuXFR5h+AVoIFKDWjPMYy+uxrqBMK+yWCeDdWJ5N6s\r\nIg1iMnPsAYGSZ6u9g/OD4xZXcss4ImzGzWPGhm/ngnn9igz22vQDEZ/Hu8gi\r\nfZn3vxhC7jeTNOTOuGT7c05PP24e61njftmglXHqfXFUCvL9TEsTogS4ZAmP\r\nMmPe5QhtOP1UI7RZsU7ujJc6vzYswab5waqBniwKnFBBj92IrwMIWK6FJ1Mm\r\nOieLUTk9PjVbnWPprYdMBGZZf9+FgEufEIVG5CEUYNlctV2fYHARn1avVmIb\r\n45ImYUlQYJlHEPGdyihQnUDRlKMy244KKKxBwmIF962S9GiFBNZIzKDUdlY8\r\niAtpNGBXUaf6RZvv1c3jqy8ZrUO4TTXokDE=\r\n=E1Dj\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.22-canary.11_1677152988025_0.7256537124769338"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.22-canary.13":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"1.0.22-canary.13","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","readme":"# OpenAI Streams\n\n[**Github**](https://github.com/gptlabs/openai-streams) |\n[**NPM**](https://npmjs.com/package/nextjs-openai) |\n[**Docs**](https://openai-streams.vercel.app)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\nNow supports WHATWG *and* Node.js streams via `OpenAI()` and `OpenAI.Node()`.\n\nIt simplifies the following:\n\n1. Prioritizing streaming and type inference.\n2. Auto-loads `OPENAI_API_KEY` from `process.env`.\n3. Uses the same function for all endpoints, and switches the type based on the\n   `OpenAI(endpoint, ...)` signature.\n\nOverall, the library aims to make it as simple to call the API as possible and\nstream updates in.\n\n### Installation\n\n```bash\nyarn add openai-streams\n\n# or\n\nnpm i --save openai-streams\n```\n\n### Usage\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\", \n     {/* params */}, \n     { apiKey: process.env.MY_SECRET_API_KEY }\n   )\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n\n#### Example: Consuming streams in Next.js Edge functions\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\n    \"completions\",\n    {\n      model: \"text-davinci-003\",\n      prompt: \"Write a sentence.\\n\\n\",\n      max_tokens: 100\n    },\n  );\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\"\n};\n```\n\n\n### Example: Consuming streams using Next.js API Route (Node)\n\nIf you cannot use an Edge runtime or want to consume Node.js streams for another\nreason, use `openai-streams/node`:\n\n```ts\nimport { OpenAI } from \"openai-streams/node\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\n    \"completions\",\n    {\n      model: \"text-davinci-003\",\n      prompt: \"Write a sentence.\\n\\n\",\n      max_tokens: 100\n    },\n  );\n\n  stream.pipe(res);\n}\n```\n\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/gptlabs/openai-streams/blob/master/src/pages/api/hello.ts).</sub>\n<sub>See also\n[`src/pages/api/demo.ts`](https://github.com/gptlabs/nextjs-openai/blob/master/src/pages/api/demo.ts)\nin `nextjs-openai`.</sub>\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n   (const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.","readmeFilename":"README.md","gitHead":"8e35ec6bda78ca31050fddcf86250bf4eb09f0ea","_id":"openai-streams@1.0.22-canary.13","_nodeVersion":"18.8.0","_npmVersion":"9.5.0","dist":{"integrity":"sha512-ROJLxZkwKwnktrvsSLPf4I/faTDvn3cm26gcUNEBnDnoaZz/9RiVTDrrYGtANyoGuATgHYnD9/F21V1Ruv9JEQ==","shasum":"c96f8d646c965c104724466658ba1632eae72c41","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.22-canary.13.tgz","fileCount":28,"unpackedSize":64927,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFpgyKcA6c4bdxMstIemwwyNfbL34xTQqApOMdH75u10AiAjEVicY/bgYcuGahpYCmX60l5qmB52oCIU3m0vMmHydA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj91TYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp2vg/+IlC2uvEy7+oy8/9t8Zf6zaUhPKLReMPYemtBR3vU57nV/3EH\r\nvn27osMqbqKxaahPo1p6HGOZs0AKUuxVEK/0kxI0qnTCLfR4n2kT7P+O4M2H\r\nV1mOLmAu9DSOJViAlABpvEaJGCnnXf2KmrfXpi1pM+roOwoiXK1YJA7V/XaV\r\niJfdlocvwGn57Z4pwzSMJbUDlgNa0fD0WY9CeY8XK4CqHQAZeg5xDT4vbkpw\r\nNoRwytfElO4AiVWiJ+Ah/QM4bKo8M56+xaRR1GE1Lp8LSBmJ6uYi5E3eS2/s\r\nrr6cvnCoditBcIN3jI+BHbrxweCM0B53116jCeDKPJ98V52tQXztheI+Bwrn\r\nAXnkuK1rLhhCC+S17OB3Ry+eeyn+/wYkUWkgIU3mzy0UPqqGeO4z6HKH5cxb\r\nFnTKtWFfjaR/075uDvCbT/b83QTRHVq0X+g1h4GR+g3OW7pYilWp57DVVHCn\r\n7sNyM6Z8fpMipExqThCBHRpyTGA7+FtGtQXEwlNz/XUw6e7WUjjRXPcbAAlP\r\nFrE8VPbzU3YhwpM8EGzk5Qoqwpqawhkb6d5kCGPTII6HwRWTfd89thlfMuOv\r\nvT3IYKaB3drvHUX2W70a6KQX5MSBc7/oOFPG3xTRQBm6DBxiSQgLbvW7d6qN\r\nt2GWF9Q9ZB+223x1S7iFztfJPSRvm8fGOyo=\r\n=7etL\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.22-canary.13_1677153495980_0.4609494701500767"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.22-canary.14":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"1.0.22-canary.14","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","readme":"# OpenAI Streams\n\n[**Github**](https://github.com/gptlabs/openai-streams) |\n[**NPM**](https://npmjs.com/package/nextjs-openai) |\n[**Docs**](https://openai-streams.vercel.app)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\nNow supports WHATWG *and* Node.js streams via `OpenAI()` and `OpenAI.Node()`.\n\nIt simplifies the following:\n\n1. Prioritizing streaming and type inference.\n2. Auto-loads `OPENAI_API_KEY` from `process.env`.\n3. Uses the same function for all endpoints, and switches the type based on the\n   `OpenAI(endpoint, ...)` signature.\n\nOverall, the library aims to make it as simple to call the API as possible and\nstream updates in.\n\n### Installation\n\n```bash\nyarn add openai-streams\n\n# or\n\nnpm i --save openai-streams\n```\n\n### Usage\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\", \n     {/* params */}, \n     { apiKey: process.env.MY_SECRET_API_KEY }\n   )\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n\n#### Example: Consuming streams in Next.js Edge functions\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\n    \"completions\",\n    {\n      model: \"text-davinci-003\",\n      prompt: \"Write a sentence.\\n\\n\",\n      max_tokens: 100\n    },\n  );\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\"\n};\n```\n\n\n### Example: Consuming streams using Next.js API Route (Node)\n\nIf you cannot use an Edge runtime or want to consume Node.js streams for another\nreason, use `openai-streams/node`:\n\n```ts\nimport { OpenAI } from \"openai-streams/node\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\n    \"completions\",\n    {\n      model: \"text-davinci-003\",\n      prompt: \"Write a sentence.\\n\\n\",\n      max_tokens: 100\n    },\n  );\n\n  stream.pipe(res);\n}\n```\n\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/gptlabs/openai-streams/blob/master/src/pages/api/hello.ts).</sub>\n<sub>See also\n[`src/pages/api/demo.ts`](https://github.com/gptlabs/nextjs-openai/blob/master/src/pages/api/demo.ts)\nin `nextjs-openai`.</sub>\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n   (const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.","readmeFilename":"README.md","gitHead":"d12dcb89b8062a0bc3a5b2d848a1733d9d2b19d7","_id":"openai-streams@1.0.22-canary.14","_nodeVersion":"18.8.0","_npmVersion":"9.5.0","dist":{"integrity":"sha512-BftM1n4kS7EqzBofNDAEwzj9XGJB4o/E0RsNNQO3olY4P24TAa+D203OXst23/awZ0u16XZXS3UMOCza9ubh1w==","shasum":"be881d0ac0a687e0b3d6e451cc69a6b697f1db84","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.22-canary.14.tgz","fileCount":28,"unpackedSize":64930,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGzjZ8n7i7SFIsNsRmVls38s+1vjrf9jtRG2SszsvpPmAiBxvIcJ7xdyTFqV0z0Fy+xvxwoitwtwpoZ8PzOfVtwt+A=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj91U9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr9hw/+JSeZyJy2AdDQvfSiucO0nrTSZHR6eh/VWovxL4qNDaOvO/BM\r\nnbl1SzaFms9BChI5pcqBbmtjDBKzJL/J8QIKPXTF8s+LVcUKPrtFulSQqT+q\r\nwTxXlCFGW4T76HZgzStmEQ9fU7y9w/9yqt+f/Y9vdPE2KXrxK2xEIslj/T8o\r\naMeQ8NXUzAh/x8k9G5N15wOyMYLeoDjXG07RJkHMU4OXkDTVrY72Au55bb0i\r\n+37chxn4R+Fvepdt9lbNCvyGFbSZ9SUwSFCnzLCYzQZ44O0rVoDO4lUnYql9\r\nIalgQJi0gTgZs+Bov/QazTi/+9ImrnbxK5yGHq+Ir5KmhZUiujyFO9Ab/SCo\r\nEzbTOSytrM8UrwtBjL64SfYSvcuPzwf72w8KtCxZ9AE3CofsRSnU9inhHTU7\r\nu6WfUAr4UBJO3b6EE323d8xE9GHXN58mbwz4LXUPm/Q+KIepAWxnHWw5j6dU\r\nFyrg/eU8vaEu5OIPzIMKlRMBmnTXUMrhGGKAyDPuKIKSZEOWTB+ouoNV1E2t\r\nLDPvseKqZwSnrDgveKIpQhTj0svBf8PM6YHujI7NXFBjX0abC2+FhVQqLNKt\r\nGOrj2UfSOpA69Suw9lGenMNujmP4mA01KhHkJCiKLu7W/4Yrk2Dc/YX/3SuL\r\napKWJIRbwnx5IoSRPnD7qLaxhZARLtA6TbA=\r\n=7+6V\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.22-canary.14_1677153596998_0.7632091045154736"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"1.0.22-canary.16":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"1.0.22-canary.16","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","readme":"# OpenAI Streams\n\n[**Github**](https://github.com/gptlabs/openai-streams) |\n[**NPM**](https://npmjs.com/package/nextjs-openai) |\n[**Docs**](https://openai-streams.vercel.app)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\nNow supports WHATWG *and* Node.js streams for full Next.js API Route support.\n\nIt simplifies the following:\n\n1. Prioritizing streaming and type inference.\n2. Auto-loads `OPENAI_API_KEY` from `process.env`.\n3. Uses the same function for all endpoints, and switches the type based on the\n   `OpenAI(endpoint, ...)` signature.\n\nOverall, the library aims to make it as simple to call the API as possible and\nstream updates in.\n\n### Installation\n\n```bash\nyarn add openai-streams\n# -or-\nnpm i --save openai-streams\n```\n\n### Usage\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\", \n     {/* params */}, \n     { apiKey: process.env.MY_SECRET_API_KEY }\n   )\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n\n#### Edge/Browser: Consuming streams in Next.js Edge functions\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\n    \"completions\",\n    {\n      model: \"text-davinci-003\",\n      prompt: \"Write a sentence.\\n\\n\",\n      max_tokens: 100\n    },\n  );\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\"\n};\n```\n\n\n### Node: Consuming streams in Next.js API Route (Node)\n\nIf you cannot use an Edge runtime or want to consume Node.js streams for another\nreason, use `openai-streams/node`:\n\n```ts\nimport { OpenAI } from \"openai-streams/node\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\n    \"completions\",\n    {\n      model: \"text-davinci-003\",\n      prompt: \"Write a sentence.\\n\\n\",\n      max_tokens: 100\n    },\n  );\n\n  stream.pipe(res);\n}\n```\n\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/gptlabs/openai-streams/blob/master/src/pages/api/hello.ts).</sub>\n<sub>See also\n[`src/pages/api/demo.ts`](https://github.com/gptlabs/nextjs-openai/blob/master/src/pages/api/demo.ts)\nin `nextjs-openai`.</sub>\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n   (const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.","readmeFilename":"README.md","gitHead":"1ac245652949c6b30e71e8a3f74758771058f0ff","_id":"openai-streams@1.0.22-canary.16","_nodeVersion":"18.8.0","_npmVersion":"9.5.0","dist":{"integrity":"sha512-rP5AL6jAr/su27gOllYhHP92Zy6Q3IH2CsotRodUXqT7aSrkSSFeKy9la5dMGMFoI9/XGpu3IphTe1TC/idtcw==","shasum":"d2e34269c632e1527308f463e69ef753904ad7fe","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-1.0.22-canary.16.tgz","fileCount":28,"unpackedSize":64929,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCEbHEz8uFwkvtlbe5+nyiJe0qKBxyNzDtkzqdSfCtljQIgKdyENgvlsR+M01i6z+FKQtEzS4kyMgPHYniHQ8A7WxY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj91c2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq3AA//Qtx9XB8idylAYaPnMlp0b2Zz9C48uYDa0AkPrnSIDm7w6Svi\r\nan1BYVF+y14KtIwjC0VRhiMprM8w4Jy1xMp2f2ix1LV2dcGAPFuIuC1H6BXl\r\nm6e7V1MgXnTGFZzlmd0K4RRGw/cwxITXlVXxLb0T69BUZQdPYP8brWbPgOmh\r\ncjXPOXmuSokE+RGuYg/l77YNk6hVCU6+6Rq5fKxUiyEYGBSBZpspHWD2p5qO\r\nJGnqKKg3jIXTjJOGtaVpBVHxcrHI38KT08tVMVtmeEx8/Q1Pq35JGj1mUdSs\r\nM4YDRAkVrop7ZjEgAjFN/oSc0U7pWr6huN2FJpOpJ5zpwdl70J2myzHoxj3b\r\nZgCWP5pTDnForW6pOVOY/3frqKxEkH5+oVPCpmOMHyvLMUsEhEfChOGqzQGo\r\nXiyHxceSrm6Kxj0dpvv9y4VTSJlmkhCHYXnrVE3XSWHi30rfdqmClb57MQZN\r\nED6miFWnqBr9ukDTf8VvTt9s37f8D7rc37z8EnEu8UhOCWGjgrHhEuk34pLj\r\nlVHw6E1oV5G1YXWDDbDIvRqO83ahMDGOAGrORFX2ZKEnfzc6xCy76CO/Qpp0\r\nagmYBBuDHFeSP54XQzUW/1C8kKjPSAPEWd1CF7GFkMLtD+uDnce4kPhy5v62\r\nxrErQQewfpqv0LhS5i+W6P2R/DC8KJtLDkM=\r\n=mJfJ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_1.0.22-canary.16_1677154102150_0.27024824153384386"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"2.0.0":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"2.0.0","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@2.0.0","dist":{"shasum":"42f81a6012bb44a02602daac0007f889a2a5c483","integrity":"sha512-9aE9l4Vv+Sc65pyOmE2GB/M8kHGc9yTzrKVXQzAGhccdnLfl7odp6pQb/7YOH7ftOO8ZNCpQvBUWsBdnlXWB9w==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-2.0.0.tgz","fileCount":34,"unpackedSize":65000,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDlnXbJNITvRRfo+U9GIl6u2Naz8zSm8fPbnjadU4soaQIgJZNvcREqt3yYipn4UhjQ1QSNmuk/CeEnV3Hbxy3rOVI="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj91ftACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmprTg//WkEU6oFVIZN1tBMRyN5qJUfVJ81+vPoZ/tKHzcpq+c+TaDlA\r\nRHztt0rZwK8YXcZLufOIKORq1MfqukkE7MYUJ88vGjU83FmoB+sDtp/cpROa\r\n27qmANW1IBAs75kLD8TR9gjnbnMU8E2zDmZJI3S1j+iiethVEm8Htx+OF1Ut\r\nWUFwkKxUpfWeqkb3Cjzboefej6tmTALQWavZPFtLwND/uDNGp4rJTIayU8/l\r\nuKqP0cnunYiZm9/DhQaivc/rRrKveE3AURnR7AtTjiHAmcLoZwJrXoqMtbu8\r\n21vWZg0xtM0hUiMVJDoMMPpGV7FMC4HXxP3dbcMa3ttyf8LXtV8XMtOcC/5K\r\no/8VVFuPVtSlv/HPBbKYzD5yM/vKj4UYxEwXqq2zXReTKj8MT2KmElwRbZEZ\r\nVGlw0X4gfFtU2vRyR8UnxiKfbLymc9YsTDQ75QZE0vm17UpYLZTMsVau2OuS\r\nWFHFl0ubmGHW7dlNlgURr2kuJ819Jyn7Jt8EpCLebNTA44eGgkq9wKP9Abv3\r\nd/72Xs6TuThkFB/JcnH8SBBgu7hUhZgv86ruX/Wkod492VZ17O7Tktcn+546\r\nuiYJ+515rQEAMwnNba6Qmy0a6mqm1dyKLb16Xdb6nwv+7/3rmX71fCHuIQuz\r\n3sXxPWO/fWjh0jJfXlQTXmv9lMHqIsYXTFM=\r\n=Xh19\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_2.0.0_1677154285417_0.1611625483752961"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"2.0.1":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"2.0.1","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@2.0.1","dist":{"shasum":"6bc79eadcb95bc1fbf2d0149b8346b0522941097","integrity":"sha512-k+iWNNJDzY+n/mz84YYZfy8MtdhI3t9jaK1h5DX5KVw/HqFeNxrxt/NcX4EWBGNmSDk2HjeXZpQD0vkE7yYm9Q==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-2.0.1.tgz","fileCount":34,"unpackedSize":65108,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwO6hsvCGBSJ7dd670N7mZOZKOvdYbXiEMZNFuptTcPAIhANiOidzmf31zf5ekKaN1mdNFHW550zVlPs8tZRaiDA80"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj91mDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmom0A//Vqn3NOPRbmbpifBu7Nq6ID3gM4Hk28GowQLcj4Y3LbRMPg//\r\n4F0S5qQZqyDbruM/K/eXNp4B7QkRGYOv0Xy196Ng02fZlAkO25XWhZ7xNGBe\r\n0eMaAS+CXC6kp82k94yQbMy5eMYQ5HuwyOy9fHyf/5yHFiAgjbhraAbcbvPn\r\nxUxHSQ5/+pqRutWiMj+U7Onka4Kp1H+uIjlH8bjJbudrHqJFlYOHN4+Sj3Ll\r\ny7MJlyDCGErRlN8FxzierCV8nMJKp/q52SkXlh6ViWjMCYrMCUNcVnseDa1J\r\n3sGWZht+z0gjJ1YjRFtgiCzdRaCl3YIOEqMf95aCa1YNqVIiuPKZFL7W6cLu\r\nUHR0CHQoo2UMDSVpqLhOXSGRuB8jwXHxrPQHkx4UHwiKeuIXSGydDaos9dGQ\r\nFshhYyb3p6h8S7e/p9kJsSR4KhQH6VlnPxQ3jFUHjx0bicOlVFBeO+UjXtsL\r\nZLWhpfCsKsvoj0+C8YHVAQ9PNqJI1/VRCZjcrDUvQWr3rEv5SSy7ffiFLDv5\r\nZfvMTitQmTx5m+CFgfxg4ObXLNnHTXcT0ZDxY8uTt+MC0z6SEpS7WkapLBnL\r\nw6XZsSSLO7AYbNT2DKI+h183BAZqUunWpsV+FWgl7dpuTpX5vqpIdbkscN8C\r\nzTKELZQe4hCUoWlu2KnYMYHnDO7CQirP31s=\r\n=Ou/V\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_2.0.1_1677154691395_0.6179096082601456"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"2.0.2":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"2.0.2","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@2.0.2","dist":{"shasum":"abf8ff0767b9a449eb802d863ad9207dbc4f3e28","integrity":"sha512-twjOTHzjgnbhba088WG8ujypVnELwHiC9VNNIbAxMYSHW0jecEOKvrFehq3/axAk3mAmkymQ3LEa/McUpco2Fw==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-2.0.2.tgz","fileCount":34,"unpackedSize":64840,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCUZik9zhc74OiWsjlfpte28sSvGviWR5wPJOF2FnL/CgIhAMusiHcFMxzSMwVJNeaZAearCQ/vu+BwCEjCOYEC08cE"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj91oYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpDzg//fib6ON6TMo+zg5ToorVJUkUUPTXLlWyUDJIfm1G/x5wzxeOe\r\nxkuwah9SAFS/0ZDT93hsRyyiy/TtXuKu7N/7lyiu+Gr8nDLxPdOREWU2EP73\r\naR+I5FMXuM/TTY/B5pxk8VtJQ00kEyyV8uu58Uy3SqwjRwRnH84j39GFbO7k\r\n8UgaJrr7uQMAcV+EkOzhEANFAyOgYbq16boSRp2Szdi+16DLPXvYAxpnbQwE\r\nv8OiHu3eRU9IYz4a5kVYw/zbM7N2hHbjIkJ7CcM9NopjqP6TAFzDrXBRlQ6R\r\n9k4b5Nai3hftz32j0hGh0AYZbXkYt5KU947NJsZGElahbWoY/Js8Hl2z7yvo\r\niYxm3iYvMqseqGC7EMPiYMN7lbHAvUXMk69Rpj6e+bNak4vvem9Kos5k4BdH\r\nWzmzQcDlQd+pRPUa5oFbkFcu8FHyxg0QExQi4TFKxCuL5ae0Q/S05VZKaHKF\r\nvgM44snNqbxShnwj0ks30e0kF4Y9O/FMlSVU/2QRVrKigTOV4EPNDwimKXhQ\r\nDcxI8lCkoAd6E1+ug+bGCi6RxeFYXFfX3AsVlq1T5lYGWiDFIeBG2pti0f44\r\niFExjDrevIdiwXdBe48hG6drLnJRBOqUSRkrTAHT+HrMl1Ph2zNtvpHN8hOI\r\n2POfh+t6fsEflSxbQSRMRC9y8iObK3PFQY4=\r\n=8oS9\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_2.0.2_1677154840473_0.6481094519681048"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"2.0.3":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"2.0.3","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@2.0.3","dist":{"shasum":"077c6189c905d1b3cdf081dcbc44e0129be232fb","integrity":"sha512-KuSwjCsiQM80XLwrzN4nGJm+BNzTXmzd2QGS9FjzFgZYfsc7ZJlbBV8rlthLEnFre7vEKpxiVFSG6Ms8+nWzHw==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-2.0.3.tgz","fileCount":34,"unpackedSize":64811,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8FZNaWZwCTWdNZtKglxJR8f1tAQG4NjlzEpIWbvLmQAIgCjRwg3d/xo3JzCFJXE992rjYGqZfWRfgdjo/tXx74C4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj91qtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrGPg/+NcDcUDA/2ApN1O2ZPsL5TxX20z2QO6DzOyJ8X4Tna1feBsEe\r\nUYG6Y8Uk05tLOy8Rw5H0EdxlsDwyfkTZLXcV7LBVbP19xKLrUrbwQvHwg5dr\r\njxoq5aIzgxyxkJmQGFuLncZasGdLH79Xa5ueuCylS+r0g/qLZzQc9WZYhMxz\r\n2HIlBb3HE2Ev4Cat+CCCKzHF3iGubOFk0lSJrKs7DFPP/w6xr617sDD8sUWt\r\nxwOZ2GcNKVHhHN8ovTztjqhROcl0BHBfn1OlCRGklw4mVBY5dSBlAwTFma5R\r\nFdwbqbPb8axqR/SVSKP2oHA23M3hWAJ4L3J8sT2pd22xIW2eTwlwLYJ8TyaY\r\n5QsE9jng9PGnHS3tuLRUZcDzU2d2nOfqg+vCn44s34b0le12E9Ey/5piAASN\r\nyBtlGjigOKSCmVr38ZBvXMM5DK1oygG1Wcy1rsNlqqi15QTEOLnaYTG+Kck+\r\nADTW7ehe0+NGYz3swKQmenoFQ2MaTMgM39wY1o+F9/mmmRRdGbo2xsdVnPKB\r\n4p8fRkqgj6mcWbDeI5jBjsxhtdlLxfrKF/xe0YLDvh9DFqu+F18tI0qpo1eV\r\n/ojpojQzZECehOO85HP/e7MVwF4VA3I9PhG9QWQqEzjOCWgr/MRSUynzFINY\r\narWAbESCfFhyjQTyomAQQt5dJ4/zRzQTOQg=\r\n=Pb1f\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_2.0.3_1677154989678_0.4019768237546253"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"2.0.4":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"2.0.4","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@2.0.4","dist":{"shasum":"d3dfcff3e1faadfee6afeff1ba3cdd68cc6685df","integrity":"sha512-ZHVnoeRD9OOEVzo1b6zaofN7hUB9hkjYIOA4Wq7ifhKtAfxB8TYZApCTYYIoU0dCZkIihGvyY7dA2KNsMFJpVg==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-2.0.4.tgz","fileCount":34,"unpackedSize":64956,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC/XNcidJjM1xr+FF4x0Rx1TLrByAaRjEwbtglS+OLizAiBxfDwz+Ig4z4hWNkXx+uK0gY0uGGMASFMOtsqmOf1Hsg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj91tXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmppXw//RrPamciKTCOaNNwFRbxC+j8DXp1Mm5V3lBF7bY9pxT+JKWQE\r\nc6goCw6jd+XNG56aolMjpHMfrLLqgGNtcpJkQtzwJDHEJtGUS9Z6YQLbgeh+\r\nMUblMwL6AamnlNvoqwzAfkXC7y+LTOrvlpIukr/8hg4wZhQiAywoSd1d1Sk2\r\nHkODfdDW0FZtEsuwMHGalbeXh0TRBorSanKxplxd0izyQISIuGv8RmbTYsyO\r\n8m0rKkQqkQPrK3vcsnP5ld3fy7k7mX3v0NNhBvIyMYgVNFhTQSqucBoYkhzv\r\nqhY0zeqCjVHSG+8txAqfyw9s8CYoxylp6eo4drsST9cAQ378lBKs2s4ShMoJ\r\n/jbOn/Z4bX/moz+E1nalFj5eNSREkJ2tVtCelbxcKYDVbTt5TqMQxNEjp0ro\r\nFJusmamzEqJUd5kX9zdzjdptPqC3LVXvFZAFkqLuTvGLrYiq8AswQSQhCK+N\r\nNoO3ee0DBRfZofFWpI8nCI0j1hVL9X8YTS1qKizGLHXkIkVGuKlL7he58bWM\r\nQw5SoVsg3PQ5zWcb9AR62G43lNd+tCUvcsPHvie3Tyom4oAZ4vW6szn8caa1\r\nLWxZs7ke3vm2trTIcpgwnzKy/Apzs7YWmDfAy3H9bpMiEed64JJcj3o55QGR\r\nXZQxaHyqm8f0il274+1+nfqCuY22tjZ4AAk=\r\n=XhxR\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_2.0.4_1677155159408_0.1721881724482468"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"3.0.0":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"3.0.0","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@3.0.0","dist":{"shasum":"0503e49c4ecbcde13ddf8c9bb1911b9ab939e7cc","integrity":"sha512-J3MklmC6DWcqVJs75G2VVXvKYJsdTYcFTH/1vVjJVyJzy5kvuoXUIhF8lww3Wx926+0iQDtdyr3F/snQ3dDv8A==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-3.0.0.tgz","fileCount":34,"unpackedSize":65052,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCnkL+ZMNhgGM270mhMyugn5y7PTO5L9C9o7CXIMz4yGgIgd66lZ53O126B6YSLC//RPQ+ag6z8d7ALwOdakIJBdig="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj+ZM3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqklw/+OG1ttQBah696xacAoTwdMScyJ+WDMrnE6hTmS0O5+wIHRzfm\r\ns+CqGHtGNjbtpDRgJUSyf7cCjs7NJqqGx9pFI/vNlC6ylI4PdPeoN5w/OVJs\r\nj2YbiCc5YPc2RXLvlYCR4AnoywMVUOy491inHLCg/hfeESYGV1Ph0Z6S9HLD\r\nMO7RsNsPCtZd8Kvfl/vYpoOI6C3HtPGqW7uaQ19JQCduRBlYdHkXHWuWwDr8\r\nAgmZPafvJsBcL8kKWtfBWBDyeA68fg+p0aZwTcfOtt/p2mW/+GCDBBrHrlul\r\nv5udyBRhvEWPRN5K+L2+7Lv6CDxUGMVAlN31LARqrFbN+7j+efzmMcw0O2/3\r\n049PYCGNA9E+WA1MUTBNBMgreP9KImrFesA4bWbFNn20NmNeA6kpMGJg6fOU\r\nsN3Dgc/SAOEozTMFPWYr8YxvTnw4K4LA2Uth/ZZCFaKWoxoknEm7aG9Oar+o\r\nZIdoqureZmq1+4hMOKCHTEeMRFBS9zXk4F8Yg3T9VKMe+wT4VT+Pi9y833Qt\r\nqbRdZ1Auv4uIcLMX49IAt4cdQaJ2v14DJisYVNVboy7KKxW/w5oM7XlnVZcy\r\nZGHj+/aS6zguSTouUA29beTRmsniLcCmn/avviHtbvuLqzzkccSWcAjLogWW\r\n100Pgkn96Vu6P1gIlGNGnVv3N/K/+EEHKnc=\r\n=TQEp\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_3.0.0_1677300535782_0.4706480815060554"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"3.0.1":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"3.0.1","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@3.0.1","dist":{"shasum":"8885330bf09faf3de933d3a9e0b3b029ca440730","integrity":"sha512-UktmomLRJUvXt/0zHKMlkCSzNml1IGm/0F9rh1o2PjvOQiHJLbRLGLoo5r8tU7Ys7UeEKx6aSM7meWJxXc8Lfg==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-3.0.1.tgz","fileCount":34,"unpackedSize":65042,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGXl2kNJiuyV3APw69GoAt0L8IYH2BPG+77dvInUR7XwAiEA6Ljybuiuj4Hs21ySNWhT/62Gad05zAz7Xmec4gPYZ6g="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj+ZNjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq3/xAAmkp0+xmF8NVS8/6oGLMH/Q6I5/A18PW6QCtRDkp+j+7lKyBp\r\nEy1jrkfgyNmkDxlwLL6UtdxT9CvPeLqE8bCOWTYl0I6Jk6yZXrmXP/+NRTbI\r\n9X4La+P09jo4WlutgpI3zY735yYEXNC4DAB46cfPqoppS8k1YAxf1n7Kk4Da\r\nzqttxd/eV6P3miP751TeZTCZvlSPdjD0k+d5H/JKzBP0tf//jYFU6Eyd1Zm3\r\nW5NYPntdBgj+H8V6ZJy1rjoNBvtcAyqZa9PqZqLLqNOo1E7VuIG9P99e5tKQ\r\nzC5Kmt7wHAbakdh32tQUiH+x1EvTip+0oXCD8/0colee+yUxHFDC1XEAYqP0\r\nPtJzQ5zf1LuF8j2GUvaXxeO8Ri2jZUr+OTKb5r08i/wqdTawirMQ9RMrvInE\r\nKjlLlSyjWcpBV83jcS9GnxA1laBoDl8Z9FM2aNVbFIy0HAJPTDwyC84CWP+O\r\nnTCZHwAAgLY5qzd9HdfEZNU1SVcOiClFwuPyNgbvKPMjukxwO5AUTvGfQWTr\r\nEwam483wQnJNf70+zzXy65Mu0YY8Fzpn/lpb7WDOUbRMbA7I+zhWi5JaT8nt\r\nbZBBzBnYXp4+WQ5IqC1/Judrs+QxVo7UnaInR0vmjpG1HZodcliuVqREheNg\r\n+bYjfLOxaB5YHvIe32TSpUXlIvYHH0WsFUQ=\r\n=8G7B\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_3.0.1_1677300579601_0.26048000390740844"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"3.0.2":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"3.0.2","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@3.0.2","dist":{"shasum":"b0792a09317adb50f0f0f6cee9e6a913cb8c698a","integrity":"sha512-h8VW4QFEzw+dUd1n7VPq04gIKa6aDLOKPWsMdIlCE1LX9f6jtZy/gVs4Vs77GWopOCMzR08Y1yBbrO8dFHfm/A==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-3.0.2.tgz","fileCount":34,"unpackedSize":65103,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBaDS3nfpt6UnV5LdaZX6C0w8nbU+kCo7vubslDngV7rAiAeL14ymsgKeEB4VlnPdPGXIinNgLAzKt6pQ2qOjlznlA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj+Z/rACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpvog//ZQY4xaNGwX0bZO4o2SNSv+ZbRhoHCSE0gFkC49KANI15S4/n\r\noJB7TxBJsP5K7CIxA+SnXpoYPDuFmAOes1zEhgbPb6mdxVIgvvFLMzX2qMTD\r\n/pSg2lOhrCn4+SVJwv0cJN6fIAhpyjzuxT5LzOGEs295kBFABVFgKSZt7Ua+\r\ntaxI1+BCCR+Oltqb6H4futqmr8ueMi/mPh9CVuknkQIkR/cPUC3eXFiUUXwg\r\nIrEengRbpHMr9PpIiLbyTTitpdAFb0o5kW5kIoAJbk1yDd2JZ1KrAi6Bsb6R\r\n+jU+W8UhswLKl0XOGiTisRCx9KJWm6CEn2IaTzwcK7kSQRl/6QxcJUgqvx/a\r\n6rjB1YWNhFewrhpyblHcNaU6ejCdS5ZUtSffKmVaM3RrCiy/OM8/M+eYeKzz\r\nVaX5vrTPQlsxgBkHptOhLA2+9FXGqGnTxSo6scYL4gMAQxblDJzC6wbEF42h\r\nGg8K9SknZmNi1ClNezeEsxI7A/b3xzz34zknvfJy9RNPpVbw23CZLYcgwUZb\r\njxS/WRyVXYix7kLSXa0o9NbYaJpvXgZQmOj43Yzi/YYUYWNoIYYp6iOEqSC1\r\nU7P9FPWmatTZSs1piDK0Br2S8JZJLnkiNRoMP8bG+nF+zUhpSv3yl84atYd8\r\n7C3oytQjBUzUe0tfkLZqxaPCndAFt0s4dGQ=\r\n=kEPn\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_3.0.2_1677303787356_0.8924854474581638"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"3.0.3":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"3.0.3","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"ava","pretest":"yarn build","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@3.0.3","dist":{"shasum":"d5e40aece9d875d86227729286d563f3249fd814","integrity":"sha512-ar57SAMRilWpiXWIaGqUB1C/8yfjaJ8qrz2UnhkdEegp0Tt8uX5nwFP0M7CltD5933Tok/UiuZ9ugqoe1gemXg==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-3.0.3.tgz","fileCount":34,"unpackedSize":64982,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCl1RUX+3+SU3t1dS1y0bkamalFkAnGM33Ht4hM6aPihwIgfj3EMuFDk0pRmcwbHXf1arK402fnf9Xh3uAPPmqp4Gk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj+aTJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrWbQ//VR3nZ0T0LTm9If0S3O9YmkUBaoBf/zuAgtxDE6KlpgAh76Fu\r\n7GUmi4G7gDrqFVIuYbeYNlR4QJ7ztuzZT9xkjvqNnGxHed9a6F27BCy05LIC\r\nYnIJ5bc5TkPBGstpMN/8F6pVba1ZWkouYRNOPcDpVlrPxHZExtnbnRe6FK+6\r\nqX0+16C275aBy9ahy49g21N+rDHZ45Mu9z9YI1DYvDCdFFyO8zTVCPqJCOM3\r\n532ntW747O/svggXu25nlQdgwKxk3au7FlhNi+58ay8WPsYUx3TJmrh05VYw\r\nuONJQ4IS5AHnjFsHxeIjuhh57EUXvuC8oZh1bP5wE4D0vT0Hqu90LgntD0+i\r\nrB+JPlEINtvr+lPylwvTBj9mkYsBkxHgqVpCs53lMSv/Ce5W42ytCZRU6H6z\r\nEwNcTGXUBRutq8ZQhagxM87z13YxRHvdyxTTW4ctL3HpTtstCulWcwd0Ntny\r\nga0YaYa8MTKglqlGGIu1uotYPmP4Zdo8rE1mLrmmwW/vB3RHIXFeQiJo5geM\r\nEbX1jZKXTlpQz84Sg0NN+p+z7+zY9VhM+XpM3Pzd/mUbFFo4Cl9zEnOYacIE\r\nOwYBzBQMItKaNKWOYM2vNwYEO49iYQZGZEnK8g/9B5OLqepaIWeZ4b3G9t3n\r\nFP6x6mFbe5Bm1X20JwMG/vpBCkhZcBh3e4A=\r\n=hES+\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_3.0.3_1677305033559_0.46668971875467546"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"3.1.0":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"3.1.0","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"yarn build && ava","retest":"ava","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@3.1.0","dist":{"shasum":"e9589e4a32fe32fef3beabd0ddf7c21387427e41","integrity":"sha512-UdtoEuVsLfZRoi/jEWidMKxwM5naAgnfiXIkwpqbIGCQ/0/GVvgBowEBXUd0NzhTbZgt/OtBNzxKd2MTLxTqMg==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-3.1.0.tgz","fileCount":36,"unpackedSize":65972,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG2Az1o2wQlI9cezLelHHrfiSS8LjqxMkZOW5oJW7bY9AiAZlRCq0MUKT9QJ/id3yB1FenIDOXicjtHZpS9XnYL35g=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/tfkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq3hw/+I+L8dI94ug33uM18DlQVmEyniHF1DKNxxwPBr+k6X/5eMPqC\r\n5K9zVDZa8PXRIdk2K3B7uP5HT81Um6ps/KdaURpx9NoReXZ0y8LhjA7/IQNG\r\nRybza88Xnii7dD+RFaVBhcZSjY11JlynvYeuVWVcwAdiA1rWppN2fGHHI1Z9\r\nckDcjXT7rQltGoP0wxz++ov+sWMcCe4UBJ29ITNudi4Vv9oGdQNa7sdY6oSM\r\noYI9bMAweqI4/HgpaIlIgaLhpEBL0foHgpzYMGpknuSfhg4bJGY6fhZPAJto\r\nBPLELNxw1msuPJ9hHdFep6EPdsAGgzx+VCXwn3FchbBMb6U7xob0GXdaAC6p\r\n3K9JhFvVMxSXB6KEH7jO2Ju4mNabr+xgygCty5LAmM4tTOj/UNGv9CffjkHy\r\n7e5NckPkixz0E/dH7wJanGNjrBUPDdeAyu/wQlmlGHVjSjNpd4NtHLqf9W26\r\nKRy33Rk58tarXRf6vyFyorSt0iXDc8uXx+TLkHixT76wPrrDCTOd6xvGA5gJ\r\n0B1WjCfGnLP7WvaaN3ZQIDfZl0KDCy0uFdxb6o1sFo8nTW1nhRK9XGo9NuRw\r\nBCMWmHE79lW+cwoPaZs5rCv9hmWU4SbqGTL4OBWUWi6fNWOmyWFaZWiQDs5A\r\noaGNEaLTal1A6ZvWoLrTV5keZDUlnpxgnu4=\r\n=P6K0\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_3.1.0_1677645796108_0.15513174558229492"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"3.1.2":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"3.1.2","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"yarn build && ava","retest":"ava","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@3.1.2","dist":{"shasum":"60817cdc3c760022fd2938c0f94f99aa8ee0a640","integrity":"sha512-cuoT0xuiJRc2nyWqN0MC9ZTU2IHtJk/V4KfQSLymsuj1GN5cX4jY49o5kaRnIR6F19behZEC8DpyB1dyq3sQKg==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-3.1.2.tgz","fileCount":36,"unpackedSize":66023,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH0Kt6sITy3tAWW8MWwYakaW7Pd/BFvMFhU6xgk47Vu+AiBlHbPp8cQ+AQJAbPO5DjznhVVXk/TSBe7H8EemKZW02g=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/tn6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoi+RAAkLwsqoDAZDFQwOyFOHpktBv3fr+LrynThIy2Wq1zn9hqg+w2\r\nNlnUdg56qeVtkOEH4FWXsan8ufj7RKlZ9agSGObY9ETPO6tHhGa4LavosXmK\r\nCK5XpkHf5pxG6/lDhVygg1jsN7e/FRF/zsOQNFXYd26vEZBXpm/xdh+yCsH6\r\nlIsRVdypApZPpJNGvwraogRA8VTOLJQRz85bHSm5SFYaywKSTt8FassfihIB\r\n4wQ5FZkqzah1sDjoDeGGpMgc0as4Wn5ZTE8KGVqZgHaXdu5WJLVOKngSr2Zh\r\nSN/tHtFD6S2h8miTketnmCPbI+mvU1tB73PyzvtKedTWz704yQ1h8bAQoTvU\r\nPCG3zbcg/nkDjXOPb03acC0lVe8jfbd16XX0xzbP5j9b1ugGwH8gf/2kv7d3\r\nf5t9oPWgHq5lXwH0QyxG8pFpRu/plo/oNwAeVzrVL/qzHzVeNJURygXz9juN\r\nJA1h12yGv8TK/y4ts504hgD+mnzbpdR+qgKr7hgm+Ge2OKVIGCLzVhxFI1AV\r\nBbfLc5W0LZZKjEF/qkWr+D9ifeIsBgAo0uW75BccNi8m6BrkrNmmFw2RK6y2\r\noOnePZLoJa7Gw8RO6gvpdeox7yf+wigxMosw1xf+9E/qd9yYN0YpXej4Kj0Q\r\nNDj2dobpphQ7Wfj4nhPNkRgstE/egz6YqBY=\r\n=tQbM\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_3.1.2_1677646329862_0.39038926896566295"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"4.0.0":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"4.0.0","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"yarn build && ava","retest":"ava","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","openai":"^3.2.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@4.0.0","dist":{"shasum":"8eaab9896dfbb42732e88729226ca7c87d1f5779","integrity":"sha512-KuaKrfgD32KbUjNh7sT5c+Kj4Pe7iZ2dZohwy0cQwY1NJgvAtrrjJCscRKR2ycb/vcKUm95+c5NMYSV3OnZ6HQ==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-4.0.0.tgz","fileCount":36,"unpackedSize":76453,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDB5yq8tdGb0AGvQ9ePR0jgA0+dwwagV4ulFbtpV3pTLAIgUoKyy6/wm4svt8XdpcRH6/0NKV636gLSa/5RnBrfI6Q="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/7OnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqfsQ//V/bgfhawn/i2wZkcRYMNnVQNY0lry12y/vbV604JHHX2twBK\r\nR3uIPYpuYNq8vdCUxgkmFw1SalqO+jntRoFD60UD+TmGlvO+5Cm/6OpInMss\r\nTRXxUud9ZqVmxIWwN+ii+jmjl5+YPXidUSw2lckmABIkM6H4tAFg5ZT5L+4p\r\nMrSOMjWBdKwnqc+eTP4F0fStIzw8maEcFe+R1nEQWYPd+tW/qU5Hb9tv7ZFx\r\n1/iDy+HrTqPMWL/9FZPGxJfBDI/9rH1toc5Y8+GmBK/7Znnf7EXl99SxIR5g\r\n4Q989sF/toizD2taSQXlfZTnxhp1vM4EGyV3FUOBaSkp55GBnEFsquUZM3MN\r\nPKHLXpxU7egFoqI4cPsE0EaMa4fY1KAdtPqgM++czREVb5LIkwknV5ohLLIr\r\nPb4MG4sU6iCuxwEKI88SQsHahzyWvY1YQEE8ZbGkkhCLznH/qHKmDlqyoPMi\r\nBWi7Sbt01wl6HaRuhlfnxx9eAADqe3gpBz8GLcMiyKGkF9IkTLYQQGHS0717\r\nEpMNX7hWd961A7S9NSmfVQhSzok861lW9YZd9Urw8/i1Dmhpn4BX2aew6u6E\r\n9lNAsQ20NHfL56AZRN2W424jTeAfFDNC8jND90KqV+JRvnekWl27+ZHAPWTs\r\nVJsoGj6JEuDztv3bZf0LPj/Ah3mjz/ob2EQ=\r\n=47xo\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_4.0.0_1677702055218_0.30926095700546785"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"4.0.1":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"4.0.1","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"yarn build && ava","retest":"ava","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","openai":"^3.2.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@4.0.1","dist":{"shasum":"efb796062d62a50651bdb5b9bc1e68c682652207","integrity":"sha512-ergPiHa9pyF7Ohd8KOkB6w2L2Q5RgCdHRexkjXB3idJu4I8ttaLDB13RzfN7OZEcm8xugbfNzr2CsdkKizavMg==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-4.0.1.tgz","fileCount":36,"unpackedSize":76502,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDV1LQeEAvf0Do9Wsm3WyT9gnvd0lQcKIE4yyslng6iMwIgW24+PK50A5hZTNaaOhTgI8MB0Y2AkFgvXlmJE0OgEWY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkACnBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmos6RAAh8rXmeNGn9O30hfrOaGXk69TdRGg6j2pfkLGIBiEuR3nZqbR\r\nIiMJE3BojvehGGnaaN24lEbScsiNVBrIomN39wuNwk3yIdnxFBKwLXnOvvwE\r\noNO/q1DsWd41INK6gHkuhK0z7my7fiXuFhOjrW3Vgq5nSVGLmjQmXeUgQd2T\r\nWgBFtUqlwAgjKwZruJ3TPrsXXeSAFOI7O4KcYrUodWSDaqOrVrhfG+L2yb3a\r\nN3Xkk6jtptHZwnCVgqlwP1SUQtssudV6qjsX+4inEKf983Vqi+sU5B5NdHE7\r\n3Nj68UXc//HuvCDqgefJc9+POwIyjq3oIrx3uiD04SNHA3fFD6oeaptKbedV\r\nai4lv5RQ3YqaJFQ3ycvQwqzttQxnUgtqcS6G2lFpkvkqN1Md76AHvJYwAQBM\r\nTqNy+xC8oXoXlZ3ZznSvskuliNl5VvHMJGe5SPD2XEcGmaf5lPveYBMuKjm9\r\nEEPtxH93WfjG+1Oi0aXghmk1M5nLrA4NGovDnO46B0MD83oiZisjDtHJka9U\r\ncP3/t+Oz/CzNNnNZpusZOe35dGwmmgrPH4bw3p+vkgdi+Bv0lovYLWeMZau/\r\njFR28wJOossopGr/cz233QDZo2NzTxJXLuzFDvk4Xqlg9fPzxMEITdQ8rzJJ\r\nt0pwL9VsD4rUeB0wQUr9EzI5TXysuw1c1YE=\r\n=O0WH\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_4.0.1_1677732289259_0.7817625022278003"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"4.0.2":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"4.0.2","license":"MIT","type":"module","platform":"node","engines":{"node":">=18"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"yarn build && ava","retest":"ava","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^41.28.0","@types/node":"^18.13.0","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","ava":"^5.2.0","eslint":"^8.34.0","typedoc":"^0.23.25","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","openai":"^3.2.0","yield-stream":"^2.0.4"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@4.0.2","dist":{"shasum":"33ac048e10c8a3722fa23fcd8e730952c4a73e2e","integrity":"sha512-SRyC/y0GARrrinrxS5JY+3NqLluZ7PKukwk2xgR5W/123hg1sQR3hxiMZsaCp4jNxSlErP16IsK2rSQd7bm8ZQ==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-4.0.2.tgz","fileCount":36,"unpackedSize":77128,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC7ZY3nAUUlKNhB906OPOzrlU82OZKJjfVCKupWh2nd/AiAxDJg3sXZ+NmlykDaA90dzKuJWizhLOTClaYrjpwi+vQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkAOQiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrNMBAAmKkR6+n/OjfSPVWwM0cX0rrR9YAmeY+TcLUVLszT/80pONb0\r\nCA5hUTbTvpG/1/u0LVID8qPyp10hnd33QyCEW7+LERqkbuYP3FzQkGSaPgiX\r\n/xcxDnDjqAsVynE6vmcaaIpwBJTKl7deSPmqORwp/sL+FuUChEovpUK/5nZf\r\nXdrzkt18j3WodLUgbaNdXHj5zJ5VpZ5DkPvDmxmCaN/yStoLpj3bZY8vw46I\r\nTUNe7jj34VjBkOHLwWgP9ErhaKRnD1jIH0ETlC3OMZ9AecVcp44mjnyi75NL\r\nMH8APRUx8avgsVhaD0oaF1MIcVL6+vu+QInYrLLN46f06CmFcggJwSpVt6Zh\r\nieLR6TQqRuL3Ty2uNdxR3YKMWE85Sxe8Wpr5ORrVo8JcnNtLr4Z4I/tzZaoZ\r\n2Kzi2Sn+coNx01+2RTVC3ePG29iixrNIZixhFVLYMjESy8BlnpAn22anp9wZ\r\nnR5gkCR2r+dmWroHws+lwJbC82FZpUTDy1mdYcqnZvhVChlIa5i1MvU175Zy\r\nni/zn2JvmXGCcezVWwY/qSikGO2dbex2+y71Pjft5BTm2qaYbYL14lDycAbE\r\nCs8pOxhQM6xF69yG+t780/ubvcnVMIEamzqahxah4sSvROmIvQ/qrlkBm50e\r\nOPCD4MkZ38eH1kMUDTbD4yrKN739TyX+4ZM=\r\n=svyD\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_4.0.2_1677780002467_0.01746245505816879"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"4.1.0":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"4.1.0","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"yarn build && ava","retest":"ava","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^42.1.0","@types/node":"^18.14.4","@typescript-eslint/eslint-plugin":"^5.54.0","@typescript-eslint/parser":"^5.54.0","ava":"^5.2.0","eslint":"^8.35.0","typedoc":"^0.23.26","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@4.1.0","dist":{"shasum":"54a8afb382ab46c12073996da11b321c31df7dcc","integrity":"sha512-3Ru3STyeWteCMkEZgG9P7yhm4b6RN6yvkU2tldQXBXGSYhRa9QBkaKqDt+pRlstuskHm3wyuC2eP9+6TGyFeeg==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-4.1.0.tgz","fileCount":36,"unpackedSize":77126,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBCVxS1tzd9otrIJgIZTd9kEHFY7xoLs1yW9kNNgvgaSAiEA7pmea2JVcqje0bIbVJfcdk2eZ4Y75AQOFTX+pDqn/1g="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkAXqRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr0JRAAi/4tesbEm2NZ/dPDHKwFnGCLjkBGKlGouOUUK6H26Y/DLoVL\r\nERFPs93Hxvcz7sFcW4UP/ErJUNJr/Snl5wuawYDoDAZHGqDA7G0lvuY3551u\r\nZoapsHDzC4KUFP6xUbT3ATfDq82QAikLV4qLX6XjB7y3SeuPmUwwNQZ+cxFW\r\nyWAI7biVnMmRsmM2llCwwqv8/1rc5e5y17gRUifkuoxiMUv1kEkrv5KJS3V0\r\nOaMgo8jj8JKBZ5x51ZL6boc9k/6BkLrplgKVb6PpmwVjkMzbRPRpnQJwboYH\r\n6JtBUzz2y2ctgVoJ2ke+zabiewqX/U+FOapPzUhZimBrPmbkkvzY8Sg8A9x5\r\nYvklbwdAtiX3BpogBahpQT8uj18QCP8dIrQBAaaJwE8ji4n0JGsCBpYJsUSz\r\n1tdg8l+ki6TI49aC6ft9E83bgZ5wZF+/9uzVomAwJoW9s1sa20P914DcUng1\r\nS6gGIPyyGpnVyNjWOXzPBeC4QrPec4qof5wBZFn6MBSSGz2RyCwI9v5NUZba\r\nUEtz2kOZN+xpJdo5+9sdK87Yr5uh4tFkzQYiyiElMeddtj5FvK1+X2Nktxkx\r\nOgaxoXtLQ1AphBfvafPcX21bY798KaKNgbGWSU1+2al9VoUx7jHv3ZBn//7n\r\nvKYrrTLkhfys8AmOP9aYSEqt6b8+H6QP/qk=\r\n=Xoan\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_4.1.0_1677818513305_0.37282951687237276"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"4.2.0":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"4.2.0","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"yarn build && ava","retest":"ava","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^42.1.0","@types/node":"^18.14.4","@typescript-eslint/eslint-plugin":"^5.54.0","@typescript-eslint/parser":"^5.54.0","ava":"^5.2.0","eslint":"^8.35.0","typedoc":"^0.23.26","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@4.2.0","dist":{"shasum":"a097dd86551f7c6360004515a4623a6f6eb1682d","integrity":"sha512-tbOEJez1mB2Uc1HtYO1arAyT+kPQCv1iOQNN6rL/onJmxJ2HUGETd9LK6VqnZWCKQX4HuRXWFu9EpP6I5zWf8A==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-4.2.0.tgz","fileCount":36,"unpackedSize":77234,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEPy500HuO+UfRDCTyL2bAbhv1z64LvgTGITE0BezGSoAiASKIkuxCNr5E9UNvonVTvU5wuNW7O+8agGOQ4aDGClKw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJQp1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpgTxAAmpeBiuPEVrO/FNz93ufk6ZjAA3jUwIh9jOgBeUIkP/FXfd1e\r\nDl6a1zN1F668q94qmTrdMDOnrfVYHREES2tr3pQom2MTrMl//xJUjIgQ/oGt\r\n+oPAUIjayDnQiE1L94HyptDuyskLVlAJ5IlyELjRYpyJRaHpaq1f1lUZuSqd\r\nHETfKf/ah1vUPgzFIv+ve+C7gNZp9SLdIsqiX66+D/Hg5cWc+8xF3mae9qXn\r\nzdAFU1FG0QoyfneV6FY4pZBFASmYQzQhZ+l+m9PHlKQb4F5JEoMWWbBlX1FZ\r\nPzaiank2giCnYIwBDnqY5iDACxH2SvjLNRw1kVWNVLCQuDC8Dn1+FMxczS6U\r\nKi0ldcrlxKlzhkVqDS1Vy+601E8fe6eHp1jpCoRwDhIaK2qKQrakmHEQ/+Pk\r\nGbhpjyCFolm+HvhS56ObY/ZsJM135yAsL0Sr45xwUQr9AQ0ZKDpQhPPvhF4C\r\nvLDR2DnH+CguZBNox4+jWBZMma8DgfwqSpsLXr5s1T3jpH7MaUpwNG9V0vSY\r\nZLIeoa2s8Eadu46lzBOmiVsfh0Md0zqyAIB86tyDU4+LMT19Ul7P3VHKHyX4\r\nzKGjKxXKvb5l+ZnyFHY0wyxwmQrrRqoAJNYlx7+QuBEWXwlgVyuRu9yz4RJ1\r\nx1zd+JTDihxsh7AikfdbcUdHVhszAOzUl1w=\r\n=JOPo\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_4.2.0_1680149109711_0.8978127835919079"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"4.2.1":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"4.2.1","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"yarn build && ava","retest":"ava","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^42.1.0","@types/node":"^18.14.4","@typescript-eslint/eslint-plugin":"^5.54.0","@typescript-eslint/parser":"^5.54.0","ava":"^5.2.0","eslint":"^8.35.0","typedoc":"^0.23.26","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@4.2.1","dist":{"shasum":"5cc35dc7fe407d80899cd46db95a7a546a47289d","integrity":"sha512-MPk0HuTTOAs3R4+IVYQhH0AcZSyP1xmh5GZ0PY+jDfCTf0wlf1R6ln9dNO/Ij6faHq9kNDp5HinV5AKX49Ug7g==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-4.2.1.tgz","fileCount":36,"unpackedSize":78957,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDQVyyvAVsLeMCDR7vb+tuMEXmOX9w9ZSIYyHDFIb+NKwIgd8KP7XlbmlE5QVMM9JsXHBTaIadi23hpFs0Ar++Df1o="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkK3e/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpoUA//Q6NIg7BOCUS7yvGgC/FOtia0qjwc/tFBLhEBs3xZhSALN1tU\r\nF7ZWT3d9hB7QFAvgkOCz0CQ6HI3wyEgompsfJh1iR/3xvBoKbOfX2UzVgoYT\r\nq/fld+a2fxRKt9xk1Rz10CJgpc/cAKjtZ8A4b1Ju4YdiTWg2ZSqUtvf/8ITU\r\n9TasMM4nb38F27ugPtI3P2b7Y4rY6mh+vzl1LKcJ48ir7VFDWCcdHpO0lKJ6\r\n2lbtc/1pSMr5A9W+Pukksc8NryouzM/tY1u2WW/OZFQydeFc4OCJXk8LqeIO\r\n+dZoaADLXErTihnY+FFhOU0e0bNEUiEQQXVsrUyNVO3FIq8bTphqWd+JIvpc\r\nDHTstMaeDysXJMrOsaTq0UHQfcYroeYx0R8hjmUBzMuhEirVXfcA2UjBqsBj\r\nSvr05XkPAMxe9xW2ExTEWknoKY2XY5BmJvVcGcdWXG6CbaoN3EwlVsNJa3Rn\r\np20LtamfR56LnJO4XEDh3lJr6ysyKAXy293OMHKlvz0kqm17MrD8SrUgmg8c\r\njoZvctihJ/mCCmgAaIM2kiZj9oSDkMRe92CKkp3iMSYU/bC9K0P/N3ENCmy7\r\n0lZ1nbU+h/U3DUsYfzvbcPsmt3EbxVJa7Y3GHg4fSjXuFI3weoBj8xWtUh+D\r\ndn0AoF4xX5i9cwx8qESy3ndvKPpbw+iSZls=\r\n=zbXH\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_4.2.1_1680570303218_0.28025242788061355"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"4.2.2":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"4.2.2","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"yarn build && ava","retest":"ava","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^42.1.0","@types/node":"^18.14.4","@typescript-eslint/eslint-plugin":"^5.54.0","@typescript-eslint/parser":"^5.54.0","ava":"^5.2.0","eslint":"^8.35.0","openai":"^3.2.1","typedoc":"^0.23.26","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@4.2.2","dist":{"shasum":"d01819f55ea361ba9f92985305061f1644cd97b0","integrity":"sha512-1LJDVC1iv1ZZ5j2M/gLNDsRbCBmfGwnenamdCuGUf+DB1d3ajQ7lTwVCH4xMkdMSsiChNWmSOX71E7tPzuL7FQ==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-4.2.2.tgz","fileCount":36,"unpackedSize":75594,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDmrXyiB1eYPUIal6DVQQH89Rr9xpqx+10jSDFzrTBpcwIhAMHRSoeqoYQ+kgg4j9OfzaSmoEjSzS+vwfNVqMMinLku"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkLaYlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpXWA//SkVlfaAxAuA+xOJNt0aVNQGEa7ppbBTv4CE4PAJPonDN8tAn\r\nYW9Ib/gTQPk58fgfNihry5UEci1b3N1GHdSZTmiVoNnZIM+lJvxXv86Qehne\r\n1++3wCuIHOh29NZbAPEZRH4RYbX+MtkQWg+ta9PVdP1wqs70r73ISNdxMvB9\r\nHG1MQC6EiONWuUnNaX0+AAsbeFpngfmhK8gS/pCn5T3p1lxw5Ip8dFQlyKr/\r\n7KJbMQigtWyQW/smIzsMd84lpvnoKD2T0BgzPU+wplp0hSLQSAJhvk9o9jr0\r\n5+ir5rUBO2Zwa95X0TQYm80p1OaeO7okRi/QlkB2CWD3Z9X/4X+KhHnBFSny\r\nh8feMId/9SAGENF1wp5k6ac7+Vf4b6xn1Ny/7NpXbvn4x0GTapnerSxHh3xY\r\nyZ/F1+rXPz29C54Blj5pA67dbGs2LQwodj7MnlovucDw0CVo5EY+uVs0tJ7d\r\nrAPy/fcgpE2sIybtkxJPaXRARZ5s2LY9qah74lbHbAc66QgwCl7vwxlqwwEW\r\nQ8a4kKe5PqRPGRg259N17vPfbcANaZ+kAIBY3oqfIBw0ONeH/aL6SJWWAhdA\r\nES0qxNCUiNcSakbF21laFaSXOJStYypSyt0B0sK5+nM1356s7k+D8YGNOQrB\r\nuSfWaFtgVXelzI99xDpsXGBbJOxSQFgIYAA=\r\n=hi0W\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_4.2.2_1680713253082_0.04740159479285189"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.0.0":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"5.0.0","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"yarn build && ava","retest":"ava","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^42.1.0","@types/node":"^18.14.4","@typescript-eslint/eslint-plugin":"^5.54.0","@typescript-eslint/parser":"^5.54.0","ava":"^5.2.0","eslint":"^8.35.0","openai":"^3.2.1","typedoc":"^0.23.26","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@5.0.0","dist":{"shasum":"b1d90cbfcc34bda550f99605a0452943e8478ee5","integrity":"sha512-IJL5dklgXu3m8rSNhBYrJxOXMtZrOdXBxowHsIMjMDLsfO+vvByOwOwwHF89M3bsuJdfV4L8LuazdXldD3fYOg==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.0.0.tgz","fileCount":36,"unpackedSize":75426,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDFRmrbbiQ/wb8yJj0Z0YaCCAntJpJ1FWUEzcELfIVT9gIgNqq/zb5g8LiTR6bi9pddYFtjQ+nBNsufORPsAqeqxfI="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkLkg2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpobw/9G0k9ZOpq1cxlC4rxPnqDLSbOAEUYEpqAyePxMoyd9Kdad57Q\r\nUh0oHaeX9HL5xl5UV6bfcKn0WmhsaCulBjPxsk4VPksGRUwcIZy7Q43wwxm9\r\nRBXuSb1Vs+cVKV4j6LjqjIezn3HY8On/7qLgiLEpyVArPRKSOFPuV8MzIxI9\r\n/SMjguSC1JsNHNHUPGBOSsRX4G8cz1Pxs1qFhMd2w3ZsqxGxFn6wmrGg/DwQ\r\nvTBtZs8kiTgdNNVKxBdUbjqvkLbvrlI4p13r1ZrX22BrEPLgs2hsbnYeH+Je\r\nBZ3T223Rgpz6I+JmUCaveAumBZYXsCr7uEbUzXspZTY2ZQmslwTVdI2S7tP4\r\njZIfIE2jy9KE/Sb5zxMExvr6yRj8rfyPWChdJK0OC9+/87G/JA9R/qDFaznA\r\nyZ/Sxr7TwaDEuDDiuw62RbjL9l18viBj4B5Pq+ubXPnZLQwtd5CY6OEY4lJI\r\n0hJwq2lchx5HvN8c95M2SUtv9wjoO0KM5ghv/X6OLnLUcQly+doAPPgss2NM\r\nv7tZVl/8LSQMNOj4r8I8ipqYBRDWIDs/HWkL6bhFp3PYCnV3W10cZZ23+x3e\r\nOwJXP5EPtsHjhLDVzC8rVUBK0eHH0YFoAvwXzkSgCukd+awhXm1VNh41ImP2\r\n6wGDXjE0ide1oEpGET2o1BXwhwy5SaWxrqE=\r\n=JBfV\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.0.0_1680754741950_0.5597492226639484"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.0.1":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"5.0.1","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"yarn build && ava","retest":"ava","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^42.1.0","@types/node":"^18.14.4","@typescript-eslint/eslint-plugin":"^5.54.0","@typescript-eslint/parser":"^5.54.0","ava":"^5.2.0","eslint":"^8.35.0","openai":"^3.2.1","typedoc":"^0.23.26","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@5.0.1","dist":{"shasum":"2ecd5fddb1bd408c6a44199efcb6c998e53c73f4","integrity":"sha512-JCMSuOVUupHFKswIghjU0eGzFKviymgCQbrER77bqROlZtYZct+Vh0wt+z8kOYC5+uHi1U7YPMZjdROsxpOsmA==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.0.1.tgz","fileCount":36,"unpackedSize":75759,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCSkX1CidA4j8AQvL2l34+Z/VD1lWT6P5WkErlPwbBC3wIgCDuyhvKLO/+O6ZY6jIH5WlRSNson6y3DD3kEYQgdOps="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkNxixACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoPWg//S0zSQnMFu0mi6Sl8gOn4REPMpPJgpf29pUAozLXdzekBOANS\r\nGKPCPTYHzAfOhJnHAzOUZyttYqL10qjxdNA7Ugrn6Dzo4NfYFjHgj9NNiELF\r\nS5ym9xXlnhUgQrPN5VYu/jPjkLLNug4bMk8l6GRypI4zYj2fnRPdUKa54WyG\r\n9P1HNwm2KQlrYLNR91eo5l2FBZJw+eQ02AJOd3+rhxsDwBBlTbqW/rTRObuU\r\nVY+djBWZHasR6S1yGOowhUKgzoj7e6j1u0TvNSqJu/FZDLoFR0HtD5InaDS1\r\nOelswJ71seg8mwfeP3r3zYsxHDJoLWgHrQKoust4nxoHfzFBLc+i2o/e0HdI\r\nttWCyQ4vGwUszyDRSKxeJhrW5Uh/vofB5Gk/lcHbXjWwKdHYBq7nOKajLaGz\r\n1bP0UiQyNHSdbfPDJyyEOAfg5lW6aOF6/ew7WwngnVLcF2Pm5f1n2kkfvrJ3\r\nIilCHILgnn8ixp7LzUGlat+FTtKDvnHYF6NnKnWuTYNsX8QCTxKih+dKLRAU\r\nSsmX7eU5dsw3QBVcYhGwEXuaqYwsQmJOp7EpOhE2QP4LUYToJgj54bqQAi4H\r\np4WQynXRVe3lzB0FxtSCZypgiS/5gwweWpYiVv9zuLq/6aOrfll2dwz6eTia\r\n3UwzVIbrnzU8Rd0YOL5yr32zDtATc/YbLoU=\r\n=1VTS\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.0.1_1681332401694_0.7430309866415832"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.0.2":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"5.0.2","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"yarn build && ava","retest":"ava","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^42.1.0","@types/node":"^18.14.4","@typescript-eslint/eslint-plugin":"^5.54.0","@typescript-eslint/parser":"^5.54.0","ava":"^5.2.0","eslint":"^8.35.0","openai":"^3.2.1","typedoc":"^0.23.26","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@5.0.2","dist":{"shasum":"041c9d876de4fb4cdfe834d6ada902dfc387bb5a","integrity":"sha512-xQhN7ckEZdeEK8UCQeV3ROZjOQKfRKchStpIGMh1C2gDZWYsOQDw5vlPmob7qKtNIiT77CaSIOWgR8DLymst7A==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.0.2.tgz","fileCount":36,"unpackedSize":75759,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCgKsfgwanTGFDNCEZcPVCkJiwn+L1YdDVwjn5Gr6UVdgIgHt3BlHvO96p6E19m5CZiNTQB1Ny/MLOeiXQ93gDysgk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkNxlbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo2uw//TWWBj5CaWuk6QyboHpMmqiEFsTIQcKVK6ZfYN6mqYmrbFLCY\r\nq3C31hwcY6BUfaaSN93t9Q1lYbUkWmpYxEEZDcCQFAiu+mfcpaak12RE7dIG\r\nyASLi2qLxSKoZvPadmgjJZIyNuy7vuvzgo364QQloPIiKAt9WhtHgim6vqLv\r\no83YMK1P1Q1aCzDyykvvoULIPSC7W6ullODaJr8O6n3EBD1z2daM5gz2J8cC\r\nsrgdZ04Uhq2ZyV/a/0GXRMwtVZPGcu12EkZbZG/sAcLHHr1Z+VRDYdpfz3/N\r\nJn94oUkXoyBooOcLbPbes2Miirx3gh1A2TIwt89GH5/bUxpNMblJbIZENpaz\r\nQ+hLKLPGvxB+reAX9IUCpmdmtraoHoTaJymReaBd7tH8cInDOCbQ3mjFUT5X\r\nZT9v5tpyYKAnmvzYvdyfpAeh4HdksT004bzdQewbX/NmfKRnenS0tzq2PJoW\r\nP0MnZ+vFz59oAtQm+EL7/eTcbJPSn3BV54j6L5+SvqkTA/PZpnr6tQcD7fps\r\nfPrMa2NPxXIipHp6V5rxVKP88y0LfBzg01OOs1lkIMowIyNNyhJyWH+lC4q5\r\nq00FQ3QG2JCmw+qinRAvAujR3/8GQcfbatKmX4meyFAcTjQSGyHYvxZmnHqW\r\nyx8Spj0nXSizF9B+4naKqT2E+n/VqQx5Ly8=\r\n=KFqS\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.0.2_1681332571229_0.12238253557095291"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.1.0":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"5.1.0","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"yarn build && ava","retest":"ava","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^42.1.0","@types/node":"^18.14.4","@typescript-eslint/eslint-plugin":"^5.54.0","@typescript-eslint/parser":"^5.54.0","ava":"^5.2.0","eslint":"^8.35.0","openai":"^3.2.1","typedoc":"^0.23.26","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/gptlabs/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@5.1.0","dist":{"shasum":"7bf6639a8bee53555917df3d335c968c48b117cf","integrity":"sha512-hJCYtXsTxpHHTjV1l+zdb8OJuZnxTbxjsDwGLhsIRGtf6XRttafqevI03SQz20Mv3ANIgkirFKD3Wrj5OsfsaA==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.1.0.tgz","fileCount":36,"unpackedSize":75948,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEBxh9e7I0LWQ016MQ5mw4T7MX6CmM0w9I+l/SrMWuhpAiBFtLryGo6C8lZO8Nz1b9xKgq5sxwZgCtXvRbNJZVXFfQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkN7B3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrbFg//TTW0fRpRh6F/dAO+j2eo0g17xh8iwA2x0wUDv/UdQsfq/Csv\r\nIfO5mB9IKEj08Llo3nV/DvxDGPaC3V0rUq11sdxC7xpx8Hww/VCFIKqpqv+P\r\nK+9EaCmIWwUxTWmwTVMFgYQGaKPBod2I1P+fVDYXEjIFMM1WFHEE1DSL1jCO\r\nqkcIB79FHVe6KqktvIO3qllZlTDS7q7RoCO9ty8nbsXlkQQ1k/kqYWzzulfc\r\nG01ZilK3n8i4okbwYw0xnieSWjAziZgwHg1SswoZ8fj8rGnKCEmDJ+ajrxWT\r\nvulgVLzlSu9FJib2zMEUX2N2HFDVkrf0KdVaWDRyVbqqLrMn7uvjk7SRa+Co\r\ncvZ40HS3q7r8m8VGY9LGdfvvxjDbx7FF1Iq1dx/XNORGhkEWPKjmU4RDadoY\r\n9A03w4UaGoEqv1Y1itD6vCCHkYws7W1fg+DEUtCIp2yYy3Z9kjlM3zIUp0Tw\r\nL5WdlJXvP+F2HghVK9c4m0EwgQ8eLgEERT4LUekWfT75IbCPTX3ax+/mG+Dz\r\ntoeLEqogviXXwaYH7bk8SuIC/gStPeVgAzr2vBCuOkHwvhyWcooDoBGlJWgZ\r\n7WdBWNIN2pyvmmzYb/Y/z1F3WJ6POWvvkRmNSUtHI1FRuYYHJEvMhVQiYLb5\r\nCe6gFUXYZk8+wAYST+92kf8ONOMVRCVSgTI=\r\n=hlSi\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.1.0_1681371255629_0.7255726295830058"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.1.1":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"5.1.1","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"canary":"yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary","dev":"tsmodule dev","docs":"yarn typedoc src","build":"tsmodule build","postbuild":"yarn docs","test":"yarn build && ava","retest":"ava","prepublishOnly":"yarn test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^42.1.0","@types/node":"^18.14.4","@typescript-eslint/eslint-plugin":"^5.54.0","@typescript-eslint/parser":"^5.54.0","ava":"^5.2.0","eslint":"^8.35.0","openai":"^3.2.1","typedoc":"^0.23.26","typescript":"^4.9.5"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^0.1.0","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/SpellcraftAI/openai-streams","licenseText":"Permission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"openai-streams@5.1.1","dist":{"shasum":"4dad8ba04fe127e4bad3b33b030d7700f744dd34","integrity":"sha512-xLy6K+Uehl9L8VPG7PjB+KaBLU6aiKI/X11Ap7asMvKgKuDPUUShlqVv2XMM3StQcJ8PAKl+KUbTCFAYiSBtMg==","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.1.1.tgz","fileCount":36,"unpackedSize":75968,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAq39eXdHV6Jh+lWbD6HDPfeT5YhvRIkhMArg91Bpc+2AiAspUPtsoqEnNRV1P3dE0mkwHstAYw27hMD08wj7r+Viw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQuaQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqu5Q//UDgaMbS94wvVXLtJhNFuMnUD2OJkagnICDg7mEzJORDsOliH\r\nv6ec9F/1sCmrlCNZDsXweqEBDeSD4hDDdQuu1y89Y0Du3cpCmPMNfBD8Eawt\r\nd4N+sG4K/RH2VyzIGJZJofCaVNokvRo0OoaIHr9xjyN0L9t19OPetNTFwYfR\r\n6qhKKDmemvXzfThdcxGfFfGwed1PbWYH1Zpi3/Q1lGpTD911S9bpyZtgrkeE\r\nnoqc5ozAhxyfzXAsj+mPhDzxojTpOmCk1QXSjKsQUxJhI+A/bafc9DoIdW2v\r\nk7UJw9bVmjpbxFm/PfSGH99cpgDDbPs9jIJN7Ch8kDp19mtIgHo9nOEJ0hZk\r\nlEY587rLrOdluts+UI7vWGg5xai5G6HC+rnDBOwKJmRApbicvZbogm/6xPHx\r\ntPUzaBjVu0tdHQafi+MWA+Bj7SKtM5y7lGF03J00rT6aPNtyVi22oRWACat8\r\nbjf1QpLQQ4zRTCMWaJE7hZ7H0RHrDmEpooeJK7y8kR4lU0vyBlj8t2kmhhlG\r\nXpgkywNugCpVJt9WNQpZSfBHK3HApyH17kpbTbQC4PlQ79fhrheiDPOvrOdY\r\nZ+cQJsf8uDfAIPu5vBuC5SvYdtFvo71Af+C3FjzNv7psWncPD/Y3voE+EC6e\r\nABF66TkhpLni4e9bKrVHABUowWjIwarsQ+A=\r\n=o4dn\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.1.1_1682105999891_0.6998081909660889"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.1.2-canary.0":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","version":"5.1.2-canary.0","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","build":"pnpm export && pnpm export-docs","test":"pnpm export && ava","retest":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.1.1","@typescript-eslint/eslint-plugin":"^5.59.5","@typescript-eslint/parser":"^5.59.5","ava":"^5.2.0","eslint":"^8.40.0","openai":"^3.2.1","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^1.0.0","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3"],"homepage":"https://github.com/SpellcraftAI/openai-streams","readme":"# OpenAI Streams\n\n[**Github**](https://github.com/SpellcraftAI/openai-streams) |\n[**NPM**](https://npmjs.com/package/openai-streams) |\n[**Docs**](https://openai-streams.vercel.app)\n\n> Now with ChatGPT API support! See [**Use with ChatGPT\n> API**](#use-with-chatgpt-api). (Whisper coming soon!)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\n- Prioritizes streams, so you can display a completion as it arrives.\n- Auto-loads `OPENAI_API_KEY` from `process.env`.\n- One single function with inferred parameter type based on the endpoint you\n  provide.\n\nUses `ReadableStream` by default for browser, Edge Runtime, and Node 18+, with\na `NodeJS.Readable` version available at `openai-streams/node`.\n\n### Installation\n\n```bash\nyarn add openai-streams\n# -or-\nnpm i --save openai-streams\n```\n\n### Usage\n\n```ts\nawait OpenAI(\n  /** 'completions', 'chat', etc. */\n  ENDPOINT,\n  /** max_tokens, temperature, messages, etc. */\n  PARAMS,\n  /** apiKey, mode, controller, etc */\n  OPTIONS\n)\n```\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\", \n     {/* endpoint params */}, \n     { apiKey: process.env.MY_SECRET_API_KEY }\n   )\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params, options?)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n   Example with `raw` streaming mode:\n\n   ```ts\n   await OpenAI(\n    \"chat\",\n    { messages: [/* ... */] },\n    { mode: \"raw\" }\n   )\n   ```\n   \n#### Edge/Browser: Consuming streams in Next.js Edge functions\n\nThis will also work in the browser, but you'll need users to paste their OpenAI\nkey and pass it in via the `{ apiKey }` option.\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\n    \"completions\",\n    {\n      model: \"text-davinci-003\",\n      prompt: \"Write a happy sentence.\\n\\n\",\n      max_tokens: 100\n    }\n  );\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\"\n};\n```\n\n\n#### Node: Consuming streams in Next.js API Route (Node)\n\nIf you cannot use an Edge runtime or want to consume Node.js streams for another\nreason, use `openai-streams/node`:\n\n```ts\nimport type { NextApiRequest, NextApiResponse } from \"next\";\nimport { OpenAI } from \"openai-streams/node\";\n\nexport default async function test (_: NextApiRequest, res: NextApiResponse) {\n  const stream = await OpenAI(\n    \"completions\",\n    {\n      model: \"text-davinci-003\",\n      prompt: \"Write a happy sentence.\\n\\n\",\n      max_tokens: 25\n    }\n  );\n\n  stream.pipe(res);\n}\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/SpellcraftAI/openai-streams/blob/master/example/src/pages/api/hello.ts).</sub>\n<sub>\n\n#### Use with ChatGPT API\n\nBy default, with `mode = \"tokens\"`, you will receive just the message deltas.\nFor full events, use `mode = \"raw\"`.\n\nSee: https://platform.openai.com/docs/guides/chat/introduction\n\n```ts\nconst stream = await OpenAI(\n  \"chat\",\n  {\n    model: \"gpt-3.5-turbo\",\n    messages: [\n      { \"role\": \"system\", \"content\": \"You are a helpful assistant that translates English to French.\" },\n      { \"role\": \"user\", \"content\": \"Translate the following English text to French: \\\"Hello world!\\\"\" }\n    ],\n  },\n);\n```\n\n\nIn `tokens` mode, you will just receive the response chunks, which look like this\n(separated with newlines for illustration):\n\n```\nHello\n!\n How\n can\n I\n assist\n you\n today\n?\n```\n\nUse `mode = \"raw\"` for access to raw events.\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n   (const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.\n","readmeFilename":"README.md","gitHead":"1be3503dfe55452cd6ed43ae0dbc08072af03da7","_id":"openai-streams@5.1.2-canary.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-NVXurVt+QeUIIKwawoMClJPfrym/OKk9ub9a5gT9ZBlZiMkkICrL1r9Xrq5BUQ764777mySN05+mEa9bmWeLDw==","shasum":"b1dee9e2ff3fd70a1e00f4150a293371ce6c41f0","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.1.2-canary.0.tgz","fileCount":30,"unpackedSize":75770,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/NgwK1TQeX4f4daXfsNxFeakK221xFJDZprVkiBnS5gIhAOcE9FpgDXvMu/0BNCigcRAY+bieLKxofSVNdNUAZKYJ"}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.1.2-canary.0_1683621264966_0.8564481564953981"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.2.0":{"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.2.0","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","build":"pnpm export && pnpm export-docs","test":"pnpm export && ava","retest":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.1.1","@typescript-eslint/eslint-plugin":"^5.59.5","@typescript-eslint/parser":"^5.59.5","ava":"^5.2.0","eslint":"^8.40.0","openai":"^3.2.1","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^1.0.0","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"gitHead":"723ec50548d874793b8f1806bad683fc57b8031e","_id":"openai-streams@5.2.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-AUkUdgRCVCowoAlKkQvGO5fg78P81atFhwbhA7y1ziPYOdc+QL7e2j8OYhfix/Har/KfjzcPV3BBxg4hL1OiAQ==","shasum":"bead31dcb6b0a003b1d884fa82f8317d6d1c224d","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.2.0.tgz","fileCount":30,"unpackedSize":75968,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGzedQjr+hfQaD+MzNVYx8kbU3KCQJvom6zIBLwYUJlNAiEAuXEUl2Bsy0lxUoeE4vzGyH6ajhpRVRwvCzMOM5zWV6w="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.2.0_1683622078549_0.6910166004964664"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.2.1-canary.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.2.1-canary.0","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","build":"pnpm export && pnpm export-docs","test":"pnpm export && ava","retest":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.1.1","@typescript-eslint/eslint-plugin":"^5.59.5","@typescript-eslint/parser":"^5.59.5","ava":"^5.2.0","eslint":"^8.40.0","openai":"^3.2.1","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^1.0.0","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"readme":"# OpenAI Streams\n\n[**Github**](https://github.com/SpellcraftAI/openai-streams) |\n[**NPM**](https://npmjs.com/package/openai-streams) |\n[**Docs**](https://openai-streams.vercel.app)\n\n> Now with ChatGPT API support! See [**Use with ChatGPT\n> API**](#use-with-chatgpt-api). (Whisper coming soon!)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\n- Prioritizes streams, so you can display a completion as it arrives.\n- Auto-loads `OPENAI_API_KEY` from `process.env`.\n- One single function with inferred parameter type based on the endpoint you\n  provide.\n\nUses `ReadableStream` by default for browser, Edge Runtime, and Node 18+, with\na `NodeJS.Readable` version available at `openai-streams/node`.\n\n### Installation\n\n```bash\nyarn add openai-streams\n# -or-\nnpm i --save openai-streams\n```\n\n### Usage\n\n```ts\nawait OpenAI(\n  /** 'completions', 'chat', etc. */\n  ENDPOINT,\n  /** max_tokens, temperature, messages, etc. */\n  PARAMS,\n  /** apiBase, apiKey, mode, controller, etc */\n  OPTIONS\n);\n```\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\",\n     {\n       /* endpoint params */\n     },\n     { apiKey: process.env.MY_SECRET_API_KEY }\n   );\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params, options?)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n   Example with `raw` streaming mode:\n\n   ```ts\n   await OpenAI(\n     \"chat\",\n     {\n       messages: [\n         /* ... */\n       ],\n     },\n     { mode: \"raw\" }\n   );\n   ```\n\n#### Edge/Browser: Consuming streams in Next.js Edge functions\n\nThis will also work in the browser, but you'll need users to paste their OpenAI\nkey and pass it in via the `{ apiKey }` option.\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 100,\n  });\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\",\n};\n```\n\n#### Node: Consuming streams in Next.js API Route (Node)\n\nIf you cannot use an Edge runtime or want to consume Node.js streams for another\nreason, use `openai-streams/node`:\n\n```ts\nimport type { NextApiRequest, NextApiResponse } from \"next\";\nimport { OpenAI } from \"openai-streams/node\";\n\nexport default async function test(_: NextApiRequest, res: NextApiResponse) {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 25,\n  });\n\n  stream.pipe(res);\n}\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/SpellcraftAI/openai-streams/blob/master/example/src/pages/api/hello.ts).</sub>\n<sub>\n\n#### Use with ChatGPT API\n\nBy default, with `mode = \"tokens\"`, you will receive just the message deltas.\nFor full events, use `mode = \"raw\"`.\n\nSee: https://platform.openai.com/docs/guides/chat/introduction\n\n```ts\nconst stream = await OpenAI(\"chat\", {\n  model: \"gpt-3.5-turbo\",\n  messages: [\n    {\n      role: \"system\",\n      content: \"You are a helpful assistant that translates English to French.\",\n    },\n    {\n      role: \"user\",\n      content: 'Translate the following English text to French: \"Hello world!\"',\n    },\n  ],\n});\n```\n\nIn `tokens` mode, you will just receive the response chunks, which look like this\n(separated with newlines for illustration):\n\n```\nHello\n!\n How\n can\n I\n assist\n you\n today\n?\n```\n\nUse `mode = \"raw\"` for access to raw events.\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n(const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.\n","readmeFilename":"README.md","gitHead":"e8a37a7328e877c964145efad608b69193f8ffc3","_id":"openai-streams@5.2.1-canary.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-1GGK8VWkajONMiqpLppcvkqJryH/kULROJmICuWpegBa8eyiXvMrqyVKjRQFJB2TD3rgwZRigQtAMEDh4WGwaA==","shasum":"e741a016269ddb6c4ee595f82ff3d535d203316e","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.2.1-canary.0.tgz","fileCount":30,"unpackedSize":76494,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDzCWoYl3QKPk6O8LkCNSCFkH6sV7xqI0GTwoggZGmMlQIgdZQ2KZ++rd3H2NTieYlVVAPzuBYq2vHXAvkIWiVbzpE="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.2.1-canary.0_1683763990439_0.7588026529158176"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.3.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.3.0","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","build":"pnpm export && pnpm export-docs","test":"pnpm export && ava","retest":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.1.1","@typescript-eslint/eslint-plugin":"^5.59.5","@typescript-eslint/parser":"^5.59.5","ava":"^5.2.0","eslint":"^8.40.0","openai":"^3.2.1","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^1.0.0","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"gitHead":"27f3b0c2a29a922d8ef95b1748573666560fba1d","_id":"openai-streams@5.3.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-481B3eWLQ4P4E7jvF38vRzz2/aQz6CLHx2XSV7J+w83791fhiUxvTNGw8uh/M04N0X5AdCqPaEPqHc+sfxNTUQ==","shasum":"1f28b6fa3d8730e4d66ea2aff314937800295a1f","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.3.0.tgz","fileCount":30,"unpackedSize":76485,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGOmX3UZtxWNTNZBEZKGL7k/PofTBsbpdrDlynv+PUqmAiEAyyS+ea23zf4EU3r9fIsv9ygN7GQiPRtW6lViCJ1vDP0="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.3.0_1683764272104_0.84838351978898"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.4.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.4.0","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","build":"pnpm export && pnpm export-docs","test":"pnpm export && ava","retest":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.1.1","@typescript-eslint/eslint-plugin":"^5.59.5","@typescript-eslint/parser":"^5.59.5","ava":"^5.2.0","eslint":"^8.40.0","openai":"^3.2.1","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^1.0.0","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"gitHead":"10e4405fb419d2f97ba45a1791cc625491969bd6","_id":"openai-streams@5.4.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-x7hvGo+6JsJ2IYdEJADAin9Zo/MfGBGycwL+hobBTat0oFTeRps+lUKmd3aXYttCjzz07w9+TwfqH/BCObfp0g==","shasum":"ad566a3e7b7940758b71dd7fbe90d6b6cdb6575c","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.4.0.tgz","fileCount":30,"unpackedSize":77091,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEkqllScvyVcm8SVEG/eTqu946MP8xZ1vsMXrrfJvUsjAiA1vRRee67lNPvQZ+YVXFl6a+qsc1ilexoUe4QfYMBw3Q=="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.4.0_1684552985339_0.8002857954818072"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.4.1-canary.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.4.1-canary.0","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","build":"pnpm export && pnpm export-docs","test":"pnpm export && ava","retest":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.1.1","@typescript-eslint/eslint-plugin":"^5.59.5","@typescript-eslint/parser":"^5.59.5","ava":"^5.2.0","eslint":"^8.40.0","openai":"^3.2.1","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"dotenv":"^16.0.3","eventsource-parser":"^1.0.0","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"readme":"# OpenAI Streams\n\n[**Github**](https://github.com/SpellcraftAI/openai-streams) |\n[**NPM**](https://npmjs.com/package/openai-streams) |\n[**Docs**](https://openai-streams.vercel.app)\n\n> Now with ChatGPT API support! See [**Use with ChatGPT\n> API**](#use-with-chatgpt-api). (Whisper coming soon!)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\n- Prioritizes streams, so you can display a completion as it arrives.\n- Auto-loads `OPENAI_API_KEY` from `process.env`.\n- One single function with inferred parameter type based on the endpoint you\n  provide.\n\nUses `ReadableStream` by default for browser, Edge Runtime, and Node 18+, with\na `NodeJS.Readable` version available at `openai-streams/node`.\n\n### Installation\n\n```bash\nyarn add openai-streams\n# -or-\nnpm i --save openai-streams\n```\n\n### Usage\n\n```ts\nawait OpenAI(\n  /** 'completions', 'chat', etc. */\n  ENDPOINT,\n  /** max_tokens, temperature, messages, etc. */\n  PARAMS,\n  /** apiBase, apiKey, mode, controller, etc */\n  OPTIONS\n);\n```\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\",\n     {\n       /* endpoint params */\n     },\n     { apiKey: process.env.MY_SECRET_API_KEY }\n   );\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params, options?)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n   Example with `raw` streaming mode:\n\n   ```ts\n   await OpenAI(\n     \"chat\",\n     {\n       messages: [\n         /* ... */\n       ],\n     },\n     { mode: \"raw\" }\n   );\n   ```\n\n#### Edge/Browser: Consuming streams in Next.js Edge functions\n\nThis will also work in the browser, but you'll need users to paste their OpenAI\nkey and pass it in via the `{ apiKey }` option.\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 100,\n  });\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\",\n};\n```\n\n#### Node: Consuming streams in Next.js API Route (Node)\n\nIf you cannot use an Edge runtime or want to consume Node.js streams for another\nreason, use `openai-streams/node`:\n\n```ts\nimport type { NextApiRequest, NextApiResponse } from \"next\";\nimport { OpenAI } from \"openai-streams/node\";\n\nexport default async function test(_: NextApiRequest, res: NextApiResponse) {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 25,\n  });\n\n  stream.pipe(res);\n}\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/SpellcraftAI/openai-streams/blob/master/example/src/pages/api/hello.ts).</sub>\n<sub>\n\n#### Use with ChatGPT API\n\nBy default, with `mode = \"tokens\"`, you will receive just the message deltas.\nFor full events, use `mode = \"raw\"`.\n\nSee: https://platform.openai.com/docs/guides/chat/introduction\n\n```ts\nconst stream = await OpenAI(\"chat\", {\n  model: \"gpt-3.5-turbo\",\n  messages: [\n    {\n      role: \"system\",\n      content: \"You are a helpful assistant that translates English to French.\",\n    },\n    {\n      role: \"user\",\n      content: 'Translate the following English text to French: \"Hello world!\"',\n    },\n  ],\n});\n```\n\nIn `tokens` mode, you will just receive the response chunks, which look like this\n(separated with newlines for illustration):\n\n```\nHello\n!\n How\n can\n I\n assist\n you\n today\n?\n```\n\nUse `mode = \"raw\"` for access to raw events.\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n(const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.\n","readmeFilename":"README.md","gitHead":"422659934cc9060ecd463e9c0a04755e2636ddbc","_id":"openai-streams@5.4.1-canary.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-QZS0EO5Nf3LecKvwQRiqQdqLf2LEfinZh4FSK8UsXpyflI7tB66CxpAelQPUa9YThB+UNjlxnSI9TBDf0EQycQ==","shasum":"36fa11d9fb022c3394da12667aac9ff9135677d2","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.4.1-canary.0.tgz","fileCount":30,"unpackedSize":77100,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbORyVmNzcp1zqf/aoAauorRticR4mNVoK5LIHCjLlyQIgWxk4LzmQWh0pDqOyk2GimZfgk1/PVfLRh10gVb9xISc="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.4.1-canary.0_1684553455849_0.8035578283870111"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.5.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.5.0","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","build":"pnpm export && pnpm export-docs","test":"pnpm export && ava","retest":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"gitHead":"a71cd705fe4e9635e781b9336025928bf900aa97","_id":"openai-streams@5.5.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-f4HFDs4bZSvNUumjjnLkOH8tn1UEkWJvBhBkzLMraQpE6TGYFwWa8f6b8+I13OF3soBtXzv+wJZ5gbd3M7Ho8g==","shasum":"8abb2a663e1ab583b1c97bb5d21be33b403512cd","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.5.0.tgz","fileCount":30,"unpackedSize":19206,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQChUX6rR91vF8eye0DuWqGf4AWakxVTajNcIfeaqKeQaQIhALPj2sgqPacxGQkQm+jHAJzb15xeUpr6HTxcY/ldru3d"}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.5.0_1684583664131_0.2072459199035699"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.5.1-canary.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.5.1-canary.0","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","build":"pnpm export && pnpm export-docs","test":"pnpm export && ava","retest":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"readme":"# OpenAI Streams\n\n[**Github**](https://github.com/SpellcraftAI/openai-streams) |\n[**NPM**](https://npmjs.com/package/openai-streams) |\n[**Docs**](https://openai-streams.vercel.app)\n\n> Now with ChatGPT API support! See [**Use with ChatGPT\n> API**](#use-with-chatgpt-api). (Whisper coming soon!)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\n- Prioritizes streams, so you can display a completion as it arrives.\n- Auto-loads `OPENAI_API_KEY` from `process.env`.\n- One single function with inferred parameter type based on the endpoint you\n  provide.\n\nUses `ReadableStream` by default for browser, Edge Runtime, and Node 18+, with\na `NodeJS.Readable` version available at `openai-streams/node`.\n\n### Installation\n\n```bash\nyarn add openai-streams\n# -or-\nnpm i --save openai-streams\n```\n\n### Usage\n\n```ts\nawait OpenAI(\n  /** 'completions', 'chat', etc. */\n  ENDPOINT,\n  /** max_tokens, temperature, messages, etc. */\n  PARAMS,\n  /** apiBase, apiKey, mode, controller, etc */\n  OPTIONS\n);\n```\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\",\n     {\n       /* endpoint params */\n     },\n     { apiKey: process.env.MY_SECRET_API_KEY }\n   );\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params, options?)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n   Example with `raw` streaming mode:\n\n   ```ts\n   await OpenAI(\n     \"chat\",\n     {\n       messages: [\n         /* ... */\n       ],\n     },\n     { mode: \"raw\" }\n   );\n   ```\n\n#### Edge/Browser: Consuming streams in Next.js Edge functions\n\nThis will also work in the browser, but you'll need users to paste their OpenAI\nkey and pass it in via the `{ apiKey }` option.\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 100,\n  });\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\",\n};\n```\n\n#### Node: Consuming streams in Next.js API Route (Node)\n\nIf you cannot use an Edge runtime or want to consume Node.js streams for another\nreason, use `openai-streams/node`:\n\n```ts\nimport type { NextApiRequest, NextApiResponse } from \"next\";\nimport { OpenAI } from \"openai-streams/node\";\n\nexport default async function test(_: NextApiRequest, res: NextApiResponse) {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 25,\n  });\n\n  stream.pipe(res);\n}\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/SpellcraftAI/openai-streams/blob/master/example/src/pages/api/hello.ts).</sub>\n<sub>\n\n#### Use with ChatGPT API\n\nBy default, with `mode = \"tokens\"`, you will receive just the message deltas.\nFor full events, use `mode = \"raw\"`.\n\nSee: https://platform.openai.com/docs/guides/chat/introduction\n\n```ts\nconst stream = await OpenAI(\"chat\", {\n  model: \"gpt-3.5-turbo\",\n  messages: [\n    {\n      role: \"system\",\n      content: \"You are a helpful assistant that translates English to French.\",\n    },\n    {\n      role: \"user\",\n      content: 'Translate the following English text to French: \"Hello world!\"',\n    },\n  ],\n});\n```\n\nIn `tokens` mode, you will just receive the response chunks, which look like this\n(separated with newlines for illustration):\n\n```\nHello\n!\n How\n can\n I\n assist\n you\n today\n?\n```\n\nUse `mode = \"raw\"` for access to raw events.\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n(const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.\n","readmeFilename":"README.md","gitHead":"b53cd87876ff7aecc5f88b9c16e51ee3a6add0fb","_id":"openai-streams@5.5.1-canary.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-dQee7fiGxzLRtfrG8sXQsrf5bV/SUOIBPCTE6OYsSClYY15d+kIr348zSpwBVW2CffHjMDQgOgPvMwsDcJiBOw==","shasum":"2129fb89e02a88882ad65994d814e871057ba5e5","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.5.1-canary.0.tgz","fileCount":32,"unpackedSize":19935,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIARxHX6zmss0sktTiIwDG3cSpt6jf+cxrFohyYzR27m1AiEAsMBLuI30Hnfc+hDYS2W64qKH5dwLuwwfnEp3tdUBiNo="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.5.1-canary.0_1684902777058_0.20210432861713912"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.6.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.6.0","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","build":"pnpm export && pnpm export-docs","test":"pnpm export && ava","retest":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"gitHead":"ca01774327ef19f416b57ec56a4ecb49e8ca83c4","_id":"openai-streams@5.6.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-fdmX/WT0Y1BfMs7m4zmH9n6KeCscHIAsekLCA79IydQIKTpE5W0kYRX7i06FUNXBdeZFvCFpbljmt5ZD5VHW1Q==","shasum":"3311604fda54cd7e35c1e515c4c8a3456ad7557b","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.6.0.tgz","fileCount":32,"unpackedSize":19926,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCtsRSYdiKtZrfX99q5gCMxt2n5Bt+YGDu10BSRuMBlFwIhAM0SQFSGx2mFEIQsIh0mgZBnYupa5W+hW1xO6Dd2+3dD"}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.6.0_1684903341447_0.18236518097273136"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.6.1-canary.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.6.1-canary.0","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","build":"pnpm export && pnpm export-docs","test":"pnpm export && ava","retest":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"readme":"# OpenAI Streams\n\n[**Github**](https://github.com/SpellcraftAI/openai-streams) |\n[**NPM**](https://npmjs.com/package/openai-streams) |\n[**Docs**](https://openai-streams.vercel.app)\n\n> Now with ChatGPT API support! See [**Use with ChatGPT\n> API**](#use-with-chatgpt-api). (Whisper coming soon!)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\n- Prioritizes streams, so you can display a completion as it arrives.\n- Auto-loads `OPENAI_API_KEY` from `process.env`.\n- One single function with inferred parameter type based on the endpoint you\n  provide.\n\nUses `ReadableStream` by default for browser, Edge Runtime, and Node 18+, with\na `NodeJS.Readable` version available at `openai-streams/node`.\n\n### Installation\n\n```bash\nyarn add openai-streams\n# -or-\nnpm i --save openai-streams\n```\n\n### Usage\n\n```ts\nawait OpenAI(\n  /** 'completions', 'chat', etc. */\n  ENDPOINT,\n  /** max_tokens, temperature, messages, etc. */\n  PARAMS,\n  /** apiBase, apiKey, mode, controller, etc */\n  OPTIONS\n);\n```\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\",\n     {\n       /* endpoint params */\n     },\n     { apiKey: process.env.MY_SECRET_API_KEY }\n   );\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params, options?)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n   Example with `raw` streaming mode:\n\n   ```ts\n   await OpenAI(\n     \"chat\",\n     {\n       messages: [\n         /* ... */\n       ],\n     },\n     { mode: \"raw\" }\n   );\n   ```\n\n#### Edge/Browser: Consuming streams in Next.js Edge functions\n\nThis will also work in the browser, but you'll need users to paste their OpenAI\nkey and pass it in via the `{ apiKey }` option.\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 100,\n  });\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\",\n};\n```\n\n#### Node: Consuming streams in Next.js API Route (Node)\n\nIf you cannot use an Edge runtime or want to consume Node.js streams for another\nreason, use `openai-streams/node`:\n\n```ts\nimport type { NextApiRequest, NextApiResponse } from \"next\";\nimport { OpenAI } from \"openai-streams/node\";\n\nexport default async function test(_: NextApiRequest, res: NextApiResponse) {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 25,\n  });\n\n  stream.pipe(res);\n}\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/SpellcraftAI/openai-streams/blob/master/example/src/pages/api/hello.ts).</sub>\n<sub>\n\n#### Use with ChatGPT API\n\nBy default, with `mode = \"tokens\"`, you will receive just the message deltas.\nFor full events, use `mode = \"raw\"`.\n\nSee: https://platform.openai.com/docs/guides/chat/introduction\n\n```ts\nconst stream = await OpenAI(\"chat\", {\n  model: \"gpt-3.5-turbo\",\n  messages: [\n    {\n      role: \"system\",\n      content: \"You are a helpful assistant that translates English to French.\",\n    },\n    {\n      role: \"user\",\n      content: 'Translate the following English text to French: \"Hello world!\"',\n    },\n  ],\n});\n```\n\nIn `tokens` mode, you will just receive the response chunks, which look like this\n(separated with newlines for illustration):\n\n```\nHello\n!\n How\n can\n I\n assist\n you\n today\n?\n```\n\nUse `mode = \"raw\"` for access to raw events.\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n(const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.\n","readmeFilename":"README.md","gitHead":"3a2ff98c004a655073834b753189c1e207a07f95","_id":"openai-streams@5.6.1-canary.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-kz6mDz+YJ7vM4gGIa6bRTsQL7B7MbnEaueFnb5kMi+cm0TlEuhBdjN0vZ3SkUP0tP65OBB6Qv9MJM7I6QTYoDg==","shasum":"5152d032862c99b7aa884234dbfebf700feba42f","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.6.1-canary.0.tgz","fileCount":32,"unpackedSize":19793,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAZa2p/eSBmoSZGXRm2clVa31sfC0bdP6eMWEESxKiWtAiEA+RabPElKB83KrRZEZktpbB8wZpi3QLVXNJ8Vmho3nDk="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.6.1-canary.0_1685168889732_0.20983544311909097"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.7.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.7.0","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","build":"pnpm export && pnpm export-docs","test":"pnpm export && ava","retest":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"gitHead":"94e0c8e73d21ee5bca142da893be4a17c1e44130","_id":"openai-streams@5.7.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-n+f7yC3bRbhLXHb1iLdPBHkWdmlZov13lnkR9MnQg7UReAj6y/gYQS/4gC/HYdKJ3bJUzrK8tboe2rKDC7ih8A==","shasum":"c6e3e9bc9d0f907b524b6ccc6ca3316090daa4d6","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.7.0.tgz","fileCount":32,"unpackedSize":19784,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDU6xsy0XnbsKx2u/YVz93Mvvl0ffaEErTrstGCBK1mLgIgdq1pB9517d4zNvWeHmmdaEjuSPwAKJQEyNnH8638TOc="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.7.0_1685169073968_0.07424456697213033"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.8.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.8.0","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"gitHead":"ff48aebd39d462f5129df9eb921d5e0a3604a8d4","_id":"openai-streams@5.8.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-z4DGA1MndXlxqSwEBIASsRiXbAzX2DDU37yLP3nH2VfRrMsgT3+jA3v3utgMfk4EEAg7tqiH1lu8BO5aQ2mnsg==","shasum":"5b909e0a0c6ac8a756c1619fd0f532f34728dc5b","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.8.0.tgz","fileCount":32,"unpackedSize":19784,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrDxV3o+GIbVGyItXQgwGqJzcOlbiJQJjOMfVpKCzUNQIhAKgfyAJlLocnMgqKx44YHiJ9FFCRtPQgPAXA6pFpib1i"}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.8.0_1686962698013_0.13507789300007933"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.8.1-cjs.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.8.1-cjs.0","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"readme":"# OpenAI Streams\n\n[**GitHub**](https://github.com/SpellcraftAI/openai-streams) |\n[**NPM**](https://npmjs.com/package/openai-streams) |\n[**Docs**](https://openai-streams.vercel.app)\n\n> Now with ChatGPT API support! See [**Use with ChatGPT\n> API**](#use-with-chatgpt-api). (Whisper coming soon!)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\n- Prioritizes streams, so you can display a completion as it arrives.\n- Auto-loads `OPENAI_API_KEY` from `process.env`.\n- One single function with inferred parameter type based on the endpoint you\n  provide.\n\nUses `ReadableStream` by default for browser, Edge Runtime, and Node 18+, with\na `NodeJS.Readable` version available at `openai-streams/node`.\n\n### Installation\n\n```bash\nyarn add openai-streams\n# -or-\nnpm i --save openai-streams\n```\n\n### Usage\n\n```ts\nawait OpenAI(\n  /** 'completions', 'chat', etc. */\n  ENDPOINT,\n  /** max_tokens, temperature, messages, etc. */\n  PARAMS,\n  /** apiBase, apiKey, mode, controller, etc */\n  OPTIONS\n);\n```\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\",\n     {\n       /* endpoint params */\n     },\n     { apiKey: process.env.MY_SECRET_API_KEY }\n   );\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params, options?)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n   Example with `raw` streaming mode:\n\n   ```ts\n   await OpenAI(\n     \"chat\",\n     {\n       messages: [\n         /* ... */\n       ],\n     },\n     { mode: \"raw\" }\n   );\n   ```\n\n#### Edge/Browser: Consuming streams in Next.js Edge functions\n\nThis will also work in the browser, but you'll need users to paste their OpenAI\nkey and pass it in via the `{ apiKey }` option.\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 100,\n  });\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\",\n};\n```\n\n#### Node: Consuming streams in Next.js API Route (Node)\n\nIf you cannot use an Edge runtime or want to consume Node.js streams for another\nreason, use `openai-streams/node`:\n\n```ts\nimport type { NextApiRequest, NextApiResponse } from \"next\";\nimport { OpenAI } from \"openai-streams/node\";\n\nexport default async function test(_: NextApiRequest, res: NextApiResponse) {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 25,\n  });\n\n  stream.pipe(res);\n}\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/SpellcraftAI/openai-streams/blob/master/example/src/pages/api/hello.ts).</sub>\n<sub>\n\n#### Use with ChatGPT API\n\nBy default, with `mode = \"tokens\"`, you will receive just the message deltas.\nFor full events, use `mode = \"raw\"`.\n\nSee: https://platform.openai.com/docs/guides/chat/introduction\n\n```ts\nconst stream = await OpenAI(\"chat\", {\n  model: \"gpt-3.5-turbo\",\n  messages: [\n    {\n      role: \"system\",\n      content: \"You are a helpful assistant that translates English to French.\",\n    },\n    {\n      role: \"user\",\n      content: 'Translate the following English text to French: \"Hello world!\"',\n    },\n  ],\n});\n```\n\nIn `tokens` mode, you will just receive the response chunks, which look like this\n(separated with newlines for illustration):\n\n```\nHello\n!\n How\n can\n I\n assist\n you\n today\n?\n```\n\nUse `mode = \"raw\"` for access to raw events.\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n(const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.\n","readmeFilename":"README.md","gitHead":"a7243e5fd69e1cb93342b0577075e0c0c69e6801","_id":"openai-streams@5.8.1-cjs.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-8YU22WxfmPXKzDZ8LD4p1tafrbWr895zKuqG3dv5a6+FzND0xwE50ZxmusJih/dcIV3fwf3gdFrhCLq8sYwZSA==","shasum":"3f34b196c07ee48f44917ef2fedf7b917084cbd0","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.8.1-cjs.0.tgz","fileCount":32,"unpackedSize":26543,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCiyD8nY+SsSBKx6xXQHLGbQU6/h9QsTa/b0xDiSV6nvgIgdPwxfZ6njIFdcFIBMEIn6ptI+kWMEE4wpLLj/vVLqW4="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.8.1-cjs.0_1686962718360_0.8336249015226971"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.9.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.9.0","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"gitHead":"ebb2821a1762f85773061adaf5091192b7181bd6","_id":"openai-streams@5.9.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-7xaFJl2qysSF+Mpo/wnSC+07kZ2UBnZpwIFqwIexbeqGHIrAYzg16A4vJ88c6edihY4cKUSo7eyuUTqahd0YbA==","shasum":"29002a322289bb6928587cfc8fb8d01455793ea2","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.9.0.tgz","fileCount":32,"unpackedSize":19784,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGZpGokN57roQtOhFDAA03IxH3iCNB65Its6yrukoPZoAiBdrLkMvPR6Y/TR+46jedys2Egw+4ibZqI9w/2TeGb8iQ=="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.9.0_1686962931885_0.7515582606549893"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.9.1-cjs.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.9.1-cjs.0","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"readme":"# OpenAI Streams\n\n[**GitHub**](https://github.com/SpellcraftAI/openai-streams) |\n[**NPM**](https://npmjs.com/package/openai-streams) |\n[**Docs**](https://openai-streams.vercel.app)\n\n> Now with ChatGPT API support! See [**Use with ChatGPT\n> API**](#use-with-chatgpt-api). (Whisper coming soon!)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\n- Prioritizes streams, so you can display a completion as it arrives.\n- Auto-loads `OPENAI_API_KEY` from `process.env`.\n- One single function with inferred parameter type based on the endpoint you\n  provide.\n\nUses `ReadableStream` by default for browser, Edge Runtime, and Node 18+, with\na `NodeJS.Readable` version available at `openai-streams/node`.\n\n### Installation\n\n```bash\nyarn add openai-streams\n# -or-\nnpm i --save openai-streams\n```\n\n### Usage\n\n```ts\nawait OpenAI(\n  /** 'completions', 'chat', etc. */\n  ENDPOINT,\n  /** max_tokens, temperature, messages, etc. */\n  PARAMS,\n  /** apiBase, apiKey, mode, controller, etc */\n  OPTIONS\n);\n```\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\",\n     {\n       /* endpoint params */\n     },\n     { apiKey: process.env.MY_SECRET_API_KEY }\n   );\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params, options?)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n   Example with `raw` streaming mode:\n\n   ```ts\n   await OpenAI(\n     \"chat\",\n     {\n       messages: [\n         /* ... */\n       ],\n     },\n     { mode: \"raw\" }\n   );\n   ```\n\n#### Edge/Browser: Consuming streams in Next.js Edge functions\n\nThis will also work in the browser, but you'll need users to paste their OpenAI\nkey and pass it in via the `{ apiKey }` option.\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 100,\n  });\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\",\n};\n```\n\n#### Node: Consuming streams in Next.js API Route (Node)\n\nIf you cannot use an Edge runtime or want to consume Node.js streams for another\nreason, use `openai-streams/node`:\n\n```ts\nimport type { NextApiRequest, NextApiResponse } from \"next\";\nimport { OpenAI } from \"openai-streams/node\";\n\nexport default async function test(_: NextApiRequest, res: NextApiResponse) {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 25,\n  });\n\n  stream.pipe(res);\n}\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/SpellcraftAI/openai-streams/blob/master/example/src/pages/api/hello.ts).</sub>\n<sub>\n\n#### Use with ChatGPT API\n\nBy default, with `mode = \"tokens\"`, you will receive just the message deltas.\nFor full events, use `mode = \"raw\"`.\n\nSee: https://platform.openai.com/docs/guides/chat/introduction\n\n```ts\nconst stream = await OpenAI(\"chat\", {\n  model: \"gpt-3.5-turbo\",\n  messages: [\n    {\n      role: \"system\",\n      content: \"You are a helpful assistant that translates English to French.\",\n    },\n    {\n      role: \"user\",\n      content: 'Translate the following English text to French: \"Hello world!\"',\n    },\n  ],\n});\n```\n\nIn `tokens` mode, you will just receive the response chunks, which look like this\n(separated with newlines for illustration):\n\n```\nHello\n!\n How\n can\n I\n assist\n you\n today\n?\n```\n\nUse `mode = \"raw\"` for access to raw events.\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n(const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.\n","readmeFilename":"README.md","gitHead":"00d1291300a545b26152847b7a9487d05ddef32f","_id":"openai-streams@5.9.1-cjs.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-ezFHNOWSmr6+EwSliQPW/vDiTi8EVfGIoq9M7CYrmpWjBLCNyexFQ0qfY7ZGqcm2sFWsmAn5Hl2FrH5PaS4n4A==","shasum":"15706a17e2bd5ee7c1f38811578fa7fb671250a6","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.9.1-cjs.0.tgz","fileCount":32,"unpackedSize":26543,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCb82QJAs6FYIKuaNL4WX866tRmnEMqoEbALdvDNz2b0AIgTNYsU8S36YmjyQrS2CgDTJO7ezZxlsFvGv6txlGtA7w="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.9.1-cjs.0_1686962949460_0.9005688122065232"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.10.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.10.0","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"gitHead":"c84d84484b23686dd6996b3923dd8bcad32ed1a5","_id":"openai-streams@5.10.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-MyeACWfIIFGVj8luXiweknqQfNfHRzWTBAw3nYxUzkzaR+98NFRtfAIHUFQkZPZFNnGts8LCrCmCcH2nz/q1Bg==","shasum":"406d95fe941547bac5698307b78011a232f17346","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.10.0.tgz","fileCount":32,"unpackedSize":19785,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC6sIMo/NiI62xlXKL6oKqMoOAdjWrkB2rr2AE68c8q/gIhAIrTluWivgcukueDM+yxLLVsPztfYr0TYisuWUvXzKxo"}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.10.0_1686963233870_0.7015599685604101"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.10.1-cjs.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.10.1-cjs.0","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"readme":"# OpenAI Streams\n\n[**GitHub**](https://github.com/SpellcraftAI/openai-streams) |\n[**NPM**](https://npmjs.com/package/openai-streams) |\n[**Docs**](https://openai-streams.vercel.app)\n\n> Now with ChatGPT API support! See [**Use with ChatGPT\n> API**](#use-with-chatgpt-api). (Whisper coming soon!)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\n- Prioritizes streams, so you can display a completion as it arrives.\n- Auto-loads `OPENAI_API_KEY` from `process.env`.\n- One single function with inferred parameter type based on the endpoint you\n  provide.\n\nUses `ReadableStream` by default for browser, Edge Runtime, and Node 18+, with\na `NodeJS.Readable` version available at `openai-streams/node`.\n\n### Installation\n\n```bash\nyarn add openai-streams\n# -or-\nnpm i --save openai-streams\n```\n\n### Usage\n\n```ts\nawait OpenAI(\n  /** 'completions', 'chat', etc. */\n  ENDPOINT,\n  /** max_tokens, temperature, messages, etc. */\n  PARAMS,\n  /** apiBase, apiKey, mode, controller, etc */\n  OPTIONS\n);\n```\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\",\n     {\n       /* endpoint params */\n     },\n     { apiKey: process.env.MY_SECRET_API_KEY }\n   );\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params, options?)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n   Example with `raw` streaming mode:\n\n   ```ts\n   await OpenAI(\n     \"chat\",\n     {\n       messages: [\n         /* ... */\n       ],\n     },\n     { mode: \"raw\" }\n   );\n   ```\n\n#### Edge/Browser: Consuming streams in Next.js Edge functions\n\nThis will also work in the browser, but you'll need users to paste their OpenAI\nkey and pass it in via the `{ apiKey }` option.\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 100,\n  });\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\",\n};\n```\n\n#### Node: Consuming streams in Next.js API Route (Node)\n\nIf you cannot use an Edge runtime or want to consume Node.js streams for another\nreason, use `openai-streams/node`:\n\n```ts\nimport type { NextApiRequest, NextApiResponse } from \"next\";\nimport { OpenAI } from \"openai-streams/node\";\n\nexport default async function test(_: NextApiRequest, res: NextApiResponse) {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 25,\n  });\n\n  stream.pipe(res);\n}\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/SpellcraftAI/openai-streams/blob/master/example/src/pages/api/hello.ts).</sub>\n<sub>\n\n#### Use with ChatGPT API\n\nBy default, with `mode = \"tokens\"`, you will receive just the message deltas.\nFor full events, use `mode = \"raw\"`.\n\nSee: https://platform.openai.com/docs/guides/chat/introduction\n\n```ts\nconst stream = await OpenAI(\"chat\", {\n  model: \"gpt-3.5-turbo\",\n  messages: [\n    {\n      role: \"system\",\n      content: \"You are a helpful assistant that translates English to French.\",\n    },\n    {\n      role: \"user\",\n      content: 'Translate the following English text to French: \"Hello world!\"',\n    },\n  ],\n});\n```\n\nIn `tokens` mode, you will just receive the response chunks, which look like this\n(separated with newlines for illustration):\n\n```\nHello\n!\n How\n can\n I\n assist\n you\n today\n?\n```\n\nUse `mode = \"raw\"` for access to raw events.\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n(const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.\n","readmeFilename":"README.md","gitHead":"864606856155d22c2a6b32df20345f69c455ee81","_id":"openai-streams@5.10.1-cjs.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-+q7F7HC8YpcLQcGnO5ZEvJycggshpWynXbP0WTmmfzafDjj2BzprDm/XmdbgBRooArhpGnYv2QIRAfI11qCI6w==","shasum":"76d7dfd5c39d64f536ab76011f713e46b6a76e46","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.10.1-cjs.0.tgz","fileCount":32,"unpackedSize":26544,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDegv35PYl6Zd+1L9BFW2JHYIT1r/q/fGQQH8mQ4mwk3wIgRqJf40dvkD5LSRKSJEJMOdYui5/y27aVtIBVCvzYYHw="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.10.1-cjs.0_1686963251071_0.05469485111814598"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.11.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.11.0","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"gitHead":"195dfa5a9cd821e402ef970549814dce5bc8d714","_id":"openai-streams@5.11.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-iAV34khopsDbrK3kPff2kHb/yRJZ6EOpwpsF2B4bjSFyjk4pLQ770o2boJY3pLAmr/VTPwDKEen3y8VMvKBrpQ==","shasum":"1a02eaffcb9d1c8b93d45afe93d166f027da0fef","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.11.0.tgz","fileCount":32,"unpackedSize":19785,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAVT15KxBIt7KVMmQHcnv6XQvVo+HFdR9Qxkxqqz8uKkAiABumfE9hzneSbDx6EsvZh9P95Wg7ly//q7uV4qzjW39A=="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.11.0_1686963364150_0.6392094975154883"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.11.1-0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.11.1-0","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":"./node.js",".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"readme":"# OpenAI Streams\n\n[**GitHub**](https://github.com/SpellcraftAI/openai-streams) |\n[**NPM**](https://npmjs.com/package/openai-streams) |\n[**Docs**](https://openai-streams.vercel.app)\n\n> Now with ChatGPT API support! See [**Use with ChatGPT\n> API**](#use-with-chatgpt-api). (Whisper coming soon!)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\n- Prioritizes streams, so you can display a completion as it arrives.\n- Auto-loads `OPENAI_API_KEY` from `process.env`.\n- One single function with inferred parameter type based on the endpoint you\n  provide.\n\nUses `ReadableStream` by default for browser, Edge Runtime, and Node 18+, with\na `NodeJS.Readable` version available at `openai-streams/node`.\n\n### Installation\n\n```bash\nyarn add openai-streams\n# -or-\nnpm i --save openai-streams\n```\n\n### Usage\n\n```ts\nawait OpenAI(\n  /** 'completions', 'chat', etc. */\n  ENDPOINT,\n  /** max_tokens, temperature, messages, etc. */\n  PARAMS,\n  /** apiBase, apiKey, mode, controller, etc */\n  OPTIONS\n);\n```\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\",\n     {\n       /* endpoint params */\n     },\n     { apiKey: process.env.MY_SECRET_API_KEY }\n   );\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params, options?)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n   Example with `raw` streaming mode:\n\n   ```ts\n   await OpenAI(\n     \"chat\",\n     {\n       messages: [\n         /* ... */\n       ],\n     },\n     { mode: \"raw\" }\n   );\n   ```\n\n#### Edge/Browser: Consuming streams in Next.js Edge functions\n\nThis will also work in the browser, but you'll need users to paste their OpenAI\nkey and pass it in via the `{ apiKey }` option.\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 100,\n  });\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\",\n};\n```\n\n#### Node: Consuming streams in Next.js API Route (Node)\n\nIf you cannot use an Edge runtime or want to consume Node.js streams for another\nreason, use `openai-streams/node`:\n\n```ts\nimport type { NextApiRequest, NextApiResponse } from \"next\";\nimport { OpenAI } from \"openai-streams/node\";\n\nexport default async function test(_: NextApiRequest, res: NextApiResponse) {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 25,\n  });\n\n  stream.pipe(res);\n}\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/SpellcraftAI/openai-streams/blob/master/example/src/pages/api/hello.ts).</sub>\n<sub>\n\n#### Use with ChatGPT API\n\nBy default, with `mode = \"tokens\"`, you will receive just the message deltas.\nFor full events, use `mode = \"raw\"`.\n\nSee: https://platform.openai.com/docs/guides/chat/introduction\n\n```ts\nconst stream = await OpenAI(\"chat\", {\n  model: \"gpt-3.5-turbo\",\n  messages: [\n    {\n      role: \"system\",\n      content: \"You are a helpful assistant that translates English to French.\",\n    },\n    {\n      role: \"user\",\n      content: 'Translate the following English text to French: \"Hello world!\"',\n    },\n  ],\n});\n```\n\nIn `tokens` mode, you will just receive the response chunks, which look like this\n(separated with newlines for illustration):\n\n```\nHello\n!\n How\n can\n I\n assist\n you\n today\n?\n```\n\nUse `mode = \"raw\"` for access to raw events.\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n(const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.\n","readmeFilename":"README.md","gitHead":"d3ffd0e42d45b9f85f9471385be17e8a2fecfe3a","_id":"openai-streams@5.11.1-0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-5pOGbRi3eYVH/EBQ+pX/dxUY5OnmhF5jTRDhrYfN7rgmOrUnbTJg75l7DRZNvYGLVYB+irAFgbGTyGuLATCgKg==","shasum":"4e25c3119c16c70345b4e7909707dc7a990b673c","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.11.1-0.tgz","fileCount":32,"unpackedSize":26540,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+jVhgH4jcEsgMgFRQqIOg5h52esRo/flSIHIxqmnPNgIgFTzNV5TcXnUDendvumnCa9Bwt3X4i+Wk2kuBc0nNMOM="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.11.1-0_1686963382333_0.8519191200800604"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.12.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.12.0","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":{"import":"./node.js","require":"./node.cjs"},".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -b -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"gitHead":"b2d24b3d0520ac9fa860c22aa73de021ea27965d","_id":"openai-streams@5.12.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-4zNiocGSE7UWdNtTJZU9NiQZrG3T50GZ/nZFssZojLbTkNg/bkJO3DD8gcDgvEBfdP1CnoWXfpbjJ0zHr9GhjA==","shasum":"299fb732032f581bd50ac3f4e8c19027acb4fc9e","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.12.0.tgz","fileCount":32,"unpackedSize":19843,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFKA6A6kDT58Xoec39tLQfRUlIGVZPUHwvqTKHkm5DAOAiAKRC0MQKbDV7e6+T2QBgrVIyrMqlwZYa/OAd93HA6npQ=="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.12.0_1686964947589_0.391018642229749"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.12.1-0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.12.1-0","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":{"import":"./node.js","require":"./node.cjs"},".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -b -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"readme":"# OpenAI Streams\n\n[**GitHub**](https://github.com/SpellcraftAI/openai-streams) |\n[**NPM**](https://npmjs.com/package/openai-streams) |\n[**Docs**](https://openai-streams.vercel.app)\n\n> Now with ChatGPT API support! See [**Use with ChatGPT\n> API**](#use-with-chatgpt-api). (Whisper coming soon!)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\n- Prioritizes streams, so you can display a completion as it arrives.\n- Auto-loads `OPENAI_API_KEY` from `process.env`.\n- One single function with inferred parameter type based on the endpoint you\n  provide.\n\nUses `ReadableStream` by default for browser, Edge Runtime, and Node 18+, with\na `NodeJS.Readable` version available at `openai-streams/node`.\n\n### Installation\n\n```bash\nyarn add openai-streams\n# -or-\nnpm i --save openai-streams\n```\n\n### Usage\n\n```ts\nawait OpenAI(\n  /** 'completions', 'chat', etc. */\n  ENDPOINT,\n  /** max_tokens, temperature, messages, etc. */\n  PARAMS,\n  /** apiBase, apiKey, mode, controller, etc */\n  OPTIONS\n);\n```\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\",\n     {\n       /* endpoint params */\n     },\n     { apiKey: process.env.MY_SECRET_API_KEY }\n   );\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params, options?)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n   Example with `raw` streaming mode:\n\n   ```ts\n   await OpenAI(\n     \"chat\",\n     {\n       messages: [\n         /* ... */\n       ],\n     },\n     { mode: \"raw\" }\n   );\n   ```\n\n#### Edge/Browser: Consuming streams in Next.js Edge functions\n\nThis will also work in the browser, but you'll need users to paste their OpenAI\nkey and pass it in via the `{ apiKey }` option.\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 100,\n  });\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\",\n};\n```\n\n#### Node: Consuming streams in Next.js API Route (Node)\n\nIf you cannot use an Edge runtime or want to consume Node.js streams for another\nreason, use `openai-streams/node`:\n\n```ts\nimport type { NextApiRequest, NextApiResponse } from \"next\";\nimport { OpenAI } from \"openai-streams/node\";\n\nexport default async function test(_: NextApiRequest, res: NextApiResponse) {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 25,\n  });\n\n  stream.pipe(res);\n}\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/SpellcraftAI/openai-streams/blob/master/example/src/pages/api/hello.ts).</sub>\n<sub>\n\n#### Use with ChatGPT API\n\nBy default, with `mode = \"tokens\"`, you will receive just the message deltas.\nFor full events, use `mode = \"raw\"`.\n\nSee: https://platform.openai.com/docs/guides/chat/introduction\n\n```ts\nconst stream = await OpenAI(\"chat\", {\n  model: \"gpt-3.5-turbo\",\n  messages: [\n    {\n      role: \"system\",\n      content: \"You are a helpful assistant that translates English to French.\",\n    },\n    {\n      role: \"user\",\n      content: 'Translate the following English text to French: \"Hello world!\"',\n    },\n  ],\n});\n```\n\nIn `tokens` mode, you will just receive the response chunks, which look like this\n(separated with newlines for illustration):\n\n```\nHello\n!\n How\n can\n I\n assist\n you\n today\n?\n```\n\nUse `mode = \"raw\"` for access to raw events.\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n(const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.\n","readmeFilename":"README.md","gitHead":"e4b25c5d2fc4d55ba2107e95be1448e6167c1a97","_id":"openai-streams@5.12.1-0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-Phij2txG3q21RYzBYCnLEmyT5o3OYqMvetnhzctI6LbeQZDbV9ZA4Y9k1cxQ3bG1lVw622lxjbqWhycsmJHPkg==","shasum":"b98d715463319ec51436cb49a495e203f46ad411","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.12.1-0.tgz","fileCount":32,"unpackedSize":27940,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID3cq+R0gWzu4goYVylI3A1wwAatxNfcHB8XAxLeY6IXAiBox0kSSBTLP9BaHHq/1NyVtZqUz/HIqdFK40EnmMOGIQ=="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.12.1-0_1686964960151_0.4091704683471822"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.13.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.13.0","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":{"import":"./node.js","require":"./node.cjs"},".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -b -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"gitHead":"747fc25be54405ad260f4d27af08f9954a79f2e1","_id":"openai-streams@5.13.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-muesrCaqm2OvDlgaRuuNuRLsjMkGOzsDsTVowv93FL5gQzj9cqeunj2KRDbnu3fnQp+RgbCEymWN1wbk4MQR+Q==","shasum":"dd4c01c56b292e966852b734c9aabda47b8be524","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.13.0.tgz","fileCount":33,"unpackedSize":19874,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqliOoWwxQWCN2c1mrZLWA/cZCawbRuwnZ0jiiB44IZAIhAJPijYxm2/3LyU3OkQvl+z/uwUBi4P2C1kLKey5cN4os"}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.13.0_1686965169738_0.4418725503345222"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.13.1-0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.13.1-0","license":"MIT","type":"module","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":{"import":"./node.js","require":"./node.cjs"},".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -b -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"readme":"# OpenAI Streams\n\n[**GitHub**](https://github.com/SpellcraftAI/openai-streams) |\n[**NPM**](https://npmjs.com/package/openai-streams) |\n[**Docs**](https://openai-streams.vercel.app)\n\n> Now with ChatGPT API support! See [**Use with ChatGPT\n> API**](#use-with-chatgpt-api). (Whisper coming soon!)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\n- Prioritizes streams, so you can display a completion as it arrives.\n- Auto-loads `OPENAI_API_KEY` from `process.env`.\n- One single function with inferred parameter type based on the endpoint you\n  provide.\n\nUses `ReadableStream` by default for browser, Edge Runtime, and Node 18+, with\na `NodeJS.Readable` version available at `openai-streams/node`.\n\n### Installation\n\n```bash\nyarn add openai-streams\n# -or-\nnpm i --save openai-streams\n```\n\n### Usage\n\n```ts\nawait OpenAI(\n  /** 'completions', 'chat', etc. */\n  ENDPOINT,\n  /** max_tokens, temperature, messages, etc. */\n  PARAMS,\n  /** apiBase, apiKey, mode, controller, etc */\n  OPTIONS\n);\n```\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\",\n     {\n       /* endpoint params */\n     },\n     { apiKey: process.env.MY_SECRET_API_KEY }\n   );\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params, options?)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n   Example with `raw` streaming mode:\n\n   ```ts\n   await OpenAI(\n     \"chat\",\n     {\n       messages: [\n         /* ... */\n       ],\n     },\n     { mode: \"raw\" }\n   );\n   ```\n\n#### Edge/Browser: Consuming streams in Next.js Edge functions\n\nThis will also work in the browser, but you'll need users to paste their OpenAI\nkey and pass it in via the `{ apiKey }` option.\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 100,\n  });\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\",\n};\n```\n\n#### Node: Consuming streams in Next.js API Route (Node)\n\nIf you cannot use an Edge runtime or want to consume Node.js streams for another\nreason, use `openai-streams/node`:\n\n```ts\nimport type { NextApiRequest, NextApiResponse } from \"next\";\nimport { OpenAI } from \"openai-streams/node\";\n\nexport default async function test(_: NextApiRequest, res: NextApiResponse) {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 25,\n  });\n\n  stream.pipe(res);\n}\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/SpellcraftAI/openai-streams/blob/master/example/src/pages/api/hello.ts).</sub>\n<sub>\n\n#### Use with ChatGPT API\n\nBy default, with `mode = \"tokens\"`, you will receive just the message deltas.\nFor full events, use `mode = \"raw\"`.\n\nSee: https://platform.openai.com/docs/guides/chat/introduction\n\n```ts\nconst stream = await OpenAI(\"chat\", {\n  model: \"gpt-3.5-turbo\",\n  messages: [\n    {\n      role: \"system\",\n      content: \"You are a helpful assistant that translates English to French.\",\n    },\n    {\n      role: \"user\",\n      content: 'Translate the following English text to French: \"Hello world!\"',\n    },\n  ],\n});\n```\n\nIn `tokens` mode, you will just receive the response chunks, which look like this\n(separated with newlines for illustration):\n\n```\nHello\n!\n How\n can\n I\n assist\n you\n today\n?\n```\n\nUse `mode = \"raw\"` for access to raw events.\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n(const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.\n","readmeFilename":"README.md","gitHead":"1378d444961c5f5d7d1d0a373213a3fa428925b0","_id":"openai-streams@5.13.1-0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-+YUx8j/P6m03YV054QQnNDGjHH3UUXDpl1LfkmmI32/rctZZUQYC5C+z6b51VXAFi3XMCm67YpfPGb4cd4AYgw==","shasum":"312becb94c560e4fabfc2d3c6d3fd678f997b220","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.13.1-0.tgz","fileCount":33,"unpackedSize":27971,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDObHgrAOW5kcgX7EnTE8a0fDr3bHG8iSveEf0uVy6tWwIgZbfBAYbk82MfAZ1DhFraZIyPhLb9KFe1C/8ACzmrRfk="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.13.1-0_1686965185497_0.24166979630420538"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.14.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.14.0","license":"MIT","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":{"import":"./node.js","require":"./node.cjs"},".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -b -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"gitHead":"13bc37c5fbaa956de1acdbfb74bb2fbf3ab6f5ea","_id":"openai-streams@5.14.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-L9Qjs4vdfmJdTGxyw4BTdE+FRSZySre1PQ3CbsYY2RN6zEWokIhHVg5MRPQUeJFfNd5z67lTeRwG3hM0vIFVHg==","shasum":"45a6c5ab438041259b9280868282e2e63588d00f","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.14.0.tgz","fileCount":33,"unpackedSize":19854,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCVe7kfMwGbcbJNT9M0U/zeyxJnRfdoywBQw42F937J1AIgYK7wONtDQDipYh8o1mKGzhuV6l1hNIi+/bffbSLZx50="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.14.0_1686965509804_0.8344748266659521"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.14.1-0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.14.1-0","license":"MIT","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":{"import":"./node.js","require":"./node.cjs"},".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -b -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"readme":"# OpenAI Streams\n\n[**GitHub**](https://github.com/SpellcraftAI/openai-streams) |\n[**NPM**](https://npmjs.com/package/openai-streams) |\n[**Docs**](https://openai-streams.vercel.app)\n\n> Now with ChatGPT API support! See [**Use with ChatGPT\n> API**](#use-with-chatgpt-api). (Whisper coming soon!)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\n- Prioritizes streams, so you can display a completion as it arrives.\n- Auto-loads `OPENAI_API_KEY` from `process.env`.\n- One single function with inferred parameter type based on the endpoint you\n  provide.\n\nUses `ReadableStream` by default for browser, Edge Runtime, and Node 18+, with\na `NodeJS.Readable` version available at `openai-streams/node`.\n\n### Installation\n\n```bash\nyarn add openai-streams\n# -or-\nnpm i --save openai-streams\n```\n\n### Usage\n\n```ts\nawait OpenAI(\n  /** 'completions', 'chat', etc. */\n  ENDPOINT,\n  /** max_tokens, temperature, messages, etc. */\n  PARAMS,\n  /** apiBase, apiKey, mode, controller, etc */\n  OPTIONS\n);\n```\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\",\n     {\n       /* endpoint params */\n     },\n     { apiKey: process.env.MY_SECRET_API_KEY }\n   );\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params, options?)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n   Example with `raw` streaming mode:\n\n   ```ts\n   await OpenAI(\n     \"chat\",\n     {\n       messages: [\n         /* ... */\n       ],\n     },\n     { mode: \"raw\" }\n   );\n   ```\n\n#### Edge/Browser: Consuming streams in Next.js Edge functions\n\nThis will also work in the browser, but you'll need users to paste their OpenAI\nkey and pass it in via the `{ apiKey }` option.\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 100,\n  });\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\",\n};\n```\n\n#### Node: Consuming streams in Next.js API Route (Node)\n\nIf you cannot use an Edge runtime or want to consume Node.js streams for another\nreason, use `openai-streams/node`:\n\n```ts\nimport type { NextApiRequest, NextApiResponse } from \"next\";\nimport { OpenAI } from \"openai-streams/node\";\n\nexport default async function test(_: NextApiRequest, res: NextApiResponse) {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 25,\n  });\n\n  stream.pipe(res);\n}\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/SpellcraftAI/openai-streams/blob/master/example/src/pages/api/hello.ts).</sub>\n<sub>\n\n#### Use with ChatGPT API\n\nBy default, with `mode = \"tokens\"`, you will receive just the message deltas.\nFor full events, use `mode = \"raw\"`.\n\nSee: https://platform.openai.com/docs/guides/chat/introduction\n\n```ts\nconst stream = await OpenAI(\"chat\", {\n  model: \"gpt-3.5-turbo\",\n  messages: [\n    {\n      role: \"system\",\n      content: \"You are a helpful assistant that translates English to French.\",\n    },\n    {\n      role: \"user\",\n      content: 'Translate the following English text to French: \"Hello world!\"',\n    },\n  ],\n});\n```\n\nIn `tokens` mode, you will just receive the response chunks, which look like this\n(separated with newlines for illustration):\n\n```\nHello\n!\n How\n can\n I\n assist\n you\n today\n?\n```\n\nUse `mode = \"raw\"` for access to raw events.\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n(const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.\n","readmeFilename":"README.md","gitHead":"9a10d89b45fd3056891192a2e871ddf7760ad2d4","_id":"openai-streams@5.14.1-0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-18QZxQGolOwWxFczAGebi+oTj+Kzh+l0QDLoM81Zz9W41jxY57ng57wBUobFirtiEaecsM6SDoHTr8LIWzlvZA==","shasum":"5858fcb38ba8fa31da12318e0eedd5053ac071f7","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.14.1-0.tgz","fileCount":33,"unpackedSize":27951,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCoeotMo3wn+/nQGPCzsb3RtSJlUcgBWE0lkty0W14h4gIhANz0W17cnc4pbGSMANmyxBIFQQwHpmMD+OlSORjfThwl"}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.14.1-0_1686965524954_0.1657329136151764"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.15.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.15.0","license":"MIT","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":{"import":"./node.js","require":"./node.cjs"},".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -b -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"gitHead":"3fec6f1491d4fe5ba216f22df1ced9946202186c","_id":"openai-streams@5.15.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-6gdQuGn8pjT+M4mK3JfSClPo6P/K0AqF1/bvMl7iWQ5QhPnaGKeW5wn5RBPV7RYxZ6ty7Efm80Z/f3MsL10Iqg==","shasum":"133737038c706da9b436dd8bee6af8430caf060b","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.15.0.tgz","fileCount":33,"unpackedSize":19861,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAIlDLHCXLAY0nUKR5Rnf3nPtG+MFiGeqSQHpE7XGlU5AiAIFcbGDdAaCcgmTRDes8ijDg9zUgS+EkEHAKB4P5NDwQ=="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.15.0_1686966231419_0.4831416631388874"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.15.1-0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.15.1-0","license":"MIT","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":{"import":"./node.js","require":"./node.cjs"},".":"./dist/index.js","./*":"./dist/*/index.js"},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -b -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"readme":"# OpenAI Streams\n\n[**GitHub**](https://github.com/SpellcraftAI/openai-streams) |\n[**NPM**](https://npmjs.com/package/openai-streams) |\n[**Docs**](https://openai-streams.vercel.app)\n\n> Now with ChatGPT API support! See [**Use with ChatGPT\n> API**](#use-with-chatgpt-api). (Whisper coming soon!)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\n- Prioritizes streams, so you can display a completion as it arrives.\n- Auto-loads `OPENAI_API_KEY` from `process.env`.\n- One single function with inferred parameter type based on the endpoint you\n  provide.\n\nUses `ReadableStream` by default for browser, Edge Runtime, and Node 18+, with\na `NodeJS.Readable` version available at `openai-streams/node`.\n\n### Installation\n\n```bash\nyarn add openai-streams\n# -or-\nnpm i --save openai-streams\n```\n\n### Usage\n\n```ts\nawait OpenAI(\n  /** 'completions', 'chat', etc. */\n  ENDPOINT,\n  /** max_tokens, temperature, messages, etc. */\n  PARAMS,\n  /** apiBase, apiKey, mode, controller, etc */\n  OPTIONS\n);\n```\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\",\n     {\n       /* endpoint params */\n     },\n     { apiKey: process.env.MY_SECRET_API_KEY }\n   );\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params, options?)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n   Example with `raw` streaming mode:\n\n   ```ts\n   await OpenAI(\n     \"chat\",\n     {\n       messages: [\n         /* ... */\n       ],\n     },\n     { mode: \"raw\" }\n   );\n   ```\n\n#### Edge/Browser: Consuming streams in Next.js Edge functions\n\nThis will also work in the browser, but you'll need users to paste their OpenAI\nkey and pass it in via the `{ apiKey }` option.\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 100,\n  });\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\",\n};\n```\n\n#### Node: Consuming streams in Next.js API Route (Node)\n\nIf you cannot use an Edge runtime or want to consume Node.js streams for another\nreason, use `openai-streams/node`:\n\n```ts\nimport type { NextApiRequest, NextApiResponse } from \"next\";\nimport { OpenAI } from \"openai-streams/node\";\n\nexport default async function test(_: NextApiRequest, res: NextApiResponse) {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 25,\n  });\n\n  stream.pipe(res);\n}\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/SpellcraftAI/openai-streams/blob/master/example/src/pages/api/hello.ts).</sub>\n<sub>\n\n#### Use with ChatGPT API\n\nBy default, with `mode = \"tokens\"`, you will receive just the message deltas.\nFor full events, use `mode = \"raw\"`.\n\nSee: https://platform.openai.com/docs/guides/chat/introduction\n\n```ts\nconst stream = await OpenAI(\"chat\", {\n  model: \"gpt-3.5-turbo\",\n  messages: [\n    {\n      role: \"system\",\n      content: \"You are a helpful assistant that translates English to French.\",\n    },\n    {\n      role: \"user\",\n      content: 'Translate the following English text to French: \"Hello world!\"',\n    },\n  ],\n});\n```\n\nIn `tokens` mode, you will just receive the response chunks, which look like this\n(separated with newlines for illustration):\n\n```\nHello\n!\n How\n can\n I\n assist\n you\n today\n?\n```\n\nUse `mode = \"raw\"` for access to raw events.\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n(const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.\n","readmeFilename":"README.md","gitHead":"76e95f59b077ce3eb2c66b859f8e19fa9fa6d301","_id":"openai-streams@5.15.1-0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-tWWApRNCle63bdTFsFInOCtmtOOq4R7akUhK9GcQEm2hF+mQzZVN4vLTzgYeiEF5s7mnbR+V0/Oz3jn9eqDXxw==","shasum":"ffc5935d8f1ecb16e863d22b0c07d2acb9086393","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.15.1-0.tgz","fileCount":33,"unpackedSize":27958,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCwMzVd/Ip+wPf90vQ+WXNt+8D/fJkbvD5RZLFopQ1DGwIgZbvW5GxoM65NEMI11NoModTIB3foXCD2pJDiif5OK1U="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.15.1-0_1686966248367_0.3076741162348233"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.16.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.16.0","license":"MIT","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":{"import":"./node.js","require":"./node.cjs"},".":{"import":"./dist/index.js","require":"./dist/index.cjs"},"./*":{"import":"./dist/*/index.js","require":"./dist/*/index.cjs"}},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -b -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"gitHead":"95c959934bb1194c5c70a1412815fc1a2926dd69","_id":"openai-streams@5.16.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-yBBKaUaTsb/EVL9EA1PZIm5JwSiDjuxpCKQhAbBrT/+p6Vno22ldG5SEgsLm4F72sSF00Md1oLAMaOpTzxwjqA==","shasum":"aa56f54730ece3c3f7bfa48d64c9c990245af955","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.16.0.tgz","fileCount":33,"unpackedSize":19985,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHkWXRGS7pQzBGbnYEiddz7S8q3h0wRBEj+3ivUliVsQIhALFm35EXE0kSo5mq+6plAFcx8HELMvMVqaKsQ0syzLB1"}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.16.0_1686967098890_0.10896452227293607"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.16.1-0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.16.1-0","license":"MIT","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":{"import":"./node.js","require":"./node.cjs"},".":{"import":"./dist/index.js","require":"./dist/index.cjs"},"./*":{"import":"./dist/*/index.js","require":"./dist/*/index.cjs"}},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -b -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"readme":"# OpenAI Streams\n\n[**GitHub**](https://github.com/SpellcraftAI/openai-streams) |\n[**NPM**](https://npmjs.com/package/openai-streams) |\n[**Docs**](https://openai-streams.vercel.app)\n\n> Now with ChatGPT API support! See [**Use with ChatGPT\n> API**](#use-with-chatgpt-api). (Whisper coming soon!)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\n- Prioritizes streams, so you can display a completion as it arrives.\n- Auto-loads `OPENAI_API_KEY` from `process.env`.\n- One single function with inferred parameter type based on the endpoint you\n  provide.\n\nUses `ReadableStream` by default for browser, Edge Runtime, and Node 18+, with\na `NodeJS.Readable` version available at `openai-streams/node`.\n\n### Installation\n\n```bash\nyarn add openai-streams\n# -or-\nnpm i --save openai-streams\n```\n\n### Usage\n\n```ts\nawait OpenAI(\n  /** 'completions', 'chat', etc. */\n  ENDPOINT,\n  /** max_tokens, temperature, messages, etc. */\n  PARAMS,\n  /** apiBase, apiKey, mode, controller, etc */\n  OPTIONS\n);\n```\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\",\n     {\n       /* endpoint params */\n     },\n     { apiKey: process.env.MY_SECRET_API_KEY }\n   );\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params, options?)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n   Example with `raw` streaming mode:\n\n   ```ts\n   await OpenAI(\n     \"chat\",\n     {\n       messages: [\n         /* ... */\n       ],\n     },\n     { mode: \"raw\" }\n   );\n   ```\n\n#### Edge/Browser: Consuming streams in Next.js Edge functions\n\nThis will also work in the browser, but you'll need users to paste their OpenAI\nkey and pass it in via the `{ apiKey }` option.\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 100,\n  });\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\",\n};\n```\n\n#### Node: Consuming streams in Next.js API Route (Node)\n\nIf you cannot use an Edge runtime or want to consume Node.js streams for another\nreason, use `openai-streams/node`:\n\n```ts\nimport type { NextApiRequest, NextApiResponse } from \"next\";\nimport { OpenAI } from \"openai-streams/node\";\n\nexport default async function test(_: NextApiRequest, res: NextApiResponse) {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 25,\n  });\n\n  stream.pipe(res);\n}\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/SpellcraftAI/openai-streams/blob/master/example/src/pages/api/hello.ts).</sub>\n<sub>\n\n#### Use with ChatGPT API\n\nBy default, with `mode = \"tokens\"`, you will receive just the message deltas.\nFor full events, use `mode = \"raw\"`.\n\nSee: https://platform.openai.com/docs/guides/chat/introduction\n\n```ts\nconst stream = await OpenAI(\"chat\", {\n  model: \"gpt-3.5-turbo\",\n  messages: [\n    {\n      role: \"system\",\n      content: \"You are a helpful assistant that translates English to French.\",\n    },\n    {\n      role: \"user\",\n      content: 'Translate the following English text to French: \"Hello world!\"',\n    },\n  ],\n});\n```\n\nIn `tokens` mode, you will just receive the response chunks, which look like this\n(separated with newlines for illustration):\n\n```\nHello\n!\n How\n can\n I\n assist\n you\n today\n?\n```\n\nUse `mode = \"raw\"` for access to raw events.\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n(const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.\n","readmeFilename":"README.md","gitHead":"4ece01ff61b40c647d67469eea734c8e5b11c583","_id":"openai-streams@5.16.1-0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-P+mQJ2hyncQRdeRz9u3LIP/LNpiV5SZ5WAhaafVYjbvJkfNIYF3eVh2fApFGU0hxzlsAtsnbp7YE+1+4VIp2TA==","shasum":"efccd9a7a0800a9bb6c6afaa8297d3614acabc1c","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.16.1-0.tgz","fileCount":33,"unpackedSize":28082,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+uZmp1ZoEgHNhbSiVrDlaBDIh5FCNPjXsXvQ97RGIFQIhAO3t2A4gTN8ZeQ5IfRk8S0B0QQKG/0i14h4wnXnlNtX7"}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.16.1-0_1686967111067_0.28983263142836346"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.17.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.17.0","license":"MIT","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":{"import":"./node.js","require":"./node.cjs"},".":{"import":"./dist/index.js","require":"./dist/index.cjs"},"./*":{"import":"./dist/*/index.js","require":"./dist/*/index.cjs"}},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -b -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","node-fetch":"^3.3.1","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"gitHead":"fef3aaf1eecd2c8c25e162c09e2a7a70fcd05ce8","_id":"openai-streams@5.17.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-XUVnmu7qFMy9So7bsYrIj3OTnRMofJGwO8lG2H85aAAjDBzn3NqJClwYCcVXX08btaJwyWHLy0qjxTd62Mh1iQ==","shasum":"1c98d5bd6b9894ab357e895a6d213636e08ad450","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.17.0.tgz","fileCount":33,"unpackedSize":20832,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEBS6XlxYEx3yVz8eXwRQTF/LIVRcInjxO3v8MVONoOrAiA1l0ew+7aHItsawkdBexbVokjJXZGkqiGaKnTCtD139Q=="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.17.0_1687040271666_0.10459390581397998"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.17.1-0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.17.1-0","license":"MIT","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":{"import":"./node.js","require":"./node.cjs"},".":{"import":"./dist/index.js","require":"./dist/index.cjs"},"./*":{"import":"./dist/*/index.js","require":"./dist/*/index.cjs"}},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -b -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","node-fetch":"^3.3.1","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"readme":"# OpenAI Streams\n\n[**GitHub**](https://github.com/SpellcraftAI/openai-streams) |\n[**NPM**](https://npmjs.com/package/openai-streams) |\n[**Docs**](https://openai-streams.vercel.app)\n\n> Now with ChatGPT API support! See [**Use with ChatGPT\n> API**](#use-with-chatgpt-api). (Whisper coming soon!)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\n- Prioritizes streams, so you can display a completion as it arrives.\n- Auto-loads `OPENAI_API_KEY` from `process.env`.\n- One single function with inferred parameter type based on the endpoint you\n  provide.\n\nUses `ReadableStream` by default for browser, Edge Runtime, and Node 18+, with\na `NodeJS.Readable` version available at `openai-streams/node`.\n\n### Installation\n\n```bash\nyarn add openai-streams\n# -or-\nnpm i --save openai-streams\n```\n\n### Usage\n\n```ts\nawait OpenAI(\n  /** 'completions', 'chat', etc. */\n  ENDPOINT,\n  /** max_tokens, temperature, messages, etc. */\n  PARAMS,\n  /** apiBase, apiKey, mode, controller, etc */\n  OPTIONS\n);\n```\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\",\n     {\n       /* endpoint params */\n     },\n     { apiKey: process.env.MY_SECRET_API_KEY }\n   );\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params, options?)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n   Example with `raw` streaming mode:\n\n   ```ts\n   await OpenAI(\n     \"chat\",\n     {\n       messages: [\n         /* ... */\n       ],\n     },\n     { mode: \"raw\" }\n   );\n   ```\n\n#### Edge/Browser: Consuming streams in Next.js Edge functions\n\nThis will also work in the browser, but you'll need users to paste their OpenAI\nkey and pass it in via the `{ apiKey }` option.\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 100,\n  });\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\",\n};\n```\n\n#### Node: Consuming streams in Next.js API Route (Node)\n\nIf you cannot use an Edge runtime or want to consume Node.js streams for another\nreason, use `openai-streams/node`:\n\n```ts\nimport type { NextApiRequest, NextApiResponse } from \"next\";\nimport { OpenAI } from \"openai-streams/node\";\n\nexport default async function test(_: NextApiRequest, res: NextApiResponse) {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 25,\n  });\n\n  stream.pipe(res);\n}\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/SpellcraftAI/openai-streams/blob/master/example/src/pages/api/hello.ts).</sub>\n<sub>\n\n#### Use with ChatGPT API\n\nBy default, with `mode = \"tokens\"`, you will receive just the message deltas.\nFor full events, use `mode = \"raw\"`.\n\nSee: https://platform.openai.com/docs/guides/chat/introduction\n\n```ts\nconst stream = await OpenAI(\"chat\", {\n  model: \"gpt-3.5-turbo\",\n  messages: [\n    {\n      role: \"system\",\n      content: \"You are a helpful assistant that translates English to French.\",\n    },\n    {\n      role: \"user\",\n      content: 'Translate the following English text to French: \"Hello world!\"',\n    },\n  ],\n});\n```\n\nIn `tokens` mode, you will just receive the response chunks, which look like this\n(separated with newlines for illustration):\n\n```\nHello\n!\n How\n can\n I\n assist\n you\n today\n?\n```\n\nUse `mode = \"raw\"` for access to raw events.\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n(const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.\n","readmeFilename":"README.md","gitHead":"7dc72f11be2aac37d5fc47f19f1ec3b04b9e964b","_id":"openai-streams@5.17.1-0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-1XSpWaWEBH6VjNMp5bDKyf9WFVZxoJjQAKq2Ct8g9P5XA62ihjbPpaCzGwL/b3oE9uql42y59hWar4wxRxLcYA==","shasum":"aa14ebd4645cdafea2ed54afe299985299a89ded","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.17.1-0.tgz","fileCount":33,"unpackedSize":114731,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjPnd7eFIqsLhBsxfgEj1+eJ5yDObwpX/yWlu9bpx/ZQIhAI2/rQU0J8tY92O0BlNctKLnKPDtfxYBeaX5gUjla4Jg"}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.17.1-0_1687040289157_0.5000173199475171"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.18.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.18.0","license":"MIT","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":{"import":"./node.js","require":"./node.cjs"},".":{"import":"./dist/index.js","require":"./dist/index.cjs"},"./*":{"import":"./dist/*/index.js","require":"./dist/*/index.cjs"}},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -b -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","node-fetch":"^3.3.1","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"gitHead":"a195f935ddaeec864f68862b6f42cc6315f38190","_id":"openai-streams@5.18.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-q08rFNHVAasPKHkXjlUxpLjb5Tu3uFIxSZPdBNocvw3OsFxjnLWbOsbK4gqs9cqXMNOaIjye87hk73MgL1PEHg==","shasum":"446b652a2e5f22f1cf117603ff4767e03dc05d5e","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.18.0.tgz","fileCount":33,"unpackedSize":20832,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwZZiQFWKUZYEwCs4+oVCMSJyowrWUZPJ8o1RsZKVBIAIhAIgt3LobIwciuf9j+sjIzb/fQYB80tAaQuuqIFajw6h3"}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.18.0_1687041464807_0.1214716856928586"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.18.1-0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.18.1-0","license":"MIT","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":{"import":"./node.js","require":"./node.cjs"},".":{"import":"./dist/index.js","require":"./dist/index.cjs"},"./*":{"import":"./dist/*/index.js","require":"./dist/*/index.cjs"}},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -b -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","node-fetch":"^3.3.1","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"readme":"# OpenAI Streams\n\n[**GitHub**](https://github.com/SpellcraftAI/openai-streams) |\n[**NPM**](https://npmjs.com/package/openai-streams) |\n[**Docs**](https://openai-streams.vercel.app)\n\n> Now with ChatGPT API support! See [**Use with ChatGPT\n> API**](#use-with-chatgpt-api). (Whisper coming soon!)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\n- Prioritizes streams, so you can display a completion as it arrives.\n- Auto-loads `OPENAI_API_KEY` from `process.env`.\n- One single function with inferred parameter type based on the endpoint you\n  provide.\n\nUses `ReadableStream` by default for browser, Edge Runtime, and Node 18+, with\na `NodeJS.Readable` version available at `openai-streams/node`.\n\n### Installation\n\n```bash\nyarn add openai-streams\n# -or-\nnpm i --save openai-streams\n```\n\n### Usage\n\n```ts\nawait OpenAI(\n  /** 'completions', 'chat', etc. */\n  ENDPOINT,\n  /** max_tokens, temperature, messages, etc. */\n  PARAMS,\n  /** apiBase, apiKey, mode, controller, etc */\n  OPTIONS\n);\n```\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\",\n     {\n       /* endpoint params */\n     },\n     { apiKey: process.env.MY_SECRET_API_KEY }\n   );\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params, options?)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n   Example with `raw` streaming mode:\n\n   ```ts\n   await OpenAI(\n     \"chat\",\n     {\n       messages: [\n         /* ... */\n       ],\n     },\n     { mode: \"raw\" }\n   );\n   ```\n\n#### Edge/Browser: Consuming streams in Next.js Edge functions\n\nThis will also work in the browser, but you'll need users to paste their OpenAI\nkey and pass it in via the `{ apiKey }` option.\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 100,\n  });\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\",\n};\n```\n\n#### Node: Consuming streams in Next.js API Route (Node)\n\nIf you cannot use an Edge runtime or want to consume Node.js streams for another\nreason, use `openai-streams/node`:\n\n```ts\nimport type { NextApiRequest, NextApiResponse } from \"next\";\nimport { OpenAI } from \"openai-streams/node\";\n\nexport default async function test(_: NextApiRequest, res: NextApiResponse) {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 25,\n  });\n\n  stream.pipe(res);\n}\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/SpellcraftAI/openai-streams/blob/master/example/src/pages/api/hello.ts).</sub>\n<sub>\n\n#### Use with ChatGPT API\n\nBy default, with `mode = \"tokens\"`, you will receive just the message deltas.\nFor full events, use `mode = \"raw\"`.\n\nSee: https://platform.openai.com/docs/guides/chat/introduction\n\n```ts\nconst stream = await OpenAI(\"chat\", {\n  model: \"gpt-3.5-turbo\",\n  messages: [\n    {\n      role: \"system\",\n      content: \"You are a helpful assistant that translates English to French.\",\n    },\n    {\n      role: \"user\",\n      content: 'Translate the following English text to French: \"Hello world!\"',\n    },\n  ],\n});\n```\n\nIn `tokens` mode, you will just receive the response chunks, which look like this\n(separated with newlines for illustration):\n\n```\nHello\n!\n How\n can\n I\n assist\n you\n today\n?\n```\n\nUse `mode = \"raw\"` for access to raw events.\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n(const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.\n","readmeFilename":"README.md","gitHead":"0dc851d6ee3db54fcf438f9fe10ea468e1694eee","_id":"openai-streams@5.18.1-0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-DUX+4t22nk3NqcatSVh1YscWLsEpv5XRdTHPiSeAOIU8EbTb279DWSd61BXs/rri35OVWq+/2neLlAoFC/ZZEA==","shasum":"4a36c8489ed807a169abe1afdad33a54561f3319","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.18.1-0.tgz","fileCount":33,"unpackedSize":114731,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDfxIv1h2PpcWSN0QMHCj0OISnw7Rbloc6RhnVW9weEuwIhAKSwIfBTp/CDiWK0euSJtgHYdyrnrr8YN36cPMLPYIoT"}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.18.1-0_1687041489894_0.8157759070075483"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.19.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.19.0","license":"MIT","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":{"import":"./node.js","require":"./node.cjs"},".":{"import":"./dist/index.js","require":"./dist/index.cjs"},"./*":{"import":"./dist/*/index.js","require":"./dist/*/index.cjs"}},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -b -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","node-fetch":"^3.3.1","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"gitHead":"428b57db15182fc06ac4e40af37a4ff6e499418b","_id":"openai-streams@5.19.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-YkySqe5WPcFTHZlMKHPalkzMVvp6ZyWTcvTJyxLlm8e6TT7IZUxjW5Bn2jb54EHTsVZHn+VlhKuxoMAqWTdRLg==","shasum":"e3133eebe4593bac1c4fe7e65a9364ed7c5fec5d","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.19.0.tgz","fileCount":33,"unpackedSize":20801,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCi9tKNlkLflxNRcL1lfeMNuFgx8o6hGBob7MWryG+hQwIgf3Fgk3ES59g345ZFCZcXQqaAb2WFsqRInQvUYbus47M="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.19.0_1687105153508_0.16722066692334958"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.19.1-0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.19.1-0","license":"MIT","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":{"import":"./node.js","require":"./node.cjs"},".":{"import":"./dist/index.js","require":"./dist/index.cjs"},"./*":{"import":"./dist/*/index.js","require":"./dist/*/index.cjs"}},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -b -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","node-fetch":"^3.3.1","openai":"^3.2.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"readme":"# OpenAI Streams\n\n[**GitHub**](https://github.com/SpellcraftAI/openai-streams) |\n[**NPM**](https://npmjs.com/package/openai-streams) |\n[**Docs**](https://openai-streams.vercel.app)\n\n> Now with ChatGPT API support! See [**Use with ChatGPT\n> API**](#use-with-chatgpt-api). (Whisper coming soon!)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\n- Prioritizes streams, so you can display a completion as it arrives.\n- Auto-loads `OPENAI_API_KEY` from `process.env`.\n- One single function with inferred parameter type based on the endpoint you\n  provide.\n\nUses `ReadableStream` by default for browser, Edge Runtime, and Node 18+, with\na `NodeJS.Readable` version available at `openai-streams/node`.\n\n### Installation\n\n```bash\nyarn add openai-streams\n# -or-\nnpm i --save openai-streams\n```\n\n### Usage\n\n```ts\nawait OpenAI(\n  /** 'completions', 'chat', etc. */\n  ENDPOINT,\n  /** max_tokens, temperature, messages, etc. */\n  PARAMS,\n  /** apiBase, apiKey, mode, controller, etc */\n  OPTIONS\n);\n```\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\",\n     {\n       /* endpoint params */\n     },\n     { apiKey: process.env.MY_SECRET_API_KEY }\n   );\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params, options?)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n   Example with `raw` streaming mode:\n\n   ```ts\n   await OpenAI(\n     \"chat\",\n     {\n       messages: [\n         /* ... */\n       ],\n     },\n     { mode: \"raw\" }\n   );\n   ```\n\n#### Edge/Browser: Consuming streams in Next.js Edge functions\n\nThis will also work in the browser, but you'll need users to paste their OpenAI\nkey and pass it in via the `{ apiKey }` option.\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 100,\n  });\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\",\n};\n```\n\n#### Node: Consuming streams in Next.js API Route (Node)\n\nIf you cannot use an Edge runtime or want to consume Node.js streams for another\nreason, use `openai-streams/node`:\n\n```ts\nimport type { NextApiRequest, NextApiResponse } from \"next\";\nimport { OpenAI } from \"openai-streams/node\";\n\nexport default async function test(_: NextApiRequest, res: NextApiResponse) {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 25,\n  });\n\n  stream.pipe(res);\n}\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/SpellcraftAI/openai-streams/blob/master/example/src/pages/api/hello.ts).</sub>\n<sub>\n\n#### Use with ChatGPT API\n\nBy default, with `mode = \"tokens\"`, you will receive just the message deltas.\nFor full events, use `mode = \"raw\"`.\n\nSee: https://platform.openai.com/docs/guides/chat/introduction\n\n```ts\nconst stream = await OpenAI(\"chat\", {\n  model: \"gpt-3.5-turbo\",\n  messages: [\n    {\n      role: \"system\",\n      content: \"You are a helpful assistant that translates English to French.\",\n    },\n    {\n      role: \"user\",\n      content: 'Translate the following English text to French: \"Hello world!\"',\n    },\n  ],\n});\n```\n\nIn `tokens` mode, you will just receive the response chunks, which look like this\n(separated with newlines for illustration):\n\n```\nHello\n!\n How\n can\n I\n assist\n you\n today\n?\n```\n\nUse `mode = \"raw\"` for access to raw events.\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n(const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.\n","readmeFilename":"README.md","gitHead":"55a192a5a0e37958e13a44fbec7a4c2038367e23","_id":"openai-streams@5.19.1-0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-mHryYwmSVs1EMv/dW0fWlfv52eE/7oLifhJjNEropkPmVHiALS2CF4bhmypMWwZ4YSTKDlz1ObQypLUteYVGOA==","shasum":"7ffd202bfc7f9e866055a341ee7dfc323df252d9","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.19.1-0.tgz","fileCount":33,"unpackedSize":114700,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICS5t8e7uFBeo/l0MewYGFTLLCN6xN3OYUY3EdXPJeWyAiB4ln+t8jfR9fECRQLud6JHQicXqHiZskl9Si7Plznjuw=="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.19.1-0_1687105179701_0.056528123952795495"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.20.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.20.0","license":"MIT","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":{"import":"./node.js","require":"./node.cjs"},".":{"import":"./dist/index.js","require":"./dist/index.cjs"},"./*":{"import":"./dist/*/index.js","require":"./dist/*/index.cjs"}},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -b -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","openai":"^3.3.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","node-fetch":"^3.3.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"gitHead":"f26f66c836b281bd99ee695e3c719a19bfaf0fa8","_id":"openai-streams@5.20.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-XUlVLU8si07V5jAEm8ibS9ACKl/gbtT6cwoMjswYwPFyzl+S1rslIdPJqgrhMet7CDr5GfbKt0TIOIqUMHUtSg==","shasum":"4debb983f327cd476714b0acf2e23baf9b5b06e3","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.20.0.tgz","fileCount":33,"unpackedSize":20943,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBUNiJFeSFFucPTIS/RqBWdJo+zP+m7fTo7j0+bkkwcAIgd5iexu0lFbdmAtlq9snTaIc+Ox/fGpc+XbVZJYzaFrs="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.20.0_1687263775219_0.9957490660553945"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.20.1-0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.20.1-0","license":"MIT","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":{"import":"./node.js","require":"./node.cjs"},".":{"import":"./dist/index.js","require":"./dist/index.cjs"},"./*":{"import":"./dist/*/index.js","require":"./dist/*/index.cjs"}},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -b -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","openai":"^3.3.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","node-fetch":"^3.3.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"readme":"# OpenAI Streams\n\n[**GitHub**](https://github.com/SpellcraftAI/openai-streams) |\n[**NPM**](https://npmjs.com/package/openai-streams) |\n[**Docs**](https://openai-streams.vercel.app)\n\n> Now with ChatGPT API support! See [**Use with ChatGPT\n> API**](#use-with-chatgpt-api). (Whisper coming soon!)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\n- Prioritizes streams, so you can display a completion as it arrives.\n- Auto-loads `OPENAI_API_KEY` from `process.env`.\n- One single function with inferred parameter type based on the endpoint you\n  provide.\n\nUses `ReadableStream` by default for browser, Edge Runtime, and Node 18+, with\na `NodeJS.Readable` version available at `openai-streams/node`.\n\n### Installation\n\n```bash\nyarn add openai-streams\n# -or-\nnpm i --save openai-streams\n```\n\n### Usage\n\n```ts\nawait OpenAI(\n  /** 'completions', 'chat', etc. */\n  ENDPOINT,\n  /** max_tokens, temperature, messages, etc. */\n  PARAMS,\n  /** apiBase, apiKey, mode, controller, etc */\n  OPTIONS\n);\n```\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\",\n     {\n       /* endpoint params */\n     },\n     { apiKey: process.env.MY_SECRET_API_KEY }\n   );\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params, options?)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n   Example with `raw` streaming mode:\n\n   ```ts\n   await OpenAI(\n     \"chat\",\n     {\n       messages: [\n         /* ... */\n       ],\n     },\n     { mode: \"raw\" }\n   );\n   ```\n\n#### Edge/Browser: Consuming streams in Next.js Edge functions\n\nThis will also work in the browser, but you'll need users to paste their OpenAI\nkey and pass it in via the `{ apiKey }` option.\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 100,\n  });\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\",\n};\n```\n\n#### Node: Consuming streams in Next.js API Route (Node)\n\nIf you cannot use an Edge runtime or want to consume Node.js streams for another\nreason, use `openai-streams/node`:\n\n```ts\nimport type { NextApiRequest, NextApiResponse } from \"next\";\nimport { OpenAI } from \"openai-streams/node\";\n\nexport default async function test(_: NextApiRequest, res: NextApiResponse) {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 25,\n  });\n\n  stream.pipe(res);\n}\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/SpellcraftAI/openai-streams/blob/master/example/src/pages/api/hello.ts).</sub>\n<sub>\n\n#### Use with ChatGPT API\n\nBy default, with `mode = \"tokens\"`, you will receive just the message deltas.\nFor full events, use `mode = \"raw\"`.\n\nSee: https://platform.openai.com/docs/guides/chat/introduction\n\n```ts\nconst stream = await OpenAI(\"chat\", {\n  model: \"gpt-3.5-turbo\",\n  messages: [\n    {\n      role: \"system\",\n      content: \"You are a helpful assistant that translates English to French.\",\n    },\n    {\n      role: \"user\",\n      content: 'Translate the following English text to French: \"Hello world!\"',\n    },\n  ],\n});\n```\n\nIn `tokens` mode, you will just receive the response chunks, which look like this\n(separated with newlines for illustration):\n\n```\nHello\n!\n How\n can\n I\n assist\n you\n today\n?\n```\n\nUse `mode = \"raw\"` for access to raw events.\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n(const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.\n","readmeFilename":"README.md","gitHead":"1e9c3998cf615e85f722dc07884569b545d05e40","_id":"openai-streams@5.20.1-0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-ueJYsUUV8q3BsKqXKoQ6isvTxXXpXRtuL4bRGmX4oEoDITGguvHYa45czYUTJXB5I6nAiFcqvh2FhJZgltadNw==","shasum":"3318a68daef0bc0ec604b5baa6479955bb215d35","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.20.1-0.tgz","fileCount":33,"unpackedSize":114842,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAVfRO6uH0q1bi91FwO31cGvrp3FP/th73iDW8GqAi2pAiEAwps9qArSxRq6Bx3O1DIjHw+7P6+K4BNtsuBNxAMdhmo="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.20.1-0_1687263807363_0.8046966014902099"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.21.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.21.0","license":"MIT","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":{"import":"./node.js","require":"./node.cjs"},".":{"import":"./dist/index.js","require":"./dist/index.cjs"},"./*":{"import":"./dist/*/index.js","require":"./dist/*/index.cjs"}},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -b -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","openai":"^3.3.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","node-fetch":"^3.3.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"gitHead":"fefa76898741e61af7df33477643db7cd4d336f1","_id":"openai-streams@5.21.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-FXdbjLvSGx3+2zo8dywMqn0n6Q5K9+Ye96Siy9ANBVdcz4cSvShdeotFbrymfog/EH/lr3bkSSkqQElgRB3ccA==","shasum":"2856897144184fa56525c33394922e343b68fb25","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.21.0.tgz","fileCount":33,"unpackedSize":20963,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDM2kMV0YPVPwvJMwa958KHLDFwFYJ9xdK1eeUSBTlgMwIhAIXXkxMfJ2QQNS+B4aRwIMBsBSfqLWP9a9mP9xTL30oW"}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.21.0_1687470020113_0.8213971957608888"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.21.1-0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.21.1-0","license":"MIT","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":{"import":"./node.js","require":"./node.cjs"},".":{"import":"./dist/index.js","require":"./dist/index.cjs"},"./*":{"import":"./dist/*/index.js","require":"./dist/*/index.cjs"}},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -b -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","openai":"^3.3.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","node-fetch":"^3.3.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"readme":"# OpenAI Streams\n\n[**GitHub**](https://github.com/SpellcraftAI/openai-streams) |\n[**NPM**](https://npmjs.com/package/openai-streams) |\n[**Docs**](https://openai-streams.vercel.app)\n\n> Now with ChatGPT API support! See [**Use with ChatGPT\n> API**](#use-with-chatgpt-api). (Whisper coming soon!)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\n- Prioritizes streams, so you can display a completion as it arrives.\n- Auto-loads `OPENAI_API_KEY` from `process.env`.\n- One single function with inferred parameter type based on the endpoint you\n  provide.\n\nUses `ReadableStream` by default for browser, Edge Runtime, and Node 18+, with\na `NodeJS.Readable` version available at `openai-streams/node`.\n\n### Installation\n\n```bash\nyarn add openai-streams\n# -or-\nnpm i --save openai-streams\n```\n\n### Usage\n\n```ts\nawait OpenAI(\n  /** 'completions', 'chat', etc. */\n  ENDPOINT,\n  /** max_tokens, temperature, messages, etc. */\n  PARAMS,\n  /** apiBase, apiKey, mode, controller, etc */\n  OPTIONS\n);\n```\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\",\n     {\n       /* endpoint params */\n     },\n     { apiKey: process.env.MY_SECRET_API_KEY }\n   );\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params, options?)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n   Example with `raw` streaming mode:\n\n   ```ts\n   await OpenAI(\n     \"chat\",\n     {\n       messages: [\n         /* ... */\n       ],\n     },\n     { mode: \"raw\" }\n   );\n   ```\n\n#### Edge/Browser: Consuming streams in Next.js Edge functions\n\nThis will also work in the browser, but you'll need users to paste their OpenAI\nkey and pass it in via the `{ apiKey }` option.\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 100,\n  });\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\",\n};\n```\n\n#### Node: Consuming streams in Next.js API Route (Node)\n\nIf you cannot use an Edge runtime or want to consume Node.js streams for another\nreason, use `openai-streams/node`:\n\n```ts\nimport type { NextApiRequest, NextApiResponse } from \"next\";\nimport { OpenAI } from \"openai-streams/node\";\n\nexport default async function test(_: NextApiRequest, res: NextApiResponse) {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 25,\n  });\n\n  stream.pipe(res);\n}\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/SpellcraftAI/openai-streams/blob/master/example/src/pages/api/hello.ts).</sub>\n<sub>\n\n#### Use with ChatGPT API\n\nBy default, with `mode = \"tokens\"`, you will receive just the message deltas.\nFor full events, use `mode = \"raw\"`.\n\nSee: https://platform.openai.com/docs/guides/chat/introduction\n\n```ts\nconst stream = await OpenAI(\"chat\", {\n  model: \"gpt-3.5-turbo\",\n  messages: [\n    {\n      role: \"system\",\n      content: \"You are a helpful assistant that translates English to French.\",\n    },\n    {\n      role: \"user\",\n      content: 'Translate the following English text to French: \"Hello world!\"',\n    },\n  ],\n});\n```\n\nIn `tokens` mode, you will just receive the response chunks, which look like this\n(separated with newlines for illustration):\n\n```\nHello\n!\n How\n can\n I\n assist\n you\n today\n?\n```\n\nUse `mode = \"raw\"` for access to raw events.\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n(const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.\n","readmeFilename":"README.md","gitHead":"74271da70cccf9d00f654a83ae4b0e952f87527e","_id":"openai-streams@5.21.1-0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-KZCDwZHeYHcZKy38Za1mZrar+MgNCJq7Ho1pIzt9EbwUlJ7D+B0pGRpeexmQUQIykKVPMSp6OafaIZukU4lCBQ==","shasum":"c7fb3be3bc0dd42dbf532a9209f1c2ad320a1b4f","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.21.1-0.tgz","fileCount":33,"unpackedSize":115948,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDW5wPrRjWGzLJTxVu7JaS4HGk/NSQRmUTmomIo/W8qUgIgcBlKE0o0YcJvJTYSm9fY/R3hZQlDoiawz/Hq1IvozlY="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.21.1-0_1687470037859_0.4095354960219806"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.22.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.22.0","license":"MIT","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":{"import":"./node.js","require":"./node.cjs"},".":{"import":"./dist/index.js","require":"./dist/index.cjs"},"./*":{"import":"./dist/*/index.js","require":"./dist/*/index.cjs"}},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -b -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","openai":"^3.3.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","node-fetch":"^3.3.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"gitHead":"b4e9d8fda4891c95a882fa0af6f1ac81db7cca95","_id":"openai-streams@5.22.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-duTvwH6TC20iS9tp8v2MwsyX0yY8ucoySceX1fEGSOdJAvDYvPSb9VJbpcdo7qlp0DjOIGuc3UciIdaoqnj8Eg==","shasum":"7a37c5afbac6a44e1e97af54eafae1b48514bdb8","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.22.0.tgz","fileCount":33,"unpackedSize":20955,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEAlt3Mfof5eQh1khKW78eDt0KlJjJkICE4ATeZEG5dZAiEA90D+gujg00BvvjhulmnKzzpV72I9vi3cH+pdjnimBZE="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.22.0_1687470326481_0.5136506380665078"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.22.1-0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.22.1-0","license":"MIT","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":{"import":"./node.js","require":"./node.cjs"},".":{"import":"./dist/index.js","require":"./dist/index.cjs"},"./*":{"import":"./dist/*/index.js","require":"./dist/*/index.cjs"}},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -b -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","openai":"^3.3.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","node-fetch":"^3.3.1","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"readme":"# OpenAI Streams\n\n[**GitHub**](https://github.com/SpellcraftAI/openai-streams) |\n[**NPM**](https://npmjs.com/package/openai-streams) |\n[**Docs**](https://openai-streams.vercel.app)\n\n> Now with ChatGPT API support! See [**Use with ChatGPT\n> API**](#use-with-chatgpt-api). (Whisper coming soon!)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\n- Prioritizes streams, so you can display a completion as it arrives.\n- Auto-loads `OPENAI_API_KEY` from `process.env`.\n- One single function with inferred parameter type based on the endpoint you\n  provide.\n\nUses `ReadableStream` by default for browser, Edge Runtime, and Node 18+, with\na `NodeJS.Readable` version available at `openai-streams/node`.\n\n### Installation\n\n```bash\nyarn add openai-streams\n# -or-\nnpm i --save openai-streams\n```\n\n### Usage\n\n```ts\nawait OpenAI(\n  /** 'completions', 'chat', etc. */\n  ENDPOINT,\n  /** max_tokens, temperature, messages, etc. */\n  PARAMS,\n  /** apiBase, apiKey, mode, controller, etc */\n  OPTIONS\n);\n```\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\",\n     {\n       /* endpoint params */\n     },\n     { apiKey: process.env.MY_SECRET_API_KEY }\n   );\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params, options?)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n   Example with `raw` streaming mode:\n\n   ```ts\n   await OpenAI(\n     \"chat\",\n     {\n       messages: [\n         /* ... */\n       ],\n     },\n     { mode: \"raw\" }\n   );\n   ```\n\n#### Edge/Browser: Consuming streams in Next.js Edge functions\n\nThis will also work in the browser, but you'll need users to paste their OpenAI\nkey and pass it in via the `{ apiKey }` option.\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 100,\n  });\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\",\n};\n```\n\n#### Node: Consuming streams in Next.js API Route (Node)\n\nIf you cannot use an Edge runtime or want to consume Node.js streams for another\nreason, use `openai-streams/node`:\n\n```ts\nimport type { NextApiRequest, NextApiResponse } from \"next\";\nimport { OpenAI } from \"openai-streams/node\";\n\nexport default async function test(_: NextApiRequest, res: NextApiResponse) {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 25,\n  });\n\n  stream.pipe(res);\n}\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/SpellcraftAI/openai-streams/blob/master/example/src/pages/api/hello.ts).</sub>\n<sub>\n\n#### Use with ChatGPT API\n\nBy default, with `mode = \"tokens\"`, you will receive just the message deltas.\nFor full events, use `mode = \"raw\"`.\n\nSee: https://platform.openai.com/docs/guides/chat/introduction\n\n```ts\nconst stream = await OpenAI(\"chat\", {\n  model: \"gpt-3.5-turbo\",\n  messages: [\n    {\n      role: \"system\",\n      content: \"You are a helpful assistant that translates English to French.\",\n    },\n    {\n      role: \"user\",\n      content: 'Translate the following English text to French: \"Hello world!\"',\n    },\n  ],\n});\n```\n\nIn `tokens` mode, you will just receive the response chunks, which look like this\n(separated with newlines for illustration):\n\n```\nHello\n!\n How\n can\n I\n assist\n you\n today\n?\n```\n\nUse `mode = \"raw\"` for access to raw events.\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n(const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.\n","readmeFilename":"README.md","gitHead":"d8fdf0462a38146e65a9c2f714b5f6a90d9a5fb4","_id":"openai-streams@5.22.1-0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-Cj+IC+c9Ou/dQR+jjB4Tjh6Jm8G/8DPyVmZ56vJbfxm7WRoPTyoc0KnQakrG/cSZVGyZ0Kx4F007Pmvt0KXkug==","shasum":"ea610d692e64164049cb4496ccb3dde0fc293938","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.22.1-0.tgz","fileCount":33,"unpackedSize":115940,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+eKluJahV9odGwwQStW7bCkd6PyVgwhS5Wg1Pq3sN9wIgaSlaEr7h8iq+D5vhwnInOS8nyt+YYsyI/kBU5i80ocI="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.22.1-0_1687470342367_0.6699266954254937"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.22.1-canary.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.22.1-canary.0","license":"MIT","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":{"import":"./node.js","require":"./node.cjs"},".":{"import":"./dist/index.js","require":"./dist/index.cjs"},"./*":{"import":"./dist/*/index.js","require":"./dist/*/index.cjs"}},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -b -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","node-fetch":"^3.3.1","openai":"^3.3.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"readme":"# OpenAI Streams\n\n[**GitHub**](https://github.com/SpellcraftAI/openai-streams) |\n[**NPM**](https://npmjs.com/package/openai-streams) |\n[**Docs**](https://openai-streams.vercel.app)\n\n> Now with ChatGPT API support! See [**Use with ChatGPT\n> API**](#use-with-chatgpt-api). (Whisper coming soon!)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\n- Prioritizes streams, so you can display a completion as it arrives.\n- Auto-loads `OPENAI_API_KEY` from `process.env`.\n- One single function with inferred parameter type based on the endpoint you\n  provide.\n\nUses `ReadableStream` by default for browser, Edge Runtime, and Node 18+, with\na `NodeJS.Readable` version available at `openai-streams/node`.\n\n### Installation\n\n```bash\nyarn add openai-streams\n# -or-\nnpm i --save openai-streams\n```\n\n### Usage\n\n```ts\nawait OpenAI(\n  /** 'completions', 'chat', etc. */\n  ENDPOINT,\n  /** max_tokens, temperature, messages, etc. */\n  PARAMS,\n  /** apiBase, apiKey, mode, controller, etc */\n  OPTIONS\n);\n```\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\",\n     {\n       /* endpoint params */\n     },\n     { apiKey: process.env.MY_SECRET_API_KEY }\n   );\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params, options?)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n   Example with `raw` streaming mode:\n\n   ```ts\n   await OpenAI(\n     \"chat\",\n     {\n       messages: [\n         /* ... */\n       ],\n     },\n     { mode: \"raw\" }\n   );\n   ```\n\n#### Edge/Browser: Consuming streams in Next.js Edge functions\n\nThis will also work in the browser, but you'll need users to paste their OpenAI\nkey and pass it in via the `{ apiKey }` option.\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 100,\n  });\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\",\n};\n```\n\n#### Node: Consuming streams in Next.js API Route (Node)\n\nIf you cannot use an Edge runtime or want to consume Node.js streams for another\nreason, use `openai-streams/node`:\n\n```ts\nimport type { NextApiRequest, NextApiResponse } from \"next\";\nimport { OpenAI } from \"openai-streams/node\";\n\nexport default async function test(_: NextApiRequest, res: NextApiResponse) {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 25,\n  });\n\n  stream.pipe(res);\n}\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/SpellcraftAI/openai-streams/blob/master/example/src/pages/api/hello.ts).</sub>\n<sub>\n\n#### Use with ChatGPT API\n\nBy default, with `mode = \"tokens\"`, you will receive just the message deltas.\nFor full events, use `mode = \"raw\"`.\n\nSee: https://platform.openai.com/docs/guides/chat/introduction\n\n```ts\nconst stream = await OpenAI(\"chat\", {\n  model: \"gpt-3.5-turbo\",\n  messages: [\n    {\n      role: \"system\",\n      content: \"You are a helpful assistant that translates English to French.\",\n    },\n    {\n      role: \"user\",\n      content: 'Translate the following English text to French: \"Hello world!\"',\n    },\n  ],\n});\n```\n\nIn `tokens` mode, you will just receive the response chunks, which look like this\n(separated with newlines for illustration):\n\n```\nHello\n!\n How\n can\n I\n assist\n you\n today\n?\n```\n\nUse `mode = \"raw\"` for access to raw events.\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n(const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.\n","readmeFilename":"README.md","gitHead":"5970b667d13d68ca80ac83e496c646e8b629d0e1","_id":"openai-streams@5.22.1-canary.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-soTA8M8q2A6yVzdYQxDaS6r53UfOoDdiZzaXVq7lnmJcdRZ9WVvb1D48uCwZTusSMDBAhO7BHFee81ht9Zf4wA==","shasum":"1bc3fb686ae24109235d08a4504572d68fbf929e","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.22.1-canary.0.tgz","fileCount":33,"unpackedSize":20982,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqlzFHaVMqPK9hf7qRwUauzLaXhlIDxA9272BhckrKgAIhAONuqQhIt7ooVPTfjbBAtMQtk1i1VGSbGaGAXzvTMRrv"}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.22.1-canary.0_1687487315357_0.9516251649889615"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.22.1-cjs.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.22.1-cjs.0","license":"MIT","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":{"import":"./node.js","require":"./node.cjs"},".":{"import":"./dist/index.js","require":"./dist/index.cjs"},"./*":{"import":"./dist/*/index.js","require":"./dist/*/index.cjs"}},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -b -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","node-fetch":"^3.3.1","openai":"^3.3.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"readme":"# OpenAI Streams\n\n[**GitHub**](https://github.com/SpellcraftAI/openai-streams) |\n[**NPM**](https://npmjs.com/package/openai-streams) |\n[**Docs**](https://openai-streams.vercel.app)\n\n> Now with ChatGPT API support! See [**Use with ChatGPT\n> API**](#use-with-chatgpt-api). (Whisper coming soon!)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\n- Prioritizes streams, so you can display a completion as it arrives.\n- Auto-loads `OPENAI_API_KEY` from `process.env`.\n- One single function with inferred parameter type based on the endpoint you\n  provide.\n\nUses `ReadableStream` by default for browser, Edge Runtime, and Node 18+, with\na `NodeJS.Readable` version available at `openai-streams/node`.\n\n### Installation\n\n```bash\nyarn add openai-streams\n# -or-\nnpm i --save openai-streams\n```\n\n### Usage\n\n```ts\nawait OpenAI(\n  /** 'completions', 'chat', etc. */\n  ENDPOINT,\n  /** max_tokens, temperature, messages, etc. */\n  PARAMS,\n  /** apiBase, apiKey, mode, controller, etc */\n  OPTIONS\n);\n```\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\",\n     {\n       /* endpoint params */\n     },\n     { apiKey: process.env.MY_SECRET_API_KEY }\n   );\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params, options?)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n   Example with `raw` streaming mode:\n\n   ```ts\n   await OpenAI(\n     \"chat\",\n     {\n       messages: [\n         /* ... */\n       ],\n     },\n     { mode: \"raw\" }\n   );\n   ```\n\n#### Edge/Browser: Consuming streams in Next.js Edge functions\n\nThis will also work in the browser, but you'll need users to paste their OpenAI\nkey and pass it in via the `{ apiKey }` option.\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 100,\n  });\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\",\n};\n```\n\n#### Node: Consuming streams in Next.js API Route (Node)\n\nIf you cannot use an Edge runtime or want to consume Node.js streams for another\nreason, use `openai-streams/node`:\n\n```ts\nimport type { NextApiRequest, NextApiResponse } from \"next\";\nimport { OpenAI } from \"openai-streams/node\";\n\nexport default async function test(_: NextApiRequest, res: NextApiResponse) {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 25,\n  });\n\n  stream.pipe(res);\n}\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/SpellcraftAI/openai-streams/blob/master/example/src/pages/api/hello.ts).</sub>\n<sub>\n\n#### Use with ChatGPT API\n\nBy default, with `mode = \"tokens\"`, you will receive just the message deltas.\nFor full events, use `mode = \"raw\"`.\n\nSee: https://platform.openai.com/docs/guides/chat/introduction\n\n```ts\nconst stream = await OpenAI(\"chat\", {\n  model: \"gpt-3.5-turbo\",\n  messages: [\n    {\n      role: \"system\",\n      content: \"You are a helpful assistant that translates English to French.\",\n    },\n    {\n      role: \"user\",\n      content: 'Translate the following English text to French: \"Hello world!\"',\n    },\n  ],\n});\n```\n\nIn `tokens` mode, you will just receive the response chunks, which look like this\n(separated with newlines for illustration):\n\n```\nHello\n!\n How\n can\n I\n assist\n you\n today\n?\n```\n\nUse `mode = \"raw\"` for access to raw events.\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n(const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.\n","readmeFilename":"README.md","gitHead":"73a9edcd68fe4b9151824a89a0adbadb54b9015f","_id":"openai-streams@5.22.1-cjs.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-TCRmgPBVZ7ntEW0VZA2RnxS1atPw3fxo4paLJbA/d1pgPCibve3YJXWZ9xIm6iA5qaJ8eXCuKuy4UJz1YN++1Q==","shasum":"6ff8707147dbc3fe0becd37907a120e78d0ddbff","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.22.1-cjs.0.tgz","fileCount":33,"unpackedSize":29112,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDA4X9DF7vmbxpjtDltzJB1ttZ8kK8KUrnM7CXuwZXd1AIgBs5QPrDy+HIbwL8HssXsZXFAAt9gu63Fpg4Xf+5vJP8="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.22.1-cjs.0_1687487336888_0.18328577505039423"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.23.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.23.0","license":"MIT","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":{"import":"./node.js","require":"./node.cjs"},".":{"import":"./dist/index.js","require":"./dist/index.cjs"},"./*":{"import":"./dist/*/index.js","require":"./dist/*/index.cjs"}},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -b -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","node-fetch":"^3.3.1","openai":"^3.3.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"gitHead":"89b00cb77813b22e113078c780382940e6224caf","_id":"openai-streams@5.23.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-g6aFDk9bZiJCdklT0mthH1qZsJx1cSCmM8wS2GAbMNyifUCRzE55F7HX5YsdE9MJZlPUvhQc8/t3TIME8vr0TA==","shasum":"69ba31b749d3bbf583b1cd28f34aa5ae0fcadd01","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.23.0.tgz","fileCount":33,"unpackedSize":20973,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQ9wB8EOaVQKSJFEbwf9GjOt+OHcfbapDEVX+nrnS4uQIhANVgWslU8/DeAmipLYLmlsJfXRAhRT+rEl8IdpQUIi4v"}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.23.0_1687487521637_0.3302252692696974"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"5.23.1-0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"5.23.1-0","license":"MIT","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":{"import":"./node.js","require":"./node.cjs"},".":{"import":"./dist/index.js","require":"./dist/index.cjs"},"./*":{"import":"./dist/*/index.js","require":"./dist/*/index.cjs"}},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -b -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","node-fetch":"^3.3.1","openai":"^3.3.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"readme":"# OpenAI Streams\n\n[**GitHub**](https://github.com/SpellcraftAI/openai-streams) |\n[**NPM**](https://npmjs.com/package/openai-streams) |\n[**Docs**](https://openai-streams.vercel.app)\n\n> Now with ChatGPT API support! See [**Use with ChatGPT\n> API**](#use-with-chatgpt-api). (Whisper coming soon!)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\n- Prioritizes streams, so you can display a completion as it arrives.\n- Auto-loads `OPENAI_API_KEY` from `process.env`.\n- One single function with inferred parameter type based on the endpoint you\n  provide.\n\nUses `ReadableStream` by default for browser, Edge Runtime, and Node 18+, with\na `NodeJS.Readable` version available at `openai-streams/node`.\n\n### Installation\n\n```bash\nyarn add openai-streams\n# -or-\nnpm i --save openai-streams\n```\n\n### Usage\n\n```ts\nawait OpenAI(\n  /** 'completions', 'chat', etc. */\n  ENDPOINT,\n  /** max_tokens, temperature, messages, etc. */\n  PARAMS,\n  /** apiBase, apiKey, mode, controller, etc */\n  OPTIONS\n);\n```\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\",\n     {\n       /* endpoint params */\n     },\n     { apiKey: process.env.MY_SECRET_API_KEY }\n   );\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params, options?)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n   Example with `raw` streaming mode:\n\n   ```ts\n   await OpenAI(\n     \"chat\",\n     {\n       messages: [\n         /* ... */\n       ],\n     },\n     { mode: \"raw\" }\n   );\n   ```\n\n#### Edge/Browser: Consuming streams in Next.js Edge functions\n\nThis will also work in the browser, but you'll need users to paste their OpenAI\nkey and pass it in via the `{ apiKey }` option.\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 100,\n  });\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\",\n};\n```\n\n#### Node: Consuming streams in Next.js API Route (Node)\n\nIf you cannot use an Edge runtime or want to consume Node.js streams for another\nreason, use `openai-streams/node`:\n\n```ts\nimport type { NextApiRequest, NextApiResponse } from \"next\";\nimport { OpenAI } from \"openai-streams/node\";\n\nexport default async function test(_: NextApiRequest, res: NextApiResponse) {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 25,\n  });\n\n  stream.pipe(res);\n}\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/SpellcraftAI/openai-streams/blob/master/example/src/pages/api/hello.ts).</sub>\n<sub>\n\n#### Use with ChatGPT API\n\nBy default, with `mode = \"tokens\"`, you will receive just the message deltas.\nFor full events, use `mode = \"raw\"`.\n\nSee: https://platform.openai.com/docs/guides/chat/introduction\n\n```ts\nconst stream = await OpenAI(\"chat\", {\n  model: \"gpt-3.5-turbo\",\n  messages: [\n    {\n      role: \"system\",\n      content: \"You are a helpful assistant that translates English to French.\",\n    },\n    {\n      role: \"user\",\n      content: 'Translate the following English text to French: \"Hello world!\"',\n    },\n  ],\n});\n```\n\nIn `tokens` mode, you will just receive the response chunks, which look like this\n(separated with newlines for illustration):\n\n```\nHello\n!\n How\n can\n I\n assist\n you\n today\n?\n```\n\nUse `mode = \"raw\"` for access to raw events.\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n(const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.\n","readmeFilename":"README.md","gitHead":"ebb084d48206ce3eb51da75378c740d703d15a54","_id":"openai-streams@5.23.1-0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-Pu7l1VW9CtQb0jR2Bn3c9uCkJFGtZWoQW7gcgn74jlPPAf1LTpopD/j4SDd59dqU73kHtSNUsRG9GWuOq/knYA==","shasum":"22264c9d09affcc0b9c867e921b0554da035637d","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-5.23.1-0.tgz","fileCount":33,"unpackedSize":29108,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGm3XHbOPMoSPdtf3wwQy0xbcQVWBVjOTXQTtdz5V5odAiBoxU9CwW2UROl0agzJfuq7MMNqRFcCDBFCla/85h//fg=="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_5.23.1-0_1687487542170_0.15492687665056826"},"_hasShrinkwrap":false,"deprecated":"types, runtime issues fixed in >=6.x"},"6.1.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"6.1.0","license":"MIT","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":{"import":"./node.js","require":"./node.cjs"},".":{"import":"./dist/index.js","require":"./dist/index.cjs"},"./*":{"import":"./dist/*/index.js","require":"./dist/*/index.cjs"}},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -b -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","node-fetch":"^3.3.1","openai":"^3.3.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"gitHead":"a60314c3519e6bb11b412fbfb435abcb046f04e3","_id":"openai-streams@6.1.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-Nljk3nXmS4YsuU3JRq+RIsd4U7F1jnQjzc8z7I+nOg2tWEZx+pcvU24e5cgtxMvwvCPTfE6oPePGl7uQKIi3Hw==","shasum":"d9fe8d8f50b90a289588b3f369bbbf3b1587be57","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-6.1.0.tgz","fileCount":33,"unpackedSize":20972,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDcbXtVwhMKUW3c6iFFHoXxYBjupqaxHnlaoU9A6t2ztQIhALDLqpPGyqWoVWZ+5hc5NFD6dqI2rThd/HXmQivvNu/p"}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_6.1.0_1687487657149_0.013221236600960085"},"_hasShrinkwrap":false},"6.1.1-0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"6.1.1-0","license":"MIT","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":{"import":"./node.js","require":"./node.cjs"},".":{"import":"./dist/index.js","require":"./dist/index.cjs"},"./*":{"import":"./dist/*/index.js","require":"./dist/*/index.cjs"}},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -b -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","node-fetch":"^3.3.1","openai":"^3.3.0","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"readme":"# OpenAI Streams\n\n[**GitHub**](https://github.com/SpellcraftAI/openai-streams) |\n[**NPM**](https://npmjs.com/package/openai-streams) |\n[**Docs**](https://openai-streams.vercel.app)\n\n> Now with ChatGPT API support! See [**Use with ChatGPT\n> API**](#use-with-chatgpt-api). (Whisper coming soon!)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\n- Prioritizes streams, so you can display a completion as it arrives.\n- Auto-loads `OPENAI_API_KEY` from `process.env`.\n- One single function with inferred parameter type based on the endpoint you\n  provide.\n\nUses `ReadableStream` by default for browser, Edge Runtime, and Node 18+, with\na `NodeJS.Readable` version available at `openai-streams/node`.\n\n### Installation\n\n```bash\nyarn add openai-streams\n# -or-\nnpm i --save openai-streams\n```\n\n### Usage\n\n```ts\nawait OpenAI(\n  /** 'completions', 'chat', etc. */\n  ENDPOINT,\n  /** max_tokens, temperature, messages, etc. */\n  PARAMS,\n  /** apiBase, apiKey, mode, controller, etc */\n  OPTIONS\n);\n```\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\",\n     {\n       /* endpoint params */\n     },\n     { apiKey: process.env.MY_SECRET_API_KEY }\n   );\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params, options?)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n   Example with `raw` streaming mode:\n\n   ```ts\n   await OpenAI(\n     \"chat\",\n     {\n       messages: [\n         /* ... */\n       ],\n     },\n     { mode: \"raw\" }\n   );\n   ```\n\n#### Edge/Browser: Consuming streams in Next.js Edge functions\n\nThis will also work in the browser, but you'll need users to paste their OpenAI\nkey and pass it in via the `{ apiKey }` option.\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 100,\n  });\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\",\n};\n```\n\n#### Node: Consuming streams in Next.js API Route (Node)\n\nIf you cannot use an Edge runtime or want to consume Node.js streams for another\nreason, use `openai-streams/node`:\n\n```ts\nimport type { NextApiRequest, NextApiResponse } from \"next\";\nimport { OpenAI } from \"openai-streams/node\";\n\nexport default async function test(_: NextApiRequest, res: NextApiResponse) {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 25,\n  });\n\n  stream.pipe(res);\n}\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/SpellcraftAI/openai-streams/blob/master/example/src/pages/api/hello.ts).</sub>\n<sub>\n\n#### Use with ChatGPT API\n\nBy default, with `mode = \"tokens\"`, you will receive just the message deltas.\nFor full events, use `mode = \"raw\"`.\n\nSee: https://platform.openai.com/docs/guides/chat/introduction\n\n```ts\nconst stream = await OpenAI(\"chat\", {\n  model: \"gpt-3.5-turbo\",\n  messages: [\n    {\n      role: \"system\",\n      content: \"You are a helpful assistant that translates English to French.\",\n    },\n    {\n      role: \"user\",\n      content: 'Translate the following English text to French: \"Hello world!\"',\n    },\n  ],\n});\n```\n\nIn `tokens` mode, you will just receive the response chunks, which look like this\n(separated with newlines for illustration):\n\n```\nHello\n!\n How\n can\n I\n assist\n you\n today\n?\n```\n\nUse `mode = \"raw\"` for access to raw events.\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n(const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.\n","readmeFilename":"README.md","gitHead":"f98e6b10c66c6ce784feb9afc5fef06c33379635","_id":"openai-streams@6.1.1-0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-Mo0DgbVG0yotJbnaiahywtnm3xEvAHe58D3puqIGyEQgWfpNm+t+bBqIuX9sRtlt+vSDn0b8mPKQdGv0BmlSgQ==","shasum":"80a110f4621b91cb9109b2ccc7873a6ced68bc56","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-6.1.1-0.tgz","fileCount":33,"unpackedSize":29107,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDmej5kGHLzycnH4QpMhLmfwJvAGsFd4eNXpcPGTxTIvAiATs1EgLx2ozaXrpTts1qdnXZ702dA9vIZKBQI1gIAv5Q=="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_6.1.1-0_1687487675866_0.7610750114502995"},"_hasShrinkwrap":false},"6.2.0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"6.2.0","license":"MIT","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":{"import":"./node.js","require":"./node.cjs"},".":{"import":"./dist/index.js","require":"./dist/index.cjs"},"./*":{"import":"./dist/*/index.js","require":"./dist/*/index.cjs"}},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -b -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","node-fetch":"^3.3.1","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","openai":"^3.3.0","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"gitHead":"fc2d642ee5199950f92bba0e583f9965afc09a5a","_id":"openai-streams@6.2.0","_nodeVersion":"18.16.1","_npmVersion":"9.5.1","dist":{"integrity":"sha512-iP4CfmkXhPoRQhnO2663mOXP0rgGC++7PuuH6lqbfyMIK+G6Qo4TtfIHsMePdHtm6OOA5yQJ/Pi6MwC9tnJepg==","shasum":"1882bb3a65db1fcbaf73c85c2ef46148ff4b7e80","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-6.2.0.tgz","fileCount":33,"unpackedSize":20972,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHmPmCurbTBXDl0Xy2R5BOziYbcW33Nc9UvfnsWRLswVAiEAix/uujXl0NncX3c1ZZkn4kYA9Ay9A1Yv5NEdCj7zvIE="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_6.2.0_1689884139036_0.6711279652114339"},"_hasShrinkwrap":false},"6.2.1-0":{"author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"},"name":"openai-streams","description":"Tools for working with OpenAI streams in Node.js and TypeScript.","homepage":"https://github.com/SpellcraftAI/openai-streams","version":"6.2.1-0","license":"MIT","platform":"node","engines":{"node":">=14"},"types":"dist/index.d.ts","exports":{"./package.json":"./package.json","./node":{"import":"./node.js","require":"./node.cjs"},".":{"import":"./dist/index.js","require":"./dist/index.cjs"},"./*":{"import":"./dist/*/index.js","require":"./dist/*/index.cjs"}},"scripts":{"dev":"tsmodule dev","export-docs":"pnpm typedoc src","export":"tsmodule build","cjs":"tsmodule build -b -f cjs","build":"pnpm export && pnpm export-docs","test":"ava","prepublishOnly":"pnpm test","lint":"eslint src --fix"},"devDependencies":{"@tsmodule/tsmodule":"^44.5.0","@types/node":"^20.2.1","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","ava":"^5.2.0","dotenv":"^16.0.3","eslint":"^8.41.0","node-fetch":"^3.3.1","typedoc":"^0.24.7","typescript":"^5.0.4"},"dependencies":{"eventsource-parser":"^1.0.0","openai":"^3.3.0","yield-stream":"^3.0.0"},"keywords":["openai","typescript","streams","gpt-3","gpt-4"],"release-it":{"git":{"commitMessage":"release: v${version}","tagAnnotation":"v${version}"},"github":{"release":true,"releaseName":"v${version}"}},"readme":"# OpenAI Streams\n\n[**GitHub**](https://github.com/SpellcraftAI/openai-streams) |\n[**NPM**](https://npmjs.com/package/openai-streams) |\n[**Docs**](https://openai-streams.vercel.app)\n\n> Now with ChatGPT API support! See [**Use with ChatGPT\n> API**](#use-with-chatgpt-api). (Whisper coming soon!)\n\nThis library returns OpenAI API responses as streams only. Non-stream endpoints\nlike `edits` etc. are simply a stream with only one chunk update.\n\n- Prioritizes streams, so you can display a completion as it arrives.\n- Auto-loads `OPENAI_API_KEY` from `process.env`.\n- One single function with inferred parameter type based on the endpoint you\n  provide.\n\nUses `ReadableStream` by default for browser, Edge Runtime, and Node 18+, with\na `NodeJS.Readable` version available at `openai-streams/node`.\n\n### Installation\n\n```bash\nyarn add openai-streams\n# -or-\nnpm i --save openai-streams\n```\n\n### Usage\n\n```ts\nawait OpenAI(\n  /** 'completions', 'chat', etc. */\n  ENDPOINT,\n  /** max_tokens, temperature, messages, etc. */\n  PARAMS,\n  /** apiBase, apiKey, mode, controller, etc */\n  OPTIONS\n);\n```\n\n1. **Set the `OPENAI_API_KEY` env variable** (or pass the `{ apiKey }` option).\n\n   The library will throw if it cannot find an API key. Your program will load\n   this at runtime from `process.env.OPENAI_API_KEY` by default, but you may\n   override this with the `{ apiKey }` option.\n\n   **IMPORTANT:** For security, you should only load this from a `process.env`\n   variable.\n\n   ```ts\n   await OpenAI(\n     \"completions\",\n     {\n       /* endpoint params */\n     },\n     { apiKey: process.env.MY_SECRET_API_KEY }\n   );\n   ```\n\n2. **Call the API via `await OpenAI(endpoint, params, options?)`.**\n\n   The `params` type will be inferred based on the `endpoint` you provide, i.e.\n   for the `\"edits\"` endpoint, `import('openai').CreateEditRequest` will be\n   enforced.\n\n   Example with `raw` streaming mode:\n\n   ```ts\n   await OpenAI(\n     \"chat\",\n     {\n       messages: [\n         /* ... */\n       ],\n     },\n     { mode: \"raw\" }\n   );\n   ```\n\n#### Edge/Browser: Consuming streams in Next.js Edge functions\n\nThis will also work in the browser, but you'll need users to paste their OpenAI\nkey and pass it in via the `{ apiKey }` option.\n\n```ts\nimport { OpenAI } from \"openai-streams\";\n\nexport default async function handler() {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 100,\n  });\n\n  return new Response(stream);\n}\n\nexport const config = {\n  runtime: \"edge\",\n};\n```\n\n#### Node: Consuming streams in Next.js API Route (Node)\n\nIf you cannot use an Edge runtime or want to consume Node.js streams for another\nreason, use `openai-streams/node`:\n\n```ts\nimport type { NextApiRequest, NextApiResponse } from \"next\";\nimport { OpenAI } from \"openai-streams/node\";\n\nexport default async function test(_: NextApiRequest, res: NextApiResponse) {\n  const stream = await OpenAI(\"completions\", {\n    model: \"text-davinci-003\",\n    prompt: \"Write a happy sentence.\\n\\n\",\n    max_tokens: 25,\n  });\n\n  stream.pipe(res);\n}\n```\n\n<sub>See the example in\n[`example/src/pages/api/hello.ts`](https://github.com/SpellcraftAI/openai-streams/blob/master/example/src/pages/api/hello.ts).</sub>\n<sub>\n\n#### Use with ChatGPT API\n\nBy default, with `mode = \"tokens\"`, you will receive just the message deltas.\nFor full events, use `mode = \"raw\"`.\n\nSee: https://platform.openai.com/docs/guides/chat/introduction\n\n```ts\nconst stream = await OpenAI(\"chat\", {\n  model: \"gpt-3.5-turbo\",\n  messages: [\n    {\n      role: \"system\",\n      content: \"You are a helpful assistant that translates English to French.\",\n    },\n    {\n      role: \"user\",\n      content: 'Translate the following English text to French: \"Hello world!\"',\n    },\n  ],\n});\n```\n\nIn `tokens` mode, you will just receive the response chunks, which look like this\n(separated with newlines for illustration):\n\n```\nHello\n!\n How\n can\n I\n assist\n you\n today\n?\n```\n\nUse `mode = \"raw\"` for access to raw events.\n\n### Notes\n\n1. Internally, streams are often manipulated using generators via `for await\n(const chunk of yieldStream(stream)) { ... }`. We recommend following this\n   pattern if you find it intuitive.\n","readmeFilename":"README.md","gitHead":"41cc9e63074edb1380d30f7c17cdf69a17abbe09","_id":"openai-streams@6.2.1-0","_nodeVersion":"18.16.1","_npmVersion":"9.5.1","dist":{"integrity":"sha512-7InwX0UUx9VU0izqkLjbvZtl4IcIHFVnEag0KA2Y0xwZl26lCjLekuvqRfTx7GZjzuMa/3gXRsS9mPfFo6Kc1w==","shasum":"832f84b6f33e8236e120c73b352d68f2b2f398fc","tarball":"https://registry.npmjs.org/openai-streams/-/openai-streams-6.2.1-0.tgz","fileCount":33,"unpackedSize":29107,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBq3r2VcUQSSU4g21mfm3tTEZomwH32+uXwKRbchwNJiAiBwoV/MGctDpO+KSquKDsJx1rbG7pXeZHUszkm9YBz/PQ=="}]},"_npmUser":{"name":"ctjlewis","email":"ctj.lewis@icloud.com"},"directories":{},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openai-streams_6.2.1-0_1689884153247_0.38143606836487853"},"_hasShrinkwrap":false}},"time":{"created":"2023-02-15T00:33:21.401Z","1.0.0":"2023-02-15T00:33:21.525Z","modified":"2023-07-20T20:15:53.615Z","1.0.1":"2023-02-15T01:25:09.020Z","1.0.2":"2023-02-15T03:16:17.771Z","1.0.3":"2023-02-15T03:36:52.337Z","1.0.4":"2023-02-15T03:39:20.564Z","1.0.5":"2023-02-15T03:44:31.137Z","1.0.6":"2023-02-16T22:51:07.216Z","1.0.7":"2023-02-16T23:05:43.494Z","1.0.8":"2023-02-17T01:22:22.297Z","1.0.9":"2023-02-17T01:23:29.294Z","1.0.10":"2023-02-17T01:34:08.155Z","1.0.11":"2023-02-19T04:39:56.430Z","1.0.12":"2023-02-19T04:40:40.795Z","1.0.14":"2023-02-19T04:43:16.557Z","1.0.15":"2023-02-19T04:55:48.523Z","1.0.16":"2023-02-19T05:12:51.464Z","1.0.17":"2023-02-19T05:41:46.652Z","1.0.18":"2023-02-19T05:57:17.103Z","1.0.19":"2023-02-19T06:02:07.359Z","1.0.20":"2023-02-20T03:23:43.616Z","1.0.21":"2023-02-20T07:04:56.240Z","1.0.22-canary.2":"2023-02-23T11:04:54.084Z","1.0.22-canary.3":"2023-02-23T11:20:37.175Z","1.0.22-canary.4":"2023-02-23T11:29:19.111Z","1.0.22-canary.6":"2023-02-23T11:33:39.550Z","1.0.22-canary.7":"2023-02-23T11:38:56.171Z","1.0.22-canary.8":"2023-02-23T11:41:12.208Z","1.0.22-canary.9":"2023-02-23T11:44:52.064Z","1.0.22-canary.10":"2023-02-23T11:47:10.394Z","1.0.22-canary.11":"2023-02-23T11:49:48.148Z","1.0.22-canary.13":"2023-02-23T11:58:16.251Z","1.0.22-canary.14":"2023-02-23T11:59:57.170Z","1.0.22-canary.16":"2023-02-23T12:08:22.387Z","2.0.0":"2023-02-23T12:11:25.571Z","2.0.1":"2023-02-23T12:18:11.563Z","2.0.2":"2023-02-23T12:20:40.626Z","2.0.3":"2023-02-23T12:23:09.887Z","2.0.4":"2023-02-23T12:25:59.570Z","3.0.0":"2023-02-25T04:48:55.926Z","3.0.1":"2023-02-25T04:49:39.752Z","3.0.2":"2023-02-25T05:43:07.493Z","3.0.3":"2023-02-25T06:03:53.739Z","3.1.0":"2023-03-01T04:43:16.258Z","3.1.2":"2023-03-01T04:52:10.102Z","4.0.0":"2023-03-01T20:20:55.429Z","4.0.1":"2023-03-02T04:44:49.425Z","4.0.2":"2023-03-02T18:00:02.934Z","4.1.0":"2023-03-03T04:41:53.481Z","4.2.0":"2023-03-30T04:05:09.955Z","4.2.1":"2023-04-04T01:05:03.574Z","4.2.2":"2023-04-05T16:47:33.302Z","5.0.0":"2023-04-06T04:19:02.136Z","5.0.1":"2023-04-12T20:46:41.828Z","5.0.2":"2023-04-12T20:49:31.422Z","5.1.0":"2023-04-13T07:34:15.906Z","5.1.1":"2023-04-21T19:40:00.052Z","5.1.2-canary.0":"2023-05-09T08:34:25.137Z","5.2.0":"2023-05-09T08:47:58.699Z","5.2.1-canary.0":"2023-05-11T00:13:10.597Z","5.3.0":"2023-05-11T00:17:52.258Z","5.4.0":"2023-05-20T03:23:05.520Z","5.4.1-canary.0":"2023-05-20T03:30:56.041Z","5.5.0":"2023-05-20T11:54:24.292Z","5.5.1-canary.0":"2023-05-24T04:32:57.254Z","5.6.0":"2023-05-24T04:42:21.609Z","5.6.1-canary.0":"2023-05-27T06:28:09.923Z","5.7.0":"2023-05-27T06:31:14.109Z","5.8.0":"2023-06-17T00:44:58.169Z","5.8.1-cjs.0":"2023-06-17T00:45:18.565Z","5.9.0":"2023-06-17T00:48:52.062Z","5.9.1-cjs.0":"2023-06-17T00:49:09.652Z","5.10.0":"2023-06-17T00:53:54.024Z","5.10.1-cjs.0":"2023-06-17T00:54:11.291Z","5.11.0":"2023-06-17T00:56:04.352Z","5.11.1-0":"2023-06-17T00:56:22.600Z","5.12.0":"2023-06-17T01:22:27.802Z","5.12.1-0":"2023-06-17T01:22:40.362Z","5.13.0":"2023-06-17T01:26:09.933Z","5.13.1-0":"2023-06-17T01:26:25.673Z","5.14.0":"2023-06-17T01:31:50.004Z","5.14.1-0":"2023-06-17T01:32:05.150Z","5.15.0":"2023-06-17T01:43:51.637Z","5.15.1-0":"2023-06-17T01:44:08.534Z","5.16.0":"2023-06-17T01:58:19.097Z","5.16.1-0":"2023-06-17T01:58:31.245Z","5.17.0":"2023-06-17T22:17:51.855Z","5.17.1-0":"2023-06-17T22:18:09.383Z","5.18.0":"2023-06-17T22:37:44.974Z","5.18.1-0":"2023-06-17T22:38:10.076Z","5.19.0":"2023-06-18T16:19:13.759Z","5.19.1-0":"2023-06-18T16:19:39.883Z","5.20.0":"2023-06-20T12:22:55.458Z","5.20.1-0":"2023-06-20T12:23:27.591Z","5.21.0":"2023-06-22T21:40:20.312Z","5.21.1-0":"2023-06-22T21:40:38.037Z","5.22.0":"2023-06-22T21:45:26.641Z","5.22.1-0":"2023-06-22T21:45:42.560Z","5.22.1-canary.0":"2023-06-23T02:28:35.640Z","5.22.1-cjs.0":"2023-06-23T02:28:57.057Z","5.23.0":"2023-06-23T02:32:01.791Z","5.23.1-0":"2023-06-23T02:32:22.364Z","6.1.0":"2023-06-23T02:34:17.347Z","6.1.1-0":"2023-06-23T02:34:36.026Z","6.2.0":"2023-07-20T20:15:39.193Z","6.2.1-0":"2023-07-20T20:15:53.438Z"},"maintainers":[{"name":"ctjlewis","email":"ctj.lewis@icloud.com"}],"description":"Tools for working with OpenAI streams in Node.js and TypeScript.","keywords":["openai","typescript","streams","gpt-3","gpt-4"],"license":"MIT","readme":"","readmeFilename":"","homepage":"https://github.com/SpellcraftAI/openai-streams","author":{"name":"Spellcraft Inc.","email":"lewis@spellcraft.org"}}