diff --git a/docs/assets/icons.js b/docs/assets/icons.js index b79c9e8..e88e8ca 100644 --- a/docs/assets/icons.js +++ b/docs/assets/icons.js @@ -1,15 +1,18 @@ -(function(svg) { - svg.innerHTML = ``; - svg.style.display = 'none'; - if (location.protocol === 'file:') { - if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', updateUseElements); - else updateUseElements() - function updateUseElements() { - document.querySelectorAll('use').forEach(el => { - if (el.getAttribute('href').includes('#icon-')) { - el.setAttribute('href', el.getAttribute('href').replace(/.*#/, '#')); - } - }); - } +(function() { + addIcons(); + function addIcons() { + if (document.readyState === "loading") return document.addEventListener("DOMContentLoaded", addIcons); + const svg = document.body.appendChild(document.createElementNS("http://www.w3.org/2000/svg", "svg")); + svg.innerHTML = `""`; + svg.style.display = "none"; + if (location.protocol === "file:") updateUseElements(); } -})(document.body.appendChild(document.createElementNS('http://www.w3.org/2000/svg', 'svg'))) \ No newline at end of file + + function updateUseElements() { + document.querySelectorAll("use").forEach(el => { + if (el.getAttribute("href").includes("#icon-")) { + el.setAttribute("href", el.getAttribute("href").replace(/.*#/, "#")); + } + }); + } +})() \ No newline at end of file diff --git a/docs/assets/icons.svg b/docs/assets/icons.svg index 7dead61..e371b8b 100644 --- a/docs/assets/icons.svg +++ b/docs/assets/icons.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/docs/assets/main.js b/docs/assets/main.js index d6f1388..21a5d74 100644 --- a/docs/assets/main.js +++ b/docs/assets/main.js @@ -1,8 +1,9 @@ "use strict"; -"use strict";(()=>{var Ce=Object.create;var ne=Object.defineProperty;var Pe=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var _e=Object.getPrototypeOf,Re=Object.prototype.hasOwnProperty;var Me=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Fe=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Oe(e))!Re.call(t,i)&&i!==n&&ne(t,i,{get:()=>e[i],enumerable:!(r=Pe(e,i))||r.enumerable});return t};var De=(t,e,n)=>(n=t!=null?Ce(_e(t)):{},Fe(e||!t||!t.__esModule?ne(n,"default",{value:t,enumerable:!0}):n,t));var ae=Me((se,oe)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(n){e.console&&console.warn&&console.warn(n)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var d=t.utils.clone(n)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(r.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. -`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(n+=r[u+1]*i[d+1],u+=2,d+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),y=s.str.charAt(1),p;y in s.node.edges?p=s.node.edges[y]:(p=new t.TokenSet,s.node.edges[y]=p),s.str.length==1&&(p.final=!0),i.push({node:p,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof se=="object"?oe.exports=n():e.lunr=n()}(this,function(){return t})})()});var re=[];function G(t,e){re.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible()),document.body.style.display||(this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}createComponents(e){re.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r,app:this}),r.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}showPage(){document.body.style.display&&(console.log("Show page"),document.body.style.removeProperty("display"),this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}scrollToHash(){if(location.hash){console.log("Scorlling");let e=document.getElementById(location.hash.substring(1));if(!e)return;e.scrollIntoView({behavior:"instant",block:"start"})}}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),n=e?.parentElement;for(;n&&!n.classList.contains(".tsd-navigation");)n instanceof HTMLDetailsElement&&(n.open=!0),n=n.parentElement;if(e&&!e.checkVisibility()){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=r}}updateIndexVisibility(){let e=document.querySelector(".tsd-index-content"),n=e?.open;e&&(e.open=!0),document.querySelectorAll(".tsd-index-section").forEach(r=>{r.style.display="block";let i=Array.from(r.querySelectorAll(".tsd-index-link")).every(s=>s.offsetParent==null);r.style.display=i?"none":"block"}),e&&(e.open=n)}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n&&n.tagName!=="SECTION";)n=n.parentElement;if(n&&n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let r=document.createElement("p");r.classList.add("warning"),r.textContent="This member is normally hidden due to your filter settings.",n.prepend(r)}}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let n;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent="Copied!",e.classList.add("visible"),clearTimeout(n),n=setTimeout(()=>{e.classList.remove("visible"),n=setTimeout(()=>{e.textContent="Copy"},100)},1e3)})})}};var ie=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var de=De(ae());async function le(t,e){if(!window.searchData)return;let n=await fetch(window.searchData),r=new Blob([await n.arrayBuffer()]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();t.data=i,t.index=de.Index.load(i.index),e.classList.remove("loading"),e.classList.add("ready")}function he(){let t=document.getElementById("tsd-search");if(!t)return;let e={base:t.dataset.base+"/"},n=document.getElementById("tsd-search-script");t.classList.add("loading"),n&&(n.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),n.addEventListener("load",()=>{le(e,t)}),le(e,t));let r=document.querySelector("#tsd-search input"),i=document.querySelector("#tsd-search .results");if(!r||!i)throw new Error("The input field or the result list wrapper was not found");let s=!1;i.addEventListener("mousedown",()=>s=!0),i.addEventListener("mouseup",()=>{s=!1,t.classList.remove("has-focus")}),r.addEventListener("focus",()=>t.classList.add("has-focus")),r.addEventListener("blur",()=>{s||(s=!1,t.classList.remove("has-focus"))}),Ae(t,i,r,e)}function Ae(t,e,n,r){n.addEventListener("input",ie(()=>{Ve(t,e,n,r)},200));let i=!1;n.addEventListener("keydown",s=>{i=!0,s.key=="Enter"?Ne(e,n):s.key=="Escape"?n.blur():s.key=="ArrowUp"?ue(e,-1):s.key==="ArrowDown"?ue(e,1):i=!1}),n.addEventListener("keypress",s=>{i&&s.preventDefault()}),document.body.addEventListener("keydown",s=>{s.altKey||s.ctrlKey||s.metaKey||!n.matches(":focus")&&s.key==="/"&&(n.focus(),s.preventDefault())})}function Ve(t,e,n,r){if(!r.index||!r.data)return;e.textContent="";let i=n.value.trim(),s;if(i){let o=i.split(" ").map(a=>a.length?`*${a}*`:"").join(" ");s=r.index.search(o)}else s=[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o`,d=ce(l.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(d+=` (score: ${s[o].score.toFixed(2)})`),l.parent&&(d=` - ${ce(l.parent,i)}.${d}`);let y=document.createElement("li");y.classList.value=l.classes??"";let p=document.createElement("a");p.href=r.base+l.url,p.innerHTML=u+d,y.append(p),e.appendChild(y)}}function ue(t,e){let n=t.querySelector(".current");if(!n)n=t.querySelector(e==1?"li:first-child":"li:last-child"),n&&n.classList.add("current");else{let r=n;if(e===1)do r=r.nextElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);else do r=r.previousElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);r&&(n.classList.remove("current"),r.classList.add("current"))}}function Ne(t,e){let n=t.querySelector(".current");if(n||(n=t.querySelector("li:first-child")),n){let r=n.querySelector("a");r&&(window.location.href=r.href),e.blur()}}function ce(t,e){if(e==="")return t;let n=t.toLocaleLowerCase(),r=e.toLocaleLowerCase(),i=[],s=0,o=n.indexOf(r);for(;o!=-1;)i.push(K(t.substring(s,o)),`${K(t.substring(o,o+r.length))}`),s=o+r.length,o=n.indexOf(r,s);return i.push(K(t.substring(s))),i.join("")}var He={"&":"&","<":"<",">":">","'":"'",'"':"""};function K(t){return t.replace(/[&<>"'"]/g,e=>He[e])}var I=class{constructor(e){this.el=e.el,this.app=e.app}};var F="mousedown",fe="mousemove",H="mouseup",J={x:0,y:0},pe=!1,ee=!1,Be=!1,D=!1,me=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(me?"is-mobile":"not-mobile");me&&"ontouchstart"in document.documentElement&&(Be=!0,F="touchstart",fe="touchmove",H="touchend");document.addEventListener(F,t=>{ee=!0,D=!1;let e=F=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(fe,t=>{if(ee&&!D){let e=F=="touchstart"?t.targetTouches[0]:t,n=J.x-(e.pageX||0),r=J.y-(e.pageY||0);D=Math.sqrt(n*n+r*r)>10}});document.addEventListener(H,()=>{ee=!1});document.addEventListener("click",t=>{pe&&(t.preventDefault(),t.stopImmediatePropagation(),pe=!1)});var X=class extends I{constructor(e){super(e),this.className=this.el.dataset.toggle||"",this.el.addEventListener(H,n=>this.onPointerUp(n)),this.el.addEventListener("click",n=>n.preventDefault()),document.addEventListener(F,n=>this.onDocumentPointerDown(n)),document.addEventListener(H,n=>this.onDocumentPointerUp(n))}setActive(e){if(this.active==e)return;this.active=e,document.documentElement.classList.toggle("has-"+this.className,e),this.el.classList.toggle("active",e);let n=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(n),setTimeout(()=>document.documentElement.classList.remove(n),500)}onPointerUp(e){D||(this.setActive(!0),e.preventDefault())}onDocumentPointerDown(e){if(this.active){if(e.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(e){if(!D&&this.active&&e.target.closest(".col-sidebar")){let n=e.target.closest("a");if(n){let r=window.location.href;r.indexOf("#")!=-1&&(r=r.substring(0,r.indexOf("#"))),n.href.substring(0,r.length)==r&&setTimeout(()=>this.setActive(!1),250)}}}};var te;try{te=localStorage}catch{te={getItem(){return null},setItem(){}}}var Q=te;var ye=document.head.appendChild(document.createElement("style"));ye.dataset.for="filters";var Y=class extends I{constructor(e){super(e),this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),ye.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } -`,this.app.updateIndexVisibility()}fromLocalStorage(){let e=Q.getItem(this.key);return e?e==="true":this.el.checked}setLocalStorage(e){Q.setItem(this.key,e.toString()),this.value=e,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),this.app.updateIndexVisibility()}};var Z=class extends I{constructor(e){super(e),this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let n=Q.getItem(this.key);this.el.open=n?n==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update());let r=this.summary.querySelector("a");r&&r.addEventListener("click",()=>{location.assign(r.href)}),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function ge(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,ve(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),ve(t.value)})}function ve(t){document.documentElement.dataset.theme=t}var Le;function be(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",xe),xe())}async function xe(){let t=document.getElementById("tsd-nav-container");if(!t||!window.navigationData)return;let n=await(await fetch(window.navigationData)).arrayBuffer(),r=new Blob([n]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();Le=t.dataset.base+"/",t.innerHTML="";for(let s of i)we(s,t,[]);window.app.createComponents(t),window.app.showPage(),window.app.ensureActivePageVisible()}function we(t,e,n){let r=e.appendChild(document.createElement("li"));if(t.children){let i=[...n,t.text],s=r.appendChild(document.createElement("details"));s.className=t.class?`${t.class} tsd-index-accordion`:"tsd-index-accordion",s.dataset.key=i.join("$");let o=s.appendChild(document.createElement("summary"));o.className="tsd-accordion-summary",o.innerHTML='',Ee(t,o);let a=s.appendChild(document.createElement("div"));a.className="tsd-accordion-details";let l=a.appendChild(document.createElement("ul"));l.className="tsd-nested-navigation";for(let u of t.children)we(u,l,i)}else Ee(t,r,t.class)}function Ee(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));r.href=Le+t.path,n&&(r.className=n),location.pathname===r.pathname&&r.classList.add("current"),t.kind&&(r.innerHTML=``),r.appendChild(document.createElement("span")).textContent=t.text}else e.appendChild(document.createElement("span")).textContent=t.text}G(X,"a[data-toggle]");G(Z,".tsd-index-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var Se=document.getElementById("tsd-theme");Se&&ge(Se);var je=new U;Object.defineProperty(window,"app",{value:je});he();be();})(); +window.translations={"copy":"Copy","copied":"Copied!","normally_hidden":"This member is normally hidden due to your filter settings."}; +"use strict";(()=>{var Pe=Object.create;var ie=Object.defineProperty;var Oe=Object.getOwnPropertyDescriptor;var _e=Object.getOwnPropertyNames;var Re=Object.getPrototypeOf,Me=Object.prototype.hasOwnProperty;var Fe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var De=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _e(e))!Me.call(t,i)&&i!==n&&ie(t,i,{get:()=>e[i],enumerable:!(r=Oe(e,i))||r.enumerable});return t};var Ae=(t,e,n)=>(n=t!=null?Pe(Re(t)):{},De(e||!t||!t.__esModule?ie(n,"default",{value:t,enumerable:!0}):n,t));var ue=Fe((ae,le)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(n){e.console&&console.warn&&console.warn(n)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var d=t.utils.clone(n)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(r.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. +`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(n+=r[u+1]*i[d+1],u+=2,d+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),m=s.str.charAt(1),p;m in s.node.edges?p=s.node.edges[m]:(p=new t.TokenSet,s.node.edges[m]=p),s.str.length==1&&(p.final=!0),i.push({node:p,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof ae=="object"?le.exports=n():e.lunr=n()}(this,function(){return t})})()});var se=[];function G(t,e){se.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible()),document.body.style.display||(this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}createComponents(e){se.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r,app:this}),r.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}showPage(){document.body.style.display&&(document.body.style.removeProperty("display"),this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}scrollToHash(){if(location.hash){let e=document.getElementById(location.hash.substring(1));if(!e)return;e.scrollIntoView({behavior:"instant",block:"start"})}}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),n=e?.parentElement;for(;n&&!n.classList.contains(".tsd-navigation");)n instanceof HTMLDetailsElement&&(n.open=!0),n=n.parentElement;if(e&&!Ve(e)){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=r,document.querySelector(".col-sidebar").scrollTop=r}}updateIndexVisibility(){let e=document.querySelector(".tsd-index-content"),n=e?.open;e&&(e.open=!0),document.querySelectorAll(".tsd-index-section").forEach(r=>{r.style.display="block";let i=Array.from(r.querySelectorAll(".tsd-index-link")).every(s=>s.offsetParent==null);r.style.display=i?"none":"block"}),e&&(e.open=n)}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n&&n.tagName!=="SECTION";)n=n.parentElement;if(!n)return;let r=n.offsetParent==null,i=n;for(;i!==document.body;)i instanceof HTMLDetailsElement&&(i.open=!0),i=i.parentElement;if(n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let s=document.createElement("p");s.classList.add("warning"),s.textContent=window.translations.normally_hidden,n.prepend(s)}r&&e.scrollIntoView()}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let n;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent=window.translations.copied,e.classList.add("visible"),clearTimeout(n),n=setTimeout(()=>{e.classList.remove("visible"),n=setTimeout(()=>{e.textContent=window.translations.copy},100)},1e3)})})}};function Ve(t){let e=t.getBoundingClientRect(),n=Math.max(document.documentElement.clientHeight,window.innerHeight);return!(e.bottom<0||e.top-n>=0)}var oe=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var pe=Ae(ue());async function ce(t,e){if(!window.searchData)return;let n=await fetch(window.searchData),r=new Blob([await n.arrayBuffer()]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();t.data=i,t.index=pe.Index.load(i.index),e.classList.remove("loading"),e.classList.add("ready")}function fe(){let t=document.getElementById("tsd-search");if(!t)return;let e={base:t.dataset.base+"/"},n=document.getElementById("tsd-search-script");t.classList.add("loading"),n&&(n.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),n.addEventListener("load",()=>{ce(e,t)}),ce(e,t));let r=document.querySelector("#tsd-search input"),i=document.querySelector("#tsd-search .results");if(!r||!i)throw new Error("The input field or the result list wrapper was not found");i.addEventListener("mouseup",()=>{te(t)}),r.addEventListener("focus",()=>t.classList.add("has-focus")),He(t,i,r,e)}function He(t,e,n,r){n.addEventListener("input",oe(()=>{Ne(t,e,n,r)},200)),n.addEventListener("keydown",i=>{i.key=="Enter"?Be(e,t):i.key=="ArrowUp"?(de(e,n,-1),i.preventDefault()):i.key==="ArrowDown"&&(de(e,n,1),i.preventDefault())}),document.body.addEventListener("keypress",i=>{i.altKey||i.ctrlKey||i.metaKey||!n.matches(":focus")&&i.key==="/"&&(i.preventDefault(),n.focus())}),document.body.addEventListener("keyup",i=>{t.classList.contains("has-focus")&&(i.key==="Escape"||!e.matches(":focus-within")&&!n.matches(":focus"))&&(n.blur(),te(t))})}function te(t){t.classList.remove("has-focus")}function Ne(t,e,n,r){if(!r.index||!r.data)return;e.textContent="";let i=n.value.trim(),s;if(i){let o=i.split(" ").map(a=>a.length?`*${a}*`:"").join(" ");s=r.index.search(o)}else s=[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o`,d=he(l.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(d+=` (score: ${s[o].score.toFixed(2)})`),l.parent&&(d=` + ${he(l.parent,i)}.${d}`);let m=document.createElement("li");m.classList.value=l.classes??"";let p=document.createElement("a");p.href=r.base+l.url,p.innerHTML=u+d,m.append(p),p.addEventListener("focus",()=>{e.querySelector(".current")?.classList.remove("current"),m.classList.add("current")}),e.appendChild(m)}}function de(t,e,n){let r=t.querySelector(".current");if(!r)r=t.querySelector(n==1?"li:first-child":"li:last-child"),r&&r.classList.add("current");else{let i=r;if(n===1)do i=i.nextElementSibling??void 0;while(i instanceof HTMLElement&&i.offsetParent==null);else do i=i.previousElementSibling??void 0;while(i instanceof HTMLElement&&i.offsetParent==null);i?(r.classList.remove("current"),i.classList.add("current")):n===-1&&(r.classList.remove("current"),e.focus())}}function Be(t,e){let n=t.querySelector(".current");if(n||(n=t.querySelector("li:first-child")),n){let r=n.querySelector("a");r&&(window.location.href=r.href),te(e)}}function he(t,e){if(e==="")return t;let n=t.toLocaleLowerCase(),r=e.toLocaleLowerCase(),i=[],s=0,o=n.indexOf(r);for(;o!=-1;)i.push(ee(t.substring(s,o)),`${ee(t.substring(o,o+r.length))}`),s=o+r.length,o=n.indexOf(r,s);return i.push(ee(t.substring(s))),i.join("")}var je={"&":"&","<":"<",">":">","'":"'",'"':"""};function ee(t){return t.replace(/[&<>"'"]/g,e=>je[e])}var I=class{constructor(e){this.el=e.el,this.app=e.app}};var F="mousedown",ye="mousemove",N="mouseup",J={x:0,y:0},me=!1,ne=!1,qe=!1,D=!1,ve=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(ve?"is-mobile":"not-mobile");ve&&"ontouchstart"in document.documentElement&&(qe=!0,F="touchstart",ye="touchmove",N="touchend");document.addEventListener(F,t=>{ne=!0,D=!1;let e=F=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(ye,t=>{if(ne&&!D){let e=F=="touchstart"?t.targetTouches[0]:t,n=J.x-(e.pageX||0),r=J.y-(e.pageY||0);D=Math.sqrt(n*n+r*r)>10}});document.addEventListener(N,()=>{ne=!1});document.addEventListener("click",t=>{me&&(t.preventDefault(),t.stopImmediatePropagation(),me=!1)});var X=class extends I{constructor(e){super(e),this.className=this.el.dataset.toggle||"",this.el.addEventListener(N,n=>this.onPointerUp(n)),this.el.addEventListener("click",n=>n.preventDefault()),document.addEventListener(F,n=>this.onDocumentPointerDown(n)),document.addEventListener(N,n=>this.onDocumentPointerUp(n))}setActive(e){if(this.active==e)return;this.active=e,document.documentElement.classList.toggle("has-"+this.className,e),this.el.classList.toggle("active",e);let n=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(n),setTimeout(()=>document.documentElement.classList.remove(n),500)}onPointerUp(e){D||(this.setActive(!0),e.preventDefault())}onDocumentPointerDown(e){if(this.active){if(e.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(e){if(!D&&this.active&&e.target.closest(".col-sidebar")){let n=e.target.closest("a");if(n){let r=window.location.href;r.indexOf("#")!=-1&&(r=r.substring(0,r.indexOf("#"))),n.href.substring(0,r.length)==r&&setTimeout(()=>this.setActive(!1),250)}}}};var re;try{re=localStorage}catch{re={getItem(){return null},setItem(){}}}var Q=re;var ge=document.head.appendChild(document.createElement("style"));ge.dataset.for="filters";var Y=class extends I{constructor(e){super(e),this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),ge.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } +`,this.app.updateIndexVisibility()}fromLocalStorage(){let e=Q.getItem(this.key);return e?e==="true":this.el.checked}setLocalStorage(e){Q.setItem(this.key,e.toString()),this.value=e,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),this.app.updateIndexVisibility()}};var Z=class extends I{constructor(e){super(e),this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let n=Q.getItem(this.key);this.el.open=n?n==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update());let r=this.summary.querySelector("a");r&&r.addEventListener("click",()=>{location.assign(r.href)}),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function Ee(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,xe(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),xe(t.value)})}function xe(t){document.documentElement.dataset.theme=t}var K;function we(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",Le),Le())}async function Le(){let t=document.getElementById("tsd-nav-container");if(!t||!window.navigationData)return;let n=await(await fetch(window.navigationData)).arrayBuffer(),r=new Blob([n]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();K=t.dataset.base,K.endsWith("/")||(K+="/"),t.innerHTML="";for(let s of i)Se(s,t,[]);window.app.createComponents(t),window.app.showPage(),window.app.ensureActivePageVisible()}function Se(t,e,n){let r=e.appendChild(document.createElement("li"));if(t.children){let i=[...n,t.text],s=r.appendChild(document.createElement("details"));s.className=t.class?`${t.class} tsd-accordion`:"tsd-accordion";let o=s.appendChild(document.createElement("summary"));o.className="tsd-accordion-summary",o.dataset.key=i.join("$"),o.innerHTML='',be(t,o);let a=s.appendChild(document.createElement("div"));a.className="tsd-accordion-details";let l=a.appendChild(document.createElement("ul"));l.className="tsd-nested-navigation";for(let u of t.children)Se(u,l,i)}else be(t,r,t.class)}function be(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));r.href=K+t.path,n&&(r.className=n),location.pathname===r.pathname&&!r.href.includes("#")&&r.classList.add("current"),t.kind&&(r.innerHTML=``),r.appendChild(document.createElement("span")).textContent=t.text}else e.appendChild(document.createElement("span")).textContent=t.text}G(X,"a[data-toggle]");G(Z,".tsd-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var Te=document.getElementById("tsd-theme");Te&&Ee(Te);var $e=new U;Object.defineProperty(window,"app",{value:$e});fe();we();})(); /*! Bundled license information: lunr/lunr.js: diff --git a/docs/assets/navigation.js b/docs/assets/navigation.js index 2482c73..ccaa80e 100644 --- a/docs/assets/navigation.js +++ b/docs/assets/navigation.js @@ -1 +1 @@ -window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAE42WQU/DMAyF/0vPExMIJrQj25AqMUAMcUEcQmvWsDSpmkyAEP+drBtdQ2vHV7/3Pjl2qub5O3Hw6ZJpciP0eivWYJNRUglX+BLobWnHrXBSuFJ5dSN1nkwvf0ZtdmlyUL3gvoqn7tO0l9nV8MQDVEpksARXmLyXDVWCYlT/lE0Rz8yUBO2OoUwJa8GO9/Uwd3rWTaaln921VNAPt1I0fwvuw9QbBHFQKcqVsDA5X+jM76Q+YqR2UL/5odlx4AhRZxeT7igK4QYJOyEWnBVGZoDG93IMkupqi7fQqCzEEqz146NJBxMLeFc5abSlgQdTDBhrjtnXarVAEV5jxCMrax0M1ByUExSpMTBA9A34M8RAT9L6TaCYvcyDRIbUNfGA9Ak7Hh4udpsCF4k0ZaXAoXNrZR6Emts/Ew9IzC30ULhF+Qp5LvV6ENSqLMRcIFc+cLBQ+NlCCwmrazP8A2gUKnotMrcVSrqvwfxR5kFmBWSbCKnxULhUv0OG3sZWZSHwhkILBTu8QfwzZhB0lHkQvKV/Hgr3aD5lhm3tT+QA8G4CB4mqhbZKuOFPvlU5CGzpHb2PefkFxaSx4fEKAAA=" \ No newline at end of file +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAE42WXU+DMBSG/wvXi4uLLmaX7iMhcWqc8cZ4Uctx1JWW0BJnjP9dxpDRQU/PLc/7PjmcdhmvP5GFvY1m0R1T25JtwUSjKGc2rR6BKjMzbsFFajNZ0Z1QSTS7+R213cc47tUOz/yNJ8gl47AGm+qk13UpYtGyP2/90N+ZSwHKnkpcMmPAjI/P3d7lpNuMs2oLKyGhX25RsH8P9ksXO4+ioZjllhmYXi0V1wkUJ41QFoqPamlm7CRc1eR62l1Fyuyg4QBCxXmqBQdv/YhDkljlpX+EmpIUazCmWh9uakIk4UNuhVYGFzahkDA0HHGuzWbpVVSMUA8cWZsgqBYgLcNMdYAgwm/AfyAkehGmOgmv5ohpksCSuiGaEH/DToamC90mJ4UqdZZLsN69tZgmwfZ2FqIJkb25GUy3zN4hSYTaDopaSlIsmOfKOwmSyv9ubgSVFYUe/gOoCVZdMW5LJoX9HuyfME0yT4HvAqY6g+li9QncextbSlL4B3IjmKz5Bqk+YwZFJ0yT+Ec6y2C6Z70X3Hdq/5Ai8E/jJFBVwZSRzA7/5FtKUfgOvcP7mrc/h7NTc7sKAAA=" \ No newline at end of file diff --git a/docs/assets/search.js b/docs/assets/search.js index e565c02..29fcdaf 100644 --- a/docs/assets/search.js +++ b/docs/assets/search.js @@ -1 +1 @@ -window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAE61dX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Cqg3Szma4k3m+JSIdjLVg4arKXZRQQWCFK92qsS9kOKjuoXZrbumchzh+tAtngmGRGbGNaqzRFKBZwTdruvP9Ge0ABUhgrITtvJ4JLka4KbMKB7GKoZ5pfrhCN/xNd/aikIUXbQUb+I0+ONXOFglXYMQFUFM+7ep75XYW9pXbHPqGp7p1W8JFzw2yb9m26qIxLFvY/tr4c8YJtsqI7S6MWzcCwWjZ8n5ojpcN3MqmZMVtDrMP4pABNwj2LpamRidDh6nx+CXGq24iG9MuW6Abj+5sgHwXcZuqDu+LWrkALBQsC+f2Il2BIbDroi0PNWoGJoytgS5vYoHCnYzGrSedPrCeVHOHOw7DdcOlglYX97rIdhQN8+gd0JTbVNp9/bl0w2TjyPYcPabhxb1Z5uFAoC0XEO3p4pqKefgPaMltDuM7HOAeCIvYeBIORplgM+khk14wVgWjsUzGD6PuIFmdrn0qHyq3aDOPIgJd53Jn+6R2F4OGde6G2yfaL22n3KwLb7nj5qorD5VbFW/gVG249dOpvd7Q3IYwBbDXhXUnT0YcPqP1AA+ZYlwPYpS8RDZRxcX3hdQMr0nJzVixs7fFdQ8lYgxuIRtuPXb1CYmxcDVG4zFpvJIq8knx46JHezy5HmFHxsAUYykqsulaPLcMu+mlR3B6YCE6uJrER/ayz+jqcuOAyrdkL5R28+tRYDKEMsG4urhsxN7TB49TY3kvWfXeffsE9AMFaVa/0gH8eLFSIfWCa3l+bMrqIik610EFx+S52bmLzr3gxrHWv8MBnKTAAIdpYo8D59a9yRSeJthTyOdKdcaoRUUCTN/sldUnfUx259W5wCFI0F9vdUF/UvvqqK3e//rXX/8Pw36xmofWAAA="; \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAE61dXZPctrH9L9KrIk83v/1244/EN8m9rjjJfVC5VNxdapfameGanJEsu/zfL0EOyUajCfRw90FVo51mHxA4aDT6gJzfX7XN5+7V1+9+f/VYH+9efQ2Yv3l1LA/Vq69ffbOvq+Pp1ZtX53bf//d2X3Zd1X01/vntw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QTpy1E8u0vDGdZ0GlUmT/RDCtqtMjZ8pKZj+VHnmUIdwqdEvT+bEta74cFGQECl1rzu2dHSJIPxU6qp07dhqfHiDRkepTXZ3MJR1Lwaz8UEeAz9WedS7dYGjOwv38pt8NPlX7+thf8+7nP/74f/PrLzkP5wAA"; \ No newline at end of file diff --git a/docs/assets/style.css b/docs/assets/style.css index 778b949..9d619a6 100644 --- a/docs/assets/style.css +++ b/docs/assets/style.css @@ -10,6 +10,7 @@ --light-color-text: #222; --light-color-text-aside: #6e6e6e; --light-color-link: #1f70c2; + --light-color-focus-outline: #3584e4; --light-color-ts-keyword: #056bd6; --light-color-ts-project: #b111c9; @@ -35,6 +36,7 @@ --light-color-ts-set-signature: var(--light-color-ts-accessor); --light-color-ts-type-alias: #d51270; /* reference not included as links will be colored with the kind that it points to */ + --light-color-document: #000000; --light-external-icon: url("data:image/svg+xml;utf8,"); --light-color-scheme: light; @@ -50,6 +52,7 @@ --dark-color-text: #f5f5f5; --dark-color-text-aside: #dddddd; --dark-color-link: #00aff4; + --dark-color-focus-outline: #4c97f2; --dark-color-ts-keyword: #3399ff; --dark-color-ts-project: #e358ff; @@ -75,6 +78,7 @@ --dark-color-ts-set-signature: var(--dark-color-ts-accessor); --dark-color-ts-type-alias: #ff6492; /* reference not included as links will be colored with the kind that it points to */ + --dark-color-document: #ffffff; --dark-external-icon: url("data:image/svg+xml;utf8,"); --dark-color-scheme: dark; @@ -92,6 +96,7 @@ --color-text: var(--light-color-text); --color-text-aside: var(--light-color-text-aside); --color-link: var(--light-color-link); + --color-focus-outline: var(--light-color-focus-outline); --color-ts-keyword: var(--light-color-ts-keyword); --color-ts-module: var(--light-color-ts-module); @@ -116,6 +121,7 @@ --color-ts-get-signature: var(--light-color-ts-get-signature); --color-ts-set-signature: var(--light-color-ts-set-signature); --color-ts-type-alias: var(--light-color-ts-type-alias); + --color-document: var(--light-color-document); --external-icon: var(--light-external-icon); --color-scheme: var(--light-color-scheme); @@ -134,6 +140,7 @@ --color-text: var(--dark-color-text); --color-text-aside: var(--dark-color-text-aside); --color-link: var(--dark-color-link); + --color-focus-outline: var(--dark-color-focus-outline); --color-ts-keyword: var(--dark-color-ts-keyword); --color-ts-module: var(--dark-color-ts-module); @@ -158,6 +165,7 @@ --color-ts-get-signature: var(--dark-color-ts-get-signature); --color-ts-set-signature: var(--dark-color-ts-set-signature); --color-ts-type-alias: var(--dark-color-ts-type-alias); + --color-document: var(--dark-color-document); --external-icon: var(--dark-external-icon); --color-scheme: var(--dark-color-scheme); @@ -183,6 +191,7 @@ body { --color-text: var(--light-color-text); --color-text-aside: var(--light-color-text-aside); --color-link: var(--light-color-link); + --color-focus-outline: var(--light-color-focus-outline); --color-ts-keyword: var(--light-color-ts-keyword); --color-ts-module: var(--light-color-ts-module); @@ -207,6 +216,7 @@ body { --color-ts-get-signature: var(--light-color-ts-get-signature); --color-ts-set-signature: var(--light-color-ts-set-signature); --color-ts-type-alias: var(--light-color-ts-type-alias); + --color-document: var(--light-color-document); --external-icon: var(--light-external-icon); --color-scheme: var(--light-color-scheme); @@ -223,6 +233,7 @@ body { --color-text: var(--dark-color-text); --color-text-aside: var(--dark-color-text-aside); --color-link: var(--dark-color-link); + --color-focus-outline: var(--dark-color-focus-outline); --color-ts-keyword: var(--dark-color-ts-keyword); --color-ts-module: var(--dark-color-ts-module); @@ -247,11 +258,17 @@ body { --color-ts-get-signature: var(--dark-color-ts-get-signature); --color-ts-set-signature: var(--dark-color-ts-set-signature); --color-ts-type-alias: var(--dark-color-ts-type-alias); + --color-document: var(--dark-color-document); --external-icon: var(--dark-external-icon); --color-scheme: var(--dark-color-scheme); } +*:focus-visible, +.tsd-accordion-summary:focus-visible svg { + outline: 2px solid var(--color-focus-outline); +} + .always-visible, .always-visible .tsd-signatures { display: inherit !important; @@ -266,16 +283,6 @@ h6 { line-height: 1.2; } -h1 > a:not(.link), -h2 > a:not(.link), -h3 > a:not(.link), -h4 > a:not(.link), -h5 > a:not(.link), -h6 > a:not(.link) { - text-decoration: none; - color: var(--color-text); -} - h1 { font-size: 1.875rem; margin: 0.67rem 0; @@ -306,10 +313,6 @@ h6 { margin: 2.33rem 0; } -.uppercase { - text-transform: uppercase; -} - dl, menu, ol, @@ -333,7 +336,7 @@ footer { padding-bottom: 1rem; max-height: 3.5rem; } -.tsd-generator { +footer > p { margin: 0 1em; } @@ -421,6 +424,9 @@ a.external[target="_blank"] { background-repeat: no-repeat; padding-right: 13px; } +a.tsd-anchor-link { + color: var(--color-text); +} code, pre { @@ -580,13 +586,13 @@ dl.tsd-comment-tag-group p { } .tsd-filter-input { display: flex; - width: fit-content; width: -moz-fit-content; + width: fit-content; align-items: center; - user-select: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; + user-select: none; cursor: pointer; } .tsd-filter-input input[type="checkbox"] { @@ -609,11 +615,8 @@ dl.tsd-comment-tag-group p { Don't remove unless you know what you're doing. */ opacity: 0.99; } -.tsd-filter-input input[type="checkbox"]:focus + svg { - transform: scale(0.95); -} -.tsd-filter-input input[type="checkbox"]:focus:not(:focus-visible) + svg { - transform: scale(1); +.tsd-filter-input input[type="checkbox"]:focus-visible + svg { + outline: 2px solid var(--color-focus-outline); } .tsd-checkbox-background { fill: var(--color-accent); @@ -630,13 +633,18 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark { stroke: var(--color-accent); } -.tsd-theme-toggle { - padding-top: 0.75rem; +.settings-label { + font-weight: bold; + text-transform: uppercase; + display: inline-block; } -.tsd-theme-toggle > h4 { - display: inline; - vertical-align: middle; - margin-right: 0.75rem; + +.tsd-filter-visibility .settings-label { + margin: 0.75rem 0 0.5rem 0; +} + +.tsd-theme-toggle .settings-label { + margin: 0.75rem 0.75rem 0 0; } .tsd-hierarchy { @@ -769,6 +777,9 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark { padding: 0; max-width: 100%; } +.tsd-navigation .tsd-nav-link { + display: none; +} .tsd-nested-navigation { margin-left: 3rem; } @@ -782,6 +793,15 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark { margin-left: -1.5rem; } +.tsd-page-navigation-section { + margin-left: 10px; +} +.tsd-page-navigation-section > summary { + padding: 0.25rem; +} +.tsd-page-navigation-section > div { + margin-left: 20px; +} .tsd-page-navigation ul { padding-left: 1.75rem; } @@ -812,10 +832,10 @@ a.tsd-index-link { } .tsd-accordion-summary, .tsd-accordion-summary a { - user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; + user-select: none; cursor: pointer; } @@ -828,8 +848,9 @@ a.tsd-index-link { padding-top: 0; padding-bottom: 0; } -.tsd-index-accordion .tsd-accordion-summary > svg { +.tsd-accordion .tsd-accordion-summary > svg { margin-left: 0.25rem; + vertical-align: text-top; } .tsd-index-content > :not(:first-child) { margin-top: 0.75rem; @@ -877,7 +898,7 @@ a.tsd-index-link { } .tsd-panel-group { - margin: 4rem 0; + margin: 2rem 0; } .tsd-panel-group.tsd-index-group { margin: 2rem 0; @@ -885,6 +906,9 @@ a.tsd-index-link { .tsd-panel-group.tsd-index-group details { margin: 2rem 0; } +.tsd-panel-group > .tsd-accordion-summary { + margin-bottom: 1rem; +} #tsd-search { transition: background-color 0.2s; @@ -1034,6 +1058,12 @@ a.tsd-index-link { border-width: 1px 0; transition: background-color 0.1s; } +.tsd-signatures .tsd-index-signature:not(:last-child) { + margin-bottom: 1em; +} +.tsd-signatures .tsd-index-signature .tsd-signature { + border-width: 1px; +} .tsd-description .tsd-signatures .tsd-signature { border-width: 1px; } @@ -1347,6 +1377,12 @@ img { .has-menu .tsd-navigation { max-height: 100%; } + #tsd-toolbar-links { + display: none; + } + .tsd-navigation .tsd-nav-link { + display: flex; + } } /* one sidebar */ diff --git a/docs/classes/Client.html b/docs/classes/Client.html index 6f64245..8ab2f32 100644 --- a/docs/classes/Client.html +++ b/docs/classes/Client.html @@ -1,9 +1,5 @@ -Client | predictionguard

Client provides access the PredictionGuard API.

-

Constructors

Properties

apiKey -chatModels -completionModels -url +Client | predictionguard

Client provides access the PredictionGuard API.

+

Constructors

Methods

Constructors

  • constructor constructs a Client API for use.

    +

Constructors

  • constructor constructs a Client API for use.

    Parameters

    • url: string

      url represents the transport and domain:port.

    • apiKey: string

      apiKey represents PG api key.

      -

    Returns Client

Properties

apiKey: string
chatModels: Map<Models, boolean> = ...

Set of models supported by the chat APIs.

-
completionModels: Map<Models, boolean> = ...

Set of models supported by the completion API.

-
url: string

Methods

  • Chat generates chat completions based on a conversation history.

    +

Returns Client

Methods

  • Chat generates chat completions based on a conversation history.

    Parameters

    • input: ChatInput

      input represents the entire set of possible input for the Chat call.

    Returns Promise<[Chat, null | Error]>

    • A Promise with a Chat object and an Error object if the error is not null.
    -

    Example

    import * as pg from 'predictionguard';

    const client = new pg.Client('https://api.predictionguard.com', process.env.PGKEY);

    async function Chat() {
    const input = {
    model: pg.Models.NeuralChat7B,
    messages: [
    {
    role: pg.Roles.User,
    content: 'How do you feel about the world in general',
    },
    ],
    maxTokens: 1000,
    temperature: 0.1,
    topP: 0.1,
    topK: 50.0,
    options: {
    factuality: true,
    toxicity: true,
    pii: pg.PIIs.Replace,
    piiReplaceMethod: pg.ReplaceMethods.Random,
    },
    };

    var [result, err] = await client.Chat(input);
    if (err != null) {
    console.log('ERROR:' + err.error);
    return;
    }

    console.log('RESULT:' + result.createdDate() + ': ' + result.model + ': ' + result.choices[0].message.content);
    }

    Chat(); +
    import * as pg from 'predictionguard';

    const client = new pg.Client('https://api.predictionguard.com', process.env.PGKEY);

    async function Chat() {
    const input = {
    model: 'Neural-Chat-7B',
    messages: [
    {
    role: pg.Roles.User,
    content: 'How do you feel about the world in general',
    },
    ],
    maxTokens: 1000,
    temperature: 0.1,
    topP: 0.1,
    topK: 50,
    options: {
    factuality: true,
    toxicity: true,
    pii: pg.PIIs.Replace,
    piiReplaceMethod: pg.ReplaceMethods.Random,
    },
    };

    var [result, err] = await client.Chat(input);
    if (err != null) {
    console.log('ERROR:' + err.error);
    return;
    }

    console.log('RESULT:' + result.createdDate() + ': ' + result.model + ': ' + result.choices[0].message.content);
    }

    Chat();
    -
  • ChatSSE generates a stream of chat completions based on a + +

  • ChatSSE generates a stream of chat completions based on a conversation history.

    Parameters

    • input: ChatSSEInput

      input represents the entire set of possible input for the SSE Chat call.

      @@ -40,36 +35,41 @@
    • A Promise with an Error object if the error is not null.
    -

    Example

    import * as pg from 'predictiongaurd';

    const client = new pg.Client('https://api.predictionguard.com', process.env.PGKEY);

    async function ChatSSE() {
    const input = {
    model: pg.Models.NeuralChat7B,
    messages: [
    {
    role: pg.Roles.User,
    content: 'How do you feel about the world in general',
    },
    ],
    maxTokens: 1000,
    temperature: 0.1,
    topP: 0.1,
    topK: 50.0,
    onMessage: function (event, err) {
    if (err != null) {
    if (err.error == 'EOF') {
    return;
    }
    console.log(err);
    }

    for (const choice of event.choices) {
    if (choice.delta.hasOwnProperty('content')) {
    process.stdout.write(choice.delta.content);
    }
    }
    },
    };

    var err = await client.ChatSSE(input);
    if (err != null) {
    console.log('ERROR:' + err.error);
    return;
    }
    }

    ChatSSE(); +
    import * as pg from 'predictiongaurd';

    const client = new pg.Client('https://api.predictionguard.com', process.env.PGKEY);

    async function ChatSSE() {
    const input = {
    model: 'Neural-Chat-7B',
    messages: [
    {
    role: pg.Roles.User,
    content: 'How do you feel about the world in general',
    },
    ],
    maxTokens: 1000,
    temperature: 0.1,
    topP: 0.1,
    topK: 50,
    onMessage: function (event, err) {
    if (err != null) {
    if (err.error == 'EOF') {
    return;
    }
    console.log(err);
    }

    for (const choice of event.choices) {
    if (choice.delta.hasOwnProperty('content')) {
    process.stdout.write(choice.delta.content);
    }
    }
    },
    };

    var err = await client.ChatSSE(input);
    if (err != null) {
    console.log('ERROR:' + err.error);
    return;
    }
    }

    ChatSSE();
    -
  • ChatVision generates answers a question about an image.

    Parameters

    • input: ChatVisionInput

      input represents the entire set of possible input for the Vision Chat call.

    Returns Promise<[ChatVision, null | Error]>

    • A Promise with a ChatVision object and a Error object if the error is not null.
    -

    Example

    import * as pg from 'predictionguard';

    const client = new pg.Client('https://api.predictionguard.com', process.env.PGKEY);

    async function ChatVision() {
    const image = new pg.ImageNetwork('https://pbs.twimg.com/profile_images/1571574401107169282/ylAgz_f5_400x400.jpg');

    const input = {
    role: pg.Roles.User,
    question: 'is there a deer in this picture',
    image: image,
    maxTokens: 1000,
    temperature: 0.1,
    topP: 0.1,
    topK: 50.0,
    };

    var [result, err] = await client.ChatVision(input);
    if (err != null) {
    console.log('ERROR:' + err.error);
    return;
    }

    console.log('RESULT:' + result.createdDate() + ': ' + result.model + ': ' + result.choices[0].message.content);
    }

    ChatVision(); +
    import * as pg from 'predictionguard';

    const client = new pg.Client('https://api.predictionguard.com', process.env.PGKEY);

    async function ChatVision() {
    const image = new pg.ImageNetwork('https://pbs.twimg.com/profile_images/1571574401107169282/ylAgz_f5_400x400.jpg');

    const input = {
    role: pg.Roles.User,
    question: 'is there a deer in this picture',
    image: image,
    maxTokens: 1000,
    temperature: 0.1,
    topP: 0.1,
    topK: 50,
    };

    var [result, err] = await client.ChatVision(input);
    if (err != null) {
    console.log('ERROR:' + err.error);
    return;
    }

    console.log('RESULT:' + result.createdDate() + ': ' + result.model + ': ' + result.choices[0].message.content);
    }

    ChatVision();
    -
  • Completion generates text completions based on the provided input.

    Parameters

    • input: CompletionInput

      input represents the entire set of possible input for the Completion call.

    Returns Promise<[Completion, null | Error]>

    • A Promise with a Completion object and a Error object if the error is not null.
    -

    Example

    import * as pg from 'predictionguard';

    const client = new pg.Client('https://api.predictionguard.com', process.env.PGKEY);

    async function Completions() {
    const input = {
    model: pg.Models.NeuralChat7B,
    prompt: 'Will I lose my hair',
    maxTokens: 1000,
    temperature: 0.1,
    topP: 0.1,
    topK: 50.0,
    };

    var [result, err] = await client.Completion(input);
    if (err != null) {
    console.log('ERROR:' + err.error);
    return;
    }

    console.log('RESULT:' + result.choices[0].text);
    }

    Completions(); +
    import * as pg from 'predictionguard';

    const client = new pg.Client('https://api.predictionguard.com', process.env.PGKEY);

    async function Completions() {
    const input = {
    model: 'Neural-Chat-7B',
    prompt: 'Will I lose my hair',
    maxTokens: 1000,
    temperature: 0.1,
    topP: 0.1,
    topK: 50,
    };

    var [result, err] = await client.Completion(input);
    if (err != null) {
    console.log('ERROR:' + err.error);
    return;
    }

    console.log('RESULT:' + result.choices[0].text);
    }

    Completions();
    -
  • Embedding generates chat completions based on a conversation history.

    +

    Parameters

    • model: string

      model to use.

      +
    • input: EmbeddingInput[]

      input represents a collection of text and images to vectorize.

    Returns Promise<[Embedding, null | Error]>

    • A Promise with a Embedding object and an Error object if the error is not null.
    -

    Example

    import * as pg from 'predictiongaurd';

    const client = new pg.Client('https://api.predictionguard.com', process.env.PGKEY);

    async function Embedding() {
    const image = new pg.ImageNetwork('https://pbs.twimg.com/profile_images/1571574401107169282/ylAgz_f5_400x400.jpg');

    const input = [
    {
    text: 'This is Bill Kennedy, a decent Go developer.',
    image: image,
    },
    ];

    var [result, err] = await client.Embedding(input);
    if (err != null) {
    console.log('ERROR:' + err.error);
    return;
    }

    for (const dt of result.data) {
    process.stdout.write(dt.embedding.toString());
    }
    }

    Embedding(); +
    import * as pg from 'predictiongaurd';

    const client = new pg.Client('https://api.predictionguard.com', process.env.PGKEY);

    async function Embedding() {
    const image = new pg.ImageNetwork('https://pbs.twimg.com/profile_images/1571574401107169282/ylAgz_f5_400x400.jpg');

    const input = [
    {
    text: 'This is Bill Kennedy, a decent Go developer.',
    image: image,
    },
    ];

    var [result, err] = await client.Embedding('bridgetower-large-itm-mlm-itc', input);
    if (err != null) {
    console.log('ERROR:' + err.error);
    return;
    }

    for (const dt of result.data) {
    process.stdout.write(dt.embedding.toString());
    }
    }

    Embedding();
    -
  • Factuality checks the factuality of a given text compared to a reference.

    + +
  • Factuality checks the factuality of a given text compared to a reference.

    Parameters

    • reference: string

      reference represents the reference text for comparison.

    • text: string

      text represents the text to be checked @@ -78,32 +78,35 @@

    • A Promise with a Factuality object and a Error object if the error is not null.
    -

    Example

    import * as pg from 'predictionguard';

    const client = new pg.Client('https://api.predictionguard.com', process.env.PGKEY);

    async function Factuality() {
    const fact = `The President shall receive in full for his services during
    the term for which he shall have been elected compensation in the aggregate
    amount of 400,000 a year, to be paid monthly, and in addition an expense
    allowance of 50,000 to assist in defraying expenses relating to or resulting
    from the discharge of his official duties. Any unused amount of such expense
    allowance shall revert to the Treasury pursuant to section 1552 of title 31,
    United States Code. No amount of such expense allowance shall be included in
    the gross income of the President. He shall be entitled also to the use of
    the furniture and other effects belonging to the United States and kept in
    the Executive Residence at the White House.`;

    const text = `The president of the united states can take a salary of one
    million dollars`;

    var [result, err] = await client.Factuality(fact, text);
    if (err != null) {
    console.log('ERROR:' + err.error);
    return;
    }

    console.log('RESULT:' + JSON.stringify(result.checks[0]));
    }

    Factuality(); +
    import * as pg from 'predictionguard';

    const client = new pg.Client('https://api.predictionguard.com', process.env.PGKEY);

    async function Factuality() {
    const fact = `The President shall receive in full for his services during
    the term for which he shall have been elected compensation in the aggregate
    amount of 400,000 a year, to be paid monthly, and in addition an expense
    allowance of 50,000 to assist in defraying expenses relating to or resulting
    from the discharge of his official duties. Any unused amount of such expense
    allowance shall revert to the Treasury pursuant to section 1552 of title 31,
    United States Code. No amount of such expense allowance shall be included in
    the gross income of the President. He shall be entitled also to the use of
    the furniture and other effects belonging to the United States and kept in
    the Executive Residence at the White House.`;

    const text = `The president of the united states can take a salary of one
    million dollars`;

    var [result, err] = await client.Factuality(fact, text);
    if (err != null) {
    console.log('ERROR:' + err.error);
    return;
    }

    console.log('RESULT:' + JSON.stringify(result.checks[0]));
    }

    Factuality();
    -
  • HealthCheck validates the PG API Service is available.

    + +
  • HealthCheck validates the PG API Service is available.

    Returns Promise<[string, null | Error]>

    • A Promise with a string and an Error object if the error is not null.
    -

    Example

    import * as pg from 'predictionguard';

    const client = new pg.Client('https://api.predictionguard.com', process.env.PGKEY);

    async function HealthCheck() {
    var [result, err] = await client.HealthCheck();
    if (err != null) {
    console.log('ERROR:' + err.error);
    return;
    }

    console.log(result);
    }

    HealthCheck(); +
    import * as pg from 'predictionguard';

    const client = new pg.Client('https://api.predictionguard.com', process.env.PGKEY);

    async function HealthCheck() {
    var [result, err] = await client.HealthCheck();
    if (err != null) {
    console.log('ERROR:' + err.error);
    return;
    }

    console.log(result);
    }

    HealthCheck();
    -
  • Injection detects potential prompt injection attacks in a given prompt.

    + +
  • Injection detects potential prompt injection attacks in a given prompt.

    Parameters

    • prompt: string

      prompt represents the text to detect injection attacks against.

    Returns Promise<[Injection, null | Error]>

    • A Promise with a Injection object and a Error object if the error is not null.
    -

    Example

    import * as pg from 'predictionguard';

    const client = new pg.Client('https://api.predictionguard.com', process.env.PGKEY);

    async function Injection() {
    const prompt = `A short poem may be a stylistic choice or it may be that you
    have said what you intended to say in a more concise way.`;

    var [result, err] = await client.Injection(prompt);
    if (err != null) {
    console.log('ERROR:' + err.error);
    return;
    }

    console.log('RESULT:' + result.checks[0].probability);
    }

    Injection(); +
    import * as pg from 'predictionguard';

    const client = new pg.Client('https://api.predictionguard.com', process.env.PGKEY);

    async function Injection() {
    const prompt = `A short poem may be a stylistic choice or it may be that you
    have said what you intended to say in a more concise way.`;

    var [result, err] = await client.Injection(prompt);
    if (err != null) {
    console.log('ERROR:' + err.error);
    return;
    }

    console.log('RESULT:' + result.checks[0].probability);
    }

    Injection();
    -
  • RawDoGet performs a raw GET call.

    + +
  • RawDoGet performs a raw GET call.

    Parameters

    • endpoint: string

      endpoint represents endpoint to call and does not include the transport or domain.

    Returns Promise<[any, null | Error]>

    • A Promise with a respose object and an error object if the error is not null.
    -
  • RawDoPost performs a raw POST call.

    +
  • RawDoPost performs a raw POST call.

    Parameters

    • endpoint: string

      endpoint represents endpoint to call and does not include the transport or domain.

    • body: any

      body represents an input object.

      @@ -111,16 +114,16 @@
    • A Promise with a respose object and an error object if the error is not null.
    -
  • RawDoSSEPost performs a raw POST call with SSE support.

    +
  • RawDoSSEPost performs a raw POST call with SSE support.

    Parameters

    • endpoint: string

      endpoint represents endpoint to call and does not include the transport or domain.

    • body: any

      body represents an input object.

      -
    • onMessage: ((event, err) => void)

      onMessage represents a function that will receive the stream of chat +

    • onMessage: ((event: null | ServerSentEvent, err: null | Error) => void)

      onMessage represents a function that will receive the stream of chat results.

        • (event, err): void
        • Parameters

          • event: null | ServerSentEvent
          • err: null | Error

          Returns void

    Returns Promise<null | Error>

    • A Promise with an error object if the error is not null.
    -
  • ReplacePII replaces personal information such as names, SSNs, and +

  • ReplacePII replaces personal information such as names, SSNs, and emails in a given text.

    Parameters

    • replaceMethod: ReplaceMethods

      replaceMethod represents the method to use for replacing personal information.

      @@ -130,18 +133,20 @@
    • A Promise with a ReplacePII object and a Error object if the error is not null.
    -

    Example

    import * as pg from 'predictionguard';

    const client = new pg.Client('https://api.predictionguard.com', process.env.PGKEY);

    async function ReplacePII() {
    const replaceMethod = pg.ReplaceMethods.Mask;
    const prompt = `My email is bill@ardanlabs.com and my number is 954-123-4567.`;

    var [result, err] = await client.ReplacePII(replaceMethod, prompt);
    if (err != null) {
    console.log('ERROR:' + err.error);
    return;
    }

    console.log('RESULT:' + result.checks[0].new_prompt);
    }

    ReplacePII(); +
    import * as pg from 'predictionguard';

    const client = new pg.Client('https://api.predictionguard.com', process.env.PGKEY);

    async function ReplacePII() {
    const replaceMethod = pg.ReplaceMethods.Mask;
    const prompt = `My email is bill@ardanlabs.com and my number is 954-123-4567.`;

    var [result, err] = await client.ReplacePII(replaceMethod, prompt);
    if (err != null) {
    console.log('ERROR:' + err.error);
    return;
    }

    console.log('RESULT:' + result.checks[0].new_prompt);
    }

    ReplacePII();
    -
  • Toxicity checks the toxicity of a given text.

    Parameters

    • text: string

      text represents the text to be scored for toxicity.

    Returns Promise<[Toxicity, null | Error]>

    • A Promise with a Toxicity object and a Error object if the error is not null.
    -

    Example

    import * as pg from 'predictionguard';

    const client = new pg.Client('https://api.predictionguard.com', process.env.PGKEY);

    async function Toxicity() {
    const text = `Every flight I have is late and I am very angry. I want to
    hurt someone.`;

    var [result, err] = await client.Toxicity(text);
    if (err != null) {
    console.log('ERROR:' + err.error);
    return;
    }

    console.log('RESULT:' + result.checks[0].score);
    }

    Toxicity(); +
    import * as pg from 'predictionguard';

    const client = new pg.Client('https://api.predictionguard.com', process.env.PGKEY);

    async function Toxicity() {
    const text = `Every flight I have is late and I am very angry. I want to
    hurt someone.`;

    var [result, err] = await client.Toxicity(text);
    if (err != null) {
    console.log('ERROR:' + err.error);
    return;
    }

    console.log('RESULT:' + result.checks[0].score);
    }

    Toxicity();
    -
  • Translate converts text from one language to another.

    + +
  • Translate converts text from one language to another.

    Parameters

    • text: string

      text represents the text to be translated.

    • sourceLang: Languages

      sourceLang represents the source language of the text.

      @@ -153,6 +158,7 @@
    • A Promise with a Translate object and a Error object if the error is not null.
    -

    Example

    import * as pg from 'predictionguard';

    const client = new pg.Client('https://api.predictionguard.com', process.env.PGKEY);

    async function Translate() {
    const text = `The rain in Spain stays mainly in the plain`;
    const sourceLang = pg.Languages.English;
    const targetLang = pg.Languages.Spanish;
    const useThirdPartyEngine = false;

    var [result, err] = await client.Translate(text, sourceLang, targetLang, useThirdPartyEngine);
    if (err != null) {
    console.log('ERROR:' + err.error);
    return;
    }

    console.log('RESULT:' + result.best_translation);
    }

    Translate(); +
    import * as pg from 'predictionguard';

    const client = new pg.Client('https://api.predictionguard.com', process.env.PGKEY);

    async function Translate() {
    const text = `The rain in Spain stays mainly in the plain`;
    const sourceLang = pg.Languages.English;
    const targetLang = pg.Languages.Spanish;
    const useThirdPartyEngine = false;

    var [result, err] = await client.Translate(text, sourceLang, targetLang, useThirdPartyEngine);
    if (err != null) {
    console.log('ERROR:' + err.error);
    return;
    }

    console.log('RESULT:' + result.best_translation);
    }

    Translate();
    -
\ No newline at end of file + +
diff --git a/docs/classes/ImageFile.html b/docs/classes/ImageFile.html index c2486c3..3ac1dae 100644 --- a/docs/classes/ImageFile.html +++ b/docs/classes/ImageFile.html @@ -1,14 +1,12 @@ -ImageFile | predictionguard

ImageFile provides access retrieve an image from disk.

-

Constructors

Properties

base64 -path +ImageFile | predictionguard

ImageFile provides access retrieve an image from disk.

+

Constructors

Methods

Constructors

  • constructor constructs an ImageNetwork to use.

    +

Constructors

  • constructor constructs an ImageNetwork to use.

    Parameters

    • path: string

      path represents the location of the image on disk.

      -

    Returns ImageFile

Properties

base64: null | string
path: string

Methods

  • EncodeBase64 reads an image from disk and converts the image to base64 +

Returns ImageFile

Methods

  • EncodeBase64 reads an image from disk and converts the image to base64 encoding.

    Returns Promise<[string, null | Error]>

    • A Promise with a base64 string and an error object if the error is not null.
    -
\ No newline at end of file +
diff --git a/docs/classes/ImageNetwork.html b/docs/classes/ImageNetwork.html index 913e46a..754da87 100644 --- a/docs/classes/ImageNetwork.html +++ b/docs/classes/ImageNetwork.html @@ -1,14 +1,12 @@ -ImageNetwork | predictionguard

Class ImageNetwork

ImageNetwork provides access retrieve an image over the network.

-

Constructors

Properties

base64 -url +ImageNetwork | predictionguard

Class ImageNetwork

ImageNetwork provides access retrieve an image over the network.

+

Constructors

Methods

Constructors

  • constructor constructs an ImageNetwork to use.

    +

Constructors

Properties

base64: null | string
url: string

Methods

  • EncodeBase64 downloads an image from the network and converts the image +

Returns ImageNetwork

Methods

  • EncodeBase64 downloads an image from the network and converts the image to base64 encoding.

    Returns Promise<[string, null | Error]>

    • A Promise with a base64 string and an error object if the error is not null.
    -
\ No newline at end of file +
diff --git a/docs/enums/Languages.html b/docs/enums/Languages.html index 289dcb7..d5f1513 100644 --- a/docs/enums/Languages.html +++ b/docs/enums/Languages.html @@ -1,5 +1,5 @@ -Languages | predictionguard

Enumeration Languages

Languages represents the set of languages that can be used.

-

Enumeration Members

Afrikanns +Languages | predictionguard

Enumeration Languages

Languages represents the set of languages that can be used.

+

Enumeration Members

Enumeration Members

Afrikanns: "afr"
Amharic: "amh"
Arabic: "ara"
Armenian: "hye"
Azerbaijan: "aze"
Basque: "eus"
Belarusian: "bel"
Bengali: "ben"
Bosnian: "bos"
Catalan: "cat"
Chechen: "che"
Cherokee: "chr"
Chinese: "zho"
Croatian: "hrv"
Czech: "ces"
Danish: "dan"
Dutch: "nld"
English: "eng"
Estonian: "est"
Fijian: "fij"
Filipino: "fil"
Finnish: "fin"
French: "fra"
Galician: "glg"
Georgian: "kat"
German: "deu"
Greek: "ell"
Gujarati: "guj"
Haitian: "hat"
Hebrew: "heb"
Hindi: "hin"
Hungarian: "hun"
Icelandic: "isl"
Indonesian: "ind"
Irish: "gle"
Italian: "ita"
Japanese: "jpn"
Kannada: "kan"
Kazakh: "kaz"
Korean: "kor"
Latvian: "lav"
Lithuanian: "lit"
Macedonian: "mkd"
Malay1: "msa"
Malay2: "zlm"
Malayalam: "mal"
Maltese: "mlt"
Marathi: "mar"
Nepali: "nep"
Norwegian: "nor"
Persian: "fas"
Polish: "pol"
Portuguese: "por"
Romanian: "ron"
Russian: "rus"
Samoan: "smo"
Serbian: "srp"
Slavonic: "chu"
Slovak: "slk"
Slovenian: "slv"
Spanish: "spa"
Swahili: "swh"
Swedish: "swe"
Tamil: "tam"
Telugu: "tel"
Thai: "tha"
Turkish: "tur"
Ukrainian: "ukr"
Urdu: "urd"
Vietnamese: "vie"
Welsh: "cym"
\ No newline at end of file +

Enumeration Members

Afrikanns: "afr"
Amharic: "amh"
Arabic: "ara"
Armenian: "hye"
Azerbaijan: "aze"
Basque: "eus"
Belarusian: "bel"
Bengali: "ben"
Bosnian: "bos"
Catalan: "cat"
Chechen: "che"
Cherokee: "chr"
Chinese: "zho"
Croatian: "hrv"
Czech: "ces"
Danish: "dan"
Dutch: "nld"
English: "eng"
Estonian: "est"
Fijian: "fij"
Filipino: "fil"
Finnish: "fin"
French: "fra"
Galician: "glg"
Georgian: "kat"
German: "deu"
Greek: "ell"
Gujarati: "guj"
Haitian: "hat"
Hebrew: "heb"
Hindi: "hin"
Hungarian: "hun"
Icelandic: "isl"
Indonesian: "ind"
Irish: "gle"
Italian: "ita"
Japanese: "jpn"
Kannada: "kan"
Kazakh: "kaz"
Korean: "kor"
Latvian: "lav"
Lithuanian: "lit"
Macedonian: "mkd"
Malay1: "msa"
Malay2: "zlm"
Malayalam: "mal"
Maltese: "mlt"
Marathi: "mar"
Nepali: "nep"
Norwegian: "nor"
Persian: "fas"
Polish: "pol"
Portuguese: "por"
Romanian: "ron"
Russian: "rus"
Samoan: "smo"
Serbian: "srp"
Slavonic: "chu"
Slovak: "slk"
Slovenian: "slv"
Spanish: "spa"
Swahili: "swh"
Swedish: "swe"
Tamil: "tam"
Telugu: "tel"
Thai: "tha"
Turkish: "tur"
Ukrainian: "ukr"
Urdu: "urd"
Vietnamese: "vie"
Welsh: "cym"
diff --git a/docs/enums/Models.html b/docs/enums/Models.html deleted file mode 100644 index 743aea7..0000000 --- a/docs/enums/Models.html +++ /dev/null @@ -1,10 +0,0 @@ -Models | predictionguard

Enumeration Models

Models represents the set of models that can be used.

-

Enumeration Members

BridgetowerLargeItmMlmItc: "bridgetower-large-itm-mlm-itc"
DeepseekCoder67BInstruct: "deepseek-coder-6.7b-instruct"
Hermes2ProLlama38B: "Hermes-2-Pro-Llama-3-8B"
Hermes2ProMistral7B: "Hermes-2-Pro-Mistral-7B"
LLama3SqlCoder8b: "llama-3-sqlcoder-8b"
Llava157BHF: "llava-1.5-7b-hf"
NeuralChat7B: "Neural-Chat-7B"
NousHermesLlama213B: "Nous-Hermes-Llama-213B"
\ No newline at end of file diff --git a/docs/enums/PIIs.html b/docs/enums/PIIs.html index d2656a0..bcf8a45 100644 --- a/docs/enums/PIIs.html +++ b/docs/enums/PIIs.html @@ -1,4 +1,4 @@ -PIIs | predictionguard

Enumeration PIIs

PIIs represents the set of pii options that can be used.

-

Enumeration Members

Block +PIIs | predictionguard

Enumeration PIIs

PIIs represents the set of pii options that can be used.

+

Enumeration Members

Enumeration Members

Block: "block"
Replace: "replace"
\ No newline at end of file +

Enumeration Members

Block: "block"
Replace: "replace"
diff --git a/docs/enums/ReplaceMethods.html b/docs/enums/ReplaceMethods.html index 486318a..7e394f5 100644 --- a/docs/enums/ReplaceMethods.html +++ b/docs/enums/ReplaceMethods.html @@ -1,6 +1,6 @@ -ReplaceMethods | predictionguard

Enumeration ReplaceMethods

ReplaceMethods represents the set of replace methods that can be used.

-

Enumeration Members

Category +ReplaceMethods | predictionguard

Enumeration ReplaceMethods

ReplaceMethods represents the set of replace methods that can be used.

+

Enumeration Members

Enumeration Members

Category: "category"
Fake: "fake"
Mask: "mask"
Random: "random"
\ No newline at end of file +

Enumeration Members

Category: "category"
Fake: "fake"
Mask: "mask"
Random: "random"
diff --git a/docs/enums/Roles.html b/docs/enums/Roles.html index 5cc393a..6245db9 100644 --- a/docs/enums/Roles.html +++ b/docs/enums/Roles.html @@ -1,6 +1,6 @@ -Roles | predictionguard

Enumeration Roles

Roles represents the set of roles that a sender can represent themselves +Roles | predictionguard

Enumeration Roles

Roles represents the set of roles that a sender can represent themselves as.

-

Enumeration Members

Enumeration Members

Enumeration Members

Assistant: "assistant"
System: "system"
User: "user"
\ No newline at end of file +

Enumeration Members

Assistant: "assistant"
System: "system"
User: "user"
diff --git a/docs/index.html b/docs/index.html index e952fdd..791b702 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,34 +1,40 @@ -predictionguard

predictionguard

Prediction Guard JS Client

CircleCI -npm version

+predictionguard

predictionguard

Prediction Guard JS Client

CircleCI +npm version

Copyright 2024 Prediction Guard bill@predictionguard.com

-

Description

This package provides functionality developed to simplify interfacing with Prediction Guard API in JavaScript.

-

Requirements

To access the API, contact us here to get an enterprise access token. You will need this access token to continue.

-

Usage

Install Package

-
$ npm i predictionguard
-
+

This package provides functionality developed to simplify interfacing with Prediction Guard API in JavaScript.

+

To access the API, contact us here to get an enterprise access token. You will need this access token to continue.

+

Install Package

+
$ npm i predictionguard
+
+

Code Example

-
import * as pg from 'predictionguard';

const client = new pg.Client('https://api.predictionguard.com', process.env.PGKEY);

async function Chat() {
const input = {
model: pg.Models.NeuralChat7B,
messages: [
{
role: pg.Roles.User,
content: 'How do you feel about the world in general',
},
],
maxTokens: 1000,
temperature: 0.1,
topP: 0.1,
options: {
factuality: true,
toxicity: true,
pii: pg.PIIs.Replace,
piiReplaceMethod: pg.ReplaceMethods.Random,
},
};

var [result, err] = await client.Chat(input);
if (err != null) {
console.log('ERROR:' + err.error);
return;
}

console.log('RESULT:' + result.createdDate() + ': ' + result.model + ': ' + result.choices[0].message.content);
}

Chat(); -
-

Take a look at the examples directory for more examples.

-

Docs

You can find the SDK and Prediction Guard docs using these links.

-

SDK Docs

-

PG API Docs

-

Getting started

Once you have your API key you can use the makefile to run curl commands for the different API endpoints. +

import * as pg from 'predictionguard';

const client = new pg.Client('https://api.predictionguard.com', process.env.PGKEY);

async function Chat() {
const input = {
model: pg.Models.NeuralChat7B,
messages: [
{
role: pg.Roles.User,
content: 'How do you feel about the world in general',
},
],
maxTokens: 1000,
temperature: 0.1,
topP: 0.1,
options: {
factuality: true,
toxicity: true,
pii: pg.PIIs.Replace,
piiReplaceMethod: pg.ReplaceMethods.Random,
},
};

var [result, err] = await client.Chat(input);
if (err != null) {
console.log('ERROR:' + err.error);
return;
}

console.log('RESULT:' + result.createdDate() + ': ' + result.model + ': ' + result.choices[0].message.content);
}

Chat(); +
+ +

Take a look at the examples directory for more examples.

+

You can find the SDK and Prediction Guard docs using these links.

+

SDK Docs

+

PG API Docs

+

Once you have your API key you can use the makefile to run curl commands for the different API endpoints. For example, make curl-injection will connect to the injection endpoint and return the injection response. The makefile also allows you to run the different examples such as make js-injection to run the Go injection example.

Running The Project

-

You will need to node before you can run the project. You can follow this link or use brew which is what I do.

+

You will need to node before you can run the project. You can follow this link or use brew which is what I do.

After you clone the repo and install node, run the install command inside the root of the project folder.

$ make install
 
+

Then run the test command to make sure everything is working.

$ make test
 
+

Finally you can try running one of the JS examples.

$ make js-chat
 
-

Licensing

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. + +
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+

Copyright 2024 Prediction Guard

-
\ No newline at end of file +
diff --git a/docs/interfaces/Base64Encoder.html b/docs/interfaces/Base64Encoder.html index aeef8cd..ecf4e5d 100644 --- a/docs/interfaces/Base64Encoder.html +++ b/docs/interfaces/Base64Encoder.html @@ -1,4 +1,4 @@ -Base64Encoder | predictionguard

Interface Base64Encoder

Base64Encoder defines a method that can read a data source and returns a +Base64Encoder | predictionguard

Interface Base64Encoder

Base64Encoder defines a method that can read a data source and returns a base64 encoded string.

-
interface Base64Encoder {
    EncodeBase64(): Promise<[string, null | Error]>;
}

Methods

Methods

\ No newline at end of file +
interface Base64Encoder {
    EncodeBase64(): Promise<[string, null | Error]>;
}

Methods

Methods

diff --git a/docs/interfaces/Chat.html b/docs/interfaces/Chat.html index 5fd0378..688910c 100644 --- a/docs/interfaces/Chat.html +++ b/docs/interfaces/Chat.html @@ -1,15 +1,15 @@ -Chat | predictionguard

Interface Chat

Chat represents an object that contains the result for the chat call.

-
interface Chat {
    choices: ChatChoice[];
    created: number;
    id: string;
    model: Models;
    object: string;
    createdDate(): Date;
}

Properties

choices +Chat | predictionguard

Interface Chat

Chat represents an object that contains the result for the chat call.

+
interface Chat {
    choices: ChatChoice[];
    created: number;
    id: string;
    model: string;
    object: string;
    createdDate(): Date;
}

Properties

choices: ChatChoice[]

choices represents the collection of choices to choose from.

-
created: number

created represents the unix timestamp for when the request was +

Properties

choices: ChatChoice[]

choices represents the collection of choices to choose from.

+
created: number

created represents the unix timestamp for when the request was received.

-
id: string

id represents a unique identifier for the result.

-
model: Models

model represents the model used for generating the result.

-
object: string

object represent the type of the result document.

-

Methods

  • createdDate converts the created unix timestamp into a JS Date.

    -

    Returns Date

\ No newline at end of file +
id: string

id represents a unique identifier for the result.

+
model: string

model represents the model used for generating the result.

+
object: string

object represent the type of the result document.

+

Methods

  • createdDate converts the created unix timestamp into a JS Date.

    +

    Returns Date

diff --git a/docs/interfaces/ChatChoice.html b/docs/interfaces/ChatChoice.html index fc5e3e0..bc4e1ec 100644 --- a/docs/interfaces/ChatChoice.html +++ b/docs/interfaces/ChatChoice.html @@ -1,10 +1,10 @@ -ChatChoice | predictionguard

Interface ChatChoice

ChatChoice represents an object that contains a result choice.

-
interface ChatChoice {
    index: number;
    message: ChatMessage;
    status: string;
}

Properties

index +ChatChoice | predictionguard

Interface ChatChoice

ChatChoice represents an object that contains a result choice.

+
interface ChatChoice {
    index: number;
    message: ChatMessage;
    status: string;
}

Properties

Properties

index: number

index represents the index position in the collection for +

Properties

index: number

index represents the index position in the collection for this choice.

-
message: ChatMessage

message represents the message response for this choice.

-
status: string

status represents if the response for this choice was successful +

message: ChatMessage

message represents the message response for this choice.

+
status: string

status represents if the response for this choice was successful or not.

-
\ No newline at end of file +
diff --git a/docs/interfaces/ChatInput.html b/docs/interfaces/ChatInput.html index fa109b2..2ef55b6 100644 --- a/docs/interfaces/ChatInput.html +++ b/docs/interfaces/ChatInput.html @@ -1,22 +1,16 @@ -ChatInput | predictionguard

Interface ChatInput

ChatInput represents the full potential input options for chat.

-
interface ChatInput {
    maxTokens: number;
    messages: ChatInputMessage[];
    model: Models;
    options: ChatInputOptions;
    temperature: number;
    topK: number;
    topP: number;
}

Properties

maxTokens +ChatInput | predictionguard

Interface ChatInput

ChatInput represents the full potential input options for chat.

+
interface ChatInput {
    maxTokens: number;
    messages: ChatInputMessage[];
    model: string;
    options: ChatInputOptions;
    temperature: number;
    topK: number;
    topP: number;
}

Properties

maxTokens: number

maxTokens represents the max number of tokens to return.

-
messages: ChatInputMessage[]

messages represents the set of messages to process.

-
model: Models

model represents the model to use. You are restriced to these models: -DeepseekCoder67BInstruct -Hermes2ProLlama38B -Hermes2ProMistral7B -LLama3SqlCoder8b -Llava157BHF -NeuralChat7B

-

options represents a set of optional parameters.

-
temperature: number

temperature represents the randomness in GPT's output.

-
topK: number

topK represents the variability of the generated text.

-
topP: number

topP represents the diversity of the generated text.

-
\ No newline at end of file +

Properties

maxTokens: number

maxTokens represents the max number of tokens to return.

+
messages: ChatInputMessage[]

messages represents the set of messages to process.

+
model: string

model represents the model to use.

+

options represents a set of optional parameters.

+
temperature: number

temperature represents the randomness in GPT's output.

+
topK: number

topK represents the variability of the generated text.

+
topP: number

topP represents the diversity of the generated text.

+
diff --git a/docs/interfaces/ChatInputMessage.html b/docs/interfaces/ChatInputMessage.html index ce7ff1d..08c08cf 100644 --- a/docs/interfaces/ChatInputMessage.html +++ b/docs/interfaces/ChatInputMessage.html @@ -1,6 +1,6 @@ -ChatInputMessage | predictionguard

Interface ChatInputMessage

ChatInputMessage represents a role and content related to a chat.

-
interface ChatInputMessage {
    content: string;
    role: Roles;
}

Properties

content +ChatInputMessage | predictionguard

Interface ChatInputMessage

ChatInputMessage represents a role and content related to a chat.

+
interface ChatInputMessage {
    content: string;
    role: Roles;
}

Properties

Properties

content: string

content represents the content of the message.

-
role: Roles

role represents the role of the sender (user or assistant).

-
\ No newline at end of file +

Properties

content: string

content represents the content of the message.

+
role: Roles

role represents the role of the sender (user or assistant).

+
diff --git a/docs/interfaces/ChatInputOptions.html b/docs/interfaces/ChatInputOptions.html index 75f81c5..97573a0 100644 --- a/docs/interfaces/ChatInputOptions.html +++ b/docs/interfaces/ChatInputOptions.html @@ -1,14 +1,14 @@ -ChatInputOptions | predictionguard

Interface ChatInputOptions

ChatInputOptions represents options for post and preprocessing the input.

-
interface ChatInputOptions {
    blockPromptInjection: boolean;
    factuality: boolean;
    pii: PIIs;
    piiReplaceMethod: ReplaceMethods;
    toxicity: boolean;
}

Properties

blockPromptInjection +ChatInputOptions | predictionguard

Interface ChatInputOptions

ChatInputOptions represents options for post and preprocessing the input.

+
interface ChatInputOptions {
    blockPromptInjection: boolean;
    factuality: boolean;
    pii: PIIs;
    piiReplaceMethod: ReplaceMethods;
    toxicity: boolean;
}

Properties

blockPromptInjection: boolean

blockPromptInjection represents the choice to run the +

Properties

blockPromptInjection: boolean

blockPromptInjection represents the choice to run the blockPromptInjection algorithm.

-
factuality: boolean

factuality represents the choice to run the factuality algorithm.

-
pii: PIIs

pii represents the choice to run the repalce personal information - algorithm and which one.

-
piiReplaceMethod: ReplaceMethods

piiReplaceMethod represents the method to use for PII.

-
toxicity: boolean

toxicity represents the choice to run the toxicity algorithm.

-
\ No newline at end of file +
factuality: boolean

factuality represents the choice to run the factuality algorithm.

+
pii: PIIs

pii represents the choice to run the repalce personal information +algorithm and which one.

+
piiReplaceMethod: ReplaceMethods

piiReplaceMethod represents the method to use for PII.

+
toxicity: boolean

toxicity represents the choice to run the toxicity algorithm.

+
diff --git a/docs/interfaces/ChatMessage.html b/docs/interfaces/ChatMessage.html index 17bdae4..1d08381 100644 --- a/docs/interfaces/ChatMessage.html +++ b/docs/interfaces/ChatMessage.html @@ -1,9 +1,9 @@ -ChatMessage | predictionguard

Interface ChatMessage

ChatMessage represents an object that contains the content and a role. It +ChatMessage | predictionguard

Interface ChatMessage

ChatMessage represents an object that contains the content and a role. It can be used for input and returned as part of the response.

-
interface ChatMessage {
    content: string;
    output: string;
    role: Roles;
}

Properties

interface ChatMessage {
    content: string;
    output: string;
    role: Roles;
}

Properties

Properties

content: string

content represents the content of the message.

-
output: string

output represents the output for this message.

-
role: Roles

role represents the role of the sender (user or assistant).

-
\ No newline at end of file +

Properties

content: string

content represents the content of the message.

+
output: string

output represents the output for this message.

+
role: Roles

role represents the role of the sender (user or assistant).

+
diff --git a/docs/interfaces/ChatSSE.html b/docs/interfaces/ChatSSE.html index 3d769c2..9b15ba5 100644 --- a/docs/interfaces/ChatSSE.html +++ b/docs/interfaces/ChatSSE.html @@ -1,16 +1,16 @@ -ChatSSE | predictionguard

Interface ChatSSE

ChatSSE represents an object that contains the result for the chatSSE +ChatSSE | predictionguard

Interface ChatSSE

ChatSSE represents an object that contains the result for the chatSSE call.

-
interface ChatSSE {
    choices: ChatSSEChoice[];
    created: number;
    id: string;
    model: Models;
    object: string;
    createdDate(): Date;
}

Properties

interface ChatSSE {
    choices: ChatSSEChoice[];
    created: number;
    id: string;
    model: string;
    object: string;
    createdDate(): Date;
}

Properties

choices: ChatSSEChoice[]

choices represents the collection of choices to choose from.

-
created: number

created represents the unix timestamp for when the request was +

Properties

choices: ChatSSEChoice[]

choices represents the collection of choices to choose from.

+
created: number

created represents the unix timestamp for when the request was received.

-
id: string

id represents a unique identifier for the result.

-
model: Models

model represents the model used for generating the result.

-
object: string

object represent the type of the result document.

-

Methods

  • createdDate converts the created unix timestamp into a JS Date.

    -

    Returns Date

\ No newline at end of file +
id: string

id represents a unique identifier for the result.

+
model: string

model represents the model used for generating the result.

+
object: string

object represent the type of the result document.

+

Methods

  • createdDate converts the created unix timestamp into a JS Date.

    +

    Returns Date

diff --git a/docs/interfaces/ChatSSEChoice.html b/docs/interfaces/ChatSSEChoice.html index c76e1b4..ca69417 100644 --- a/docs/interfaces/ChatSSEChoice.html +++ b/docs/interfaces/ChatSSEChoice.html @@ -1,15 +1,15 @@ -ChatSSEChoice | predictionguard

Interface ChatSSEChoice

ChatSSEChoice represents an object that contains a result choice.

-
interface ChatSSEChoice {
    delta: ChatSSEDelta;
    finish_reason: string;
    generated_text: string;
    index: number;
    logprobs: number;
}

Properties

delta +ChatSSEChoice | predictionguard

Interface ChatSSEChoice

ChatSSEChoice represents an object that contains a result choice.

+
interface ChatSSEChoice {
    delta: ChatSSEDelta;
    finish_reason: string;
    generated_text: string;
    index: number;
    logprobs: number;
}

Properties

delta represents the partial content for this choice.

-
finish_reason: string

finish_reason represents the reason the response has finished +

Properties

delta represents the partial content for this choice.

+
finish_reason: string

finish_reason represents the reason the response has finished which is provided when this is the last choice.

-
generated_text: string

generated_text represents the final completed chat response which +

generated_text: string

generated_text represents the final completed chat response which is provided when this is the last choice.

-
index: number

index represents the index position in the collection for +

index: number

index represents the index position in the collection for this choice.

-
logprobs: number

logprobs represents the log probabilty of accuracy for this choice.

-
\ No newline at end of file +
logprobs: number

logprobs represents the log probabilty of accuracy for this choice.

+
diff --git a/docs/interfaces/ChatSSEDelta.html b/docs/interfaces/ChatSSEDelta.html index 651b9c1..33444a1 100644 --- a/docs/interfaces/ChatSSEDelta.html +++ b/docs/interfaces/ChatSSEDelta.html @@ -1,4 +1,4 @@ -ChatSSEDelta | predictionguard

Interface ChatSSEDelta

ChatSSEDelta represents an object that contains the content.

-
interface ChatSSEDelta {
    content: string;
}

Properties

Properties

content: string

content represents the partial content response for a choice.

-
\ No newline at end of file +ChatSSEDelta | predictionguard

Interface ChatSSEDelta

ChatSSEDelta represents an object that contains the content.

+
interface ChatSSEDelta {
    content: string;
}

Properties

Properties

content: string

content represents the partial content response for a choice.

+
diff --git a/docs/interfaces/ChatSSEInput.html b/docs/interfaces/ChatSSEInput.html index 6775817..6960afc 100644 --- a/docs/interfaces/ChatSSEInput.html +++ b/docs/interfaces/ChatSSEInput.html @@ -1,22 +1,16 @@ -ChatSSEInput | predictionguard

Interface ChatSSEInput

ChatSSEInput represents the full potential input options for SSE chat.

-
interface ChatSSEInput {
    maxTokens: number;
    messages: ChatInputMessage[];
    model: Models;
    onMessage: ((event, err) => void);
    temperature: number;
    topK: number;
    topP: number;
}

Properties

maxTokens +ChatSSEInput | predictionguard

Interface ChatSSEInput

ChatSSEInput represents the full potential input options for SSE chat.

+
interface ChatSSEInput {
    maxTokens: number;
    messages: ChatInputMessage[];
    model: string;
    onMessage: ((event: null | ChatSSE, err: null | Error) => void);
    temperature: number;
    topK: number;
    topP: number;
}

Properties

maxTokens: number

maxTokens represents the max number of tokens to return.

-
messages: ChatInputMessage[]

messages represents the set of messages to process.

-
model: Models

model represents the model to use. You are restriced to these models: -DeepseekCoder67BInstruct -Hermes2ProLlama38B -Hermes2ProMistral7B -LLama3SqlCoder8b -Llava157BHF -NeuralChat7B

-
onMessage: ((event, err) => void)

onMessage represents a function that will receive the messages.

-

Type declaration

    • (event, err): void
    • Parameters

      Returns void

temperature: number

temperature represents the randomness in GPT's output.

-
topK: number

topK represents the variability of the generated text.

-
topP: number

topP represents the diversity of the generated text.

-
\ No newline at end of file +

Properties

maxTokens: number

maxTokens represents the max number of tokens to return.

+
messages: ChatInputMessage[]

messages represents the set of messages to process.

+
model: string

model represents the model to use.

+
onMessage: ((event: null | ChatSSE, err: null | Error) => void)

onMessage represents a function that will receive the messages.

+
temperature: number

temperature represents the randomness in GPT's output.

+
topK: number

topK represents the variability of the generated text.

+
topP: number

topP represents the diversity of the generated text.

+
diff --git a/docs/interfaces/ChatVision.html b/docs/interfaces/ChatVision.html index cd6eec5..c3dbe00 100644 --- a/docs/interfaces/ChatVision.html +++ b/docs/interfaces/ChatVision.html @@ -1,15 +1,15 @@ -ChatVision | predictionguard

Interface ChatVision

ChatVision represents the result for the vision call.

-
interface ChatVision {
    choices: ChatVisionChoice[];
    created: number;
    id: string;
    model: Models;
    object: string;
    createdDate(): Date;
}

Properties

choices +ChatVision | predictionguard

Interface ChatVision

ChatVision represents the result for the vision call.

+
interface ChatVision {
    choices: ChatVisionChoice[];
    created: number;
    id: string;
    model: string;
    object: string;
    createdDate(): Date;
}

Properties

choices: ChatVisionChoice[]

choices represents the collection of choices to choose from.

-
created: number

created represents the unix timestamp for when the request was +

Properties

choices: ChatVisionChoice[]

choices represents the collection of choices to choose from.

+
created: number

created represents the unix timestamp for when the request was received.

-
id: string

id represents a unique identifier for the result.

-
model: Models

model represents the model used for generating the result.

-
object: string

object represent the type of the result document.

-

Methods

  • createdDate converts the created unix timestamp into a JS Date.

    -

    Returns Date

\ No newline at end of file +
id: string

id represents a unique identifier for the result.

+
model: string

model represents the model used for generating the result.

+
object: string

object represent the type of the result document.

+

Methods

  • createdDate converts the created unix timestamp into a JS Date.

    +

    Returns Date

diff --git a/docs/interfaces/ChatVisionChoice.html b/docs/interfaces/ChatVisionChoice.html index 80ada5c..af2d10a 100644 --- a/docs/interfaces/ChatVisionChoice.html +++ b/docs/interfaces/ChatVisionChoice.html @@ -1,10 +1,10 @@ -ChatVisionChoice | predictionguard

Interface ChatVisionChoice

ChatVisionChoice represents a choice for the vision call.

-
interface ChatVisionChoice {
    index: number;
    message: ChatVisionMessage;
    status: string;
}

Properties

index +ChatVisionChoice | predictionguard

Interface ChatVisionChoice

ChatVisionChoice represents a choice for the vision call.

+
interface ChatVisionChoice {
    index: number;
    message: ChatVisionMessage;
    status: string;
}

Properties

Properties

index: number

index represents the index position in the collection for +

Properties

index: number

index represents the index position in the collection for this choice.

-

message represents a response for this choice.

-
status: string

status represents if the response for this choice was successful +

message represents a response for this choice.

+
status: string

status represents if the response for this choice was successful or not.

-
\ No newline at end of file +
diff --git a/docs/interfaces/ChatVisionInput.html b/docs/interfaces/ChatVisionInput.html index 8b186f6..54ca77a 100644 --- a/docs/interfaces/ChatVisionInput.html +++ b/docs/interfaces/ChatVisionInput.html @@ -1,16 +1,18 @@ -ChatVisionInput | predictionguard

Interface ChatVisionInput

ChatVisionInput represents the full potential input options for Vision chat.

-
interface ChatVisionInput {
    image: Base64Encoder;
    maxTokens: number;
    question: string;
    role: Roles;
    temperature: number;
    topK: number;
    topP: number;
}

Properties

image +ChatVisionInput | predictionguard

Interface ChatVisionInput

ChatVisionInput represents the full potential input options for Vision chat.

+
interface ChatVisionInput {
    image: Base64Encoder;
    maxTokens: number;
    model: string;
    question: string;
    role: Roles;
    temperature: number;
    topK: number;
    topP: number;
}

Properties

image represents an object that knows how to retrieve an image.

-
maxTokens: number

maxTokens represents the max number of tokens to return.

-
question: string

question represents the question about the image.

-
role: Roles

role represents the role of the sender (user or assistant).

-
temperature: number

temperature represents the randomness in GPT's output.

-
topK: number

topK represents the variability of the generated text.

-
topP: number

topP represents the diversity of the generated text.

-
\ No newline at end of file +

Properties

image represents an object that knows how to retrieve an image.

+
maxTokens: number

maxTokens represents the max number of tokens to return.

+
model: string

model represents the model to use.

+
question: string

question represents the question about the image.

+
role: Roles

role represents the role of the sender (user or assistant).

+
temperature: number

temperature represents the randomness in GPT's output.

+
topK: number

topK represents the variability of the generated text.

+
topP: number

topP represents the diversity of the generated text.

+
diff --git a/docs/interfaces/ChatVisionMessage.html b/docs/interfaces/ChatVisionMessage.html index f01369a..b1584a7 100644 --- a/docs/interfaces/ChatVisionMessage.html +++ b/docs/interfaces/ChatVisionMessage.html @@ -1,8 +1,8 @@ -ChatVisionMessage | predictionguard

Interface ChatVisionMessage

ChatVisionMessage represents content for the vision call.

-
interface ChatVisionMessage {
    content: string;
    output: string;
    role: Roles;
}

Properties

content +ChatVisionMessage | predictionguard

Interface ChatVisionMessage

ChatVisionMessage represents content for the vision call.

+
interface ChatVisionMessage {
    content: string;
    output: string;
    role: Roles;
}

Properties

Properties

content: string

content represents the response for this message.

-
output: string

output represents the output for this message.

-
role: Roles

role represents the role of the sender (user or assistant).

-
\ No newline at end of file +

Properties

content: string

content represents the response for this message.

+
output: string

output represents the output for this message.

+
role: Roles

role represents the role of the sender (user or assistant).

+
diff --git a/docs/interfaces/Completion.html b/docs/interfaces/Completion.html index 195f282..ff29187 100644 --- a/docs/interfaces/Completion.html +++ b/docs/interfaces/Completion.html @@ -1,14 +1,14 @@ -Completion | predictionguard

Interface Completion

Completion represents an object that contains the result for the +Completion | predictionguard

Interface Completion

Completion represents an object that contains the result for the completion call.

-
interface Completion {
    choices: CompletionChoice[];
    created: number;
    id: string;
    object: string;
    createdDate(): Date;
}

Properties

interface Completion {
    choices: CompletionChoice[];
    created: number;
    id: string;
    object: string;
    createdDate(): Date;
}

Properties

Methods

Properties

choices: CompletionChoice[]

choices represents the collection of choices to choose from.

-
created: number

created represents the unix timestamp for when the request was +

Properties

choices: CompletionChoice[]

choices represents the collection of choices to choose from.

+
created: number

created represents the unix timestamp for when the request was received.

-
id: string

id represents a unique identifier for the result.

-
object: string

object represent the type of the result document.

-

Methods

  • createdDate converts the created unix timestamp into a JS Date.

    -

    Returns Date

\ No newline at end of file +
id: string

id represents a unique identifier for the result.

+
object: string

object represent the type of the result document.

+

Methods

  • createdDate converts the created unix timestamp into a JS Date.

    +

    Returns Date

diff --git a/docs/interfaces/CompletionChoice.html b/docs/interfaces/CompletionChoice.html index 827d439..5080b43 100644 --- a/docs/interfaces/CompletionChoice.html +++ b/docs/interfaces/CompletionChoice.html @@ -1,13 +1,13 @@ -CompletionChoice | predictionguard

Interface CompletionChoice

Choice represents an object that contains a result choice.

-
interface CompletionChoice {
    index: number;
    model: Models;
    status: string;
    text: string;
}

Properties

index +CompletionChoice | predictionguard

Interface CompletionChoice

Choice represents an object that contains a result choice.

+
interface CompletionChoice {
    index: number;
    model: string;
    status: string;
    text: string;
}

Properties

Properties

index: number

index represents the index position in the collection for +

Properties

index: number

index represents the index position in the collection for this choice.

-
model: Models

model represents the model used for generating the result for +

model: string

model represents the model used for generating the result for this choice.

-
status: string

status represents if the response for this choice was successful +

status: string

status represents if the response for this choice was successful or not.

-
text: string

text represents the generated text for this choice.

-
\ No newline at end of file +
text: string

text represents the generated text for this choice.

+
diff --git a/docs/interfaces/CompletionInput.html b/docs/interfaces/CompletionInput.html index 1237eb3..6482f9c 100644 --- a/docs/interfaces/CompletionInput.html +++ b/docs/interfaces/CompletionInput.html @@ -1,19 +1,14 @@ -CompletionInput | predictionguard

Interface CompletionInput

CompletionInput represents the full potential input options for completion.

-
interface CompletionInput {
    maxTokens: number;
    model: Models;
    prompt: string;
    temperature: number;
    topK: number;
    topP: number;
}

Properties

maxTokens +CompletionInput | predictionguard

Interface CompletionInput

CompletionInput represents the full potential input options for completion.

+
interface CompletionInput {
    maxTokens: number;
    model: string;
    prompt: string;
    temperature: number;
    topK: number;
    topP: number;
}

Properties

maxTokens: number

maxTokens represents the max number of tokens to return.

-
model: Models

model represents the model to use. You are restriced to these models: -DeepseekCoder67BInstruct -Hermes2ProLlama38B -Hermes2ProMistral7B -NeuralChat7B -NousHermesLlama213B

-
prompt: string

prompt represents the prompt to process.

-
temperature: number

temperature represents the randomness in GPT's output.

-
topK: number

topK represents the variability of the generated text.

-
topP: number

topP represents the diversity of the generated text.

-
\ No newline at end of file +

Properties

maxTokens: number

maxTokens represents the max number of tokens to return.

+
model: string

model represents the model to use.

+
prompt: string

prompt represents the prompt to process.

+
temperature: number

temperature represents the randomness in GPT's output.

+
topK: number

topK represents the variability of the generated text.

+
topP: number

topP represents the diversity of the generated text.

+
diff --git a/docs/interfaces/Embedding.html b/docs/interfaces/Embedding.html index 0335418..00ae186 100644 --- a/docs/interfaces/Embedding.html +++ b/docs/interfaces/Embedding.html @@ -1,15 +1,15 @@ -Embedding | predictionguard

Interface Embedding

Embedding represents the result for the embedding call.

-
interface Embedding {
    created: number;
    data: EmbeddingData[];
    id: string;
    model: Models;
    object: string;
    createdDate(): Date;
}

Properties

created +Embedding | predictionguard

Interface Embedding

Embedding represents the result for the embedding call.

+
interface Embedding {
    created: number;
    data: EmbeddingData[];
    id: string;
    model: string;
    object: string;
    createdDate(): Date;
}

Properties

Methods

Properties

created: number

created represents the unix timestamp for when the request was +

Properties

created: number

created represents the unix timestamp for when the request was received.

-

EmbeddingData represents the collection of vector points.

-
id: string

id represents a unique identifier for the result.

-
model: Models

model represents the model used for generating the result.

-
object: string

object represent the type of the result document.

-

Methods

  • createdDate converts the created unix timestamp into a JS Date.

    -

    Returns Date

\ No newline at end of file +

EmbeddingData represents the collection of vector points.

+
id: string

id represents a unique identifier for the result.

+
model: string

model represents the model used for generating the result.

+
object: string

object represent the type of the result document.

+

Methods

  • createdDate converts the created unix timestamp into a JS Date.

    +

    Returns Date

diff --git a/docs/interfaces/EmbeddingData.html b/docs/interfaces/EmbeddingData.html index e9bd7d2..17ca1cd 100644 --- a/docs/interfaces/EmbeddingData.html +++ b/docs/interfaces/EmbeddingData.html @@ -1,9 +1,9 @@ -EmbeddingData | predictionguard

Interface EmbeddingData

EmbeddingData represents the vector data points.

-
interface EmbeddingData {
    embedding: number[];
    index: number;
    status: string;
}

Properties

embedding +EmbeddingData | predictionguard

Interface EmbeddingData

EmbeddingData represents the vector data points.

+
interface EmbeddingData {
    embedding: number[];
    index: number;
    status: string;
}

Properties

Properties

embedding: number[]
index: number

index represents the index position in the collection for +

Properties

embedding: number[]
index: number

index represents the index position in the collection for this choice.

-
status: string

status represents if the response for this choice was successful +

status: string

status represents if the response for this choice was successful or not.

-
\ No newline at end of file +
diff --git a/docs/interfaces/EmbeddingInput.html b/docs/interfaces/EmbeddingInput.html index 5eee34a..524ac54 100644 --- a/docs/interfaces/EmbeddingInput.html +++ b/docs/interfaces/EmbeddingInput.html @@ -1,6 +1,6 @@ -EmbeddingInput | predictionguard

Interface EmbeddingInput

EmbeddingInput represents the input to generate embeddings.

-
interface EmbeddingInput {
    image: Base64Encoder;
    text: string;
}

Properties

image +EmbeddingInput | predictionguard

Interface EmbeddingInput

EmbeddingInput represents the input to generate embeddings.

+
interface EmbeddingInput {
    image: Base64Encoder;
    text: string;
}

Properties

Properties

image represents an image to vectorize.

-
text: string

text represents text to vectorize.

-
\ No newline at end of file +

Properties

image represents an image to vectorize.

+
text: string

text represents text to vectorize.

+
diff --git a/docs/interfaces/Error.html b/docs/interfaces/Error.html index 31c7364..8e1f5f6 100644 --- a/docs/interfaces/Error.html +++ b/docs/interfaces/Error.html @@ -1,4 +1,4 @@ -Error | predictionguard

Interface Error

Error represents an error that can be returned from the API service.

-
interface Error {
    error: string;
}

Properties

Properties

error: string

error represents an error message.

-
\ No newline at end of file +Error | predictionguard

Interface Error

Error represents an error that can be returned from the API service.

+
interface Error {
    error: string;
}

Properties

Properties

error: string

error represents an error message.

+
diff --git a/docs/interfaces/Factuality.html b/docs/interfaces/Factuality.html index 9e0a9c8..8498e67 100644 --- a/docs/interfaces/Factuality.html +++ b/docs/interfaces/Factuality.html @@ -1,14 +1,14 @@ -Factuality | predictionguard

Interface Factuality

Factuality represents an object that contains the result for the +Factuality | predictionguard

Interface Factuality

Factuality represents an object that contains the result for the factuality call.

-
interface Factuality {
    checks: FactualityCheck[];
    created: number;
    id: string;
    object: string;
    createdDate(): Date;
}

Properties

interface Factuality {
    checks: FactualityCheck[];
    created: number;
    id: string;
    object: string;
    createdDate(): Date;
}

Properties

Methods

Properties

checks: FactualityCheck[]

checks represents the collection of checks to choose from.

-
created: number

created represents the unix timestamp for when the request was +

Properties

checks: FactualityCheck[]

checks represents the collection of checks to choose from.

+
created: number

created represents the unix timestamp for when the request was received.

-
id: string

id represents a unique identifier for the result.

-
object: string

object represent the type of the result document.

-

Methods

  • createdDate converts the created unix timestamp into a JS Date.

    -

    Returns Date

\ No newline at end of file +
id: string

id represents a unique identifier for the result.

+
object: string

object represent the type of the result document.

+

Methods

  • createdDate converts the created unix timestamp into a JS Date.

    +

    Returns Date

diff --git a/docs/interfaces/FactualityCheck.html b/docs/interfaces/FactualityCheck.html index 12b87ed..9f17a45 100644 --- a/docs/interfaces/FactualityCheck.html +++ b/docs/interfaces/FactualityCheck.html @@ -1,9 +1,9 @@ -FactualityCheck | predictionguard

Interface FactualityCheck

FactualityCheck represents an object that contains a check choice.

-
interface FactualityCheck {
    index: number;
    score: number;
    status: string;
}

Properties

index +FactualityCheck | predictionguard

Interface FactualityCheck

FactualityCheck represents an object that contains a check choice.

+
interface FactualityCheck {
    index: number;
    score: number;
    status: string;
}

Properties

Properties

index: number

index represents the index position in the collection for +

Properties

index: number

index represents the index position in the collection for this checks.

-
score: number

score represents the score for this check.

-
status: string

status represents the status for this check.

-
\ No newline at end of file +
score: number

score represents the score for this check.

+
status: string

status represents the status for this check.

+
diff --git a/docs/interfaces/Injection.html b/docs/interfaces/Injection.html index e694b72..56087aa 100644 --- a/docs/interfaces/Injection.html +++ b/docs/interfaces/Injection.html @@ -1,14 +1,14 @@ -Injection | predictionguard

Interface Injection

Injection represents an object that contains the result for the +Injection | predictionguard

Interface Injection

Injection represents an object that contains the result for the injection call.

-
interface Injection {
    checks: InjectionCheck[];
    created: number;
    id: string;
    object: string;
    createdDate(): Date;
}

Properties

interface Injection {
    checks: InjectionCheck[];
    created: number;
    id: string;
    object: string;
    createdDate(): Date;
}

Properties

Methods

Properties

checks: InjectionCheck[]

checks represents the collection of checks to choose from.

-
created: number

created represents the unix timestamp for when the result was +

Properties

checks: InjectionCheck[]

checks represents the collection of checks to choose from.

+
created: number

created represents the unix timestamp for when the result was received.

-
id: string

id represents a unique identifier for the result.

-
object: string

object represent the type of the result document.

-

Methods

  • createdDate converts the created unix timestamp into a JS Date.

    -

    Returns Date

\ No newline at end of file +
id: string

id represents a unique identifier for the result.

+
object: string

object represent the type of the result document.

+

Methods

  • createdDate converts the created unix timestamp into a JS Date.

    +

    Returns Date

diff --git a/docs/interfaces/InjectionCheck.html b/docs/interfaces/InjectionCheck.html index 54b60c7..34071b0 100644 --- a/docs/interfaces/InjectionCheck.html +++ b/docs/interfaces/InjectionCheck.html @@ -1,10 +1,10 @@ -InjectionCheck | predictionguard

Interface InjectionCheck

InjectionCheck represents an object that contains a check choice.

-
interface InjectionCheck {
    index: number;
    probability: number;
    status: string;
}

Properties

index +InjectionCheck | predictionguard

Interface InjectionCheck

InjectionCheck represents an object that contains a check choice.

+
interface InjectionCheck {
    index: number;
    probability: number;
    status: string;
}

Properties

index: number

index represents the index position in the collection for +

Properties

index: number

index represents the index position in the collection for this checks.

-
probability: number

probability represents the probability of a potential injection +

probability: number

probability represents the probability of a potential injection attack.

-
status: string

status represents the status for this check.

-
\ No newline at end of file +
status: string

status represents the status for this check.

+
diff --git a/docs/interfaces/ReplacePII.html b/docs/interfaces/ReplacePII.html index aa58e61..e348df8 100644 --- a/docs/interfaces/ReplacePII.html +++ b/docs/interfaces/ReplacePII.html @@ -1,14 +1,14 @@ -ReplacePII | predictionguard

Interface ReplacePII

ReplacePII represents an object that contains the result for the +ReplacePII | predictionguard

Interface ReplacePII

ReplacePII represents an object that contains the result for the replacepi call.

-
interface ReplacePII {
    checks: ReplacePIICheck[];
    created: number;
    id: string;
    object: string;
    createdDate(): Date;
}

Properties

interface ReplacePII {
    checks: ReplacePIICheck[];
    created: number;
    id: string;
    object: string;
    createdDate(): Date;
}

Properties

Methods

Properties

checks: ReplacePIICheck[]

checks represents the collection of checks to choose from.

-
created: number

created represents the unix timestamp for when the request was +

Properties

checks: ReplacePIICheck[]

checks represents the collection of checks to choose from.

+
created: number

created represents the unix timestamp for when the request was received.

-
id: string

id represents a unique identifier for the result.

-
object: string

object represent the type of the result document.

-

Methods

  • createdDate converts the created unix timestamp into a JS Date.

    -

    Returns Date

\ No newline at end of file +
id: string

id represents a unique identifier for the result.

+
object: string

object represent the type of the result document.

+

Methods

  • createdDate converts the created unix timestamp into a JS Date.

    +

    Returns Date

diff --git a/docs/interfaces/ReplacePIICheck.html b/docs/interfaces/ReplacePIICheck.html index 3b11254..360de86 100644 --- a/docs/interfaces/ReplacePIICheck.html +++ b/docs/interfaces/ReplacePIICheck.html @@ -1,9 +1,9 @@ -ReplacePIICheck | predictionguard

Interface ReplacePIICheck

ReplacePIICheck represents an object that contains a check choice.

-
interface ReplacePIICheck {
    index: number;
    new_prompt: string;
    status: string;
}

Properties

index +ReplacePIICheck | predictionguard

Interface ReplacePIICheck

ReplacePIICheck represents an object that contains a check choice.

+
interface ReplacePIICheck {
    index: number;
    new_prompt: string;
    status: string;
}

Properties

Properties

index: number

index represents the index position in the collection for +

Properties

index: number

index represents the index position in the collection for this checks.

-
new_prompt: string

new_prompt represents the text with replaced personal information.

-
status: string

status represents the status for this check.

-
\ No newline at end of file +
new_prompt: string

new_prompt represents the text with replaced personal information.

+
status: string

status represents the status for this check.

+
diff --git a/docs/interfaces/Toxicity.html b/docs/interfaces/Toxicity.html index cdca08f..052404d 100644 --- a/docs/interfaces/Toxicity.html +++ b/docs/interfaces/Toxicity.html @@ -1,14 +1,14 @@ -Toxicity | predictionguard

Interface Toxicity

Toxicity represents an object that contains the result for the +Toxicity | predictionguard

Interface Toxicity

Toxicity represents an object that contains the result for the toxicity call.

-
interface Toxicity {
    checks: ToxicityCheck[];
    created: number;
    id: string;
    object: string;
    createdDate(): Date;
}

Properties

interface Toxicity {
    checks: ToxicityCheck[];
    created: number;
    id: string;
    object: string;
    createdDate(): Date;
}

Properties

Methods

Properties

checks: ToxicityCheck[]

checks represents the collection of checks to choose from.

-
created: number

created represents the unix timestamp for when the request was +

Properties

checks: ToxicityCheck[]

checks represents the collection of checks to choose from.

+
created: number

created represents the unix timestamp for when the request was received.

-
id: string

id represents a unique identifier for the result.

-
object: string

object represent the type of the result document.

-

Methods

  • createdDate converts the created unix timestamp into a JS Date.

    -

    Returns Date

\ No newline at end of file +
id: string

id represents a unique identifier for the result.

+
object: string

object represent the type of the result document.

+

Methods

  • createdDate converts the created unix timestamp into a JS Date.

    +

    Returns Date

diff --git a/docs/interfaces/ToxicityCheck.html b/docs/interfaces/ToxicityCheck.html index 3c11b30..47ad771 100644 --- a/docs/interfaces/ToxicityCheck.html +++ b/docs/interfaces/ToxicityCheck.html @@ -1,9 +1,9 @@ -ToxicityCheck | predictionguard

Interface ToxicityCheck

ToxicityCheck represents an object that contains a check choice.

-
interface ToxicityCheck {
    index: number;
    score: number;
    status: string;
}

Properties

index +ToxicityCheck | predictionguard

Interface ToxicityCheck

ToxicityCheck represents an object that contains a check choice.

+
interface ToxicityCheck {
    index: number;
    score: number;
    status: string;
}

Properties

Properties

index: number

index represents the index position in the collection for +

Properties

index: number

index represents the index position in the collection for this checks.

-
score: number

score represents the score for the provided text.

-
status: string

status represents the status for this check.

-
\ No newline at end of file +
score: number

score represents the score for the provided text.

+
status: string

status represents the status for this check.

+
diff --git a/docs/interfaces/Translate.html b/docs/interfaces/Translate.html index b3fbed9..a7ffc50 100644 --- a/docs/interfaces/Translate.html +++ b/docs/interfaces/Translate.html @@ -1,6 +1,6 @@ -Translate | predictionguard

Interface Translate

Translate represents an object that contains the result for the +Translate | predictionguard

Interface Translate

Translate represents an object that contains the result for the translate call.

-
interface Translate {
    best_score: number;
    best_translation: string;
    best_translation_model: string;
    created: number;
    id: string;
    object: string;
    translations: Translation[];
    createdDate(): Date;
}

Properties

interface Translate {
    best_score: number;
    best_translation: string;
    best_translation_model: string;
    created: number;
    id: string;
    object: string;
    translations: Translation[];
    createdDate(): Date;
}

Properties

best_score: number

best_score represents the best score for the best translation.

-
best_translation: string

best_translation represents the best translation of the input text.

-
best_translation_model: string

best_translation_model represents the model used for the best +

Properties

best_score: number

best_score represents the best score for the best translation.

+
best_translation: string

best_translation represents the best translation of the input text.

+
best_translation_model: string

best_translation_model represents the model used for the best translation.

-
created: number

created represents the unix timestamp for when the request was +

created: number

created represents the unix timestamp for when the request was received.

-
id: string

id represents a unique identifier for the result.

-
object: string

object represent the type of the result document.

-
translations: Translation[]

translations represents the collection of translations to choose from.

-

Methods

  • createdDate converts the created unix timestamp into a JS Date.

    -

    Returns Date

\ No newline at end of file +
id: string

id represents a unique identifier for the result.

+
object: string

object represent the type of the result document.

+
translations: Translation[]

translations represents the collection of translations to choose from.

+

Methods

  • createdDate converts the created unix timestamp into a JS Date.

    +

    Returns Date

diff --git a/docs/interfaces/Translation.html b/docs/interfaces/Translation.html index 37c1696..eecffb1 100644 --- a/docs/interfaces/Translation.html +++ b/docs/interfaces/Translation.html @@ -1,10 +1,10 @@ -Translation | predictionguard

Interface Translation

Translation represents an object that contains a translation choice.

-
interface Translation {
    model: string;
    score: number;
    status: string;
    translation: string;
}

Properties

model +Translation | predictionguard

Interface Translation

Translation represents an object that contains a translation choice.

+
interface Translation {
    model: string;
    score: number;
    status: string;
    translation: string;
}

Properties

model: string

model represents the model that was used for this translation.

-
score: number

score represents the quality score for this translation.

-
status: string

status represents the status of using the model for this translation.

-
translation: string

translation represents the translation.

-
\ No newline at end of file +

Properties

model: string

model represents the model that was used for this translation.

+
score: number

score represents the quality score for this translation.

+
status: string

status represents the status of using the model for this translation.

+
translation: string

translation represents the translation.

+
diff --git a/docs/modules.html b/docs/modules.html index d14a8c8..270ee29 100644 --- a/docs/modules.html +++ b/docs/modules.html @@ -1,5 +1,4 @@ -predictionguard

predictionguard

Index

Enumerations

Languages -Models +predictionguard

predictionguard

Index

Enumerations

\ No newline at end of file +
diff --git a/examples/chat.js b/examples/chat.js index d6e21cc..3de3b18 100644 --- a/examples/chat.js +++ b/examples/chat.js @@ -4,7 +4,7 @@ const client = new pg.Client('https://api.predictionguard.com', process.env.PGKE async function Chat() { const input = { - model: pg.Models.NeuralChat7B, + model: 'Neural-Chat-7B', messages: [ { role: pg.Roles.User, @@ -14,7 +14,7 @@ async function Chat() { maxTokens: 1000, temperature: 0.1, topP: 0.1, - topK: 50.0, + topK: 50, options: { factuality: true, toxicity: true, diff --git a/examples/chat_sse.js b/examples/chat_sse.js index 2b6ebe7..4c7e6a9 100644 --- a/examples/chat_sse.js +++ b/examples/chat_sse.js @@ -4,7 +4,7 @@ const client = new pg.Client('https://api.predictionguard.com', process.env.PGKE async function ChatSSE() { const input = { - model: pg.Models.NeuralChat7B, + model: 'Neural-Chat-7B', messages: [ { role: pg.Roles.User, @@ -14,7 +14,7 @@ async function ChatSSE() { maxTokens: 1000, temperature: 0.1, topP: 0.1, - topK: 50.0, + topK: 50, onMessage: function (event, err) { if (err != null) { if (err.error == 'EOF') { diff --git a/examples/chat_vision.js b/examples/chat_vision.js index 929b177..dbde6c7 100644 --- a/examples/chat_vision.js +++ b/examples/chat_vision.js @@ -6,16 +6,17 @@ async function ChatVision() { const image = new pg.ImageNetwork('https://images.ctfassets.net/hrltx12pl8hq/7GlCy7xexnzzrAARg86iUj/f4429bfa8397f81a2429ea003181347f/Autumn_Vectors.jpg'); const input = { + model: 'llava-1.5-7b-hf', role: pg.Roles.User, question: 'is there a deer in this picture', image: image, maxTokens: 1000, temperature: 0.1, topP: 0.1, - topK: 50.0, + topK: 50, }; - var [result, err] = await client.ChatVision(input); + var [result, err] = await client.ChatVision('bridgetower-large-itm-mlm-itc', input); if (err != null) { console.log('ERROR:' + err.error); return; diff --git a/examples/completion.js b/examples/completion.js index ae93646..d6244a2 100644 --- a/examples/completion.js +++ b/examples/completion.js @@ -4,12 +4,12 @@ const client = new pg.Client('https://api.predictionguard.com', process.env.PGKE async function Completions() { const input = { - model: pg.Models.NeuralChat7B, + model: 'Neural-Chat-7B', prompt: 'Will I lose my hair', maxTokens: 1000, temperature: 0.1, topP: 0.1, - topK: 50.0, + topK: 50, }; var [result, err] = await client.Completion(input); diff --git a/examples/embedding.js b/examples/embedding.js index 7ae6343..b0c34c4 100644 --- a/examples/embedding.js +++ b/examples/embedding.js @@ -12,7 +12,7 @@ async function Embedding() { }, ]; - var [result, err] = await client.Embedding(input); + var [result, err] = await client.Embedding('bridgetower-large-itm-mlm-itc', input); if (err != null) { console.log('ERROR:' + err.error); return; diff --git a/package-lock.json b/package-lock.json index 1144b78..75cd6ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "predictionguard", - "version": "0.20.0", + "version": "0.21.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "predictionguard", - "version": "0.20.0", + "version": "0.21.0", "license": "Apache 2.0", "dependencies": { "fetch-sse": "^1.0.23", diff --git a/package.json b/package.json index 96c55a6..39a476b 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "type": "module", "name": "predictionguard", "author": "Prediction Guard", - "version": "0.20.0", + "version": "0.21.0", "license": "Apache 2.0", "main": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/src/api_client.ts b/src/api_client.ts index e126cd4..5008a05 100644 --- a/src/api_client.ts +++ b/src/api_client.ts @@ -2,7 +2,7 @@ import fetch from 'node-fetch'; import * as sse from 'fetch-sse'; import * as model from './api_model.js'; -const version = '0.20.0'; +const version = '0.21.0'; /** Client provides access the PredictionGuard API. */ export class Client { @@ -24,16 +24,6 @@ export class Client { // ------------------------------------------------------------------------- // Chat - /** Set of models supported by the chat APIs. */ - private chatModels = new Map([ - [model.Models.DeepseekCoder67BInstruct, true], - [model.Models.Hermes2ProLlama38B, true], - [model.Models.Hermes2ProMistral7B, true], - [model.Models.LLama3SqlCoder8b, true], - [model.Models.Llava157BHF, true], - [model.Models.NeuralChat7B, true], - ]); - /** Chat generates chat completions based on a conversation history. * * @example @@ -44,7 +34,7 @@ export class Client { * * async function Chat() { * const input = { - * model: pg.Models.NeuralChat7B, + * model: 'Neural-Chat-7B', * messages: [ * { * role: pg.Roles.User, @@ -54,7 +44,7 @@ export class Client { * maxTokens: 1000, * temperature: 0.1, * topP: 0.1, - * topK: 50.0, + * topK: 50, * options: { * factuality: true, * toxicity: true, @@ -98,10 +88,6 @@ export class Client { return [zero, {error: 'model is a mandatory input'}]; } - if (!this.chatModels.get(input.model)) { - return [zero, {error: 'model specified is not supported'}]; - } - if (!input.hasOwnProperty('messages')) { return [zero, {error: 'messages is a mandatory input'}]; } @@ -201,7 +187,7 @@ export class Client { * * async function ChatSSE() { * const input = { - * model: pg.Models.NeuralChat7B, + * model: 'Neural-Chat-7B', * messages: [ * { * role: pg.Roles.User, @@ -211,7 +197,7 @@ export class Client { * maxTokens: 1000, * temperature: 0.1, * topP: 0.1, - * topK: 50.0, + * topK: 50, * onMessage: function (event, err) { * if (err != null) { * if (err.error == 'EOF') { @@ -250,10 +236,6 @@ export class Client { return {error: 'model is a mandatory input'}; } - if (!this.chatModels.get(input.model)) { - return {error: 'model specified is not supported'}; - } - if (!input.hasOwnProperty('messages')) { return {error: 'messages is a mandatory input'}; } @@ -327,7 +309,7 @@ export class Client { * maxTokens: 1000, * temperature: 0.1, * topP: 0.1, - * topK: 50.0, + * topK: 50, * }; * * var [result, err] = await client.ChatVision(input); @@ -353,7 +335,7 @@ export class Client { id: '', object: '', created: 0, - model: model.Models.Llava157BHF, + model: '', choices: [], createdDate: function () { return new Date(0); @@ -361,6 +343,10 @@ export class Client { }; try { + if (!input.hasOwnProperty('model')) { + return [zero, {error: 'model is a mandatory input'}]; + } + if (!input.hasOwnProperty('role')) { return [zero, {error: 'role is a mandatory input'}]; } @@ -379,7 +365,7 @@ export class Client { } const m = new Map(); - m.set('model', model.Models.Llava157BHF); + m.set('model', input.model); m.set('messages', [ { role: input.role, @@ -435,15 +421,6 @@ export class Client { // ------------------------------------------------------------------------- // Completion - /** Set of models supported by the completion API. */ - private completionModels = new Map([ - [model.Models.DeepseekCoder67BInstruct, true], - [model.Models.Hermes2ProLlama38B, true], - [model.Models.Hermes2ProMistral7B, true], - [model.Models.NeuralChat7B, true], - [model.Models.NousHermesLlama213B, true], - ]); - /** Completion generates text completions based on the provided input. * * @example @@ -454,12 +431,12 @@ export class Client { * * async function Completions() { * const input = { - * model: pg.Models.NeuralChat7B, + * model: 'Neural-Chat-7B', * prompt: 'Will I lose my hair', * maxTokens: 1000, * temperature: 0.1, * topP: 0.1, - * topK: 50.0, + * topK: 50, * }; * * var [result, err] = await client.Completion(input); @@ -496,10 +473,6 @@ export class Client { return [zero, {error: 'model is a mandatory input'}]; } - if (!this.completionModels.get(input.model)) { - return [zero, {error: 'model specified is not supported'}]; - } - if (!input.hasOwnProperty('prompt')) { return [zero, {error: 'prompt is a mandatory input'}]; } @@ -563,7 +536,7 @@ export class Client { * }, * ]; * - * var [result, err] = await client.Embedding(input); + * var [result, err] = await client.Embedding('bridgetower-large-itm-mlm-itc', input); * if (err != null) { * console.log('ERROR:' + err.error); * return; @@ -577,18 +550,20 @@ export class Client { * Embedding(); * ``` * + * @param {string} model - model to use. + * * @param {model.EmbeddingInput[]} input - input represents a collection of * text and images to vectorize. * * @returns - A Promise with a Embedding object and an Error object if * the error is not null. */ - async Embedding(input: model.EmbeddingInput[]): Promise<[model.Embedding, model.Error | null]> { + async Embedding(model: string, input: model.EmbeddingInput[]): Promise<[model.Embedding, model.Error | null]> { const zero: model.Embedding = { id: '', object: '', created: 0, - model: model.Models.BridgetowerLargeItmMlmItc, + model: '', data: [], createdDate: function () { return new Date(0); @@ -614,7 +589,7 @@ export class Client { } const body = { - model: model.Models.BridgetowerLargeItmMlmItc, + model: model, input: embeds, }; diff --git a/src/api_model.ts b/src/api_model.ts index 9010c25..9b80fdb 100644 --- a/src/api_model.ts +++ b/src/api_model.ts @@ -6,18 +6,6 @@ export interface Error { // ----------------------------------------------------------------------------- -/** Models represents the set of models that can be used. */ -export enum Models { - BridgetowerLargeItmMlmItc = 'bridgetower-large-itm-mlm-itc', - DeepseekCoder67BInstruct = 'deepseek-coder-6.7b-instruct', - Hermes2ProLlama38B = 'Hermes-2-Pro-Llama-3-8B', - Hermes2ProMistral7B = 'Hermes-2-Pro-Mistral-7B', - LLama3SqlCoder8b = 'llama-3-sqlcoder-8b', - Llava157BHF = 'llava-1.5-7b-hf', - NeuralChat7B = 'Neural-Chat-7B', - NousHermesLlama213B = 'Nous-Hermes-Llama-213B', -} - /** Roles represents the set of roles that a sender can represent themselves * as. */ export enum Roles { @@ -156,15 +144,8 @@ export interface ChatInputOptions { /** ChatInput represents the full potential input options for chat. */ export interface ChatInput { - /** model represents the model to use. You are restriced to these models: - * DeepseekCoder67BInstruct - * Hermes2ProLlama38B - * Hermes2ProMistral7B - * LLama3SqlCoder8b - * Llava157BHF - * NeuralChat7B - */ - model: Models; + /** model represents the model to use. */ + model: string; /** messages represents the set of messages to process. */ messages: ChatInputMessage[]; @@ -225,7 +206,7 @@ export interface Chat { created: number; /** model represents the model used for generating the result. */ - model: Models; + model: string; /** choices represents the collection of choices to choose from. */ choices: ChatChoice[]; @@ -238,15 +219,8 @@ export interface Chat { /** ChatSSEInput represents the full potential input options for SSE chat. */ export interface ChatSSEInput { - /** model represents the model to use. You are restriced to these models: - * DeepseekCoder67BInstruct - * Hermes2ProLlama38B - * Hermes2ProMistral7B - * LLama3SqlCoder8b - * Llava157BHF - * NeuralChat7B - */ - model: Models; + /** model represents the model to use. */ + model: string; /** messages represents the set of messages to process. */ messages: ChatInputMessage[]; @@ -308,7 +282,7 @@ export interface ChatSSE { created: number; /** model represents the model used for generating the result. */ - model: Models; + model: string; /** choices represents the collection of choices to choose from. */ choices: ChatSSEChoice[]; @@ -321,6 +295,9 @@ export interface ChatSSE { /** ChatVisionInput represents the full potential input options for Vision chat. */ export interface ChatVisionInput { + /** model represents the model to use. */ + model: string; + /** role represents the role of the sender (user or assistant). */ role: Roles; @@ -382,7 +359,7 @@ export interface ChatVision { created: number; /** model represents the model used for generating the result. */ - model: Models; + model: string; /** choices represents the collection of choices to choose from. */ choices: ChatVisionChoice[]; @@ -395,14 +372,8 @@ export interface ChatVision { /** CompletionInput represents the full potential input options for completion. */ export interface CompletionInput { - /** model represents the model to use. You are restriced to these models: - * DeepseekCoder67BInstruct - * Hermes2ProLlama38B - * Hermes2ProMistral7B - * NeuralChat7B - * NousHermesLlama213B - */ - model: Models; + /** model represents the model to use. */ + model: string; /** prompt represents the prompt to process. */ prompt: string; @@ -428,7 +399,7 @@ export interface CompletionChoice { /** model represents the model used for generating the result for * this choice. */ - model: Models; + model: string; /** status represents if the response for this choice was successful * or not. */ @@ -496,7 +467,7 @@ export interface Embedding { created: number; /** model represents the model used for generating the result. */ - model: Models; + model: string; /** EmbeddingData represents the collection of vector points. */ data: EmbeddingData[]; diff --git a/test/api_test.js b/test/api_test.js index 3b95702..9185972 100644 --- a/test/api_test.js +++ b/test/api_test.js @@ -270,7 +270,7 @@ async function testChatBasic() { const client = new pg.Client('http://localhost:8080', 'any key'); const input = { - model: pg.Models.NeuralChat7B, + model: 'Neural-Chat-7B', messages: [ { role: pg.Roles.User, @@ -309,6 +309,7 @@ async function testChatVision() { }; const input = { + model: 'llava-1.5-7b-hf', role: pg.Roles.User, question: 'is there a deer in this picture', image: imageMock, @@ -332,7 +333,7 @@ async function testChatBadkey() { const client = new pg.Client('http://localhost:8080', ''); const input = { - model: pg.Models.NeuralChat7B, + model: 'Neural-Chat-7B', messages: [ { role: pg.Roles.User, @@ -388,7 +389,7 @@ async function testCompletionBasic() { const client = new pg.Client('http://localhost:8080', 'any key'); const input = { - model: pg.Models.NeuralChat7B, + model: 'Neural-Chat-7B', prompt: 'Will I lose my hair', maxTokens: 1000, temperature: 0.1, @@ -410,7 +411,7 @@ async function testCompletionBadkey() { const client = new pg.Client('http://localhost:8080', ''); const input = { - model: pg.Models.NeuralChat7B, + model: 'Neural-Chat-7B', prompt: 'Will I lose my hair', maxTokens: 1000, temperature: 0.1, @@ -463,7 +464,7 @@ async function testEmbeddingBasic() { }, ]; - var [result, err] = await client.Embedding(input); + var [result, err] = await client.Embedding('bridgetower-large-itm-mlm-itc', input); if (err != null) { assert.fail('ERROR:' + err.error); } @@ -490,7 +491,7 @@ async function testEmbeddingBadkey() { }, ]; - var [, err] = await client.Embedding(input); + var [, err] = await client.Embedding('bridgetower-large-itm-mlm-itc', input); if (err == null) { assert.fail("didn't get an error"); }