openai-streams
Advanced tools
Comparing version 6.2.0 to 6.2.1-0
@@ -1,1 +0,1 @@ | ||
const e=globalThis.process?.versions?.node?"node":"edge",o=new TextEncoder,n=new TextDecoder;export{n as DECODER,o as ENCODER,e as RUNTIME}; | ||
"use strict";var t=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var x=(o,e)=>{for(var s in e)t(o,s,{get:e[s],enumerable:!0})},p=(o,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of E(e))!d.call(o,n)&&n!==s&&t(o,n,{get:()=>e[n],enumerable:!(r=c(e,n))||r.enumerable});return o};var D=o=>p(t({},"__esModule",{value:!0}),o);var i={};x(i,{DECODER:()=>g,ENCODER:()=>R,RUNTIME:()=>T});module.exports=D(i);var T=globalThis.process?.versions?.node?"node":"edge",R=new TextEncoder,g=new TextDecoder;0&&(module.exports={DECODER,ENCODER,RUNTIME}); |
@@ -1,1 +0,1 @@ | ||
export*from"./lib/index.js"; | ||
"use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var p=(r,o,f,x)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of c(o))!d.call(r,e)&&e!==f&&a(r,e,{get:()=>o[e],enumerable:!(x=b(o,e))||x.enumerable});return r},t=(r,o,f)=>(p(r,o,"default"),f&&p(f,o,"default"));var g=r=>p(a({},"__esModule",{value:!0}),r);var m={};module.exports=g(m);t(m,require("./lib"),module.exports);0&&(module.exports={...require("./lib")}); |
@@ -1,1 +0,1 @@ | ||
const c=async(s,a,r=globalThis.fetch,{delay:t,maxRetries:n}={delay:500,maxRetries:7})=>{if(!r)throw new Error("No fetch implementation found.");for(let o=0;o<=n;o++)try{const e=await r(s,a);if(!e.ok&&(await e.json()).type==="RATE_LIMIT_REACHED")throw new Error("RATE_LIMIT_REACHED");return e}catch(e){if(e.message==="RATE_LIMIT_REACHED"&&o<n)console.log("Rate limit reached. Retrying in "+t+"ms"),await new Promise(i=>setTimeout(i,t)),t*=2;else throw e}throw new Error("Max retries reached.")};export{c as fetchWithBackoff}; | ||
"use strict";var a=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var R=Object.prototype.hasOwnProperty;var m=(t,e)=>{for(var r in e)a(t,r,{get:e[r],enumerable:!0})},p=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of h(e))!R.call(t,o)&&o!==r&&a(t,o,{get:()=>e[o],enumerable:!(n=f(e,o))||n.enumerable});return t};var I=t=>p(a({},"__esModule",{value:!0}),t);var E={};m(E,{fetchWithBackoff:()=>u});module.exports=I(E);var u=async(t,e,r=globalThis.fetch,{delay:n,maxRetries:o}={delay:500,maxRetries:7})=>{if(!r)throw new Error("No fetch implementation found.");for(let s=0;s<=o;s++)try{let i=await r(t,e);if(!i.ok&&(await i.json()).type==="RATE_LIMIT_REACHED")throw new Error("RATE_LIMIT_REACHED");return i}catch(i){if(i.message==="RATE_LIMIT_REACHED"&&s<o)console.log("Rate limit reached. Retrying in "+n+"ms"),await new Promise(c=>setTimeout(c,n)),n*=2;else throw i}throw new Error("Max retries reached.")};0&&(module.exports={fetchWithBackoff}); |
@@ -1,1 +0,1 @@ | ||
const t={NO_API_KEY:"No API key provided. Please set the OPENAI_API_KEY environment variable or pass the { apiKey } option.",MAX_TOKENS:"Maximum number of tokens reached.",UNKNOWN:"An unknown error occurred.",INVALID_API_KEY:"Incorrect API key provided. You can find your API key at https://platform.openai.com/account/api-keys.",INVALID_MODEL:"The model does not exist",RATE_LIMIT_REACHED:"You are sending requests too quickly. Pace your requests. Read the Rate limit guide.",EXCEEDED_QUOTA:"You have hit your maximum monthly spend (hard limit) which you can view in the account billing section. Apply for a quota increase.",ENGINE_OVERLOAD:"Our servers are experiencing high traffic. Please retry your requests after a brief wait.",SERVER_ERROR:"Issue on our servers. Retry your request after a brief wait and contact us if the issue persists. Check the status page."};class o extends Error{type;message;constructor(e){const r=t[e];super(r),this.message=r,this.type=e}toJSON(){return{type:this.type,message:this.message}}}export{o as OpenAIError,t as OpenAIErrors}; | ||
"use strict";var o=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var y=(r,e)=>{for(var t in e)o(r,t,{get:e[t],enumerable:!0})},E=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of u(e))!c.call(r,s)&&s!==t&&o(r,s,{get:()=>e[s],enumerable:!(n=p(e,s))||n.enumerable});return r};var A=r=>E(o({},"__esModule",{value:!0}),r);var I={};y(I,{OpenAIError:()=>a,OpenAIErrors:()=>i});module.exports=A(I);var i={NO_API_KEY:"No API key provided. Please set the OPENAI_API_KEY environment variable or pass the { apiKey } option.",MAX_TOKENS:"Maximum number of tokens reached.",UNKNOWN:"An unknown error occurred.",INVALID_API_KEY:"Incorrect API key provided. You can find your API key at https://platform.openai.com/account/api-keys.",INVALID_MODEL:"The model does not exist",RATE_LIMIT_REACHED:"You are sending requests too quickly. Pace your requests. Read the Rate limit guide.",EXCEEDED_QUOTA:"You have hit your maximum monthly spend (hard limit) which you can view in the account billing section. Apply for a quota increase.",ENGINE_OVERLOAD:"Our servers are experiencing high traffic. Please retry your requests after a brief wait.",SERVER_ERROR:"Issue on our servers. Retry your request after a brief wait and contact us if the issue persists. Check the status page."},a=class extends Error{type;message;constructor(e){let t=i[e];super(t),this.message=t,this.type=e}toJSON(){return{type:this.type,message:this.message}}};0&&(module.exports={OpenAIError,OpenAIErrors}); |
@@ -1,1 +0,1 @@ | ||
export*from"./openai/index.js";export*from"./types.js";export*from"./streaming/index.js";export*from"./errors.js"; | ||
"use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var t=(f,e,p,x)=>{if(e&&typeof e=="object"||typeof e=="function")for(let m of c(e))!d.call(f,m)&&m!==p&&a(f,m,{get:()=>e[m],enumerable:!(x=b(e,m))||x.enumerable});return f},r=(f,e,p)=>(t(f,e,"default"),p&&t(p,e,"default"));var g=f=>t(a({},"__esModule",{value:!0}),f);var o={};module.exports=g(o);r(o,require("./openai"),module.exports);r(o,require("./types"),module.exports);r(o,require("./streaming"),module.exports);r(o,require("./errors"),module.exports);0&&(module.exports={...require("./openai"),...require("./types"),...require("./streaming"),...require("./errors")}); |
@@ -1,1 +0,1 @@ | ||
import{streamArray as c}from"yield-stream";import{OpenAIAPIEndpoints as u}from"../types.js";import{ENCODER as m}from"../../globs/shared.js";import{OpenAIError as e}from"../errors.js";import{fetchWithBackoff as R}from"../backoff.js";import{ChatStream as g,EventStream as y,getTokensFromResponse as S,TokenStream as _}from"../streaming/index.js";const v=async(n,h,{mode:r="tokens",apiBase:f="https://api.openai.com/v1",apiKey:i=process.env.OPENAI_API_KEY,apiHeaders:d={},controller:l,onDone:A,onParse:E,fetch:I}={})=>{if(!i)throw new e("NO_API_KEY");const p=n==="completions"||n==="chat",N=u[n],t=await R(`${f}/${N}`,{method:"POST",body:JSON.stringify({...h,stream:p?!0:void 0}),headers:{Authorization:`Bearer ${i}`,"Content-Type":"application/json",Accept:"application/json",...d},signal:l?.signal},I);switch(t.status){case 401:throw new e("INVALID_API_KEY");case 404:throw new e("INVALID_MODEL");case 429:throw new e("RATE_LIMIT_REACHED");case 500:throw new e("SERVER_ERROR");default:if(!t.body)throw new e("UNKNOWN")}let o;const s={mode:r,onDone:A,onParse:E};if(p)switch(r){case"raw":o=y(t.body,s);break;case"tokens":switch(n){case"chat":o=g(t.body,s);break;default:o=_(t.body,s);break}break;default:throw console.error(`Unknown mode: ${r} for streaming response.`),new e("UNKNOWN")}else{const a=await t.text();switch(r){case"tokens":const O=JSON.parse(a),w=S(O);if(typeof w!="string"){console.error("No text choices received from OpenAI: "+a),o=c([]);break}const k=m.encode(w);o=c([k]);break;case"raw":const b=m.encode(a);o=c([b]);break;default:throw console.error(`Unknown mode: ${r} for non-streaming response.`),new e("UNKNOWN")}}return o};export{v as OpenAI}; | ||
"use strict";var d=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var P=(e,o)=>{for(var t in o)d(e,t,{get:o[t],enumerable:!0})},T=(e,o,t,c)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of x(o))!C.call(e,n)&&n!==t&&d(e,n,{get:()=>o[n],enumerable:!(c=_(o,n))||c.enumerable});return e};var U=e=>T(d({},"__esModule",{value:!0}),e);var K={};P(K,{OpenAI:()=>D});module.exports=U(K);var h=e=>function*(){for(let o of e)yield o};var v=(e,o)=>new ReadableStream({async start(t){for await(let c of e(o))t.enqueue(c);t.close()}});var f=e=>v(h(e));var y=require("../types"),w=require("../../globs/shared"),r=require("../errors"),A=require("../backoff"),a=require("../streaming"),D=async(e,o,{mode:t="tokens",apiBase:c="https://api.openai.com/v1",apiKey:n=process.env.OPENAI_API_KEY,apiHeaders:E={},controller:b,onDone:k,onParse:I,fetch:N}={})=>{if(!n)throw new r.OpenAIError("NO_API_KEY");let l=e==="completions"||e==="chat",O=y.OpenAIAPIEndpoints[e],i=await(0,A.fetchWithBackoff)(`${c}/${O}`,{method:"POST",body:JSON.stringify({...o,stream:l?!0:void 0}),headers:{Authorization:`Bearer ${n}`,"Content-Type":"application/json",Accept:"application/json",...E},signal:b?.signal},N);switch(i.status){case 401:throw new r.OpenAIError("INVALID_API_KEY");case 404:throw new r.OpenAIError("INVALID_MODEL");case 429:throw new r.OpenAIError("RATE_LIMIT_REACHED");case 500:throw new r.OpenAIError("SERVER_ERROR");default:if(!i.body)throw new r.OpenAIError("UNKNOWN")}let s,p={mode:t,onDone:k,onParse:I};if(l)switch(t){case"raw":s=(0,a.EventStream)(i.body,p);break;case"tokens":switch(e){case"chat":s=(0,a.ChatStream)(i.body,p);break;default:s=(0,a.TokenStream)(i.body,p);break}break;default:throw console.error(`Unknown mode: ${t} for streaming response.`),new r.OpenAIError("UNKNOWN")}else{let m=await i.text();switch(t){case"tokens":let g=JSON.parse(m),u=(0,a.getTokensFromResponse)(g);if(typeof u!="string"){console.error("No text choices received from OpenAI: "+m),s=f([]);break}let R=w.ENCODER.encode(u);s=f([R]);break;case"raw":let S=w.ENCODER.encode(m);s=f([S]);break;default:throw console.error(`Unknown mode: ${t} for non-streaming response.`),new r.OpenAIError("UNKNOWN")}}return s};0&&(module.exports={OpenAI}); |
@@ -1,1 +0,1 @@ | ||
export*from"./edge.js"; | ||
"use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var p=(r,o,f,x)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of c(o))!d.call(r,e)&&e!==f&&a(r,e,{get:()=>o[e],enumerable:!(x=b(o,e))||x.enumerable});return r},t=(r,o,f)=>(p(r,o,"default"),f&&p(f,o,"default"));var g=r=>p(a({},"__esModule",{value:!0}),r);var m={};module.exports=g(m);t(m,require("./edge"),module.exports);0&&(module.exports={...require("./edge")}); |
@@ -1,1 +0,1 @@ | ||
import{Readable as n}from"stream";import{yieldStream as m}from"yield-stream";import{OpenAI as a}from"./edge.js";const I=async(e,o,r)=>{const t=await a(e,o,r);return n.from(m(t))};export{I as OpenAI}; | ||
"use strict";var n=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var d=(o,e)=>{for(var r in e)n(o,r,{get:e[r],enumerable:!0})},y=(o,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of m(e))!p.call(o,t)&&t!==r&&n(o,t,{get:()=>e[t],enumerable:!(a=i(e,t))||a.enumerable});return o};var l=o=>y(n({},"__esModule",{value:!0}),o);var A={};d(A,{OpenAI:()=>u});module.exports=l(A);var f=require("stream");var s=async function*(o,e){let r=o.getReader();for(;!e?.signal.aborted;){let{done:a,value:t}=await r.read();if(a)break;yield t}};var c=require("./edge"),u=async(o,e,r)=>{let a=await(0,c.OpenAI)(o,e,r);return f.Readable.from(s(a))};0&&(module.exports={OpenAI}); |
@@ -1,1 +0,1 @@ | ||
export*from"./streams.js";export*from"./transforms.js"; | ||
"use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var t=(f,o,p,x)=>{if(o&&typeof o=="object"||typeof o=="function")for(let m of c(o))!d.call(f,m)&&m!==p&&a(f,m,{get:()=>o[m],enumerable:!(x=b(o,m))||x.enumerable});return f},e=(f,o,p)=>(t(f,o,"default"),p&&t(p,o,"default"));var g=f=>t(a({},"__esModule",{value:!0}),f);var r={};module.exports=g(r);e(r,require("./streams"),module.exports);e(r,require("./transforms"),module.exports);0&&(module.exports={...require("./streams"),...require("./transforms")}); |
@@ -1,1 +0,5 @@ | ||
import{ENCODER as d,DECODER as i}from"../../globs/shared.js";import{ChatParser as O,TokenParser as h}from"./transforms.js";import{createParser as A}from"eventsource-parser";import{pipeline as m,yieldStream as u}from"yield-stream";import{yieldStream as k}from"yield-stream/node";import{OpenAIError as I}from"../errors.js";const c=(e,{mode:o="tokens",onDone:s})=>new ReadableStream({async start(r){const S=A(async n=>{if(n.type==="event"){const{data:a}=n;if(a==="[DONE]"){r.desiredSize===null||r.close(),await s?.();return}try{const t=JSON.parse(a);if(r.enqueue(d.encode(a)),o==="tokens"&&t?.choices){const{choices:l}=t;for(const y of l)if(y?.finish_reason==="length")throw new I("MAX_TOKENS")}}catch(t){r.error(t)}}}),f=typeof e.pipe=="function";for await(const n of f?k(e):u(e)){const a=i.decode(n);try{const t=JSON.parse(a);t.hasOwnProperty("error")&&r.error(new Error(t.error.message))}catch{}S.feed(a)}}}),p=({onParse:e})=>async function*(s){const r=i.decode(s);e?.(r),r&&(yield d.encode(r))},x=(e,o={mode:"tokens"})=>m(c(e,o),h,p(o)),v=(e,o={mode:"tokens"})=>m(c(e,o),O,p(o));export{v as ChatStream,c as EventStream,x as TokenStream}; | ||
"use strict";var b=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var U=Object.prototype.hasOwnProperty;var q=(r,t)=>{for(var e in t)b(r,e,{get:t[e],enumerable:!0})},F=(r,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of M(t))!U.call(r,n)&&n!==e&&b(r,n,{get:()=>t[n],enumerable:!(o=J(t,n))||o.enumerable});return r};var _=r=>F(b({},"__esModule",{value:!0}),r);var X={};q(X,{ChatStream:()=>V,EventStream:()=>N,TokenStream:()=>K});module.exports=_(X);var h=require("../../globs/shared"),w=require("./transforms");function R(r){let t,e,o,n,y,f,s;return i(),{feed:A,reset:i};function i(){t=!0,e="",o=0,n=-1,y=void 0,f=void 0,s=""}function A(S){e=e?e+S:S,t&&z(e)&&(e=e.slice(C.length)),t=!1;let d=e.length,a=0,u=!1;for(;a<d;){u&&(e[a]===` | ||
`&&++a,u=!1);let l=-1,m=n,c;for(let p=o;l<0&&p<d;++p)c=e[p],c===":"&&m<0?m=p-a:c==="\r"?(u=!0,l=p-a):c===` | ||
`&&(l=p-a);if(l<0){o=d-a,n=m;break}else o=0,n=-1;O(e,a,m,l),a+=l+1}a===d?e="":a>0&&(e=e.slice(a))}function O(S,d,a,u){if(u===0){s.length>0&&(r({type:"event",id:y,event:f||void 0,data:s.slice(0,-1)}),s="",y=void 0),f=void 0;return}let l=a<0,m=S.slice(d,d+(l?u:a)),c=0;l?c=u:S[d+a+1]===" "?c=a+2:c=a+1;let p=d+c,D=u-c,v=S.slice(p,p+D).toString();if(m==="data")s+=v?"".concat(v,` | ||
`):` | ||
`;else if(m==="event")f=v;else if(m==="id"&&!v.includes("\0"))y=v;else if(m==="retry"){let I=parseInt(v,10);Number.isNaN(I)||r({type:"reconnect-interval",value:I})}}}var C=[239,187,191];function z(r){return C.every((t,e)=>r.charCodeAt(e)===t)}var g=(...r)=>r.reduce((t,e)=>async function*(o){for await(let n of t(o))yield*e(n)});var H=(r,t)=>new ReadableStream({async start(e){for await(let o of r(t))e.enqueue(o);e.close()}}),x=(r,...t)=>{let e=g(...t);return H(async function*(){for await(let o of k(r))yield*e(o)})};var k=async function*(r,t){let e=r.getReader();for(;!t?.signal.aborted;){let{done:o,value:n}=await e.read();if(o)break;yield n}};var E=async function*(r,t){for await(let e of r){if(t?.signal.aborted)break;yield e}};var P=require("../errors"),N=(r,{mode:t="tokens",onDone:e})=>new ReadableStream({async start(o){let n=R(async f=>{if(f.type==="event"){let{data:s}=f;if(s==="[DONE]"){o.desiredSize===null||o.close(),await e?.();return}try{let i=JSON.parse(s);if(o.enqueue(h.ENCODER.encode(s)),t==="tokens"&&i?.choices){let{choices:A}=i;for(let O of A)if(O?.finish_reason==="length")throw new P.OpenAIError("MAX_TOKENS")}}catch(i){o.error(i)}}}),y=typeof r.pipe=="function";for await(let f of y?E(r):k(r)){let s=h.DECODER.decode(f);try{let i=JSON.parse(s);i.hasOwnProperty("error")&&o.error(new Error(i.error.message))}catch{}n.feed(s)}}}),T=({onParse:r})=>async function*(e){let o=h.DECODER.decode(e);r?.(o),o&&(yield h.ENCODER.encode(o))},K=(r,t={mode:"tokens"})=>x(N(r,t),w.TokenParser,T(t)),V=(r,t={mode:"tokens"})=>x(N(r,t),w.ChatParser,T(t));0&&(module.exports={ChatStream,EventStream,TokenStream}); |
@@ -1,1 +0,1 @@ | ||
import{ENCODER as i,DECODER as d}from"../../globs/shared.js";import{OpenAIError as c}from"../errors.js";const f=o=>{const e=o?.choices?.[0];if(!e)throw console.error("No choices received from OpenAI"),new c("UNKNOWN");const n=e?.text??e?.message;if(typeof n!="string")throw console.error("No text received from OpenAI choice"),new c("UNKNOWN");return n},O=async function*(o){const e=d.decode(o),r=JSON.parse(e)?.choices?.[0],{delta:t}=r??{};if(typeof t!="object")throw console.error("Received invalid delta from OpenAI in ChatParser."),new c("UNKNOWN");const{content:s}=t;s&&(yield i.encode(s))},E=async function*(o){const e=d.decode(o),n=JSON.parse(e),r=f(n);yield i.encode(r)},l=async function*(o){const e=new TextEncoder,r=new TextDecoder().decode(o),t=JSON.parse(r),{logprobs:s}=t?.choices?.[0];s&&(yield e.encode(JSON.stringify(s)))};export{O as ChatParser,l as LogprobsParser,E as TokenParser,f as getTokensFromResponse}; | ||
"use strict";var d=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var m=(o,e)=>{for(var n in e)d(o,n,{get:e[n],enumerable:!0})},O=(o,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of a(e))!N.call(o,r)&&r!==n&&d(o,r,{get:()=>e[r],enumerable:!(s=p(e,r))||s.enumerable});return o};var E=o=>O(d({},"__esModule",{value:!0}),o);var x={};m(x,{ChatParser:()=>l,LogprobsParser:()=>y,TokenParser:()=>h,getTokensFromResponse:()=>f});module.exports=E(x);var t=require("../../globs/shared"),i=require("../errors"),f=o=>{let e=o?.choices?.[0];if(!e)throw console.error("No choices received from OpenAI"),new i.OpenAIError("UNKNOWN");let n=e?.text??e?.message;if(typeof n!="string")throw console.error("No text received from OpenAI choice"),new i.OpenAIError("UNKNOWN");return n},l=async function*(o){let e=t.DECODER.decode(o),s=JSON.parse(e)?.choices?.[0],{delta:r}=s??{};if(typeof r!="object")throw console.error("Received invalid delta from OpenAI in ChatParser."),new i.OpenAIError("UNKNOWN");let{content:c}=r;c&&(yield t.ENCODER.encode(c))},h=async function*(o){let e=t.DECODER.decode(o),n=JSON.parse(e),s=f(n);yield t.ENCODER.encode(s)},y=async function*(o){let e=new TextEncoder,s=new TextDecoder().decode(o),r=JSON.parse(s),{logprobs:c}=r?.choices?.[0];c&&(yield e.encode(JSON.stringify(c)))};0&&(module.exports={ChatParser,LogprobsParser,TokenParser,getTokensFromResponse}); |
@@ -1,1 +0,1 @@ | ||
const s={chat:"chat/completions",completions:"completions",edits:"edits",embeddings:"embeddings",images:"images","fine-tunes":"fine-tunes"};export*from"./pinned.js";export{s as OpenAIAPIEndpoints}; | ||
"use strict";var r=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var C=(t,e)=>{for(var n in e)r(t,n,{get:e[n],enumerable:!0})},i=(t,e,n,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of m(e))!A.call(t,o)&&o!==n&&r(t,o,{get:()=>e[o],enumerable:!(a=d(e,o))||a.enumerable});return t},p=(t,e,n)=>(i(t,e,"default"),n&&i(n,e,"default"));var I=t=>i(r({},"__esModule",{value:!0}),t);var s={};C(s,{OpenAIAPIEndpoints:()=>O});module.exports=I(s);p(s,require("./pinned"),module.exports);var O={chat:"chat/completions",completions:"completions",edits:"edits",embeddings:"embeddings",images:"images","fine-tunes":"fine-tunes"};0&&(module.exports={OpenAIAPIEndpoints,...require("./pinned")}); |
{ | ||
"type": "module" | ||
"type": "commonjs" | ||
} |
@@ -6,3 +6,3 @@ { | ||
"homepage": "https://github.com/SpellcraftAI/openai-streams", | ||
"version": "6.2.0", | ||
"version": "6.2.1-0", | ||
"license": "MIT", | ||
@@ -9,0 +9,0 @@ "platform": "node", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29107
227
10