opik 1.9.30 → 1.9.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';var ansiEscapes=require('ansi-escapes'),tslog=require('tslog'),Sd=require('fs'),Af=require('ini');require('dotenv/config');var dw=require('qs'),uuid=require('uuid'),Hb=require('fast-json-stable-stringify'),Vb=require('xxhash-wasm'),util=require('util'),$b=require('mustache'),Zb=require('nunjucks'),dateFns=require('date-fns'),jestDiff=require('jest-diff'),rx=require('fast-deep-equal'),async_hooks=require('async_hooks'),Gi=require('chalk'),dx=require('boxen'),ux=require('ora'),ai$1=require('ai'),openai=require('@ai-sdk/openai'),anthropic=require('@ai-sdk/anthropic'),google=require('@ai-sdk/google'),zod=require('zod');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Sd__default=/*#__PURE__*/_interopDefault(Sd);var Af__default=/*#__PURE__*/_interopDefault(Af);var dw__default=/*#__PURE__*/_interopDefault(dw);var Hb__default=/*#__PURE__*/_interopDefault(Hb);var Vb__default=/*#__PURE__*/_interopDefault(Vb);var $b__default=/*#__PURE__*/_interopDefault($b);var Zb__default=/*#__PURE__*/_interopDefault(Zb);var rx__default=/*#__PURE__*/_interopDefault(rx);var Gi__default=/*#__PURE__*/_interopDefault(Gi);var dx__default=/*#__PURE__*/_interopDefault(dx);var ux__default=/*#__PURE__*/_interopDefault(ux);var wd=Object.create;var Ze=Object.defineProperty;var bd=Object.getOwnPropertyDescriptor;var ff=Object.getOwnPropertyNames;var hf=Object.getPrototypeOf,wf=Object.prototype.hasOwnProperty;var xd=(i,t)=>(t=Symbol[i])?t:Symbol.for("Symbol."+i),hr=i=>{throw TypeError(i)};var bf=(i,t,e)=>t in i?Ze(i,t,{enumerable:true,configurable:true,writable:true,value:e}):i[t]=e;var me=(i=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(i,{get:(t,e)=>(typeof require!="undefined"?require:t)[e]}):i)(function(i){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+i+'" is not supported')});var nn=(i,t)=>()=>(i&&(t=i(i=0)),t);var Y=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports),E=(i,t)=>{for(var e in t)Ze(i,e,{get:t[e],enumerable:true});},xf=(i,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of ff(t))!wf.call(i,a)&&a!==e&&Ze(i,a,{get:()=>t[a],enumerable:!(o=bd(t,a))||o.enumerable});return i};var Rf=(i,t,e)=>(e=i!=null?wd(hf(i)):{},xf(Ze(e,"default",{value:i,enumerable:true}),i));var Rd=i=>{var t;return [,,,wd((t=void 0)!=null?t:null)]},yd=["class","method","getter","setter","accessor","field","value","get","set"],fr=i=>i!==void 0&&typeof i!="function"?hr("Function expected"):i,yf=(i,t,e,o,a)=>({kind:yd[i],name:t,metadata:o,addInitializer:n=>e._?hr("Already initialized"):a.push(fr(n||null))}),sn=(i,t)=>bf(t,xd("metadata"),i[3]),kd=(i,t,e,o)=>{for(var a=0,n=i[t>>1],c=n&&n.length;a<c;a++)n[a].call(e);return o},vd=(i,t,e,o,a,n)=>{var m,u,g,R,y=t&7,v=false,z=false,S=2,F=yd[y+5],G=i[S]||(i[S]=[]),oe=((a=a.prototype),bd(a,e));for(var Ye=o.length-1;Ye>=0;Ye--)g=yf(y,e,u={},i[3],G),(g.static=v,g.private=z,R=g.access={has:ne=>e in ne},(R.get=ne=>ne[e]),y>2),m=(0, o[Ye])(oe[F],g),u._=1,fr(m)&&(oe[F]=m);return oe&&Ze(a,e,oe),a};var ru={};E(ru,{Node18UniversalStreamWrapper:()=>_n});var _n,ou=nn(()=>{_n=class i{constructor(t){this.readableStream=t,this.reader=this.readableStream.getReader(),this.events={data:[],end:[],error:[],readable:[],close:[],pause:[],resume:[]},this.paused=false,this.resumeCallback=null,this.encoding=null;}on(t,e){var o;(o=this.events[t])==null||o.push(e);}off(t,e){var o;this.events[t]=(o=this.events[t])==null?void 0:o.filter(a=>a!==e);}pipe(t){return this.on("data",async e=>{if(t instanceof i)t._write(e);else if(t instanceof WritableStream){let o=t.getWriter();o.write(e).then(()=>o.releaseLock());}else t.write(e);}),this.on("end",async()=>{t instanceof i?t._end():t instanceof WritableStream?t.getWriter().close():t.end();}),this.on("error",async e=>{t instanceof i?t._error(e):t instanceof WritableStream?t.getWriter().abort(e):t.destroy(e);}),this._startReading(),t}pipeTo(t){return this.pipe(t)}unpipe(t){this.off("data",async e=>{if(t instanceof i)t._write(e);else if(t instanceof WritableStream){let o=t.getWriter();o.write(e).then(()=>o.releaseLock());}else t.write(e);}),this.off("end",async()=>{t instanceof i?t._end():t instanceof WritableStream?t.getWriter().close():t.end();}),this.off("error",async e=>{t instanceof i?t._error(e):t instanceof WritableStream?t.getWriter().abort(e):t.destroy(e);});}destroy(t){this.reader.cancel(t).then(()=>{this._emit("close");}).catch(e=>{this._emit("error",e);});}pause(){this.paused=true,this._emit("pause");}resume(){this.paused&&(this.paused=false,this._emit("resume"),this.resumeCallback&&(this.resumeCallback(),this.resumeCallback=null));}get isPaused(){return this.paused}async read(){this.paused&&await new Promise(o=>{this.resumeCallback=o;});let{done:t,value:e}=await this.reader.read();if(!t)return e}setEncoding(t){this.encoding=t;}async text(){let t=[];for(;;){let{done:o,value:a}=await this.reader.read();if(o)break;a&&t.push(a);}return new TextDecoder(this.encoding||"utf-8").decode(await new Blob(t).arrayBuffer())}async json(){let t=await this.text();return JSON.parse(t)}_write(t){this._emit("data",t);}_end(){this._emit("end");}_error(t){this._emit("error",t);}_emit(t,e){if(this.events[t])for(let o of this.events[t]||[])o(e);}async _startReading(){try{for(this._emit("readable");;){this.paused&&await new Promise(o=>{this.resumeCallback=o;});let{done:t,value:e}=await this.reader.read();if(t){this._emit("end"),this._emit("close");break}e&&this._emit("data",e);}}catch(t){this._emit("error",t);}}[Symbol.asyncIterator](){return {next:async()=>{this.paused&&await new Promise(o=>{this.resumeCallback=o;});let{done:t,value:e}=await this.reader.read();return t?{done:true,value:void 0}:{done:false,value:e}},[Symbol.asyncIterator](){return this}}}};});var tu={};E(tu,{UndiciStreamWrapper:()=>Tn});var Tn,au=nn(()=>{Tn=class i{constructor(t){this.readableStream=t,this.reader=this.readableStream.getReader(),this.events={data:[],end:[],error:[],readable:[],close:[],pause:[],resume:[]},this.paused=false,this.resumeCallback=null,this.encoding=null;}on(t,e){var o;(o=this.events[t])==null||o.push(e);}off(t,e){var o;this.events[t]=(o=this.events[t])==null?void 0:o.filter(a=>a!==e);}pipe(t){return this.on("data",e=>{if(t instanceof i)t._write(e);else {let o=t.getWriter();o.write(e).then(()=>o.releaseLock());}}),this.on("end",()=>{t instanceof i?t._end():t.getWriter().close();}),this.on("error",e=>{t instanceof i?t._error(e):t.getWriter().abort(e);}),this._startReading(),t}pipeTo(t){return this.pipe(t)}unpipe(t){this.off("data",e=>{if(t instanceof i)t._write(e);else {let o=t.getWriter();o.write(e).then(()=>o.releaseLock());}}),this.off("end",()=>{t instanceof i?t._end():t.getWriter().close();}),this.off("error",e=>{t instanceof i?t._error(e):t.getWriter().abort(e);});}destroy(t){this.reader.cancel(t).then(()=>{this._emit("close");}).catch(e=>{this._emit("error",e);});}pause(){this.paused=true,this._emit("pause");}resume(){this.paused&&(this.paused=false,this._emit("resume"),this.resumeCallback&&(this.resumeCallback(),this.resumeCallback=null));}get isPaused(){return this.paused}async read(){this.paused&&await new Promise(o=>{this.resumeCallback=o;});let{done:t,value:e}=await this.reader.read();if(!t)return e}setEncoding(t){this.encoding=t;}async text(){let t=[];for(;;){let{done:o,value:a}=await this.reader.read();if(o)break;a&&t.push(a);}return new TextDecoder(this.encoding||"utf-8").decode(await new Blob(t).arrayBuffer())}async json(){let t=await this.text();return JSON.parse(t)}_write(t){this._emit("data",t);}_end(){this._emit("end");}_error(t){this._emit("error",t);}_emit(t,e){if(this.events[t])for(let o of this.events[t]||[])o(e);}async _startReading(){try{for(this._emit("readable");;){this.paused&&await new Promise(o=>{this.resumeCallback=o;});let{done:t,value:e}=await this.reader.read();if(t){this._emit("end"),this._emit("close");break}e&&this._emit("data",e);}}catch(t){this._emit("error",t);}}[Symbol.asyncIterator](){return {next:async()=>{this.paused&&await new Promise(o=>{this.resumeCallback=o;});let{done:t,value:e}=await this.reader.read();return t?{done:true,value:void 0}:{done:false,value:e}},[Symbol.asyncIterator](){return this}}}};});var iu={};E(iu,{NodePre18StreamWrapper:()=>An});var An,nu=nn(()=>{An=class{constructor(t){this.readableStream=t;}on(t,e){this.readableStream.on(t,e);}off(t,e){this.readableStream.off(t,e);}pipe(t){return this.readableStream.pipe(t),t}pipeTo(t){return this.pipe(t)}unpipe(t){t?this.readableStream.unpipe(t):this.readableStream.unpipe();}destroy(t){this.readableStream.destroy(t);}pause(){this.readableStream.pause();}resume(){this.readableStream.resume();}get isPaused(){return this.readableStream.isPaused()}async read(){return new Promise((t,e)=>{let o=this.readableStream.read();o?t(o):(this.readableStream.once("readable",()=>{let a=this.readableStream.read();t(a);}),this.readableStream.once("error",e));})}setEncoding(t){this.readableStream.setEncoding(t),this.encoding=t;}async text(){let t=[],e=new TextEncoder;this.readableStream.setEncoding(this.encoding||"utf-8");for await(let a of this.readableStream)t.push(e.encode(a));return new TextDecoder(this.encoding||"utf-8").decode(Buffer.concat(t))}async json(){let t=await this.text();return JSON.parse(t)}[Symbol.asyncIterator](){let e=this.readableStream[Symbol.asyncIterator]();return {async next(){let{value:o,done:a}=await e.next();return {value:o,done:a}},[Symbol.asyncIterator](){return this}}}};});var fu=Y((OI,gu)=>{var uu=me("stream").Stream,ww=me("util");gu.exports=fe;function fe(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=true,this._maxDataSizeExceeded=false,this._released=false,this._bufferedEvents=[];}ww.inherits(fe,uu);fe.create=function(i,t){var e=new this;t=t||{};for(var o in t)e[o]=t[o];e.source=i;var a=i.emit;return i.emit=function(){return e._handleEmit(arguments),a.apply(i,arguments)},i.on("error",function(){}),e.pauseStream&&i.pause(),e};Object.defineProperty(fe.prototype,"readable",{configurable:true,enumerable:true,get:function(){return this.source.readable}});fe.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};fe.prototype.resume=function(){this._released||this.release(),this.source.resume();};fe.prototype.pause=function(){this.source.pause();};fe.prototype.release=function(){this._released=true,this._bufferedEvents.forEach(function(i){this.emit.apply(this,i);}.bind(this)),this._bufferedEvents=[];};fe.prototype.pipe=function(){var i=uu.prototype.pipe.apply(this,arguments);return this.resume(),i};fe.prototype._handleEmit=function(i){if(this._released){this.emit.apply(this,i);return}i[0]==="data"&&(this.dataSize+=i[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(i);};fe.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=true;var i="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(i));}};});var xu=Y((WI,bu)=>{var bw=me("util"),wu=me("stream").Stream,hu=fu();bu.exports=V;function V(){this.writable=false,this.readable=true,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=true,this._released=false,this._streams=[],this._currentStream=null,this._insideLoop=false,this._pendingNext=false;}bw.inherits(V,wu);V.create=function(i){var t=new this;i=i||{};for(var e in i)t[e]=i[e];return t};V.isStreamLike=function(i){return typeof i!="function"&&typeof i!="string"&&typeof i!="boolean"&&typeof i!="number"&&!Buffer.isBuffer(i)};V.prototype.append=function(i){var t=V.isStreamLike(i);if(t){if(!(i instanceof hu)){var e=hu.create(i,{maxDataSize:1/0,pauseStream:this.pauseStreams});i.on("data",this._checkDataSize.bind(this)),i=e;}this._handleErrors(i),this.pauseStreams&&i.pause();}return this._streams.push(i),this};V.prototype.pipe=function(i,t){return wu.prototype.pipe.call(this,i,t),this.resume(),i};V.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=true;return}this._insideLoop=true;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=false;}};V.prototype._realGetNext=function(){var i=this._streams.shift();if(typeof i=="undefined"){this.end();return}if(typeof i!="function"){this._pipeNext(i);return}var t=i;t(function(e){var o=V.isStreamLike(e);o&&(e.on("data",this._checkDataSize.bind(this)),this._handleErrors(e)),this._pipeNext(e);}.bind(this));};V.prototype._pipeNext=function(i){this._currentStream=i;var t=V.isStreamLike(i);if(t){i.on("end",this._getNext.bind(this)),i.pipe(this,{end:false});return}var e=i;this.write(e),this._getNext();};V.prototype._handleErrors=function(i){var t=this;i.on("error",function(e){t._emitError(e);});};V.prototype.write=function(i){this.emit("data",i);};V.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"));};V.prototype.resume=function(){this._released||(this._released=true,this.writable=true,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume");};V.prototype.end=function(){this._reset(),this.emit("end");};V.prototype.destroy=function(){this._reset(),this.emit("close");};V.prototype._reset=function(){this.writable=false,this._streams=[],this._currentStream=null;};V.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var i="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(i));}};V.prototype._updateDataSize=function(){this.dataSize=0;var i=this;this._streams.forEach(function(t){t.dataSize&&(i.dataSize+=t.dataSize);}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize);};V.prototype._emitError=function(i){this._reset(),this.emit("error",i);};});var Ru=Y((BI,xw)=>{xw.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/3gpp-ims+xml":{source:"iana",compressible:true},"application/3gpphal+json":{source:"iana",compressible:true},"application/3gpphalforms+json":{source:"iana",compressible:true},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:true},"application/alto-costmap+json":{source:"iana",compressible:true},"application/alto-costmapfilter+json":{source:"iana",compressible:true},"application/alto-directory+json":{source:"iana",compressible:true},"application/alto-endpointcost+json":{source:"iana",compressible:true},"application/alto-endpointcostparams+json":{source:"iana",compressible:true},"application/alto-endpointprop+json":{source:"iana",compressible:true},"application/alto-endpointpropparams+json":{source:"iana",compressible:true},"application/alto-error+json":{source:"iana",compressible:true},"application/alto-networkmap+json":{source:"iana",compressible:true},"application/alto-networkmapfilter+json":{source:"iana",compressible:true},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:true},"application/alto-updatestreamparams+json":{source:"iana",compressible:true},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:true,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:true,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:true,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:true,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:true,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:true,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:true},"application/atsc-rsat+xml":{source:"iana",compressible:true,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:true},"application/bacnet-xdd+zip":{source:"iana",compressible:false},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:false,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/calendar+json":{source:"iana",compressible:true},"application/calendar+xml":{source:"iana",compressible:true,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:true},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:true},"application/ccxml+xml":{source:"iana",compressible:true,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:true,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:true},"application/cellml+xml":{source:"iana",compressible:true},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:true},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:true},"application/clue_info+xml":{source:"iana",compressible:true},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:true},"application/coap-group+json":{source:"iana",compressible:true},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:true},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:true,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:true},"application/cstadata+xml":{source:"iana",compressible:true},"application/csvm+json":{source:"iana",compressible:true},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:true},"application/dash+xml":{source:"iana",compressible:true,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:true,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:true,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:true},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:true},"application/dicom+xml":{source:"iana",compressible:true},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:true},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:true,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:true},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:true,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:true,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:false},"application/edifact":{source:"iana",compressible:false},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:true},"application/elm+xml":{source:"iana",compressible:true},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/emergencycalldata.comment+xml":{source:"iana",compressible:true},"application/emergencycalldata.control+xml":{source:"iana",compressible:true},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:true},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:true},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:true},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:true},"application/emergencycalldata.veds+xml":{source:"iana",compressible:true},"application/emma+xml":{source:"iana",compressible:true,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:true,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:true},"application/epub+zip":{source:"iana",compressible:false,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:true},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:true,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:true},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/fido.trusted-apps+json":{compressible:true},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:false},"application/framework-attributes+xml":{source:"iana",compressible:true},"application/geo+json":{source:"iana",compressible:true,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:true},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:true,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:true,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:false,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:true},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:true},"application/ibe-pkg-reply+xml":{source:"iana",compressible:true},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:true,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:true,extensions:["its"]},"application/java-archive":{source:"apache",compressible:false,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:false,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:false,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:true,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:true},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:true},"application/jrd+json":{source:"iana",compressible:true},"application/jscalendar+json":{source:"iana",compressible:true},"application/json":{source:"iana",charset:"UTF-8",compressible:true,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:true},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:true,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:true},"application/jwk-set+json":{source:"iana",compressible:true},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:true},"application/kpml-response+xml":{source:"iana",compressible:true},"application/ld+json":{source:"iana",compressible:true,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:true,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:true},"application/lost+xml":{source:"iana",compressible:true,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:true},"application/lpf+zip":{source:"iana",compressible:false},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:true,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:true,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:true,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:true,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:true},"application/mathml-presentation+xml":{source:"iana",compressible:true},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:true},"application/mbms-deregister+xml":{source:"iana",compressible:true},"application/mbms-envelope+xml":{source:"iana",compressible:true},"application/mbms-msk+xml":{source:"iana",compressible:true},"application/mbms-msk-response+xml":{source:"iana",compressible:true},"application/mbms-protection-description+xml":{source:"iana",compressible:true},"application/mbms-reception-report+xml":{source:"iana",compressible:true},"application/mbms-register+xml":{source:"iana",compressible:true},"application/mbms-register-response+xml":{source:"iana",compressible:true},"application/mbms-schedule+xml":{source:"iana",compressible:true},"application/mbms-user-service-description+xml":{source:"iana",compressible:true},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:true,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:true},"application/mediaservercontrol+xml":{source:"iana",compressible:true,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:true},"application/metalink+xml":{source:"apache",compressible:true,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:true,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:true,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:true,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:true,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:true,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:true},"application/mrb-publish+xml":{source:"iana",compressible:true},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/msword":{source:"iana",compressible:false,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:true},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:true},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:false,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:true},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:true,extensions:["opf"]},"application/ogg":{source:"iana",compressible:false,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:true,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:true},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:false},"application/p2p-overlay+xml":{source:"iana",compressible:true,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:true,extensions:["xer"]},"application/pdf":{source:"iana",compressible:false,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:false,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:true,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/postscript":{source:"iana",compressible:true,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:true},"application/problem+json":{source:"iana",compressible:true},"application/problem+xml":{source:"iana",compressible:true},"application/provenance+xml":{source:"iana",compressible:true,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:false},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:true},"application/pskc+xml":{source:"iana",compressible:true,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:true},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:true,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:true},"application/rdf+xml":{source:"iana",compressible:true,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:true,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:true},"application/resource-lists+xml":{source:"iana",compressible:true,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:true,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:true},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:true},"application/rls-services+xml":{source:"iana",compressible:true,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:true,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:true,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:true,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:true,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:true,extensions:["rss"]},"application/rtf":{source:"iana",compressible:true,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:true},"application/samlmetadata+xml":{source:"iana",compressible:true},"application/sarif+json":{source:"iana",compressible:true},"application/sarif-external-properties+json":{source:"iana",compressible:true},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:true,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:true},"application/scim+json":{source:"iana",compressible:true},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:true},"application/senml+xml":{source:"iana",compressible:true,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:true},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:true},"application/sensml+xml":{source:"iana",compressible:true,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:true},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:true,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:true},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:true,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:true},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:true,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:true},"application/spirits-event+xml":{source:"iana",compressible:true},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:true,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:true,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:true,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:true,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:true},"application/swid+xml":{source:"iana",compressible:true,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:true},"application/taxii+json":{source:"iana",compressible:true},"application/td+json":{source:"iana",compressible:true},"application/tei+xml":{source:"iana",compressible:true,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:true,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:true},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:true,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:true,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:false,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:true},"application/urc-ressheet+xml":{source:"iana",compressible:true,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:true,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:true},"application/vcard+json":{source:"iana",compressible:true},"application/vcard+xml":{source:"iana",compressible:true},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:true,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:true},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:true},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:true},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:true},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:true},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:true},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:true},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:true},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:true},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:true},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:true},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:true},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:false,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:true,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:true},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:true},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:false,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:true},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:true},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:true},"application/vnd.apple.installer+xml":{source:"iana",compressible:true,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:false,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:true},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:true},"application/vnd.avistar+xml":{source:"iana",compressible:true},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:true,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:true},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:true},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:true},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:true},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:true},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:true,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:true,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:true},"application/vnd.collection.doc+json":{source:"iana",compressible:true},"application/vnd.collection.next+json":{source:"iana",compressible:true},"application/vnd.comicbook+zip":{source:"iana",compressible:false},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:true},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:true,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:true},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:true},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:true},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:true},"application/vnd.cyclonedx+xml":{source:"iana",compressible:true},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:false},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:true,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:true},"application/vnd.dataresource+json":{source:"iana",compressible:true},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:true,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:true},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:true},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:true},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:true},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:true},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:true},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:true},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:true},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:true},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:true},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:true},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:true},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:true},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:true},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:false},"application/vnd.eszigno3+xml":{source:"iana",compressible:true,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:true},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:false},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:false},"application/vnd.etsi.cug+xml":{source:"iana",compressible:true},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:true},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:true},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:true},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:true},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:true},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:true},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:true},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:true},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:true},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:true},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:true},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:true},"application/vnd.etsi.sci+xml":{source:"iana",compressible:true},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:true},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:true},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:true},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:false},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:false},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:false},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:true},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:true},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:true},"application/vnd.geo+json":{source:"iana",compressible:true},"application/vnd.geocube+xml":{source:"iana",compressible:true},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:false,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:false,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:false,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:true,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:false,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:true},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:false},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:true},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:true},"application/vnd.hal+xml":{source:"iana",compressible:true,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:true,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:true},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:true},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:true},"application/vnd.hyper-item+json":{source:"iana",compressible:true},"application/vnd.hyperdrive+json":{source:"iana",compressible:true},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:false},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:false},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:true},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:true},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:true},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:true},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:true},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:true},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:true},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:true},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:true},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:true},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:true},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:true},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:true},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:true},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:true},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:true,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:false},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:true},"application/vnd.las.las+xml":{source:"iana",compressible:true,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:true},"application/vnd.liberty-request+xml":{source:"iana",compressible:true},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:true,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:false},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:true},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:true},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:true},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:true},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:false},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:true},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:true},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:true,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:false,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:true,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:true},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:true},"application/vnd.ms-outlook":{compressible:false,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:true},"application/vnd.ms-powerpoint":{source:"iana",compressible:false,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:true},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:true},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:true},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:false,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:true},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:true},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:true},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:true},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:true},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:true},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:true,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:true},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:false,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:false,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:false,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:false,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:true},"application/vnd.oftn.l10n+json":{source:"iana",compressible:true},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:true},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:true},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:true},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:true},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:true},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:true},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:true},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:true},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:true},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:true},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:true},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:true},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:true},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:true},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:true},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:true},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:true},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:true},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:true},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:true},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:true},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:true,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:true},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:true},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:true},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:true},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:true},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:true},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:true},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:true},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:true},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:true},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:true},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:true,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:true,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:false,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:false,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:false,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:true},"application/vnd.oracle.resource+json":{source:"iana",compressible:true},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:true},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:true},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:true},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:true},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:true},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:true,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:true},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:true,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:true},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:true},"application/vnd.shopkick+json":{source:"iana",compressible:true},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:true},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:true,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:true,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:true,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:true},"application/vnd.syft+json":{source:"iana",compressible:true},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:true,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:true,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:true,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:true},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:true},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:true},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:true,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:true},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:true},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:true},"application/vnd.wv.ssp+xml":{source:"iana",compressible:true},"application/vnd.xacml+json":{source:"iana",compressible:true},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:true},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:true,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:true,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:true,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:true},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:true,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:true,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:true},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:true,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:true,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:false,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:false,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:false,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:false,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:false,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:false},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:true,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:true,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:true,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:false,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:true,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:false,extensions:["jnlp"]},"application/x-javascript":{compressible:true},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:false,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:false},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:true,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:false,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:false,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:true,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:false,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:false,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:true,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:true,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:true,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:true,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:true,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:false,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:true,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:true,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:true,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:true,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:true},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:true,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:false,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:true},"application/xaml+xml":{source:"apache",compressible:true,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:true,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:true,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:true,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:true,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:true},"application/xcap-ns+xml":{source:"iana",compressible:true,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:true},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:true},"application/xenc+xml":{source:"iana",compressible:true,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:true,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:true},"application/xliff+xml":{source:"iana",compressible:true,extensions:["xlf"]},"application/xml":{source:"iana",compressible:true,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:true,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:true},"application/xmpp+xml":{source:"iana",compressible:true},"application/xop+xml":{source:"iana",compressible:true,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:true,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:true,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:true,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:true,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:true},"application/yang-data+xml":{source:"iana",compressible:true},"application/yang-patch+json":{source:"iana",compressible:true},"application/yang-patch+xml":{source:"iana",compressible:true},"application/yin+xml":{source:"iana",compressible:true,extensions:["yin"]},"application/zip":{source:"iana",compressible:false,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:false,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:false,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:false},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:false,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:false,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:false,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:false,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:false},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:false},"audio/vorbis":{source:"iana",compressible:false},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:false,extensions:["wav"]},"audio/wave":{compressible:false,extensions:["wav"]},"audio/webm":{source:"apache",compressible:false,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:false,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:false,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:true,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:true,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:false,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:false,extensions:["avif"]},"image/bmp":{source:"iana",compressible:true,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:false,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:false,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:false,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:false,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:false,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:false},"image/png":{source:"iana",compressible:false,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:true,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:false,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:true,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:true,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:true,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:true,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:true,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:false},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:false},"message/imdn+xml":{source:"iana",compressible:true},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:false},"message/rfc822":{source:"iana",compressible:true,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:true,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:true,extensions:["glb"]},"model/iges":{source:"iana",compressible:false,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:false,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:true,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:false,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:false,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:true,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:true},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:false,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:false,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:false,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:false,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:true,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:false},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:false},"multipart/form-data":{source:"iana",compressible:false},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:false},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:false},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:true,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:true},"text/cmd":{compressible:true},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:true,extensions:["css"]},"text/csv":{source:"iana",compressible:true,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:true,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:true},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:true,extensions:["jsx"]},"text/less":{compressible:true,extensions:["less"]},"text/markdown":{source:"iana",compressible:true,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:true,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:true,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:true,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:true,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:true,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:true,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:true,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:true,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:true,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:true},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:true},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:true,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:true,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:true,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:true,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:true,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:true,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:false,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:false,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:false,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:false,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:false,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:false,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:false,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:false,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:true},"x-shader/x-vertex":{compressible:true}};});var ku=Y((LI,yu)=>{yu.exports=Ru();});var Su=Y(te=>{var Gt=ku(),Rw=me("path").extname,vu=/^\s*([^;\s]*)(?:;|\s|$)/,yw=/^text\//i;te.charset=zu;te.charsets={lookup:zu};te.contentType=kw;te.extension=vw;te.extensions=Object.create(null);te.lookup=zw;te.types=Object.create(null);Sw(te.extensions,te.types);function zu(i){if(!i||typeof i!="string")return false;var t=vu.exec(i),e=t&&Gt[t[1].toLowerCase()];return e&&e.charset?e.charset:t&&yw.test(t[1])?"UTF-8":false}function kw(i){if(!i||typeof i!="string")return false;var t=i.indexOf("/")===-1?te.lookup(i):i;if(!t)return false;if(t.indexOf("charset")===-1){var e=te.charset(t);e&&(t+="; charset="+e.toLowerCase());}return t}function vw(i){if(!i||typeof i!="string")return false;var t=vu.exec(i),e=t&&te.extensions[t[1].toLowerCase()];return !e||!e.length?false:e[0]}function zw(i){if(!i||typeof i!="string")return false;var t=Rw("x."+i).toLowerCase().substr(1);return t&&te.types[t]||false}function Sw(i,t){var e=["nginx","apache",void 0,"iana"];Object.keys(Gt).forEach(function(a){var n=Gt[a],c=n.extensions;if(!(!c||!c.length)){i[a]=c;for(var m=0;m<c.length;m++){var u=c[m];if(t[u]){var g=e.indexOf(Gt[t[u]].source),R=e.indexOf(n.source);if(t[u]!=="application/octet-stream"&&(g>R||g===R&&t[u].substr(0,12)==="application/"))continue}t[u]=a;}}});}});var Tu=Y((HI,_u)=>{_u.exports=_w;function _w(i){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(i):setTimeout(i,0);}});var En=Y((JI,Eu)=>{var Au=Tu();Eu.exports=Tw;function Tw(i){var t=false;return Au(function(){t=true;}),function(o,a){t?i(o,a):Au(function(){i(o,a);});}}});var Pn=Y((KI,Pu)=>{Pu.exports=Aw;function Aw(i){Object.keys(i.jobs).forEach(Ew.bind(i)),i.jobs={};}function Ew(i){typeof this.jobs[i]=="function"&&this.jobs[i]();}});var Cn=Y((XI,Iu)=>{var Cu=En(),Pw=Pn();Iu.exports=Cw;function Cw(i,t,e,o){var a=e.keyedList?e.keyedList[e.index]:e.index;e.jobs[a]=Iw(t,a,i[a],function(n,c){a in e.jobs&&(delete e.jobs[a],n?Pw(e):e.results[a]=c,o(n,e.results));});}function Iw(i,t,e,o){var a;return i.length==2?a=i(e,Cu(o)):a=i(e,t,Cu(o)),a}});var In=Y((GI,ju)=>{ju.exports=jw;function jw(i,t){var e=!Array.isArray(i),o={index:0,keyedList:e||t?Object.keys(i):null,jobs:{},results:e?{}:[],size:e?Object.keys(i).length:i.length};return t&&o.keyedList.sort(e?t:function(a,n){return t(i[a],i[n])}),o}});var jn=Y(($I,Uu)=>{var Uw=Pn(),Nw=En();Uu.exports=Dw;function Dw(i){Object.keys(this.jobs).length&&(this.index=this.size,Uw(this),Nw(i)(null,this.results));}});var Du=Y((QI,Nu)=>{var Mw=Cn(),Fw=In(),Ow=jn();Nu.exports=Ww;function Ww(i,t,e){for(var o=Fw(i);o.index<(o.keyedList||i).length;)Mw(i,t,o,function(a,n){if(a){e(a,n);return}if(Object.keys(o.jobs).length===0){e(null,o.results);return}}),o.index++;return Ow.bind(o,e)}});var Un=Y((YI,$t)=>{var Mu=Cn(),Bw=In(),Lw=jn();$t.exports=Vw;$t.exports.ascending=Fu;$t.exports.descending=Hw;function Vw(i,t,e,o){var a=Bw(i,e);return Mu(i,t,a,function n(c,m){if(c){o(c,m);return}if(a.index++,a.index<(a.keyedList||i).length){Mu(i,t,a,n);return}o(null,a.results);}),Lw.bind(a,o)}function Fu(i,t){return i<t?-1:i>t?1:0}function Hw(i,t){return -1*Fu(i,t)}});var Wu=Y((ZI,Ou)=>{var Jw=Un();Ou.exports=Kw;function Kw(i,t,e){return Jw(i,t,null,e)}});var Lu=Y((qI,Bu)=>{Bu.exports={parallel:Du(),serial:Wu(),serialOrdered:Un()};});var Hu=Y((ej,Vu)=>{Vu.exports=function(i,t){return Object.keys(t).forEach(function(e){i[e]=i[e]||t[e];}),i};});var Ku=Y((rj,Ju)=>{var Fn=xu(),Xw=me("util"),Nn=me("path"),Gw=me("http"),$w=me("https"),Qw=me("url").parse,Yw=me("fs"),Zw=me("stream").Stream,Dn=Su(),qw=Lu(),Mn=Hu();Ju.exports=P;Xw.inherits(P,Fn);function P(i){if(!(this instanceof P))return new P(i);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],Fn.call(this),i=i||{};for(var t in i)this[t]=i[t];}P.LINE_BREAK=`\r
|
|
2
2
|
`;P.DEFAULT_CONTENT_TYPE="application/octet-stream";P.prototype.append=function(i,t,e){e=e||{},typeof e=="string"&&(e={filename:e});var o=Fn.prototype.append.bind(this);if(typeof t=="number"&&(t=""+t),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var a=this._multiPartHeader(i,t,e),n=this._multiPartFooter();o(a),o(t),o(n),this._trackLength(a,t,e);};P.prototype._trackLength=function(i,t,e){var o=0;e.knownLength!=null?o+=+e.knownLength:Buffer.isBuffer(t)?o=t.length:typeof t=="string"&&(o=Buffer.byteLength(t)),this._valueLength+=o,this._overheadLength+=Buffer.byteLength(i)+P.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&t.hasOwnProperty("httpVersion"))&&!(t instanceof Zw))&&(e.knownLength||this._valuesToMeasure.push(t));};P.prototype._lengthRetriever=function(i,t){i.hasOwnProperty("fd")?i.end!=null&&i.end!=1/0&&i.start!=null?t(null,i.end+1-(i.start?i.start:0)):Yw.stat(i.path,function(e,o){var a;if(e){t(e);return}a=o.size-(i.start?i.start:0),t(null,a);}):i.hasOwnProperty("httpVersion")?t(null,+i.headers["content-length"]):i.hasOwnProperty("httpModule")?(i.on("response",function(e){i.pause(),t(null,+e.headers["content-length"]);}),i.resume()):t("Unknown stream");};P.prototype._multiPartHeader=function(i,t,e){if(typeof e.header=="string")return e.header;var o=this._getContentDisposition(t,e),a=this._getContentType(t,e),n="",c={"Content-Disposition":["form-data",'name="'+i+'"'].concat(o||[]),"Content-Type":[].concat(a||[])};typeof e.header=="object"&&Mn(c,e.header);var m;for(var u in c)c.hasOwnProperty(u)&&(m=c[u],m!=null&&(Array.isArray(m)||(m=[m]),m.length&&(n+=u+": "+m.join("; ")+P.LINE_BREAK)));return "--"+this.getBoundary()+P.LINE_BREAK+n+P.LINE_BREAK};P.prototype._getContentDisposition=function(i,t){var e,o;return typeof t.filepath=="string"?e=Nn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||i.name||i.path?e=Nn.basename(t.filename||i.name||i.path):i.readable&&i.hasOwnProperty("httpVersion")&&(e=Nn.basename(i.client._httpMessage.path||"")),e&&(o='filename="'+e+'"'),o};P.prototype._getContentType=function(i,t){var e=t.contentType;return !e&&i.name&&(e=Dn.lookup(i.name)),!e&&i.path&&(e=Dn.lookup(i.path)),!e&&i.readable&&i.hasOwnProperty("httpVersion")&&(e=i.headers["content-type"]),!e&&(t.filepath||t.filename)&&(e=Dn.lookup(t.filepath||t.filename)),!e&&typeof i=="object"&&(e=P.DEFAULT_CONTENT_TYPE),e};P.prototype._multiPartFooter=function(){return function(i){var t=P.LINE_BREAK,e=this._streams.length===0;e&&(t+=this._lastBoundary()),i(t);}.bind(this)};P.prototype._lastBoundary=function(){return "--"+this.getBoundary()+"--"+P.LINE_BREAK};P.prototype.getHeaders=function(i){var t,e={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in i)i.hasOwnProperty(t)&&(e[t.toLowerCase()]=i[t]);return e};P.prototype.setBoundary=function(i){this._boundary=i;};P.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};P.prototype.getBuffer=function(){for(var i=new Buffer.alloc(0),t=this.getBoundary(),e=0,o=this._streams.length;e<o;e++)typeof this._streams[e]!="function"&&(Buffer.isBuffer(this._streams[e])?i=Buffer.concat([i,this._streams[e]]):i=Buffer.concat([i,Buffer.from(this._streams[e])]),(typeof this._streams[e]!="string"||this._streams[e].substring(2,t.length+2)!==t)&&(i=Buffer.concat([i,Buffer.from(P.LINE_BREAK)])));return Buffer.concat([i,Buffer.from(this._lastBoundary())])};P.prototype._generateBoundary=function(){for(var i="--------------------------",t=0;t<24;t++)i+=Math.floor(Math.random()*10).toString(16);this._boundary=i;};P.prototype.getLengthSync=function(){var i=this._overheadLength+this._valueLength;return this._streams.length&&(i+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),i};P.prototype.hasKnownLength=function(){var i=true;return this._valuesToMeasure.length&&(i=false),i};P.prototype.getLength=function(i){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(i.bind(this,null,t));return}qw.parallel(this._valuesToMeasure,this._lengthRetriever,function(e,o){if(e){i(e);return}o.forEach(function(a){t+=a;}),i(null,t);});};P.prototype.submit=function(i,t){var e,o,a={method:"post"};return typeof i=="string"?(i=Qw(i),o=Mn({port:i.port,path:i.pathname,host:i.hostname,protocol:i.protocol},a)):(o=Mn(i,a),o.port||(o.port=o.protocol=="https:"?443:80)),o.headers=this.getHeaders(i.headers),o.protocol=="https:"?e=$w.request(o):e=Gw.request(o),this.getLength(function(n,c){if(n&&n!=="Unknown stream"){this._error(n);return}if(c&&e.setHeader("Content-Length",c),this.pipe(e),t){var m,u=function(g,R){return e.removeListener("error",u),e.removeListener("response",m),t.call(this,g,R)};m=u.bind(this,null),e.on("error",u),e.on("response",m);}}.bind(this)),e};P.prototype._error=function(i){this.error||(this.error=i,this.pause(),this.emit("error",i));};P.prototype.toString=function(){return "[object FormData]"};});var _f={SILLY:0,TRACE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5,FATAL:6};function Ut(i,t=i){return ansiEscapes.link(t,i)}var k=new tslog.Logger({hideLogPositionForProduction:true,prettyLogTemplate:"{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}} {{logLevelName}} "}),zd=i=>{k.settings.minLevel=_f[i];},Tf=()=>{k.settings.minLevel=100;};zd(process.env.OPIK_LOG_LEVEL||"INFO");var Ef="~/.opik.config",cn={apiKey:"",apiUrl:"https://www.comet.com/opik/api",projectName:"Default Project",workspaceName:"default",batchDelayMs:300,holdUntilFlush:false};function _d(i){return Object.fromEntries(Object.entries(i).filter(([,t])=>t!==void 0))}function Pf(){return _d({apiKey:process.env.OPIK_API_KEY,apiUrl:process.env.OPIK_URL_OVERRIDE,projectName:process.env.OPIK_PROJECT_NAME,workspaceName:process.env.OPIK_WORKSPACE,batchDelayMs:process.env.OPIK_BATCH_DELAY_MS?Number(process.env.OPIK_BATCH_DELAY_MS):void 0,holdUntilFlush:process.env.OPIK_HOLD_UNTIL_FLUSH===void 0?void 0:["1","true","yes"].includes(String(process.env.OPIK_HOLD_UNTIL_FLUSH).toLowerCase())})}function Cf(){let i=process.env.OPIK_CONFIG_PATH||Ef;if(!Sd__default.default.existsSync(i)){if(process.env.OPIK_CONFIG_PATH)throw new Error(`Config file not found at ${i}`);return {}}try{let t=Af__default.default.parse(Sd__default.default.readFileSync(i,"utf8"));return t.opik?_d({apiKey:t.opik.api_key,apiUrl:t.opik.url_override,projectName:t.opik.project_name,workspaceName:t.opik.workspace}):{}}catch(t){return k.error(`Error loading config file ${i}: ${t}`),{}}}function Td(i){let t=Pf(),e=Cf(),{headers:o,...a}=i||{};return If({...cn,...e,...t,...a})}function If(i){if(!i.apiUrl)throw new Error("OPIK_URL_OVERRIDE is not set");let t=jf(i.apiUrl);if(t&&!i.apiKey)throw new Error("OPIK_API_KEY is not set");if(t&&!i.workspaceName)throw new Error("OPIK_WORKSPACE is not set");return i}function jf(i){return new URL(i).hostname.endsWith("comet.com")}var K={};E(K,{AlertAlertType:()=>Uf,AlertPublicAlertType:()=>Lf,AlertTriggerConfigPublicType:()=>Wf,AlertTriggerConfigType:()=>Df,AlertTriggerConfigWriteType:()=>Mf,AlertTriggerEventType:()=>Nf,AlertTriggerPublicEventType:()=>Bf,AlertTriggerWriteEventType:()=>Ff,AlertWriteAlertType:()=>Of,AnnotationQueuePublicScope:()=>Kf,AnnotationQueueScope:()=>Hf,AnnotationQueueWriteScope:()=>Jf,AssistantMessageRole:()=>ih,AttachmentListRequestEntityType:()=>Ed,BadRequestError:()=>_,CheckName:()=>zh,CheckPublicName:()=>iw,CheckPublicResult:()=>nw,CheckResult:()=>Sh,ColumnCompareTypesItem:()=>uh,ColumnPublicTypesItem:()=>yh,ColumnTypesItem:()=>kh,CompleteMultipartUploadRequestEntityType:()=>Xf,ConflictError:()=>W,DatasetItemCompareSource:()=>gh,DatasetItemFilterOperator:()=>sh,DatasetItemPublicSource:()=>xh,DatasetItemSource:()=>ch,DatasetItemWriteSource:()=>zn,DatasetPublicVisibility:()=>bh,DatasetUpdateVisibility:()=>Ud,DatasetVisibility:()=>ph,DatasetWriteVisibility:()=>jd,DeleteAttachmentsRequestEntityType:()=>Gf,DownloadAttachmentRequestEntityType:()=>Pd,ExperimentItemCompareTraceVisibilityMode:()=>fh,ExperimentItemPublicTraceVisibilityMode:()=>Rh,ExperimentItemTraceVisibilityMode:()=>lh,ExperimentPublicStatus:()=>Ch,ExperimentPublicType:()=>Ph,ExperimentStatus:()=>vh,ExperimentType:()=>Sn,ExperimentUpdateStatus:()=>Fd,ExperimentUpdateType:()=>Md,ExperimentWriteStatus:()=>Dd,ExperimentWriteType:()=>Nd,FeedbackScoreBatchItemSource:()=>tw,FeedbackScoreBatchItemThreadSource:()=>cw,FeedbackScoreCompareSource:()=>hh,FeedbackScoreExperimentItemBulkWriteViewSource:()=>Th,FeedbackScorePublicSource:()=>ew,FeedbackScoreSource:()=>mh,FindFeedbackDefinitionsRequestType:()=>Od,FindFeedbackScoreNames1RequestType:()=>Gd,ForbiddenError:()=>Z,GetSpanStatsRequestType:()=>$d,GetSpansByProjectRequestType:()=>Xd,GetWebhookExamplesRequestAlertType:()=>Ad,GuardrailName:()=>Ih,GuardrailResult:()=>jh,GuardrailWriteName:()=>Uh,GuardrailWriteResult:()=>Nh,LlmAsJudgeMessagePublicRole:()=>rh,LlmAsJudgeMessageRole:()=>$f,LlmAsJudgeMessageWriteRole:()=>Zf,LlmAsJudgeOutputSchemaPublicType:()=>oh,LlmAsJudgeOutputSchemaType:()=>Qf,LlmAsJudgeOutputSchemaWriteType:()=>qf,LogItemLevel:()=>ah,ManualEvaluationRequestEntityType:()=>Fh,NotFoundError:()=>T,NotImplementedError:()=>wr,OptimizationPublicStatus:()=>Bh,OptimizationStatus:()=>Oh,OptimizationUpdateStatus:()=>Bd,OptimizationWriteStatus:()=>Wh,ProjectDetailedVisibility:()=>Xh,ProjectMetricRequestPublicInterval:()=>Jd,ProjectMetricRequestPublicMetricType:()=>Hd,ProjectMetricResponsePublicInterval:()=>Jh,ProjectMetricResponsePublicMetricType:()=>Hh,ProjectPublicVisibility:()=>Vh,ProjectUpdateVisibility:()=>Vd,ProjectVisibility:()=>Lh,ProjectWriteVisibility:()=>Ld,PromptType:()=>Gh,PromptVersionDetailType:()=>Qh,PromptVersionPublicType:()=>Yh,PromptVersionType:()=>$h,PromptWriteType:()=>Kd,ProviderApiKeyProvider:()=>Mh,ProviderApiKeyPublicProvider:()=>Dh,ProviderApiKeyWriteProvider:()=>Wd,ResponseFormatType:()=>nh,SpanExperimentItemBulkWriteViewType:()=>Ah,SpanFilterPublicOperator:()=>aw,SpanPublicType:()=>rw,SpanSearchStreamRequestPublicType:()=>Qd,SpanType:()=>ye,SpanUpdateType:()=>Zh,SpanWriteType:()=>qh,StartMultipartUploadRequestEntityType:()=>Cd,TraceFilterOperator:()=>Yf,TraceFilterPublicOperator:()=>th,TraceFilterWriteOperator:()=>eh,TracePublicVisibilityMode:()=>sw,TraceThreadFilterOperator:()=>lw,TraceThreadFilterPublicOperator:()=>Kh,TraceThreadStatus:()=>pw,TraceVisibilityMode:()=>_h,UnauthorizedError:()=>$,UnprocessableEntityError:()=>B,UploadAttachmentRequestEntityType:()=>Id,ValueEntryCompareSource:()=>wh,ValueEntryExperimentItemBulkWriteViewSource:()=>Eh,ValueEntryPublicSource:()=>ow,ValueEntrySource:()=>dh,WebhookTestResultStatus:()=>Vf,alerts:()=>Nt,annotationQueues:()=>mn,attachments:()=>Dt,automationRuleEvaluators:()=>un,chatCompletions:()=>gn,check:()=>dn,dashboards:()=>fn,datasets:()=>Mt,experiments:()=>Ft,feedbackDefinitions:()=>Ot,guardrails:()=>hn,llmProviderKey:()=>Wt,manualEvaluation:()=>wn,openTelemetryIngestion:()=>bn,optimizations:()=>Bt,projects:()=>Lt,prompts:()=>Vt,redirect:()=>vn,serviceToggles:()=>xn,spans:()=>Ht,systemUsage:()=>ln,traces:()=>Rn,welcomeWizard:()=>yn,workspaces:()=>kn});var Nt={};E(Nt,{GetWebhookExamplesRequestAlertType:()=>Ad});var Ad={General:"general",Slack:"slack",Pagerduty:"pagerduty"};var Dt={};E(Dt,{AttachmentListRequestEntityType:()=>Ed,DownloadAttachmentRequestEntityType:()=>Pd,StartMultipartUploadRequestEntityType:()=>Cd,UploadAttachmentRequestEntityType:()=>Id});var Ed={Trace:"trace",Span:"span"};var Pd={Trace:"trace",Span:"span"};var Cd={Trace:"trace",Span:"span"};var Id={Trace:"trace",Span:"span"};var Mt={};E(Mt,{DatasetUpdateVisibility:()=>Ud,DatasetWriteVisibility:()=>jd});var jd={Private:"private",Public:"public"};var Ud={Private:"private",Public:"public"};var Ft={};E(Ft,{ExperimentUpdateStatus:()=>Fd,ExperimentUpdateType:()=>Md,ExperimentWriteStatus:()=>Dd,ExperimentWriteType:()=>Nd});var Nd={Regular:"regular",Trial:"trial",MiniBatch:"mini-batch"};var Dd={Running:"running",Completed:"completed",Cancelled:"cancelled"};var Md={Regular:"regular",Trial:"trial",MiniBatch:"mini-batch"};var Fd={Running:"running",Completed:"completed",Cancelled:"cancelled"};var Ot={};E(Ot,{FindFeedbackDefinitionsRequestType:()=>Od});var Od={Numerical:"numerical",Categorical:"categorical",Boolean:"boolean"};var Wt={};E(Wt,{ProviderApiKeyWriteProvider:()=>Wd});var Wd={Openai:"openai",Anthropic:"anthropic",Gemini:"gemini",Openrouter:"openrouter",VertexAi:"vertex-ai",CustomLlm:"custom-llm"};var Bt={};E(Bt,{OptimizationUpdateStatus:()=>Bd});var Bd={Running:"running",Completed:"completed",Cancelled:"cancelled"};var Lt={};E(Lt,{ProjectMetricRequestPublicInterval:()=>Jd,ProjectMetricRequestPublicMetricType:()=>Hd,ProjectUpdateVisibility:()=>Vd,ProjectWriteVisibility:()=>Ld});var Ld={Private:"private",Public:"public"};var Vd={Private:"private",Public:"public"};var Hd={FeedbackScores:"FEEDBACK_SCORES",TraceCount:"TRACE_COUNT",TokenUsage:"TOKEN_USAGE",Duration:"DURATION",Cost:"COST",GuardrailsFailedCount:"GUARDRAILS_FAILED_COUNT",ThreadCount:"THREAD_COUNT",ThreadDuration:"THREAD_DURATION",ThreadFeedbackScores:"THREAD_FEEDBACK_SCORES"};var Jd={Hourly:"HOURLY",Daily:"DAILY",Weekly:"WEEKLY"};var Vt={};E(Vt,{PromptWriteType:()=>Kd});var Kd={Mustache:"mustache",Jinja2:"jinja2"};var Ht={};E(Ht,{FindFeedbackScoreNames1RequestType:()=>Gd,GetSpanStatsRequestType:()=>$d,GetSpansByProjectRequestType:()=>Xd,SpanSearchStreamRequestPublicType:()=>Qd});var Xd={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var Gd={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var $d={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var Qd={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var ln={};var mn={};var dn={};var un={};var gn={};var fn={};var hn={};var wn={};var bn={};var xn={};var Rn={};var yn={};var kn={};var vn={};var Uf={General:"general",Slack:"slack",Pagerduty:"pagerduty"};var Nf={TraceErrors:"trace:errors",TraceFeedbackScore:"trace:feedback_score",TraceThreadFeedbackScore:"trace_thread:feedback_score",PromptCreated:"prompt:created",PromptCommitted:"prompt:committed",TraceGuardrailsTriggered:"trace:guardrails_triggered",PromptDeleted:"prompt:deleted",ExperimentFinished:"experiment:finished",TraceCost:"trace:cost",TraceLatency:"trace:latency"};var Df={ScopeProject:"scope:project",ThresholdFeedbackScore:"threshold:feedback_score",ThresholdCost:"threshold:cost",ThresholdLatency:"threshold:latency",ThresholdErrors:"threshold:errors"};var Mf={ScopeProject:"scope:project",ThresholdFeedbackScore:"threshold:feedback_score",ThresholdCost:"threshold:cost",ThresholdLatency:"threshold:latency",ThresholdErrors:"threshold:errors"};var Ff={TraceErrors:"trace:errors",TraceFeedbackScore:"trace:feedback_score",TraceThreadFeedbackScore:"trace_thread:feedback_score",PromptCreated:"prompt:created",PromptCommitted:"prompt:committed",TraceGuardrailsTriggered:"trace:guardrails_triggered",PromptDeleted:"prompt:deleted",ExperimentFinished:"experiment:finished",TraceCost:"trace:cost",TraceLatency:"trace:latency"};var Of={General:"general",Slack:"slack",Pagerduty:"pagerduty"};var Wf={ScopeProject:"scope:project",ThresholdFeedbackScore:"threshold:feedback_score",ThresholdCost:"threshold:cost",ThresholdLatency:"threshold:latency",ThresholdErrors:"threshold:errors"};var Bf={TraceErrors:"trace:errors",TraceFeedbackScore:"trace:feedback_score",TraceThreadFeedbackScore:"trace_thread:feedback_score",PromptCreated:"prompt:created",PromptCommitted:"prompt:committed",TraceGuardrailsTriggered:"trace:guardrails_triggered",PromptDeleted:"prompt:deleted",ExperimentFinished:"experiment:finished",TraceCost:"trace:cost",TraceLatency:"trace:latency"};var Lf={General:"general",Slack:"slack",Pagerduty:"pagerduty"};var Vf={Success:"success",Failure:"failure"};var Hf={Trace:"trace",Thread:"thread"};var Jf={Trace:"trace",Thread:"thread"};var Kf={Trace:"trace",Thread:"thread"};var Xf={Trace:"trace",Span:"span"};var Gf={Trace:"trace",Span:"span"};var $f={System:"SYSTEM",User:"USER",Ai:"AI",ToolExecutionResult:"TOOL_EXECUTION_RESULT",Custom:"CUSTOM"};var Qf={Boolean:"BOOLEAN",Integer:"INTEGER",Double:"DOUBLE"};var Yf={Contains:"contains",NotContains:"not_contains",StartsWith:"starts_with",EndsWith:"ends_with",EqualTo:"=",NotEquals:"!=",GreaterThan:">",GreaterThanOrEqualTo:">=",LessThan:"<",LessThanOrEqualTo:"<=",IsEmpty:"is_empty",IsNotEmpty:"is_not_empty"};var Zf={System:"SYSTEM",User:"USER",Ai:"AI",ToolExecutionResult:"TOOL_EXECUTION_RESULT",Custom:"CUSTOM"};var qf={Boolean:"BOOLEAN",Integer:"INTEGER",Double:"DOUBLE"};var eh={Contains:"contains",NotContains:"not_contains",StartsWith:"starts_with",EndsWith:"ends_with",EqualTo:"=",NotEquals:"!=",GreaterThan:">",GreaterThanOrEqualTo:">=",LessThan:"<",LessThanOrEqualTo:"<=",IsEmpty:"is_empty",IsNotEmpty:"is_not_empty"};var rh={System:"SYSTEM",User:"USER",Ai:"AI",ToolExecutionResult:"TOOL_EXECUTION_RESULT",Custom:"CUSTOM"};var oh={Boolean:"BOOLEAN",Integer:"INTEGER",Double:"DOUBLE"};var th={Contains:"contains",NotContains:"not_contains",StartsWith:"starts_with",EndsWith:"ends_with",EqualTo:"=",NotEquals:"!=",GreaterThan:">",GreaterThanOrEqualTo:">=",LessThan:"<",LessThanOrEqualTo:"<=",IsEmpty:"is_empty",IsNotEmpty:"is_not_empty"};var ah={Info:"INFO",Warn:"WARN",Error:"ERROR",Debug:"DEBUG",Trace:"TRACE"};var ih={System:"system",User:"user",Assistant:"assistant",Tool:"tool",Function:"function"};var nh={Text:"text",JsonObject:"json_object",JsonSchema:"json_schema"};var sh={Contains:"contains",NotContains:"not_contains",StartsWith:"starts_with",EndsWith:"ends_with",EqualTo:"=",NotEquals:"!=",GreaterThan:">",GreaterThanOrEqualTo:">=",LessThan:"<",LessThanOrEqualTo:"<=",IsEmpty:"is_empty",IsNotEmpty:"is_not_empty"};var ph={Private:"private",Public:"public"};var ch={Manual:"manual",Trace:"trace",Span:"span",Sdk:"sdk"};var lh={Default:"default",Hidden:"hidden"};var mh={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var dh={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var zn={Manual:"manual",Trace:"trace",Span:"span",Sdk:"sdk"};var uh={String:"string",Number:"number",Object:"object",Boolean:"boolean",Array:"array",Null:"null"};var gh={Manual:"manual",Trace:"trace",Span:"span",Sdk:"sdk"};var fh={Default:"default",Hidden:"hidden"};var hh={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var wh={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var bh={Private:"private",Public:"public"};var xh={Manual:"manual",Trace:"trace",Span:"span",Sdk:"sdk"};var Rh={Default:"default",Hidden:"hidden"};var yh={String:"string",Number:"number",Object:"object",Boolean:"boolean",Array:"array",Null:"null"};var kh={String:"string",Number:"number",Object:"object",Boolean:"boolean",Array:"array",Null:"null"};var Sn={Regular:"regular",Trial:"trial",MiniBatch:"mini-batch"};var vh={Running:"running",Completed:"completed",Cancelled:"cancelled"};var zh={Topic:"TOPIC",Pii:"PII"};var Sh={Passed:"passed",Failed:"failed"};var ye={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var _h={Default:"default",Hidden:"hidden"};var Th={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var Ah={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var Eh={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var Ph={Regular:"regular",Trial:"trial",MiniBatch:"mini-batch"};var Ch={Running:"running",Completed:"completed",Cancelled:"cancelled"};var Ih={Topic:"TOPIC",Pii:"PII"};var jh={Passed:"passed",Failed:"failed"};var Uh={Topic:"TOPIC",Pii:"PII"};var Nh={Passed:"passed",Failed:"failed"};var Dh={Openai:"openai",Anthropic:"anthropic",Gemini:"gemini",Openrouter:"openrouter",VertexAi:"vertex-ai",CustomLlm:"custom-llm"};var Mh={Openai:"openai",Anthropic:"anthropic",Gemini:"gemini",Openrouter:"openrouter",VertexAi:"vertex-ai",CustomLlm:"custom-llm"};var Fh={Trace:"trace",Thread:"thread"};var Oh={Running:"running",Completed:"completed",Cancelled:"cancelled"};var Wh={Running:"running",Completed:"completed",Cancelled:"cancelled"};var Bh={Running:"running",Completed:"completed",Cancelled:"cancelled"};var Lh={Private:"private",Public:"public"};var Vh={Private:"private",Public:"public"};var Hh={FeedbackScores:"FEEDBACK_SCORES",TraceCount:"TRACE_COUNT",TokenUsage:"TOKEN_USAGE",Duration:"DURATION",Cost:"COST",GuardrailsFailedCount:"GUARDRAILS_FAILED_COUNT",ThreadCount:"THREAD_COUNT",ThreadDuration:"THREAD_DURATION",ThreadFeedbackScores:"THREAD_FEEDBACK_SCORES"};var Jh={Hourly:"HOURLY",Daily:"DAILY",Weekly:"WEEKLY"};var Kh={Contains:"contains",NotContains:"not_contains",StartsWith:"starts_with",EndsWith:"ends_with",EqualTo:"=",NotEquals:"!=",GreaterThan:">",GreaterThanOrEqualTo:">=",LessThan:"<",LessThanOrEqualTo:"<=",IsEmpty:"is_empty",IsNotEmpty:"is_not_empty"};var Xh={Private:"private",Public:"public"};var Gh={Mustache:"mustache",Jinja2:"jinja2"};var $h={Mustache:"mustache",Jinja2:"jinja2"};var Qh={Mustache:"mustache",Jinja2:"jinja2"};var Yh={Mustache:"mustache",Jinja2:"jinja2"};var Zh={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var qh={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var ew={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var rw={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var ow={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var tw={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var aw={Contains:"contains",NotContains:"not_contains",StartsWith:"starts_with",EndsWith:"ends_with",EqualTo:"=",NotEquals:"!=",GreaterThan:">",GreaterThanOrEqualTo:">=",LessThan:"<",LessThanOrEqualTo:"<=",IsEmpty:"is_empty",IsNotEmpty:"is_not_empty"};var iw={Topic:"TOPIC",Pii:"PII"};var nw={Passed:"passed",Failed:"failed"};var sw={Default:"default",Hidden:"hidden"};var pw={Active:"active",Inactive:"inactive"};var cw={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var lw={Contains:"contains",NotContains:"not_contains",StartsWith:"starts_with",EndsWith:"ends_with",EqualTo:"=",NotEquals:"!=",GreaterThan:">",GreaterThanOrEqualTo:">=",LessThan:"<",LessThanOrEqualTo:"<=",IsEmpty:"is_empty",IsNotEmpty:"is_not_empty"};var Pe=(i,t,e)=>JSON.stringify(i,t,e);var p=class i extends Error{constructor({message:t,statusCode:e,body:o,rawResponse:a}){super(mw({message:t,statusCode:e,body:o})),Object.setPrototypeOf(this,i.prototype),this.statusCode=e,this.body=o,this.rawResponse=a;}};function mw({message:i,statusCode:t,body:e}){let o=[];return i!=null&&o.push(i),t!=null&&o.push(`Status code: ${t.toString()}`),e!=null&&o.push(`Body: ${Pe(e,void 0,2)}`),o.join(`
|
|
3
3
|
`)}var f=class i extends Error{constructor(t){super(t),Object.setPrototypeOf(this,i.prototype);}};var _=class i extends p{constructor(t,e){super({message:"BadRequestError",statusCode:400,body:t,rawResponse:e}),Object.setPrototypeOf(this,i.prototype);}};var W=class i extends p{constructor(t,e){super({message:"ConflictError",statusCode:409,body:t,rawResponse:e}),Object.setPrototypeOf(this,i.prototype);}};var B=class i extends p{constructor(t,e){super({message:"UnprocessableEntityError",statusCode:422,body:t,rawResponse:e}),Object.setPrototypeOf(this,i.prototype);}};var T=class i extends p{constructor(t,e){super({message:"NotFoundError",statusCode:404,body:t,rawResponse:e}),Object.setPrototypeOf(this,i.prototype);}};var $=class i extends p{constructor(t,e){super({message:"UnauthorizedError",statusCode:401,body:t,rawResponse:e}),Object.setPrototypeOf(this,i.prototype);}};var Z=class i extends p{constructor(t,e){super({message:"ForbiddenError",statusCode:403,body:t,rawResponse:e}),Object.setPrototypeOf(this,i.prototype);}};var wr=class i extends p{constructor(t,e){super({message:"NotImplementedError",statusCode:501,body:t,rawResponse:e}),Object.setPrototypeOf(this,i.prototype);}};var w={Default:"http://localhost:5173/api"};var br;typeof globalThis.Headers!="undefined"?br=globalThis.Headers:br=class Yd{constructor(t){if(this.headers=new Map,t)if(t instanceof Yd)t.forEach((e,o)=>this.append(o,e));else if(Array.isArray(t))for(let[e,o]of t)if(typeof e=="string"&&typeof o=="string")this.append(e,o);else throw new TypeError("Each header entry must be a [string, string] tuple");else for(let[e,o]of Object.entries(t))if(typeof o=="string")this.append(e,o);else throw new TypeError("Header values must be strings")}append(t,e){let o=t.toLowerCase(),a=this.headers.get(o)||[];this.headers.set(o,[...a,e]);}delete(t){let e=t.toLowerCase();this.headers.delete(e);}get(t){let e=t.toLowerCase(),o=this.headers.get(e);return o?o.join(", "):null}has(t){let e=t.toLowerCase();return this.headers.has(e)}set(t,e){let o=t.toLowerCase();this.headers.set(o,[e]);}forEach(t,e){let o=e?t.bind(e):t;this.headers.forEach((a,n)=>o(a.join(", "),n,this));}getSetCookie(){return this.headers.get("set-cookie")||[]}*entries(){for(let[t,e]of this.headers.entries())yield [t,e.join(", ")];}*keys(){yield*this.headers.keys();}*values(){for(let t of this.headers.values())yield t.join(", ");}[Symbol.iterator](){return this.entries()}};var Jt={headers:new br,redirected:false,status:499,statusText:"Client Closed Request",type:"error",url:""},Kt={headers:new br,redirected:false,status:0,statusText:"Unknown Error",type:"error",url:""};function Xt(i){return {headers:i.headers,redirected:i.redirected,status:i.status,statusText:i.statusText,type:i.type,url:i.url}}function Zd(i,t){return Object.keys(t!=null?t:{}).length>0?`${i}?${dw__default.default.stringify(t,{arrayFormat:"repeat"})}`:i}var d=uw();function uw(){var u,g,R,y,v;return typeof window!="undefined"&&typeof window.document!="undefined"?{type:"browser",version:window.navigator.userAgent}:typeof globalThis!="undefined"&&((u=globalThis==null?void 0:globalThis.navigator)==null?void 0:u.userAgent)==="Cloudflare-Workers"?{type:"workerd"}:typeof EdgeRuntime=="string"?{type:"edge-runtime"}:typeof self=="object"&&typeof(self==null?void 0:self.importScripts)=="function"&&(((g=self.constructor)==null?void 0:g.name)==="DedicatedWorkerGlobalScope"||((R=self.constructor)==null?void 0:R.name)==="ServiceWorkerGlobalScope"||((y=self.constructor)==null?void 0:y.name)==="SharedWorkerGlobalScope")?{type:"web-worker"}:typeof Deno!="undefined"&&typeof Deno.version!="undefined"&&typeof Deno.version.deno!="undefined"?{type:"deno",version:Deno.version.deno}:typeof Bun!="undefined"&&typeof Bun.version!="undefined"?{type:"bun",version:Bun.version}:typeof process!="undefined"&&"version"in process&&!!process.version&&"versions"in process&&!!((v=process.versions)!=null&&v.node)?{type:"node",version:process.versions.node,parsedVersion:Number(process.versions.node.split(".")[0])}:typeof navigator!="undefined"&&(navigator==null?void 0:navigator.product)==="ReactNative"?{type:"react-native"}:{type:"unknown"}}async function qd(){return d.type==="node"&&d.parsedVersion!=null&&d.parsedVersion>=18?fetch:d.type==="node"?(await import('node-fetch')).default:typeof fetch=="function"?fetch:(await import('node-fetch')).default}async function eu({body:i,type:t}){return t.includes("json")?Pe(i):i}async function su(i){return d.type==="node"&&d.parsedVersion!=null&&d.parsedVersion>=18?new(await Promise.resolve().then(()=>(ou(),ru))).Node18UniversalStreamWrapper(i):d.type!=="node"&&typeof fetch=="function"?new(await Promise.resolve().then(()=>(au(),tu))).UndiciStreamWrapper(i):new(await Promise.resolve().then(()=>(nu(),iu))).NodePre18StreamWrapper(i)}async function pu(i,t){if(i.body!=null&&t==="blob")return await i.blob();if(i.body!=null&&t==="arrayBuffer")return await i.arrayBuffer();if(i.body!=null&&t==="sse")return i.body;if(i.body!=null&&t==="streaming")return su(i.body);if(i.body!=null&&t==="text")return await i.text();{let e=await i.text();if(e.length>0)try{return JSON.parse(e)}catch{return {ok:false,error:{reason:"non-json",statusCode:i.status,rawBody:e}}}else return}}var gw="timeout";function cu(i){let t=new AbortController,e=setTimeout(()=>t.abort(gw),i);return {signal:t.signal,abortId:e}}function lu(...i){let t=i.length===1&&Array.isArray(i[0])?i[0]:i,e=new AbortController;for(let o of t){if(o.aborted){e.abort(o==null?void 0:o.reason);break}o.addEventListener("abort",()=>e.abort(o==null?void 0:o.reason),{signal:e.signal});}return e.signal}var mu=async(i,t,e,o,a,n,c,m,u)=>{let g=[],R;if(n!=null){let{signal:z,abortId:S}=cu(n);R=S,g.push(z);}c!=null&&g.push(c);let y=lu(g),v=await i(t,{method:e,headers:o,body:a,signal:y,credentials:m?"include":void 0,duplex:u});return R!=null&&clearTimeout(R),v};function fw(i){let t=1+(Math.random()*2-1)*.2;return i*t}async function du(i,t=2){let e=await i();for(let o=0;o<t&&([408,429].includes(e.status)||e.status>=500);++o){let a=Math.min(1e3*Math.pow(2,o),6e4),n=fw(a);await new Promise(c=>setTimeout(c,n)),e=await i();}return e}async function hw(i){let t={};if(i.body!==void 0&&i.contentType!=null&&(t["Content-Type"]=i.contentType),i.headers!=null)for(let[n,c]of Object.entries(i.headers))c!=null&&(t[n]=c);let e=Zd(i.url,i.queryParameters),o=await eu({body:i.body,type:i.requestType==="json"?"json":"other"}),a=await qd();try{let n=await du(async()=>mu(a,e,i.method,t,o,i.timeoutMs,i.abortSignal,i.withCredentials,i.duplex),i.maxRetries),c=await pu(n,i.responseType);return n.status>=200&&n.status<400?{ok:!0,body:c,headers:n.headers,rawResponse:Xt(n)}:{ok:!1,error:{reason:"status-code",statusCode:n.status,body:c},rawResponse:Xt(n)}}catch(n){return i.abortSignal!=null&&i.abortSignal.aborted?{ok:false,error:{reason:"unknown",errorMessage:"The user aborted a request"},rawResponse:Jt}:n instanceof Error&&n.name==="AbortError"?{ok:false,error:{reason:"timeout"},rawResponse:Jt}:n instanceof Error?{ok:false,error:{reason:"unknown",errorMessage:n.message},rawResponse:Kt}:{ok:false,error:{reason:"unknown",errorMessage:Pe(n)},rawResponse:Kt}}}var b=hw;var s={get:async i=>typeof i=="function"?i():i};var h=class i extends Promise{constructor(t){super(e=>{e(void 0);}),this.innerPromise=t;}static fromFunction(t,...e){return new i(t(...e))}static interceptFunction(t){return (...e)=>i.fromPromise(t(...e))}static fromPromise(t){return new i(t)}static fromExecutor(t){let e=new Promise(t);return new i(e)}static fromResult(t){let e=Promise.resolve(t);return new i(e)}unwrap(){return this.unwrappedPromise||(this.unwrappedPromise=this.innerPromise.then(({data:t})=>t)),this.unwrappedPromise}then(t,e){return this.unwrap().then(t,e)}catch(t){return this.unwrap().catch(t)}finally(t){return this.unwrap().finally(t)}async withRawResponse(){return await this.innerPromise}};function Ln(i){return typeof i=="object"&&i!=null&&"name"in i}function Vn(i){return typeof i=="object"&&i!=null&&"path"in i}function Hn(i){let t=i.lastIndexOf("/"),e=i.lastIndexOf("\\"),o=Math.max(t,e);return o>=0?i.substring(o+1):i}async function Xu(){let i;return d.type==="node"&&d.parsedVersion!=null&&d.parsedVersion>=18?i=new On:d.type==="node"?i=new Wn:i=new Bn,await i.setup(),i}var On=class{async setup(){this.fd=new(await import('formdata-node')).FormData;}append(t,e){var o;(o=this.fd)==null||o.append(t,e);}getFileName(t,e){if(e!=null)return e;if(Ln(t))return t.name;if(Vn(t)&&t.path)return Hn(t.path.toString())}async appendFile(t,e,o){var a,n;o=this.getFileName(e,o),e instanceof Blob?(a=this.fd)==null||a.append(t,e,o):(n=this.fd)==null||n.append(t,{type:void 0,name:o,[Symbol.toStringTag]:"File",stream(){return e}});}async getRequest(){let t=new(await import('form-data-encoder')).FormDataEncoder(this.fd);return {body:(await import('readable-stream')).Readable.from(t),headers:t.headers,duplex:"half"}}},Wn=class{async setup(){this.fd=new(await Promise.resolve().then(()=>Rf(Ku()))).default;}append(t,e){var o;(o=this.fd)==null||o.append(t,e);}getFileName(t,e){if(e!=null)return e;if(Ln(t))return t.name;if(Vn(t)&&t.path)return Hn(t.path.toString())}async appendFile(t,e,o){var n,c;o=this.getFileName(e,o);let a;e instanceof Blob?a=Buffer.from(await e.arrayBuffer()):a=e,o==null?(n=this.fd)==null||n.append(t,a):(c=this.fd)==null||c.append(t,a,{filename:o});}getRequest(){return {body:this.fd,headers:this.fd?this.fd.getHeaders():{}}}},Bn=class{async setup(){this.fd=new FormData;}append(t,e){var o;(o=this.fd)==null||o.append(t,e);}getFileName(t,e){if(e!=null)return e;if(Ln(t))return t.name;if(Vn(t)&&t.path)return Hn(t.path.toString())}async appendFile(t,e,o){var a,n;if(o=this.getFileName(e,o),e instanceof Blob){(a=this.fd)==null||a.append(t,e,o);return}(n=this.fd)==null||n.append(t,new Blob([e]),o);}getRequest(){return {body:this.fd,headers:{}}}};var r={};E(r,{JsonError:()=>qe,ParseError:()=>er,any:()=>pg,bigint:()=>$u,boolean:()=>cg,booleanLiteral:()=>sg,date:()=>Qu,discriminant:()=>bg,enum_:()=>Yt,getObjectLikeUtils:()=>he,getObjectUtils:()=>We,getSchemaUtils:()=>U,isProperty:()=>Ie,lazy:()=>Yu,lazyObject:()=>ag,list:()=>qt,number:()=>lg,object:()=>Zt,objectWithoutOptionalProperties:()=>tg,optional:()=>Jn,property:()=>qu,record:()=>gg,set:()=>fg,string:()=>mg,stringLiteral:()=>ng,transform:()=>Kn,undiscriminatedUnion:()=>wg,union:()=>Rg,unknown:()=>dg,withParsedProperties:()=>Gn});var A={BIGINT:"bigint",DATE:"date",ENUM:"enum",LIST:"list",STRING_LITERAL:"stringLiteral",BOOLEAN_LITERAL:"booleanLiteral",OBJECT:"object",ANY:"any",BOOLEAN:"boolean",NUMBER:"number",STRING:"string",UNKNOWN:"unknown",RECORD:"record",SET:"set",UNION:"union",UNDISCRIMINATED_UNION:"undiscriminatedUnion",NULLABLE:"nullable",OPTIONAL:"optional",OPTIONAL_NULLABLE:"optionalNullable"};function j(i,t){return `Expected ${t}. Received ${eb(i)}.`}function eb(i){if(Array.isArray(i))return "list";if(i===null)return "null";if(i instanceof BigInt)return "BigInt";switch(typeof i){case "string":return `"${i}"`;case "bigint":case "number":case "boolean":case "undefined":return `${i}`}return typeof i}function Q(i){return {...i,json:Gu(i.json),parse:Gu(i.parse)}}function Gu(i){return (t,e)=>{let o=i(t,e),{skipValidation:a=false}=e!=null?e:{};return !o.ok&&a?(console.warn(["Failed to validate.",...o.errors.map(n=>" - "+(n.path.length>0?`${n.path.join(".")}: ${n.message}`:n.message))].join(`
|
|
4
|
-
`)),{ok:true,value:t}):o}}function Qt(i){return i.path.length===0?i.message:`${i.path.join(" -> ")}: ${i.message}`}var qe=class i extends Error{constructor(e){super(e.map(Qt).join("; "));this.errors=e;Object.setPrototypeOf(this,i.prototype);}};var er=class i extends Error{constructor(e){super(e.map(Qt).join("; "));this.errors=e;Object.setPrototypeOf(this,i.prototype);}};function U(i){return {nullable:()=>rb(i),optional:()=>Jn(i),optionalNullable:()=>ob(i),transform:t=>Kn(i,t),parseOrThrow:(t,e)=>{let o=i.parse(t,e);if(o.ok)return o.value;throw new er(o.errors)},jsonOrThrow:(t,e)=>{let o=i.json(t,e);if(o.ok)return o.value;throw new qe(o.errors)}}}function rb(i){let t={parse:(e,o)=>e==null?{ok:true,value:null}:i.parse(e,o),json:(e,o)=>e==null?{ok:true,value:null}:i.json(e,o),getType:()=>A.NULLABLE};return {...t,...U(t)}}function Jn(i){let t={parse:(e,o)=>e==null?{ok:true,value:void 0}:i.parse(e,o),json:(e,o)=>o!=null&&o.omitUndefined&&e===void 0?{ok:true,value:void 0}:e==null?{ok:true,value:null}:i.json(e,o),getType:()=>A.OPTIONAL};return {...t,...U(t)}}function ob(i){let t={parse:(e,o)=>e===void 0?{ok:true,value:void 0}:e===null?{ok:true,value:null}:i.parse(e,o),json:(e,o)=>e===void 0?{ok:true,value:void 0}:e===null?{ok:true,value:null}:i.json(e,o),getType:()=>A.OPTIONAL_NULLABLE};return {...t,...U(t)}}function Kn(i,t){let e={parse:(o,a)=>{let n=i.parse(o,a);return n.ok?{ok:true,value:t.transform(n.value)}:n},json:(o,a)=>{let n=t.untransform(o);return i.json(n,a)},getType:()=>i.getType()};return {...e,...U(e)}}function $u(){let i={parse:(t,{breadcrumbsPrefix:e=[]}={})=>typeof t=="bigint"?{ok:true,value:t}:typeof t=="number"?{ok:true,value:BigInt(t)}:{ok:false,errors:[{path:e,message:j(t,"bigint | number")}]},json:(t,{breadcrumbsPrefix:e=[]}={})=>typeof t!="bigint"?{ok:false,errors:[{path:e,message:j(t,"bigint")}]}:{ok:true,value:t},getType:()=>A.BIGINT};return {...Q(i),...U(i)}}var tb=/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;function Qu(){let i={parse:(t,{breadcrumbsPrefix:e=[]}={})=>typeof t!="string"?{ok:false,errors:[{path:e,message:j(t,"string")}]}:tb.test(t)?{ok:true,value:new Date(t)}:{ok:false,errors:[{path:e,message:j(t,"ISO 8601 date string")}]},json:(t,{breadcrumbsPrefix:e=[]}={})=>t instanceof Date?{ok:true,value:t.toISOString()}:{ok:false,errors:[{path:e,message:j(t,"Date object")}]},getType:()=>A.DATE};return {...Q(i),...U(i)}}function q(i,t){return ()=>{let e={parse:t,json:t,getType:()=>i};return {...Q(e),...U(e)}}}function Yt(i){let t=new Set(i);return q(A.ENUM,(o,{allowUnrecognizedEnumValues:a,breadcrumbsPrefix:n=[]}={})=>typeof o!="string"?{ok:false,errors:[{path:n,message:j(o,"string")}]}:!t.has(o)&&!a?{ok:false,errors:[{path:n,message:j(o,"enum")}]}:{ok:true,value:o})()}function Yu(i){let t=Xn(i);return {...t,...U(t)}}function Xn(i){return {parse:(t,e)=>rr(i).parse(t,e),json:(t,e)=>rr(i).json(t,e),getType:()=>rr(i).getType()}}function rr(i){let t=i;return t.__zurg_memoized==null&&(t.__zurg_memoized=i()),t.__zurg_memoized}function xr(i){return Object.entries(i)}function Rr(i,t){let e=new Set(t);return Object.entries(i).reduce((o,[a,n])=>(e.has(a)&&(o[a]=n),o),{})}function Ce(i){if(typeof i!="object"||i===null)return false;if(Object.getPrototypeOf(i)===null)return true;let t=i;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(i)===t}function yr(i){return Object.keys(i)}function Zu(i,t){let e=[],o=[];for(let a of i)t(a)?e.push(a):o.push(a);return [e,o]}function he(i){return {withParsedProperties:t=>Gn(i,t)}}function Gn(i,t){let e={parse:(o,a)=>{let n=i.parse(o,a);if(!n.ok)return n;let c=Object.entries(t).reduce((m,[u,g])=>({...m,[u]:typeof g=="function"?g(n.value):g}),{});return {ok:true,value:{...n.value,...c}}},json:(o,a)=>{var m;if(!Ce(o))return {ok:false,errors:[{path:(m=a==null?void 0:a.breadcrumbsPrefix)!=null?m:[],message:j(o,"object")}]};let n=new Set(Object.keys(t)),c=Rr(o,Object.keys(o).filter(u=>!n.has(u)));return i.json(c,a)},getType:()=>i.getType()};return {...e,...U(e),...he(e)}}function qu(i,t){return {rawKey:i,valueSchema:t,isProperty:true}}function Ie(i){return i.isProperty}function Zt(i){let t={_getRawProperties:()=>Object.entries(i).map(([e,o])=>Ie(o)?o.rawKey:e),_getParsedProperties:()=>yr(i),parse:(e,o)=>{let a={},n=[];for(let[c,m]of xr(i)){let u=Ie(m)?m.rawKey:c,g=Ie(m)?m.valueSchema:m,R={rawKey:u,parsedKey:c,valueSchema:g};a[u]=R,og(g)&&n.push(u);}return eg({value:e,requiredKeys:n,getProperty:c=>{let m=a[c];if(m!=null)return {transformedKey:m.parsedKey,transform:u=>{var g;return m.valueSchema.parse(u,{...o,breadcrumbsPrefix:[...(g=o==null?void 0:o.breadcrumbsPrefix)!=null?g:[],c]})}}},unrecognizedObjectKeys:o==null?void 0:o.unrecognizedObjectKeys,skipValidation:o==null?void 0:o.skipValidation,breadcrumbsPrefix:o==null?void 0:o.breadcrumbsPrefix,omitUndefined:o==null?void 0:o.omitUndefined})},json:(e,o)=>{let a=[];for(let[n,c]of xr(i)){let m=Ie(c)?c.valueSchema:c;og(m)&&a.push(n);}return eg({value:e,requiredKeys:a,getProperty:n=>{let c=i[n];if(c!=null)return Ie(c)?{transformedKey:c.rawKey,transform:m=>{var u;return c.valueSchema.json(m,{...o,breadcrumbsPrefix:[...(u=o==null?void 0:o.breadcrumbsPrefix)!=null?u:[],n]})}}:{transformedKey:n,transform:m=>{var u;return c.json(m,{...o,breadcrumbsPrefix:[...(u=o==null?void 0:o.breadcrumbsPrefix)!=null?u:[],n]})}}},unrecognizedObjectKeys:o==null?void 0:o.unrecognizedObjectKeys,skipValidation:o==null?void 0:o.skipValidation,breadcrumbsPrefix:o==null?void 0:o.breadcrumbsPrefix,omitUndefined:o==null?void 0:o.omitUndefined})},getType:()=>A.OBJECT};return {...Q(t),...U(t),...he(t),...We(t)}}function eg({value:i,requiredKeys:t,getProperty:e,unrecognizedObjectKeys:o="fail",skipValidation:a=false,breadcrumbsPrefix:n=[]}){if(!Ce(i))return {ok:false,errors:[{path:n,message:j(i,"object")}]};let c=new Set(t),m=[],u={};for(let[g,R]of Object.entries(i)){let y=e(g);if(y!=null){c.delete(g);let v=y.transform(R);v.ok?u[y.transformedKey]=v.value:(u[g]=R,m.push(...v.errors));}else switch(o){case "fail":m.push({path:[...n,g],message:`Unexpected key "${g}"`});break;case "strip":break;case "passthrough":u[g]=R;break}}return m.push(...t.filter(g=>c.has(g)).map(g=>({path:n,message:`Missing required key "${g}"`}))),m.length===0||a?{ok:true,value:u}:{ok:false,errors:m}}function We(i){return {extend:t=>{let e={_getParsedProperties:()=>[...i._getParsedProperties(),...t._getParsedProperties()],_getRawProperties:()=>[...i._getRawProperties(),...t._getRawProperties()],parse:(o,a)=>rg({extensionKeys:t._getRawProperties(),value:o,transformBase:n=>i.parse(n,a),transformExtension:n=>t.parse(n,a)}),json:(o,a)=>rg({extensionKeys:t._getParsedProperties(),value:o,transformBase:n=>i.json(n,a),transformExtension:n=>t.json(n,a)}),getType:()=>A.OBJECT};return {...e,...U(e),...he(e),...We(e)}},passthrough:()=>{let t={_getParsedProperties:()=>i._getParsedProperties(),_getRawProperties:()=>i._getRawProperties(),parse:(e,o)=>{let a=i.parse(e,{...o,unrecognizedObjectKeys:"passthrough"});return a.ok?{ok:true,value:{...e,...a.value}}:a},json:(e,o)=>{let a=i.json(e,{...o,unrecognizedObjectKeys:"passthrough"});return a.ok?{ok:true,value:{...e,...a.value}}:a},getType:()=>A.OBJECT};return {...t,...U(t),...he(t),...We(t)}}}}function rg({extensionKeys:i,value:t,transformBase:e,transformExtension:o}){let a=new Set(i),[n,c]=Zu(yr(t),g=>a.has(g)),m=e(Rr(t,c)),u=o(Rr(t,n));return m.ok&&u.ok?{ok:true,value:{...m.value,...u.value}}:{ok:false,errors:[...m.ok?[]:m.errors,...u.ok?[]:u.errors]}}function og(i){return !ab(i)}function ab(i){switch(i.getType()){case A.ANY:case A.UNKNOWN:case A.OPTIONAL:case A.OPTIONAL_NULLABLE:return true;default:return false}}function tg(i){return Zt(i)}function ag(i){let t={...Xn(i),_getRawProperties:()=>rr(i)._getRawProperties(),_getParsedProperties:()=>rr(i)._getParsedProperties()};return {...t,...U(t),...he(t),...We(t)}}function qt(i){let t={parse:(e,o)=>ig(e,(a,n)=>{var c;return i.parse(a,{...o,breadcrumbsPrefix:[...(c=o==null?void 0:o.breadcrumbsPrefix)!=null?c:[],`[${n}]`]})}),json:(e,o)=>ig(e,(a,n)=>{var c;return i.json(a,{...o,breadcrumbsPrefix:[...(c=o==null?void 0:o.breadcrumbsPrefix)!=null?c:[],`[${n}]`]})}),getType:()=>A.LIST};return {...Q(t),...U(t)}}function ig(i,t){return Array.isArray(i)?i.map((o,a)=>t(o,a)).reduce((o,a)=>{if(o.ok&&a.ok)return {ok:true,value:[...o.value,a.value]};let n=[];return o.ok||n.push(...o.errors),a.ok||n.push(...a.errors),{ok:false,errors:n}},{ok:true,value:[]}):{ok:false,errors:[{message:j(i,"list"),path:[]}]}}function ng(i){return q(A.STRING_LITERAL,(e,{breadcrumbsPrefix:o=[]}={})=>e===i?{ok:true,value:i}:{ok:false,errors:[{path:o,message:j(e,`"${i}"`)}]})()}function sg(i){return q(A.BOOLEAN_LITERAL,(e,{breadcrumbsPrefix:o=[]}={})=>e===i?{ok:true,value:i}:{ok:false,errors:[{path:o,message:j(e,`${i.toString()}`)}]})()}var pg=q(A.ANY,i=>({ok:true,value:i}));var cg=q(A.BOOLEAN,(i,{breadcrumbsPrefix:t=[]}={})=>typeof i=="boolean"?{ok:true,value:i}:{ok:false,errors:[{path:t,message:j(i,"boolean")}]});var lg=q(A.NUMBER,(i,{breadcrumbsPrefix:t=[]}={})=>typeof i=="number"?{ok:true,value:i}:{ok:false,errors:[{path:t,message:j(i,"number")}]});var mg=q(A.STRING,(i,{breadcrumbsPrefix:t=[]}={})=>typeof i=="string"?{ok:true,value:i}:{ok:false,errors:[{path:t,message:j(i,"string")}]});var dg=q(A.UNKNOWN,i=>({ok:true,value:i}));function gg(i,t){let e={parse:(o,a)=>ug({value:o,isKeyNumeric:i.getType()===A.NUMBER,transformKey:n=>{var c;return i.parse(n,{...a,breadcrumbsPrefix:[...(c=a==null?void 0:a.breadcrumbsPrefix)!=null?c:[],`${n} (key)`]})},transformValue:(n,c)=>{var m;return t.parse(n,{...a,breadcrumbsPrefix:[...(m=a==null?void 0:a.breadcrumbsPrefix)!=null?m:[],`${c}`]})},breadcrumbsPrefix:a==null?void 0:a.breadcrumbsPrefix}),json:(o,a)=>ug({value:o,isKeyNumeric:i.getType()===A.NUMBER,transformKey:n=>{var c;return i.json(n,{...a,breadcrumbsPrefix:[...(c=a==null?void 0:a.breadcrumbsPrefix)!=null?c:[],`${n} (key)`]})},transformValue:(n,c)=>{var m;return t.json(n,{...a,breadcrumbsPrefix:[...(m=a==null?void 0:a.breadcrumbsPrefix)!=null?m:[],`${c}`]})},breadcrumbsPrefix:a==null?void 0:a.breadcrumbsPrefix}),getType:()=>A.RECORD};return {...Q(e),...U(e)}}function ug({value:i,isKeyNumeric:t,transformKey:e,transformValue:o,breadcrumbsPrefix:a=[]}){return Ce(i)?xr(i).reduce((n,[c,m])=>{if(m===void 0)return n;let u=n,g=c;if(t){let z=c.length>0?Number(c):NaN;isNaN(z)||(g=z);}let R=e(g),y=o(m,g);if(u.ok&&R.ok&&y.ok)return {ok:true,value:{...u.value,[R.value]:y.value}};let v=[];return u.ok||v.push(...u.errors),R.ok||v.push(...R.errors),y.ok||v.push(...y.errors),{ok:false,errors:v}},{ok:true,value:{}}):{ok:false,errors:[{path:a,message:j(i,"object")}]}}function fg(i){let t=qt(i),e={parse:(o,a)=>{let n=t.parse(o,a);return n.ok?{ok:true,value:new Set(n.value)}:n},json:(o,a)=>{var c;return o instanceof Set?t.json([...o],a):{ok:false,errors:[{path:(c=a==null?void 0:a.breadcrumbsPrefix)!=null?c:[],message:j(o,"Set")}]}},getType:()=>A.SET};return {...Q(e),...U(e)}}function wg(i){let t={parse:(e,o)=>hg((a,n)=>a.parse(e,n),i,o),json:(e,o)=>hg((a,n)=>a.json(e,n),i,o),getType:()=>A.UNDISCRIMINATED_UNION};return {...Q(t),...U(t)}}function hg(i,t,e){let o=[];for(let[a,n]of t.entries()){let c=i(n,{...e,skipValidation:false});if(c.ok)return c;for(let m of c.errors)o.push({path:m.path,message:`[Variant ${a}] ${m.message}`});}return {ok:false,errors:o}}function bg(i,t){return {parsedDiscriminant:i,rawDiscriminant:t}}function Rg(i,t){let e=typeof i=="string"?i:i.rawDiscriminant,o=typeof i=="string"?i:i.parsedDiscriminant,a=Yt(yr(t)),n={parse:(c,m)=>xg({value:c,discriminant:e,transformedDiscriminant:o,transformDiscriminantValue:u=>{var g;return a.parse(u,{allowUnrecognizedEnumValues:m==null?void 0:m.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...(g=m==null?void 0:m.breadcrumbsPrefix)!=null?g:[],e]})},getAdditionalPropertiesSchema:u=>t[u],allowUnrecognizedUnionMembers:m==null?void 0:m.allowUnrecognizedUnionMembers,transformAdditionalProperties:(u,g)=>g.parse(u,m),breadcrumbsPrefix:m==null?void 0:m.breadcrumbsPrefix}),json:(c,m)=>xg({value:c,discriminant:o,transformedDiscriminant:e,transformDiscriminantValue:u=>{var g;return a.json(u,{allowUnrecognizedEnumValues:m==null?void 0:m.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...(g=m==null?void 0:m.breadcrumbsPrefix)!=null?g:[],o]})},getAdditionalPropertiesSchema:u=>t[u],allowUnrecognizedUnionMembers:m==null?void 0:m.allowUnrecognizedUnionMembers,transformAdditionalProperties:(u,g)=>g.json(u,m),breadcrumbsPrefix:m==null?void 0:m.breadcrumbsPrefix}),getType:()=>A.UNION};return {...Q(n),...U(n),...he(n)}}function xg({value:i,discriminant:t,transformedDiscriminant:e,transformDiscriminantValue:o,getAdditionalPropertiesSchema:a,allowUnrecognizedUnionMembers:n=false,transformAdditionalProperties:c,breadcrumbsPrefix:m=[]}){if(!Ce(i))return {ok:false,errors:[{path:m,message:j(i,"object")}]};let{[t]:u,...g}=i;if(u==null)return {ok:false,errors:[{path:m,message:`Missing discriminant ("${t}")`}]};let R=o(u);if(!R.ok)return {ok:false,errors:R.errors};let y=a(R.value);if(y==null)return n?{ok:true,value:{[e]:R.value,...g}}:{ok:false,errors:[{path:[...m,t],message:"Unexpected discriminant value"}]};let v=c(g,y);return v.ok?{ok:true,value:{[e]:u,...v.value}}:v}function ib(i){var t=[];if(i.length===0)return "";if(typeof i[0]!="string")throw new TypeError("Url must be a string. Received "+i[0]);if(i[0].match(/^[^/:]+:\/*$/)&&i.length>1){var e=i.shift();i[0]=e+i[0];}i[0].match(/^file:\/\/\//)?i[0]=i[0].replace(/^([^/:]+):\/*/,"$1:///"):i[0]=i[0].replace(/^([^/:]+):\/*/,"$1://");for(var o=0;o<i.length;o++){var a=i[o];if(typeof a!="string")throw new TypeError("Url must be a string. Received "+a);a!==""&&(o>0&&(a=a.replace(/^[\/]+/,"")),o<i.length-1?a=a.replace(/[\/]+$/,""):a=a.replace(/[\/]+$/,"/"),t.push(a));}var n=t.join("/");n=n.replace(/\/(\?|&|#[^!])/g,"$1");var c=n.split("?");return n=c.shift()+(c.length>0?"?":"")+c.join("&"),n}function x(){var i;return typeof arguments[0]=="object"?i=arguments[0]:i=[].slice.call(arguments),ib(i)}var C={};E(C,{AggregationData:()=>wl,Alert:()=>mb,AlertAlertType:()=>Bs,AlertPagePublic:()=>ip,AlertPublic:()=>Po,AlertPublicAlertType:()=>qs,AlertTrigger:()=>Ks,AlertTriggerConfig:()=>Js,AlertTriggerConfigPublic:()=>tp,AlertTriggerConfigPublicType:()=>op,AlertTriggerConfigType:()=>Hs,AlertTriggerConfigWrite:()=>Gs,AlertTriggerConfigWriteType:()=>Xs,AlertTriggerEventType:()=>Vs,AlertTriggerPublic:()=>ap,AlertTriggerPublicEventType:()=>rp,AlertTriggerWrite:()=>Qs,AlertTriggerWriteEventType:()=>$s,AlertWrite:()=>Eo,AlertWriteAlertType:()=>Ys,AnnotationQueue:()=>mp,AnnotationQueueBatch:()=>ub,AnnotationQueueBatchWrite:()=>yo,AnnotationQueueItemIds:()=>Ba,AnnotationQueuePagePublic:()=>gp,AnnotationQueuePublic:()=>Co,AnnotationQueuePublicScope:()=>dp,AnnotationQueueReviewer:()=>lp,AnnotationQueueReviewerPublic:()=>up,AnnotationQueueScope:()=>cp,AnnotationQueueUpdate:()=>ko,AnnotationQueueWrite:()=>Ro,AnnotationQueueWriteScope:()=>_s,AssistantMessage:()=>hc,AssistantMessageRole:()=>fc,Attachment:()=>fp,AttachmentListRequestEntityType:()=>oa,AttachmentPage:()=>hp,AuthDetailsHolder:()=>yp,AutomationRuleEvaluator:()=>fb,AutomationRuleEvaluatorLlmAsJudge:()=>Ep,AutomationRuleEvaluatorLlmAsJudgePublic:()=>Ko,AutomationRuleEvaluatorLlmAsJudgeWrite:()=>Op,AutomationRuleEvaluatorObjectPublic:()=>ac,AutomationRuleEvaluatorPagePublic:()=>ic,AutomationRuleEvaluatorPublic:()=>nc,AutomationRuleEvaluatorTraceThreadLlmAsJudge:()=>Cp,AutomationRuleEvaluatorTraceThreadLlmAsJudgePublic:()=>Go,AutomationRuleEvaluatorTraceThreadLlmAsJudgeWrite:()=>Bp,AutomationRuleEvaluatorTraceThreadUserDefinedMetricPython:()=>Ip,AutomationRuleEvaluatorTraceThreadUserDefinedMetricPythonPublic:()=>$o,AutomationRuleEvaluatorTraceThreadUserDefinedMetricPythonWrite:()=>Vp,AutomationRuleEvaluatorUpdate:()=>gc,AutomationRuleEvaluatorUpdateLlmAsJudge:()=>lc,AutomationRuleEvaluatorUpdateTraceThreadLlmAsJudge:()=>dc,AutomationRuleEvaluatorUpdateTraceThreadUserDefinedMetricPython:()=>uc,AutomationRuleEvaluatorUpdateUserDefinedMetricPython:()=>mc,AutomationRuleEvaluatorUserDefinedMetricPython:()=>Pp,AutomationRuleEvaluatorUserDefinedMetricPythonPublic:()=>Xo,AutomationRuleEvaluatorUserDefinedMetricPythonWrite:()=>Jp,AutomationRuleEvaluatorWrite:()=>Gp,AvgValueStatPublic:()=>Bc,BatchDelete:()=>L,BatchDeleteByProject:()=>Nb,BiInformation:()=>Ds,BiInformationResponse:()=>ir,BooleanFeedbackDefinition:()=>kl,BooleanFeedbackDefinitionCreate:()=>El,BooleanFeedbackDefinitionPublic:()=>at,BooleanFeedbackDefinitionUpdate:()=>Jl,BooleanFeedbackDetail:()=>yl,BooleanFeedbackDetailCreate:()=>Al,BooleanFeedbackDetailPublic:()=>Dl,BooleanFeedbackDetailUpdate:()=>Hl,CategoricalFeedbackDefinition:()=>zl,CategoricalFeedbackDefinitionCreate:()=>Cl,CategoricalFeedbackDefinitionPublic:()=>it,CategoricalFeedbackDefinitionUpdate:()=>Xl,CategoricalFeedbackDetail:()=>vl,CategoricalFeedbackDetailCreate:()=>Pl,CategoricalFeedbackDetailPublic:()=>Ml,CategoricalFeedbackDetailUpdate:()=>Kl,ChatCompletionChoice:()=>bc,ChatCompletionRequest:()=>zo,ChatCompletionResponse:()=>kc,Check:()=>il,CheckName:()=>tl,CheckPublic:()=>Jm,CheckPublicName:()=>Vm,CheckPublicResult:()=>Hm,CheckResult:()=>al,ChunkedOutputJsonNode:()=>xb,ChunkedOutputJsonNodePublic:()=>vb,ChunkedOutputJsonNodePublicType:()=>Rl,ChunkedOutputJsonNodeType:()=>el,Column:()=>Zc,ColumnCompare:()=>Ac,ColumnCompareTypesItem:()=>Tc,ColumnPublic:()=>$c,ColumnPublicTypesItem:()=>Gc,ColumnTypesItem:()=>Yc,Comment:()=>H,CommentCompare:()=>Ec,CommentPublic:()=>Ke,CompleteMultipartUploadRequest:()=>La,CompleteMultipartUploadRequestEntityType:()=>wp,CompletionTokensDetails:()=>Rc,CountValueStatPublic:()=>Lc,CreateDatasetItemsFromSpansRequest:()=>Tr,CreateDatasetItemsFromTracesRequest:()=>Ar,CreatePromptVersionDetail:()=>Zr,DashboardPagePublic:()=>vc,DashboardPublic:()=>He,DashboardUpdatePublic:()=>_o,DashboardWrite:()=>So,DataPointDouble:()=>Db,DataPointNumberPublic:()=>gm,Dataset:()=>hb,DatasetExpansion:()=>bb,DatasetExpansionResponse:()=>_c,DatasetExpansionWrite:()=>Ir,DatasetIdentifier:()=>Pr,DatasetIdentifierPublic:()=>jr,DatasetItem:()=>Yo,DatasetItemBatch:()=>wb,DatasetItemBatchUpdate:()=>vr,DatasetItemBatchWrite:()=>_r,DatasetItemCompare:()=>Mc,DatasetItemCompareSource:()=>Pc,DatasetItemFilter:()=>Qn,DatasetItemFilterOperator:()=>$n,DatasetItemPageCompare:()=>Fc,DatasetItemPagePublic:()=>Qc,DatasetItemPublic:()=>et,DatasetItemPublicSource:()=>Kc,DatasetItemSource:()=>Sc,DatasetItemStreamRequest:()=>Ur,DatasetItemUpdate:()=>Yn,DatasetItemWrite:()=>Sr,DatasetItemWriteSource:()=>Zn,DatasetItemsDelete:()=>Cr,DatasetPagePublic:()=>Wc,DatasetPublic:()=>nr,DatasetPublicVisibility:()=>Oc,DatasetUpdate:()=>Er,DatasetUpdateVisibility:()=>pa,DatasetVisibility:()=>zc,DatasetWrite:()=>zr,DatasetWriteVisibility:()=>sa,DeleteAttachmentsRequest:()=>gb,DeleteAttachmentsRequestEntityType:()=>xp,DeleteFeedbackScore:()=>mt,DeleteIdsHolder:()=>sr,DeleteThreadFeedbackScores:()=>fo,DeleteTraceThreads:()=>ho,Delta:()=>wc,DownloadAttachmentRequestEntityType:()=>ta,ErrorCountWithDeviation:()=>ct,ErrorCountWithDeviationDetailed:()=>ym,ErrorInfo:()=>Se,ErrorInfoExperimentItemBulkWriteView:()=>Or,ErrorInfoPublic:()=>dt,ErrorInfoWrite:()=>ro,ErrorMessage:()=>ae,ErrorMessageDetail:()=>Ib,ErrorMessageDetailed:()=>Pb,ErrorMessagePublic:()=>db,Experiment:()=>Rb,ExperimentGroupAggregationsResponse:()=>xl,ExperimentGroupResponse:()=>hl,ExperimentItem:()=>Dr,ExperimentItemBulkRecord:()=>cl,ExperimentItemBulkRecordExperimentItemBulkWriteView:()=>ds,ExperimentItemBulkUpload:()=>yb,ExperimentItemBulkUploadExperimentItemBulkWriteView:()=>Wr,ExperimentItemCompare:()=>Dc,ExperimentItemCompareTraceVisibilityMode:()=>Nc,ExperimentItemPublic:()=>qo,ExperimentItemPublicTraceVisibilityMode:()=>Xc,ExperimentItemStreamRequest:()=>Lr,ExperimentItemTraceVisibilityMode:()=>as,ExperimentItemsBatch:()=>Mr,ExperimentItemsDelete:()=>Fr,ExperimentPagePublic:()=>dl,ExperimentPublic:()=>tt,ExperimentPublicStatus:()=>ml,ExperimentPublicType:()=>ll,ExperimentStatus:()=>ol,ExperimentStreamRequestPublic:()=>Vr,ExperimentType:()=>rl,ExperimentUpdate:()=>Br,ExperimentUpdateStatus:()=>ua,ExperimentUpdateType:()=>da,ExperimentWrite:()=>Nr,ExperimentWriteStatus:()=>ma,ExperimentWriteType:()=>la,ExportTraceServiceRequest:()=>Tb,Feedback:()=>zb,FeedbackCreate:()=>Nl,FeedbackDefinitionPagePublic:()=>Bl,FeedbackObjectPublic:()=>Wl,FeedbackPublic:()=>Vl,FeedbackScore:()=>ee,FeedbackScoreAverage:()=>pe,FeedbackScoreAverageDetailed:()=>km,FeedbackScoreAveragePublic:()=>Ve,FeedbackScoreBatch:()=>ft,FeedbackScoreBatchItem:()=>Lm,FeedbackScoreBatchItemSource:()=>Bm,FeedbackScoreBatchItemThread:()=>vs,FeedbackScoreBatchItemThreadSource:()=>ks,FeedbackScoreBatchThread:()=>wo,FeedbackScoreCompare:()=>Uc,FeedbackScoreCompareSource:()=>Cc,FeedbackScoreExperimentItemBulkWriteView:()=>ms,FeedbackScoreExperimentItemBulkWriteViewSource:()=>ps,FeedbackScoreNames:()=>um,FeedbackScorePublic:()=>ut,FeedbackScorePublicSource:()=>Dm,FeedbackScoreSource:()=>rs,FeedbackUpdate:()=>Yl,FindFeedbackDefinitionsRequestType:()=>ha,FindFeedbackScoreNames1RequestType:()=>Pa,Function:()=>vo,FunctionCall:()=>_e,GetSpanStatsRequestType:()=>Ca,GetSpansByProjectRequestType:()=>Ea,GetWebhookExamplesRequestAlertType:()=>ea,GroupContent:()=>ul,GroupContentWithAggregations:()=>bl,GroupDetail:()=>gl,GroupDetails:()=>fl,Guardrail:()=>em,GuardrailBatch:()=>Sb,GuardrailBatchWrite:()=>To,GuardrailName:()=>Zl,GuardrailResult:()=>ql,GuardrailWrite:()=>Ns,GuardrailWriteName:()=>js,GuardrailWriteResult:()=>Us,GuardrailsValidation:()=>nl,GuardrailsValidationPublic:()=>Km,IdsHolder:()=>kb,ImageUrl:()=>Sp,ImageUrlPublic:()=>Qp,ImageUrlWrite:()=>Up,JsonListString:()=>N,JsonListStringCompare:()=>Ga,JsonListStringExperimentItemBulkWriteView:()=>we,JsonListStringPublic:()=>ce,JsonListStringWrite:()=>se,JsonNode:()=>D,JsonNodeDetail:()=>hs,JsonNodePublic:()=>Te,JsonNodeWrite:()=>Be,JsonSchema:()=>Ps,LlmAsJudgeCode:()=>Do,LlmAsJudgeCodePublic:()=>ec,LlmAsJudgeCodeWrite:()=>Fp,LlmAsJudgeMessage:()=>Uo,LlmAsJudgeMessageContent:()=>Tp,LlmAsJudgeMessageContentPublic:()=>Zp,LlmAsJudgeMessageContentWrite:()=>Dp,LlmAsJudgeMessagePublic:()=>Ho,LlmAsJudgeMessagePublicRole:()=>$p,LlmAsJudgeMessageRole:()=>zp,LlmAsJudgeMessageWrite:()=>Bo,LlmAsJudgeMessageWriteRole:()=>jp,LlmAsJudgeModelParameters:()=>jo,LlmAsJudgeModelParametersPublic:()=>Vo,LlmAsJudgeModelParametersWrite:()=>Wo,LlmAsJudgeOutputSchema:()=>No,LlmAsJudgeOutputSchemaPublic:()=>Jo,LlmAsJudgeOutputSchemaPublicType:()=>qp,LlmAsJudgeOutputSchemaType:()=>Ap,LlmAsJudgeOutputSchemaWrite:()=>Lo,LlmAsJudgeOutputSchemaWriteType:()=>Mp,LogItem:()=>pc,LogItemLevel:()=>sc,LogPage:()=>cc,ManualEvaluationRequest:()=>Za,ManualEvaluationRequestEntityType:()=>am,ManualEvaluationResponse:()=>Ya,Message:()=>Ts,MultipartUploadPart:()=>bp,NumericalFeedbackDefinition:()=>_l,NumericalFeedbackDefinitionCreate:()=>jl,NumericalFeedbackDefinitionPublic:()=>nt,NumericalFeedbackDefinitionUpdate:()=>$l,NumericalFeedbackDetail:()=>Sl,NumericalFeedbackDetailCreate:()=>Il,NumericalFeedbackDetailPublic:()=>Fl,NumericalFeedbackDetailUpdate:()=>Gl,Optimization:()=>Ab,OptimizationPagePublic:()=>pm,OptimizationPublic:()=>pt,OptimizationPublicStatus:()=>sm,OptimizationStatus:()=>im,OptimizationUpdate:()=>Kr,OptimizationUpdateStatus:()=>Ra,OptimizationWrite:()=>qa,OptimizationWriteStatus:()=>nm,PageColumns:()=>qc,PercentageValueStatPublic:()=>Vc,PercentageValues:()=>Ae,PercentageValuesDetailed:()=>vm,PercentageValuesPublic:()=>Zo,Project:()=>Eb,ProjectDetailed:()=>Sm,ProjectDetailedVisibility:()=>zm,ProjectMetricRequestPublic:()=>$r,ProjectMetricRequestPublicInterval:()=>Sa,ProjectMetricRequestPublicMetricType:()=>za,ProjectMetricResponsePublic:()=>bm,ProjectMetricResponsePublicInterval:()=>hm,ProjectMetricResponsePublicMetricType:()=>fm,ProjectPagePublic:()=>mm,ProjectPublic:()=>lt,ProjectPublicVisibility:()=>lm,ProjectRetrieveDetailed:()=>Qr,ProjectStatItemObjectPublic:()=>Jc,ProjectStatsPublic:()=>Je,ProjectStatsSummary:()=>Rm,ProjectStatsSummaryItem:()=>xm,ProjectUpdate:()=>Gr,ProjectUpdateVisibility:()=>va,ProjectVisibility:()=>cm,ProjectWrite:()=>Xr,ProjectWriteVisibility:()=>ka,Prompt:()=>Cb,PromptDetail:()=>Em,PromptPagePublic:()=>Um,PromptPublic:()=>jm,PromptTokensDetails:()=>xc,PromptType:()=>_m,PromptUpdatable:()=>qr,PromptVersion:()=>Am,PromptVersionDetail:()=>ke,PromptVersionDetailType:()=>ws,PromptVersionLink:()=>$a,PromptVersionLinkPublic:()=>Qa,PromptVersionLinkWrite:()=>fa,PromptVersionPagePublic:()=>Im,PromptVersionPublic:()=>Cm,PromptVersionPublicType:()=>Pm,PromptVersionRetrieveDetail:()=>eo,PromptVersionType:()=>Tm,PromptWrite:()=>Yr,PromptWriteType:()=>Ta,ProviderApiKey:()=>_b,ProviderApiKeyPagePublic:()=>om,ProviderApiKeyProvider:()=>tm,ProviderApiKeyPublic:()=>st,ProviderApiKeyPublicProvider:()=>rm,ProviderApiKeyUpdate:()=>Jr,ProviderApiKeyWrite:()=>Hr,ProviderApiKeyWriteProvider:()=>ba,ResponseFormat:()=>Cs,ResponseFormatType:()=>Es,Result:()=>Xe,ResultsNumberPublic:()=>wm,ScoreName:()=>dm,ServiceTogglesConfig:()=>Nm,Span:()=>ot,SpanBatch:()=>jb,SpanBatchUpdate:()=>io,SpanBatchWrite:()=>to,SpanEnrichmentOptions:()=>qn,SpanExperimentItemBulkWriteView:()=>ss,SpanExperimentItemBulkWriteViewType:()=>ns,SpanFilterPublic:()=>ys,SpanFilterPublicOperator:()=>Rs,SpanPagePublic:()=>Wm,SpanPublic:()=>gt,SpanPublicType:()=>Om,SpanSearchStreamRequestPublic:()=>no,SpanSearchStreamRequestPublicType:()=>Ia,SpanType:()=>pl,SpanUpdate:()=>ao,SpanUpdateType:()=>xs,SpanWrite:()=>oo,SpanWriteType:()=>bs,SpansCountResponse:()=>Fs,StartMultipartUploadRequest:()=>kr,StartMultipartUploadRequestEntityType:()=>aa,StartMultipartUploadResponse:()=>Rp,StreamOptions:()=>As,Tool:()=>Is,ToolCall:()=>Qo,Trace:()=>rt,TraceBatch:()=>Ub,TraceBatchUpdate:()=>lo,TraceBatchWrite:()=>po,TraceCountResponse:()=>Ws,TraceEnrichmentOptions:()=>es,TraceExperimentItemBulkWriteView:()=>is,TraceFilter:()=>Io,TraceFilterOperator:()=>vp,TraceFilterPublic:()=>ze,TraceFilterPublicOperator:()=>us,TraceFilterWrite:()=>Xp,TraceFilterWriteOperator:()=>Kp,TracePagePublic:()=>Qm,TracePublic:()=>ht,TracePublicVisibilityMode:()=>Xm,TraceSearchStreamRequestPublic:()=>xo,TraceThread:()=>wt,TraceThreadBatchIdentifier:()=>go,TraceThreadBatchUpdate:()=>uo,TraceThreadFilter:()=>Ss,TraceThreadFilterOperator:()=>zs,TraceThreadFilterPublic:()=>fs,TraceThreadFilterPublicOperator:()=>gs,TraceThreadIdentifier:()=>ei,TraceThreadLlmAsJudgeCode:()=>Fo,TraceThreadLlmAsJudgeCodePublic:()=>oc,TraceThreadLlmAsJudgeCodeWrite:()=>Wp,TraceThreadPage:()=>$m,TraceThreadSearchStreamRequest:()=>bo,TraceThreadStatus:()=>Gm,TraceThreadUpdate:()=>mo,TraceThreadUserDefinedMetricPythonCode:()=>Oo,TraceThreadUserDefinedMetricPythonCodePublic:()=>tc,TraceThreadUserDefinedMetricPythonCodeWrite:()=>Lp,TraceUpdate:()=>co,TraceVisibilityMode:()=>sl,TraceWrite:()=>so,UploadAttachmentRequestEntityType:()=>ia,Usage:()=>yc,UserDefinedMetricPythonCode:()=>Mo,UserDefinedMetricPythonCodePublic:()=>rc,UserDefinedMetricPythonCodeWrite:()=>Hp,ValueEntry:()=>ts,ValueEntryCompare:()=>jc,ValueEntryCompareSource:()=>Ic,ValueEntryExperimentItemBulkWriteView:()=>ls,ValueEntryExperimentItemBulkWriteViewSource:()=>cs,ValueEntryPublic:()=>Fm,ValueEntryPublicSource:()=>Mm,ValueEntrySource:()=>os,VideoUrl:()=>_p,VideoUrlPublic:()=>Yp,VideoUrlWrite:()=>Np,Webhook:()=>Ls,WebhookExamples:()=>np,WebhookPublic:()=>ep,WebhookTestResult:()=>pp,WebhookTestResultStatus:()=>sp,WebhookWrite:()=>Zs,WelcomeWizardSubmission:()=>Ao,WelcomeWizardTracking:()=>Ym,WorkspaceConfiguration:()=>bt,WorkspaceMetricRequest:()=>Mb,WorkspaceMetricResponse:()=>ri,WorkspaceMetricsSummaryRequest:()=>pr,WorkspaceMetricsSummaryResponse:()=>Zm,WorkspaceNameHolder:()=>kp,WorkspaceSpansCount:()=>Ms,WorkspaceTraceCount:()=>Os,alerts:()=>ra,annotationQueues:()=>Da,attachments:()=>or,chatCompletions:()=>Ma,dashboards:()=>Fa,datasets:()=>ca,experiments:()=>tr,feedbackDefinitions:()=>wa,guardrails:()=>Oa,llmProviderKey:()=>xa,optimizations:()=>ya,projects:()=>_a,prompts:()=>Aa,spans:()=>ar,traces:()=>Le,welcomeWizard:()=>Wa});var ra={};E(ra,{GetWebhookExamplesRequestAlertType:()=>ea});var ea=r.enum_(["general","slack","pagerduty"]);var or={};E(or,{AttachmentListRequestEntityType:()=>oa,DownloadAttachmentRequestEntityType:()=>ta,StartMultipartUploadRequest:()=>kr,StartMultipartUploadRequestEntityType:()=>aa,UploadAttachmentRequestEntityType:()=>ia,uploadAttachment:()=>na});var oa=r.enum_(["trace","span"]);var ta=r.enum_(["trace","span"]);var aa=r.enum_(["trace","span"]);var ia=r.enum_(["trace","span"]);var na={};E(na,{Request:()=>nb});var nb=r.record(r.string(),r.unknown());var kr=r.object({fileName:r.property("file_name",r.string()),numOfFileParts:r.property("num_of_file_parts",r.number()),mimeType:r.property("mime_type",r.string().optional()),projectName:r.property("project_name",r.string().optional()),entityType:r.property("entity_type",aa),entityId:r.property("entity_id",r.string()),path:r.string()});var ca={};E(ca,{CreateDatasetItemsFromSpansRequest:()=>Tr,CreateDatasetItemsFromTracesRequest:()=>Ar,DatasetExpansionWrite:()=>Ir,DatasetIdentifier:()=>Pr,DatasetIdentifierPublic:()=>jr,DatasetItemBatchUpdate:()=>vr,DatasetItemBatchWrite:()=>_r,DatasetItemStreamRequest:()=>Ur,DatasetItemsDelete:()=>Cr,DatasetUpdate:()=>Er,DatasetUpdateVisibility:()=>pa,DatasetWrite:()=>zr,DatasetWriteVisibility:()=>sa});var sa=r.enum_(["private","public"]);var pa=r.enum_(["private","public"]);var $n=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Qn=r.object({field:r.string().optional(),operator:$n.optional(),key:r.string().optional(),value:r.string().optional()});var D=r.record(r.string(),r.unknown());var Yn=r.object({input:r.string().optional(),expectedOutput:r.property("expected_output",r.string().optional()),metadata:D.optional(),data:D.optional(),tags:r.list(r.string()).optional()});var vr=r.object({ids:r.list(r.string()).optional(),filters:r.list(Qn).optional(),update:Yn,mergeTags:r.property("merge_tags",r.boolean().optional())});var zr=r.object({id:r.string().optional(),name:r.string(),visibility:sa.optional(),tags:r.list(r.string()).optional(),description:r.string().optional()});var Zn=r.enum_(["manual","trace","span","sdk"]);var Sr=r.object({id:r.string().optional(),traceId:r.property("trace_id",r.string().optional()),spanId:r.property("span_id",r.string().optional()),source:Zn,data:D,tags:r.list(r.string()).optional()});var _r=r.object({datasetName:r.property("dataset_name",r.string().optional()),datasetId:r.property("dataset_id",r.string().optional()),items:r.list(Sr)});var qn=r.object({includeTags:r.boolean().optional(),includeFeedbackScores:r.boolean().optional(),includeComments:r.boolean().optional(),includeUsage:r.boolean().optional(),includeMetadata:r.boolean().optional()});var Tr=r.object({spanIds:r.property("span_ids",r.list(r.string())),enrichmentOptions:r.property("enrichment_options",qn)});var es=r.object({includeSpans:r.boolean().optional(),includeTags:r.boolean().optional(),includeFeedbackScores:r.boolean().optional(),includeComments:r.boolean().optional(),includeUsage:r.boolean().optional(),includeMetadata:r.boolean().optional()});var Ar=r.object({traceIds:r.property("trace_ids",r.list(r.string())),enrichmentOptions:r.property("enrichment_options",es)});var Er=r.object({name:r.string(),description:r.string().optional(),visibility:pa.optional(),tags:r.list(r.string()).optional()});var Pr=r.object({datasetName:r.property("dataset_name",r.string())});var Cr=r.object({itemIds:r.property("item_ids",r.list(r.string()))});var Ir=r.object({model:r.string(),sampleCount:r.property("sample_count",r.number().optional()),preserveFields:r.property("preserve_fields",r.list(r.string()).optional()),variationInstructions:r.property("variation_instructions",r.string().optional()),customPrompt:r.property("custom_prompt",r.string().optional())});var jr=r.object({datasetName:r.property("dataset_name",r.string())});var Ur=r.object({datasetName:r.property("dataset_name",r.string()),lastRetrievedId:r.property("last_retrieved_id",r.string().optional()),steamLimit:r.property("steam_limit",r.number().optional())});var tr={};E(tr,{ExperimentItemBulkUploadExperimentItemBulkWriteView:()=>Wr,ExperimentItemStreamRequest:()=>Lr,ExperimentItemsBatch:()=>Mr,ExperimentItemsDelete:()=>Fr,ExperimentStreamRequestPublic:()=>Vr,ExperimentUpdate:()=>Br,ExperimentUpdateStatus:()=>ua,ExperimentUpdateType:()=>da,ExperimentWrite:()=>Nr,ExperimentWriteStatus:()=>ma,ExperimentWriteType:()=>la,findFeedbackScoreNames:()=>ga});var la=r.enum_(["regular","trial","mini-batch"]);var ma=r.enum_(["running","completed","cancelled"]);var da=r.enum_(["regular","trial","mini-batch"]);var ua=r.enum_(["running","completed","cancelled"]);var ga={};E(ga,{Response:()=>sb});var sb=r.list(r.string());var se=r.undiscriminatedUnion([r.record(r.string(),r.unknown()),r.list(r.record(r.string(),r.unknown())),r.string()]);var fa=r.object({id:r.string()});var Nr=r.object({id:r.string().optional(),datasetName:r.property("dataset_name",r.string()),name:r.string().optional(),metadata:se.optional(),type:la.optional(),optimizationId:r.property("optimization_id",r.string().optional()),status:ma.optional(),promptVersion:r.property("prompt_version",fa.optional()),promptVersions:r.property("prompt_versions",r.list(fa).optional())});var N=r.undiscriminatedUnion([r.record(r.string(),r.unknown()),r.list(r.record(r.string(),r.unknown())),r.string()]);var rs=r.enum_(["ui","sdk","online_scoring"]);var os=r.enum_(["ui","sdk","online_scoring"]);var ts=r.object({value:r.number().optional(),reason:r.string().optional(),categoryName:r.property("category_name",r.string().optional()),source:os.optional(),lastUpdatedAt:r.property("last_updated_at",r.date().optional())});var ee=r.object({name:r.string(),categoryName:r.property("category_name",r.string().optional()),value:r.number(),reason:r.string().optional(),source:rs,createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),valueByAuthor:r.property("value_by_author",r.record(r.string(),ts).optional())});var H=r.object({id:r.string().optional(),text:r.string(),createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var as=r.enum_(["default","hidden"]);var Dr=r.object({id:r.string().optional(),experimentId:r.property("experiment_id",r.string()),datasetItemId:r.property("dataset_item_id",r.string()),traceId:r.property("trace_id",r.string()),input:N.optional(),output:N.optional(),feedbackScores:r.property("feedback_scores",r.list(ee).optional()),comments:r.list(H).optional(),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),duration:r.number().optional(),usage:r.record(r.string(),r.number()).optional(),createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),traceVisibilityMode:r.property("trace_visibility_mode",as.optional())});var Mr=r.object({experimentItems:r.property("experiment_items",r.list(Dr))});var Fr=r.object({ids:r.list(r.string())});var we=r.undiscriminatedUnion([r.record(r.string(),r.unknown()),r.list(r.record(r.string(),r.unknown())),r.string()]);var Or=r.object({exceptionType:r.property("exception_type",r.string()),message:r.string().optional(),traceback:r.string()});var is=r.object({id:r.string().optional(),projectName:r.property("project_name",r.string().optional()),name:r.string().optional(),startTime:r.property("start_time",r.date()),endTime:r.property("end_time",r.date().optional()),input:we.optional(),output:we.optional(),metadata:we.optional(),tags:r.list(r.string()).optional(),errorInfo:r.property("error_info",Or.optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),threadId:r.property("thread_id",r.string().optional())});var ns=r.enum_(["general","tool","llm","guardrail"]);var ss=r.object({id:r.string().optional(),parentSpanId:r.property("parent_span_id",r.string().optional()),name:r.string().optional(),type:ns.optional(),startTime:r.property("start_time",r.date()),endTime:r.property("end_time",r.date().optional()),input:we.optional(),output:we.optional(),metadata:we.optional(),model:r.string().optional(),provider:r.string().optional(),tags:r.list(r.string()).optional(),usage:r.record(r.string(),r.number()).optional(),errorInfo:r.property("error_info",Or.optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),totalEstimatedCostVersion:r.property("total_estimated_cost_version",r.string().optional())});var ps=r.enum_(["ui","sdk","online_scoring"]);var cs=r.enum_(["ui","sdk","online_scoring"]);var ls=r.object({value:r.number().optional(),reason:r.string().optional(),categoryName:r.property("category_name",r.string().optional()),source:cs.optional(),lastUpdatedAt:r.property("last_updated_at",r.date().optional())});var ms=r.object({name:r.string(),categoryName:r.property("category_name",r.string().optional()),value:r.number(),reason:r.string().optional(),source:ps,createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),valueByAuthor:r.property("value_by_author",r.record(r.string(),ls).optional())});var ds=r.object({datasetItemId:r.property("dataset_item_id",r.string()),evaluateTaskResult:r.property("evaluate_task_result",we.optional()),trace:is.optional(),spans:r.list(ss).optional(),feedbackScores:r.property("feedback_scores",r.list(ms).optional())});var Wr=r.object({experimentName:r.property("experiment_name",r.string()),datasetName:r.property("dataset_name",r.string()),experimentId:r.property("experiment_id",r.string().optional()),items:r.list(ds)});var Br=r.object({name:r.string().optional(),metadata:D.optional(),type:da.optional(),status:ua.optional()});var Lr=r.object({experimentName:r.property("experiment_name",r.string()),limit:r.number().optional(),lastRetrievedId:r.property("last_retrieved_id",r.string().optional()),truncate:r.boolean().optional()});var Vr=r.object({name:r.string(),limit:r.number().optional(),lastRetrievedId:r.property("last_retrieved_id",r.string().optional())});var wa={};E(wa,{FindFeedbackDefinitionsRequestType:()=>ha});var ha=r.enum_(["numerical","categorical","boolean"]);var xa={};E(xa,{ProviderApiKeyUpdate:()=>Jr,ProviderApiKeyWrite:()=>Hr,ProviderApiKeyWriteProvider:()=>ba});var ba=r.enum_(["openai","anthropic","gemini","openrouter","vertex-ai","custom-llm"]);var Hr=r.object({provider:ba,apiKey:r.property("api_key",r.string().optional()),name:r.string().optional(),providerName:r.property("provider_name",r.string().optional()),headers:r.record(r.string(),r.string()).optional(),configuration:r.record(r.string(),r.string()).optional(),baseUrl:r.property("base_url",r.string().optional())});var Jr=r.object({apiKey:r.property("api_key",r.string().optional()),name:r.string().optional(),providerName:r.property("provider_name",r.string().optional()),headers:r.record(r.string(),r.string()).optional(),configuration:r.record(r.string(),r.string()).optional(),baseUrl:r.property("base_url",r.string().optional())});var ya={};E(ya,{OptimizationUpdate:()=>Kr,OptimizationUpdateStatus:()=>Ra});var Ra=r.enum_(["running","completed","cancelled"]);var Kr=r.object({name:r.string().optional(),status:Ra.optional()});var _a={};E(_a,{ProjectMetricRequestPublic:()=>$r,ProjectMetricRequestPublicInterval:()=>Sa,ProjectMetricRequestPublicMetricType:()=>za,ProjectRetrieveDetailed:()=>Qr,ProjectUpdate:()=>Gr,ProjectUpdateVisibility:()=>va,ProjectWrite:()=>Xr,ProjectWriteVisibility:()=>ka});var ka=r.enum_(["private","public"]);var va=r.enum_(["private","public"]);var za=r.enum_(["FEEDBACK_SCORES","TRACE_COUNT","TOKEN_USAGE","DURATION","COST","GUARDRAILS_FAILED_COUNT","THREAD_COUNT","THREAD_DURATION","THREAD_FEEDBACK_SCORES"]);var Sa=r.enum_(["HOURLY","DAILY","WEEKLY"]);var Xr=r.object({name:r.string(),visibility:ka.optional(),description:r.string().optional()});var Gr=r.object({name:r.string().optional(),description:r.string().optional(),visibility:va.optional()});var us=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var ze=r.object({field:r.string().optional(),operator:us.optional(),key:r.string().optional(),value:r.string().optional()});var gs=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var fs=r.object({field:r.string().optional(),operator:gs.optional(),key:r.string().optional(),value:r.string().optional()});var $r=r.object({metricType:r.property("metric_type",za.optional()),interval:Sa.optional(),intervalStart:r.property("interval_start",r.date().optional()),intervalEnd:r.property("interval_end",r.date().optional()),traceFilters:r.property("trace_filters",r.list(ze).optional()),threadFilters:r.property("thread_filters",r.list(fs).optional())});var Qr=r.object({name:r.string()});var Aa={};E(Aa,{CreatePromptVersionDetail:()=>Zr,PromptUpdatable:()=>qr,PromptVersionRetrieveDetail:()=>eo,PromptWrite:()=>Yr,PromptWriteType:()=>Ta});var Ta=r.enum_(["mustache","jinja2"]);var Be=r.record(r.string(),r.unknown());var Yr=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional(),template:r.string().optional(),metadata:Be.optional(),changeDescription:r.property("change_description",r.string().optional()),type:Ta.optional(),tags:r.list(r.string()).optional()});var hs=r.record(r.string(),r.unknown());var ws=r.enum_(["mustache","jinja2"]);var ke=r.object({id:r.string().optional(),promptId:r.property("prompt_id",r.string().optional()),commit:r.string().optional(),template:r.string(),metadata:hs.optional(),type:ws.optional(),changeDescription:r.property("change_description",r.string().optional()),variables:r.list(r.string()).optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional())});var Zr=r.object({name:r.string(),version:ke});var qr=r.object({name:r.string(),description:r.string().optional(),tags:r.list(r.string()).optional()});var eo=r.object({name:r.string(),commit:r.string().optional()});var ar={};E(ar,{FindFeedbackScoreNames1RequestType:()=>Pa,GetSpanStatsRequestType:()=>Ca,GetSpansByProjectRequestType:()=>Ea,SpanBatchUpdate:()=>io,SpanBatchWrite:()=>to,SpanSearchStreamRequestPublic:()=>no,SpanSearchStreamRequestPublicType:()=>Ia,findFeedbackScoreNames1:()=>ja});var Ea=r.enum_(["general","tool","llm","guardrail"]);var Pa=r.enum_(["general","tool","llm","guardrail"]);var Ca=r.enum_(["general","tool","llm","guardrail"]);var Ia=r.enum_(["general","tool","llm","guardrail"]);var ja={};E(ja,{Response:()=>pb});var pb=r.list(r.string());var bs=r.enum_(["general","tool","llm","guardrail"]);var ro=r.object({exceptionType:r.property("exception_type",r.string()),message:r.string().optional(),traceback:r.string()});var oo=r.object({id:r.string().optional(),projectName:r.property("project_name",r.string().optional()),traceId:r.property("trace_id",r.string().optional()),parentSpanId:r.property("parent_span_id",r.string().optional()),name:r.string().optional(),type:bs.optional(),startTime:r.property("start_time",r.date()),endTime:r.property("end_time",r.date().optional()),input:se.optional(),output:se.optional(),metadata:se.optional(),model:r.string().optional(),provider:r.string().optional(),tags:r.list(r.string()).optional(),usage:r.record(r.string(),r.number()).optional(),errorInfo:r.property("error_info",ro.optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),totalEstimatedCostVersion:r.property("total_estimated_cost_version",r.string().optional())});var to=r.object({spans:r.list(oo)});var xs=r.enum_(["general","tool","llm","guardrail"]);var Se=r.object({exceptionType:r.property("exception_type",r.string()),message:r.string().optional(),traceback:r.string()});var ao=r.object({projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),traceId:r.property("trace_id",r.string()),parentSpanId:r.property("parent_span_id",r.string().optional()),name:r.string().optional(),type:xs.optional(),endTime:r.property("end_time",r.date().optional()),input:N.optional(),output:N.optional(),metadata:N.optional(),model:r.string().optional(),provider:r.string().optional(),tags:r.list(r.string()).optional(),usage:r.record(r.string(),r.number()).optional(),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),errorInfo:r.property("error_info",Se.optional())});var io=r.object({ids:r.list(r.string()),update:ao,mergeTags:r.property("merge_tags",r.boolean().optional())});var Rs=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var ys=r.object({field:r.string().optional(),operator:Rs.optional(),key:r.string().optional(),value:r.string().optional()});var no=r.object({traceId:r.property("trace_id",r.string().optional()),projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),type:Ia.optional(),filters:r.list(ys).optional(),limit:r.number().optional(),lastRetrievedId:r.property("last_retrieved_id",r.string().optional()),truncate:r.boolean().optional(),fromTime:r.property("from_time",r.date().optional()),toTime:r.property("to_time",r.date().optional())});var Le={};E(Le,{DeleteThreadFeedbackScores:()=>fo,DeleteTraceThreads:()=>ho,FeedbackScoreBatchThread:()=>wo,TraceBatchUpdate:()=>lo,TraceBatchWrite:()=>po,TraceSearchStreamRequestPublic:()=>xo,TraceThreadBatchIdentifier:()=>go,TraceThreadBatchUpdate:()=>uo,TraceThreadSearchStreamRequest:()=>bo,findFeedbackScoreNames2:()=>Ua,findTraceThreadsFeedbackScoreNames:()=>Na});var Ua={};E(Ua,{Response:()=>cb});var cb=r.list(r.string());var Na={};E(Na,{Response:()=>lb});var lb=r.list(r.string());var so=r.object({id:r.string().optional(),projectName:r.property("project_name",r.string().optional()),name:r.string().optional(),startTime:r.property("start_time",r.date()),endTime:r.property("end_time",r.date().optional()),input:se.optional(),output:se.optional(),metadata:se.optional(),tags:r.list(r.string()).optional(),errorInfo:r.property("error_info",ro.optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),threadId:r.property("thread_id",r.string().optional())});var po=r.object({traces:r.list(so)});var co=r.object({projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),name:r.string().optional(),endTime:r.property("end_time",r.date().optional()),input:N.optional(),output:N.optional(),metadata:N.optional(),tags:r.list(r.string()).optional(),errorInfo:r.property("error_info",Se.optional()),threadId:r.property("thread_id",r.string().optional())});var lo=r.object({ids:r.list(r.string()),update:co,mergeTags:r.property("merge_tags",r.boolean().optional())});var mo=r.object({tags:r.list(r.string()).optional()});var uo=r.object({ids:r.list(r.string()),update:mo,mergeTags:r.property("merge_tags",r.boolean().optional())});var go=r.object({projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),threadId:r.property("thread_id",r.string().optional()),threadIds:r.property("thread_ids",r.list(r.string()).optional())});var fo=r.object({projectName:r.property("project_name",r.string()),threadId:r.property("thread_id",r.string()),names:r.list(r.string()),author:r.string().optional()});var ho=r.object({projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),threadIds:r.property("thread_ids",r.list(r.string()))});var ks=r.enum_(["ui","sdk","online_scoring"]);var vs=r.object({projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),name:r.string(),categoryName:r.property("category_name",r.string().optional()),value:r.number(),reason:r.string().optional(),source:ks,author:r.string().optional(),threadId:r.property("thread_id",r.string())});var wo=r.object({scores:r.list(vs)});var zs=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Ss=r.object({field:r.string().optional(),operator:zs.optional(),key:r.string().optional(),value:r.string().optional()});var bo=r.object({projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),filters:r.list(Ss).optional(),lastRetrievedThreadModelId:r.property("last_retrieved_thread_model_id",r.string().optional()),limit:r.number().optional(),truncate:r.boolean().optional(),stripAttachments:r.property("strip_attachments",r.boolean().optional()),fromTime:r.property("from_time",r.date().optional()),toTime:r.property("to_time",r.date().optional())});var xo=r.object({projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),filters:r.list(ze).optional(),lastRetrievedId:r.property("last_retrieved_id",r.string().optional()),limit:r.number().optional(),truncate:r.boolean().optional(),stripAttachments:r.property("strip_attachments",r.boolean().optional()),fromTime:r.property("from_time",r.date().optional()),toTime:r.property("to_time",r.date().optional())});var Da={};E(Da,{AnnotationQueueBatchWrite:()=>yo,AnnotationQueueUpdate:()=>ko});var _s=r.enum_(["trace","thread"]);var Ro=r.object({id:r.string().optional(),projectId:r.property("project_id",r.string()),name:r.string(),description:r.string().optional(),instructions:r.string().optional(),scope:_s,commentsEnabled:r.property("comments_enabled",r.boolean().optional()),feedbackDefinitionNames:r.property("feedback_definition_names",r.list(r.string()).optional())});var yo=r.object({annotationQueues:r.property("annotation_queues",r.list(Ro))});var ko=r.object({name:r.string().optional(),description:r.string().optional(),instructions:r.string().optional(),commentsEnabled:r.property("comments_enabled",r.boolean().optional()),feedbackDefinitionNames:r.property("feedback_definition_names",r.list(r.string()).optional())});var Ma={};E(Ma,{ChatCompletionRequest:()=>zo});var Ts=r.record(r.string(),r.unknown());var As=r.object({includeUsage:r.property("include_usage",r.boolean().optional())});var Es=r.enum_(["text","json_object","json_schema"]);var Ps=r.object({name:r.string().optional(),strict:r.boolean().optional(),schema:r.record(r.string(),r.record(r.string(),r.unknown())).optional()});var Cs=r.object({type:Es.optional(),jsonSchema:r.property("json_schema",Ps.optional())});var vo=r.object({name:r.string().optional(),description:r.string().optional(),strict:r.boolean().optional(),parameters:r.record(r.string(),r.record(r.string(),r.unknown())).optional()});var Is=r.object({type:r.stringLiteral("function").optional(),function:vo.optional()});var _e=r.object({name:r.string().optional(),arguments:r.string().optional()});var zo=r.object({model:r.string().optional(),messages:r.list(Ts).optional(),temperature:r.number().optional(),topP:r.property("top_p",r.number().optional()),n:r.number().optional(),stream:r.boolean().optional(),streamOptions:r.property("stream_options",As.optional()),stop:r.list(r.string()).optional(),maxTokens:r.property("max_tokens",r.number().optional()),maxCompletionTokens:r.property("max_completion_tokens",r.number().optional()),presencePenalty:r.property("presence_penalty",r.number().optional()),frequencyPenalty:r.property("frequency_penalty",r.number().optional()),logitBias:r.property("logit_bias",r.record(r.string(),r.number()).optional()),user:r.string().optional(),responseFormat:r.property("response_format",Cs.optional()),seed:r.number().optional(),tools:r.list(Is).optional(),toolChoice:r.property("tool_choice",r.record(r.string(),r.unknown()).optional()),parallelToolCalls:r.property("parallel_tool_calls",r.boolean().optional()),store:r.boolean().optional(),metadata:r.record(r.string(),r.string()).optional(),reasoningEffort:r.property("reasoning_effort",r.string().optional()),serviceTier:r.property("service_tier",r.string().optional()),functions:r.list(vo).optional(),functionCall:r.property("function_call",_e.optional())});var Fa={};E(Fa,{DashboardUpdatePublic:()=>_o,DashboardWrite:()=>So});var So=r.object({name:r.string(),description:r.string().optional(),config:Be});var Te=r.record(r.string(),r.unknown());var _o=r.object({name:r.string().optional(),description:r.string().optional(),config:Te.optional()});var Oa={};E(Oa,{GuardrailBatchWrite:()=>To});var js=r.enum_(["TOPIC","PII"]);var Us=r.enum_(["passed","failed"]);var Ns=r.object({entityId:r.property("entity_id",r.string()),secondaryId:r.property("secondary_id",r.string()),projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),name:js,result:Us,config:D,details:D});var To=r.object({guardrails:r.list(Ns)});var Wa={};E(Wa,{WelcomeWizardSubmission:()=>Ao});var Ao=r.object({role:r.string().optional(),integrations:r.list(r.string()).optional(),email:r.string().optional(),joinBetaProgram:r.property("join_beta_program",r.boolean().optional())});var Ds=r.object({workspaceId:r.property("workspace_id",r.string().optional()),user:r.string().optional(),count:r.number().optional()});var ir=r.object({biInformation:r.property("bi_information",r.list(Ds).optional())});var Ms=r.object({workspace:r.string().optional(),spanCount:r.property("span_count",r.number().optional())});var Fs=r.object({workspacesSpansCount:r.property("workspaces_spans_count",r.list(Ms).optional())});var Os=r.object({workspace:r.string().optional(),traceCount:r.property("trace_count",r.number().optional())});var Ws=r.object({workspacesTracesCount:r.property("workspaces_traces_count",r.list(Os).optional())});var ae=r.object({code:r.number().optional(),message:r.string().optional(),details:r.string().optional()});var Bs=r.enum_(["general","slack","pagerduty"]);var Ls=r.object({id:r.string().optional(),name:r.string().optional(),url:r.string(),secretToken:r.property("secret_token",r.string().optional()),headers:r.record(r.string(),r.string()).optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var Vs=r.enum_(["trace:errors","trace:feedback_score","trace_thread:feedback_score","prompt:created","prompt:committed","trace:guardrails_triggered","prompt:deleted","experiment:finished","trace:cost","trace:latency"]);var Hs=r.enum_(["scope:project","threshold:feedback_score","threshold:cost","threshold:latency","threshold:errors"]);var Js=r.object({id:r.string().optional(),alertTriggerId:r.property("alert_trigger_id",r.string().optional()),type:Hs,configValue:r.property("config_value",r.record(r.string(),r.string()).optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var Ks=r.object({id:r.string().optional(),alertId:r.property("alert_id",r.string().optional()),eventType:r.property("event_type",Vs),triggerConfigs:r.property("trigger_configs",r.list(Js).optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional())});var mb=r.object({id:r.string().optional(),name:r.string().optional(),enabled:r.boolean().optional(),alertType:r.property("alert_type",Bs.optional()),metadata:r.record(r.string(),r.string()).optional(),webhook:Ls,triggers:r.list(Ks).optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var Xs=r.enum_(["scope:project","threshold:feedback_score","threshold:cost","threshold:latency","threshold:errors"]);var Gs=r.object({id:r.string().optional(),type:Xs,configValue:r.property("config_value",r.record(r.string(),r.string()).optional())});var $s=r.enum_(["trace:errors","trace:feedback_score","trace_thread:feedback_score","prompt:created","prompt:committed","trace:guardrails_triggered","prompt:deleted","experiment:finished","trace:cost","trace:latency"]);var Qs=r.object({id:r.string().optional(),eventType:r.property("event_type",$s),triggerConfigs:r.property("trigger_configs",r.list(Gs).optional())});var Ys=r.enum_(["general","slack","pagerduty"]);var Zs=r.object({id:r.string().optional(),name:r.string().optional(),url:r.string(),secretToken:r.property("secret_token",r.string().optional()),headers:r.record(r.string(),r.string()).optional()});var Eo=r.object({id:r.string().optional(),name:r.string().optional(),enabled:r.boolean().optional(),alertType:r.property("alert_type",Ys.optional()),metadata:r.record(r.string(),r.string()).optional(),webhook:Zs,triggers:r.list(Qs).optional()});var L=r.object({ids:r.list(r.string())});var qs=r.enum_(["general","slack","pagerduty"]);var ep=r.object({id:r.string().optional(),name:r.string().optional(),url:r.string(),secretToken:r.property("secret_token",r.string().optional()),headers:r.record(r.string(),r.string()).optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var rp=r.enum_(["trace:errors","trace:feedback_score","trace_thread:feedback_score","prompt:created","prompt:committed","trace:guardrails_triggered","prompt:deleted","experiment:finished","trace:cost","trace:latency"]);var op=r.enum_(["scope:project","threshold:feedback_score","threshold:cost","threshold:latency","threshold:errors"]);var tp=r.object({id:r.string().optional(),alertTriggerId:r.property("alert_trigger_id",r.string().optional()),type:op,configValue:r.property("config_value",r.record(r.string(),r.string()).optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var ap=r.object({id:r.string().optional(),alertId:r.property("alert_id",r.string().optional()),eventType:r.property("event_type",rp),triggerConfigs:r.property("trigger_configs",r.list(tp).optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional())});var Po=r.object({id:r.string().optional(),name:r.string().optional(),enabled:r.boolean().optional(),alertType:r.property("alert_type",qs.optional()),metadata:r.record(r.string(),r.string()).optional(),webhook:ep,triggers:r.list(ap).optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var ip=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(Po).optional(),sortableBy:r.property("sortable_by",r.list(r.string()).optional())});var db=r.object({code:r.number().optional(),message:r.string().optional(),details:r.string().optional()});var np=r.object({responseExamples:r.property("response_examples",r.record(r.string(),r.record(r.string(),r.unknown())).optional())});var sp=r.enum_(["success","failure"]);var pp=r.object({status:sp.optional(),statusCode:r.property("status_code",r.number().optional()),requestBody:r.property("request_body",r.string().optional()),errorMessage:r.property("error_message",r.string().optional())});var Ba=r.object({ids:r.list(r.string())});var cp=r.enum_(["trace","thread"]);var lp=r.object({username:r.string().optional(),status:r.number().optional()});var pe=r.object({name:r.string(),value:r.number()});var mp=r.object({id:r.string().optional(),projectId:r.property("project_id",r.string()),projectName:r.property("project_name",r.string().optional()),name:r.string(),description:r.string().optional(),instructions:r.string().optional(),scope:cp,commentsEnabled:r.property("comments_enabled",r.boolean().optional()),feedbackDefinitionNames:r.property("feedback_definition_names",r.list(r.string()).optional()),reviewers:r.list(lp).optional(),feedbackScores:r.property("feedback_scores",r.list(pe).optional()),itemsCount:r.property("items_count",r.number().optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var ub=r.object({annotationQueues:r.property("annotation_queues",r.list(mp))});var dp=r.enum_(["trace","thread"]);var up=r.object({username:r.string().optional(),status:r.number().optional()});var Ve=r.object({name:r.string(),value:r.number()});var Co=r.object({id:r.string().optional(),projectId:r.property("project_id",r.string()),projectName:r.property("project_name",r.string().optional()),name:r.string(),description:r.string().optional(),instructions:r.string().optional(),scope:dp,commentsEnabled:r.property("comments_enabled",r.boolean().optional()),feedbackDefinitionNames:r.property("feedback_definition_names",r.list(r.string()).optional()),reviewers:r.list(up).optional(),feedbackScores:r.property("feedback_scores",r.list(Ve).optional()),itemsCount:r.property("items_count",r.number().optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var gp=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(Co).optional(),sortableBy:r.list(r.string()).optional()});var fp=r.object({link:r.string().optional(),fileName:r.property("file_name",r.string()),fileSize:r.property("file_size",r.number()),mimeType:r.property("mime_type",r.string())});var hp=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(fp).optional(),sortableBy:r.list(r.string()).optional()});var wp=r.enum_(["trace","span"]);var bp=r.object({eTag:r.property("e_tag",r.string()),partNumber:r.property("part_number",r.number())});var La=r.object({fileName:r.property("file_name",r.string()),projectName:r.property("project_name",r.string().optional()),entityType:r.property("entity_type",wp),entityId:r.property("entity_id",r.string()),containerId:r.property("container_id",r.string().optional()),fileSize:r.property("file_size",r.number()),mimeType:r.property("mime_type",r.string().optional()),uploadId:r.property("upload_id",r.string()),uploadedFileParts:r.property("uploaded_file_parts",r.list(bp))});var xp=r.enum_(["trace","span"]);var gb=r.object({fileNames:r.property("file_names",r.list(r.string())),entityType:r.property("entity_type",xp),entityId:r.property("entity_id",r.string()),containerId:r.property("container_id",r.string())});var Rp=r.object({uploadId:r.property("upload_id",r.string()),preSignUrls:r.property("pre_sign_urls",r.list(r.string()))});var yp=r.record(r.string(),r.unknown());var kp=r.object({workspaceName:r.property("workspace_name",r.string().optional())});var vp=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Io=r.object({field:r.string().optional(),operator:vp.optional(),key:r.string().optional(),value:r.string().optional()});var jo=r.object({name:r.string(),temperature:r.number(),seed:r.number().optional(),customParameters:r.property("custom_parameters",D.optional())});var zp=r.enum_(["SYSTEM","USER","AI","TOOL_EXECUTION_RESULT","CUSTOM"]);var Sp=r.object({url:r.string(),detail:r.string().optional()});var _p=r.object({url:r.string()});var Tp=r.object({type:r.string(),text:r.string().optional(),imageUrl:r.property("image_url",Sp.optional()),videoUrl:r.property("video_url",_p.optional())});var Uo=r.object({role:zp,content:r.string().optional(),contentArray:r.property("content_array",r.list(Tp).optional()),stringContent:r.property("string_content",r.boolean().optional()),structuredContent:r.property("structured_content",r.boolean().optional())});var Ap=r.enum_(["BOOLEAN","INTEGER","DOUBLE"]);var No=r.object({name:r.string(),type:Ap,description:r.string()});var Do=r.object({model:jo,messages:r.list(Uo),variables:r.record(r.string(),r.string()),schema:r.list(No)});var Ep=r.object({code:Do.optional()});var Mo=r.object({metric:r.string(),arguments:r.record(r.string(),r.string())});var Pp=r.object({code:Mo.optional()});var Fo=r.object({model:jo,messages:r.list(Uo),schema:r.list(No)});var Cp=r.object({code:Fo.optional()});var Oo=r.object({metric:r.string()});var Ip=r.object({code:Oo.optional()});var Va=r.object({id:r.string().optional(),projectId:r.property("project_id",r.string()),projectName:r.property("project_name",r.string().optional()),name:r.string(),samplingRate:r.property("sampling_rate",r.number().optional()),enabled:r.boolean().optional(),filters:r.list(Io).optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),action:r.stringLiteral("evaluator")}),fb=r.union("type",{llm_as_judge:Ep.extend(Va),user_defined_metric_python:Pp.extend(Va),trace_thread_llm_as_judge:Cp.extend(Va),trace_thread_user_defined_metric_python:Ip.extend(Va)}).transform({transform:i=>i,untransform:i=>i});var Wo=r.object({name:r.string(),temperature:r.number(),seed:r.number().optional(),customParameters:r.property("custom_parameters",Be.optional())});var jp=r.enum_(["SYSTEM","USER","AI","TOOL_EXECUTION_RESULT","CUSTOM"]);var Up=r.object({url:r.string(),detail:r.string().optional()});var Np=r.object({url:r.string()});var Dp=r.object({type:r.string(),text:r.string().optional(),imageUrl:r.property("image_url",Up.optional()),videoUrl:r.property("video_url",Np.optional())});var Bo=r.object({role:jp,content:r.string().optional(),contentArray:r.property("content_array",r.list(Dp).optional()),stringContent:r.property("string_content",r.boolean().optional()),structuredContent:r.property("structured_content",r.boolean().optional())});var Mp=r.enum_(["BOOLEAN","INTEGER","DOUBLE"]);var Lo=r.object({name:r.string(),type:Mp,description:r.string()});var Fp=r.object({model:Wo,messages:r.list(Bo),variables:r.record(r.string(),r.string()),schema:r.list(Lo)});var Op=r.object({code:Fp.optional()});var Wp=r.object({model:Wo,messages:r.list(Bo),schema:r.list(Lo)});var Bp=r.object({code:Wp.optional()});var Lp=r.object({metric:r.string()});var Vp=r.object({code:Lp.optional()});var Hp=r.object({metric:r.string(),arguments:r.record(r.string(),r.string())});var Jp=r.object({code:Hp.optional()});var Kp=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Xp=r.object({field:r.string().optional(),operator:Kp.optional(),key:r.string().optional(),value:r.string().optional()});var Ha=r.object({projectId:r.property("project_id",r.string()),name:r.string(),samplingRate:r.property("sampling_rate",r.number().optional()),enabled:r.boolean().optional(),filters:r.list(Xp).optional(),action:r.stringLiteral("evaluator")}),Gp=r.union("type",{llm_as_judge:Op.extend(Ha),user_defined_metric_python:Jp.extend(Ha),trace_thread_llm_as_judge:Bp.extend(Ha),trace_thread_user_defined_metric_python:Vp.extend(Ha)}).transform({transform:i=>i,untransform:i=>i});var Vo=r.object({name:r.string(),temperature:r.number(),seed:r.number().optional(),customParameters:r.property("custom_parameters",Te.optional())});var $p=r.enum_(["SYSTEM","USER","AI","TOOL_EXECUTION_RESULT","CUSTOM"]);var Qp=r.object({url:r.string(),detail:r.string().optional()});var Yp=r.object({url:r.string()});var Zp=r.object({type:r.string(),text:r.string().optional(),imageUrl:r.property("image_url",Qp.optional()),videoUrl:r.property("video_url",Yp.optional())});var Ho=r.object({role:$p,content:r.string().optional(),contentArray:r.property("content_array",r.list(Zp).optional()),stringContent:r.property("string_content",r.boolean().optional()),structuredContent:r.property("structured_content",r.boolean().optional())});var qp=r.enum_(["BOOLEAN","INTEGER","DOUBLE"]);var Jo=r.object({name:r.string(),type:qp,description:r.string()});var ec=r.object({model:Vo,messages:r.list(Ho),variables:r.record(r.string(),r.string()),schema:r.list(Jo)});var Ko=r.object({code:ec.optional()});var rc=r.object({metric:r.string(),arguments:r.record(r.string(),r.string())});var Xo=r.object({code:rc.optional()});var oc=r.object({model:Vo,messages:r.list(Ho),schema:r.list(Jo)});var Go=r.object({code:oc.optional()});var tc=r.object({metric:r.string()});var $o=r.object({code:tc.optional()});var Ja=r.object({id:r.string().optional(),projectId:r.property("project_id",r.string()),projectName:r.property("project_name",r.string().optional()),name:r.string(),samplingRate:r.property("sampling_rate",r.number().optional()),enabled:r.boolean().optional(),filters:r.list(ze).optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),action:r.stringLiteral("evaluator")}),ac=r.union("type",{llm_as_judge:Ko.extend(Ja),user_defined_metric_python:Xo.extend(Ja),trace_thread_llm_as_judge:Go.extend(Ja),trace_thread_user_defined_metric_python:$o.extend(Ja)}).transform({transform:i=>i,untransform:i=>i});var ic=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(ac).optional(),sortableBy:r.property("sortable_by",r.list(r.string()).optional())});var Ka=r.object({id:r.string().optional(),projectId:r.property("project_id",r.string()),projectName:r.property("project_name",r.string().optional()),name:r.string(),samplingRate:r.property("sampling_rate",r.number().optional()),enabled:r.boolean().optional(),filters:r.list(ze).optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),action:r.stringLiteral("evaluator")}),nc=r.union("type",{llm_as_judge:Ko.extend(Ka),user_defined_metric_python:Xo.extend(Ka),trace_thread_llm_as_judge:Go.extend(Ka),trace_thread_user_defined_metric_python:$o.extend(Ka)}).transform({transform:i=>i,untransform:i=>i});var sc=r.enum_(["INFO","WARN","ERROR","DEBUG","TRACE"]);var pc=r.object({timestamp:r.date().optional(),ruleId:r.property("rule_id",r.string().optional()),level:sc.optional(),message:r.string().optional(),markers:r.record(r.string(),r.string()).optional()});var cc=r.object({content:r.list(pc).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional()});var lc=r.object({code:Do.optional()});var mc=r.object({code:Mo.optional()});var dc=r.object({code:Fo.optional()});var uc=r.object({code:Oo.optional()});var Xa=r.object({name:r.string(),samplingRate:r.property("sampling_rate",r.number().optional()),enabled:r.boolean().optional(),filters:r.list(Io).optional(),projectId:r.property("project_id",r.string()),action:r.stringLiteral("evaluator")}),gc=r.union("type",{llm_as_judge:lc.extend(Xa),user_defined_metric_python:mc.extend(Xa),trace_thread_llm_as_judge:dc.extend(Xa),trace_thread_user_defined_metric_python:uc.extend(Xa)}).transform({transform:i=>i,untransform:i=>i});var fc=r.enum_(["system","user","assistant","tool","function"]);var Qo=r.object({id:r.string().optional(),index:r.number().optional(),type:r.stringLiteral("function").optional(),function:_e.optional()});var hc=r.object({role:fc.optional(),content:r.string().optional(),reasoningContent:r.property("reasoning_content",r.string().optional()),name:r.string().optional(),toolCalls:r.property("tool_calls",r.list(Qo).optional()),refusal:r.string().optional(),functionCall:r.property("function_call",_e.optional())});var wc=r.object({role:r.string().optional(),content:r.string().optional(),reasoningContent:r.property("reasoning_content",r.string().optional()),toolCalls:r.property("tool_calls",r.list(Qo).optional()),functionCall:r.property("function_call",_e.optional())});var bc=r.object({index:r.number().optional(),message:hc.optional(),delta:wc.optional(),finishReason:r.property("finish_reason",r.string().optional())});var xc=r.object({cachedTokens:r.property("cached_tokens",r.number().optional())});var Rc=r.object({reasoningTokens:r.property("reasoning_tokens",r.number().optional())});var yc=r.object({totalTokens:r.property("total_tokens",r.number().optional()),promptTokens:r.property("prompt_tokens",r.number().optional()),promptTokensDetails:r.property("prompt_tokens_details",xc.optional()),completionTokens:r.property("completion_tokens",r.number().optional()),completionTokensDetails:r.property("completion_tokens_details",Rc.optional())});var kc=r.object({id:r.string().optional(),created:r.number().optional(),model:r.string().optional(),choices:r.list(bc).optional(),usage:yc.optional(),systemFingerprint:r.property("system_fingerprint",r.string().optional()),serviceTier:r.property("service_tier",r.string().optional())});var He=r.object({id:r.string().optional(),workspaceId:r.property("workspace_id",r.string().optional()),name:r.string(),slug:r.string().optional(),description:r.string().optional(),config:Te,createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional())});var vc=r.object({content:r.list(He).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional()});var zc=r.enum_(["private","public"]);var hb=r.object({id:r.string().optional(),name:r.string(),visibility:zc.optional(),tags:r.list(r.string()).optional(),description:r.string().optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),experimentCount:r.property("experiment_count",r.number().optional()),datasetItemsCount:r.property("dataset_items_count",r.number().optional()),optimizationCount:r.property("optimization_count",r.number().optional()),mostRecentExperimentAt:r.property("most_recent_experiment_at",r.date().optional()),lastCreatedExperimentAt:r.property("last_created_experiment_at",r.date().optional()),mostRecentOptimizationAt:r.property("most_recent_optimization_at",r.date().optional()),lastCreatedOptimizationAt:r.property("last_created_optimization_at",r.date().optional())});var Sc=r.enum_(["manual","trace","span","sdk"]);var Yo=r.object({id:r.string().optional(),traceId:r.property("trace_id",r.string().optional()),spanId:r.property("span_id",r.string().optional()),source:Sc,data:D,tags:r.list(r.string()).optional(),experimentItems:r.property("experiment_items",r.list(Dr).optional()),datasetId:r.property("dataset_id",r.string().optional()),createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var wb=r.object({datasetName:r.property("dataset_name",r.string().optional()),datasetId:r.property("dataset_id",r.string().optional()),items:r.list(Yo)});var _c=r.object({generatedSamples:r.property("generated_samples",r.list(Yo).optional()),model:r.string().optional(),totalGenerated:r.property("total_generated",r.number().optional()),generationTime:r.property("generation_time",r.date().optional())});var bb=r.object({model:r.string(),sampleCount:r.property("sample_count",r.number().optional()),preserveFields:r.property("preserve_fields",r.list(r.string()).optional()),variationInstructions:r.property("variation_instructions",r.string().optional()),customPrompt:r.property("custom_prompt",r.string().optional())});var Tc=r.enum_(["string","number","object","boolean","array","null"]);var Ac=r.object({name:r.string().optional(),types:r.list(Tc).optional(),filterFieldPrefix:r.property("filter_field_prefix",r.string().optional()),filterField:r.string().optional()});var Ec=r.object({id:r.string().optional(),text:r.string(),createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var Pc=r.enum_(["manual","trace","span","sdk"]);var Ga=r.undiscriminatedUnion([r.record(r.string(),r.unknown()),r.list(r.record(r.string(),r.unknown())),r.string()]);var Cc=r.enum_(["ui","sdk","online_scoring"]);var Ic=r.enum_(["ui","sdk","online_scoring"]);var jc=r.object({value:r.number().optional(),reason:r.string().optional(),categoryName:r.property("category_name",r.string().optional()),source:Ic.optional(),lastUpdatedAt:r.property("last_updated_at",r.date().optional())});var Uc=r.object({name:r.string(),categoryName:r.property("category_name",r.string().optional()),value:r.number(),reason:r.string().optional(),source:Cc,createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),valueByAuthor:r.property("value_by_author",r.record(r.string(),jc).optional())});var Nc=r.enum_(["default","hidden"]);var Dc=r.object({id:r.string().optional(),experimentId:r.property("experiment_id",r.string()),datasetItemId:r.property("dataset_item_id",r.string()),traceId:r.property("trace_id",r.string()),input:Ga.optional(),output:Ga.optional(),feedbackScores:r.property("feedback_scores",r.list(Uc).optional()),comments:r.list(Ec).optional(),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),duration:r.number().optional(),usage:r.record(r.string(),r.number()).optional(),createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),traceVisibilityMode:r.property("trace_visibility_mode",Nc.optional())});var Mc=r.object({id:r.string().optional(),traceId:r.property("trace_id",r.string().optional()),spanId:r.property("span_id",r.string().optional()),source:Pc,data:D,tags:r.list(r.string()).optional(),experimentItems:r.property("experiment_items",r.list(Dc).optional()),datasetId:r.property("dataset_id",r.string().optional()),createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var Fc=r.object({content:r.list(Mc).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),columns:r.list(Ac).optional(),sortableBy:r.list(r.string()).optional()});var Oc=r.enum_(["private","public"]);var nr=r.object({id:r.string().optional(),name:r.string(),visibility:Oc.optional(),tags:r.list(r.string()).optional(),description:r.string().optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),experimentCount:r.property("experiment_count",r.number().optional()),datasetItemsCount:r.property("dataset_items_count",r.number().optional()),optimizationCount:r.property("optimization_count",r.number().optional()),mostRecentExperimentAt:r.property("most_recent_experiment_at",r.date().optional()),lastCreatedExperimentAt:r.property("last_created_experiment_at",r.date().optional()),mostRecentOptimizationAt:r.property("most_recent_optimization_at",r.date().optional()),lastCreatedOptimizationAt:r.property("last_created_optimization_at",r.date().optional())});var Wc=r.object({content:r.list(nr).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),sortableBy:r.list(r.string()).optional()});var Bc=r.object({value:r.number().optional()});var Lc=r.object({value:r.number().optional()});var Zo=r.object({p50:r.number().optional(),p90:r.number().optional(),p99:r.number().optional()});var Vc=r.object({value:Zo.optional()});var Hc=r.object({name:r.string().optional()}),Jc=r.union("type",{PERCENTAGE:Vc.extend(Hc),COUNT:Lc.extend(Hc),AVG:Bc.extend(Hc)}).transform({transform:i=>i,untransform:i=>i});var Je=r.object({stats:r.list(Jc).optional()});var Kc=r.enum_(["manual","trace","span","sdk"]);var Xc=r.enum_(["default","hidden"]);var qo=r.object({id:r.string().optional(),experimentId:r.property("experiment_id",r.string()),datasetItemId:r.property("dataset_item_id",r.string()),traceId:r.property("trace_id",r.string()),createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),traceVisibilityMode:r.property("trace_visibility_mode",Xc.optional())});var et=r.object({id:r.string().optional(),traceId:r.property("trace_id",r.string().optional()),spanId:r.property("span_id",r.string().optional()),source:Kc,data:D,tags:r.list(r.string()).optional(),experimentItems:r.property("experiment_items",r.list(qo).optional()),datasetId:r.property("dataset_id",r.string().optional()),createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var Gc=r.enum_(["string","number","object","boolean","array","null"]);var $c=r.object({name:r.string().optional(),types:r.list(Gc).optional(),filterFieldPrefix:r.property("filter_field_prefix",r.string().optional()),filterField:r.string().optional()});var Qc=r.object({content:r.list(et).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),columns:r.list($c).optional(),sortableBy:r.list(r.string()).optional()});var Yc=r.enum_(["string","number","object","boolean","array","null"]);var Zc=r.object({name:r.string().optional(),types:r.list(Yc).optional(),filterFieldPrefix:r.property("filter_field_prefix",r.string().optional()),filterField:r.string().optional()});var qc=r.object({columns:r.list(Zc).optional()});var el=r.object({typeName:r.string().optional()});var xb=r.object({type:el.optional(),closed:r.boolean().optional()});var rl=r.enum_(["regular","trial","mini-batch"]);var ol=r.enum_(["running","completed","cancelled"]);var Ae=r.object({p50:r.number().optional(),p90:r.number().optional(),p99:r.number().optional()});var $a=r.object({id:r.string(),commit:r.string().optional(),promptId:r.property("prompt_id",r.string().optional()),promptName:r.property("prompt_name",r.string().optional())});var Rb=r.object({id:r.string().optional(),datasetName:r.property("dataset_name",r.string()),datasetId:r.property("dataset_id",r.string().optional()),name:r.string().optional(),metadata:N.optional(),type:rl.optional(),optimizationId:r.property("optimization_id",r.string().optional()),feedbackScores:r.property("feedback_scores",r.list(pe).optional()),comments:r.list(H).optional(),traceCount:r.property("trace_count",r.number().optional()),createdAt:r.property("created_at",r.date().optional()),duration:Ae.optional(),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),totalEstimatedCostAvg:r.property("total_estimated_cost_avg",r.number().optional()),usage:r.record(r.string(),r.number()).optional(),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),status:ol.optional(),promptVersion:r.property("prompt_version",$a.optional()),promptVersions:r.property("prompt_versions",r.list($a).optional())});var sr=r.object({ids:r.list(r.string())});var tl=r.enum_(["TOPIC","PII"]);var al=r.enum_(["passed","failed"]);var il=r.object({name:tl.optional(),result:al.optional()});var nl=r.object({spanId:r.property("span_id",r.string().optional()),checks:r.list(il).optional()});var sl=r.enum_(["default","hidden"]);var rt=r.object({id:r.string().optional(),projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),name:r.string().optional(),startTime:r.property("start_time",r.date()),endTime:r.property("end_time",r.date().optional()),input:N.optional(),output:N.optional(),metadata:N.optional(),tags:r.list(r.string()).optional(),errorInfo:r.property("error_info",Se.optional()),usage:r.record(r.string(),r.number()).optional(),createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),feedbackScores:r.property("feedback_scores",r.list(ee).optional()),comments:r.list(H).optional(),guardrailsValidations:r.property("guardrails_validations",r.list(nl).optional()),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),spanCount:r.property("span_count",r.number().optional()),duration:r.number().optional(),threadId:r.property("thread_id",r.string().optional()),visibilityMode:r.property("visibility_mode",sl.optional()),llmSpanCount:r.property("llm_span_count",r.number().optional()),providers:r.list(r.string()).optional()});var pl=r.enum_(["general","tool","llm","guardrail"]);var ot=r.object({id:r.string().optional(),projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),traceId:r.property("trace_id",r.string().optional()),parentSpanId:r.property("parent_span_id",r.string().optional()),name:r.string().optional(),type:pl.optional(),startTime:r.property("start_time",r.date()),endTime:r.property("end_time",r.date().optional()),input:N.optional(),output:N.optional(),metadata:N.optional(),model:r.string().optional(),provider:r.string().optional(),tags:r.list(r.string()).optional(),usage:r.record(r.string(),r.number()).optional(),errorInfo:r.property("error_info",Se.optional()),createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),feedbackScores:r.property("feedback_scores",r.list(ee).optional()),comments:r.list(H).optional(),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),totalEstimatedCostVersion:r.property("total_estimated_cost_version",r.string().optional()),duration:r.number().optional()});var cl=r.object({datasetItemId:r.property("dataset_item_id",r.string()),evaluateTaskResult:r.property("evaluate_task_result",N.optional()),trace:rt.optional(),spans:r.list(ot).optional(),feedbackScores:r.property("feedback_scores",r.list(ee).optional())});var yb=r.object({experimentName:r.property("experiment_name",r.string()),datasetName:r.property("dataset_name",r.string()),experimentId:r.property("experiment_id",r.string().optional()),items:r.list(cl)});var Ke=r.object({id:r.string().optional(),text:r.string(),createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var ce=r.undiscriminatedUnion([r.record(r.string(),r.unknown()),r.list(r.record(r.string(),r.unknown())),r.string()]);var ll=r.enum_(["regular","trial","mini-batch"]);var ml=r.enum_(["running","completed","cancelled"]);var Qa=r.object({id:r.string(),commit:r.string().optional(),promptId:r.property("prompt_id",r.string().optional()),promptName:r.property("prompt_name",r.string().optional())});var tt=r.object({id:r.string().optional(),datasetName:r.property("dataset_name",r.string()),datasetId:r.property("dataset_id",r.string().optional()),name:r.string().optional(),metadata:ce.optional(),type:ll.optional(),optimizationId:r.property("optimization_id",r.string().optional()),feedbackScores:r.property("feedback_scores",r.list(Ve).optional()),comments:r.list(Ke).optional(),traceCount:r.property("trace_count",r.number().optional()),createdAt:r.property("created_at",r.date().optional()),duration:Zo.optional(),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),totalEstimatedCostAvg:r.property("total_estimated_cost_avg",r.number().optional()),usage:r.record(r.string(),r.number()).optional(),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),status:ml.optional(),promptVersion:r.property("prompt_version",Qa.optional()),promptVersions:r.property("prompt_versions",r.list(Qa).optional())});var dl=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(tt).optional(),sortableBy:r.list(r.string()).optional()});var ul=r.object({label:r.string().optional()});var gl=r.object({groupSorting:r.property("group_sorting",r.list(r.string()).optional())});var fl=r.object({groupsDetails:r.property("groups_details",r.list(gl).optional())});var hl=r.object({content:r.record(r.string(),ul).optional(),details:fl.optional()});var wl=r.object({experimentCount:r.property("experiment_count",r.number().optional()),traceCount:r.property("trace_count",r.number().optional()),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),totalEstimatedCostAvg:r.property("total_estimated_cost_avg",r.number().optional()),duration:Ae.optional(),feedbackScores:r.property("feedback_scores",r.list(pe).optional())});var bl=r.object({aggregations:wl.optional()});var xl=r.object({content:r.record(r.string(),bl).optional()});var kb=r.object({ids:r.list(r.string())});var Rl=r.object({typeName:r.string().optional()});var vb=r.object({type:Rl.optional(),closed:r.boolean().optional()});var yl=r.object({trueLabel:r.string(),falseLabel:r.string()});var kl=r.object({details:yl.optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var vl=r.object({categories:r.record(r.string(),r.number())});var zl=r.object({details:vl.optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var Sl=r.object({max:r.number(),min:r.number()});var _l=r.object({details:Sl.optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var Tl=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional(),createdAt:r.date().optional(),createdBy:r.string().optional(),lastUpdatedAt:r.date().optional(),lastUpdatedBy:r.string().optional()}),zb=r.union("type",{numerical:_l.extend(Tl),categorical:zl.extend(Tl),boolean:kl.extend(Tl)}).transform({transform:i=>i,untransform:i=>i});var Al=r.object({trueLabel:r.string(),falseLabel:r.string()});var El=r.object({details:Al.optional()});var Pl=r.object({categories:r.record(r.string(),r.number())});var Cl=r.object({details:Pl.optional()});var Il=r.object({max:r.number(),min:r.number()});var jl=r.object({details:Il.optional()});var Ul=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional()}),Nl=r.union("type",{numerical:jl.extend(Ul),categorical:Cl.extend(Ul),boolean:El.extend(Ul)}).transform({transform:i=>i,untransform:i=>i});var Dl=r.object({trueLabel:r.string(),falseLabel:r.string()});var at=r.object({details:Dl.optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var Ml=r.object({categories:r.record(r.string(),r.number())});var it=r.object({details:Ml.optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var Fl=r.object({max:r.number(),min:r.number()});var nt=r.object({details:Fl.optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var Ol=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional(),createdAt:r.date().optional(),createdBy:r.string().optional(),lastUpdatedAt:r.date().optional(),lastUpdatedBy:r.string().optional()}),Wl=r.union("type",{numerical:nt.extend(Ol),categorical:it.extend(Ol),boolean:at.extend(Ol)}).transform({transform:i=>i,untransform:i=>i});var Bl=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(Wl).optional()});var Ll=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional(),createdAt:r.date().optional(),createdBy:r.string().optional(),lastUpdatedAt:r.date().optional(),lastUpdatedBy:r.string().optional()}),Vl=r.union("type",{numerical:nt.extend(Ll),categorical:it.extend(Ll),boolean:at.extend(Ll)}).transform({transform:i=>i,untransform:i=>i});var Hl=r.object({trueLabel:r.string(),falseLabel:r.string()});var Jl=r.object({details:Hl.optional()});var Kl=r.object({categories:r.record(r.string(),r.number())});var Xl=r.object({details:Kl.optional()});var Gl=r.object({max:r.number(),min:r.number()});var $l=r.object({details:Gl.optional()});var Ql=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional()}),Yl=r.union("type",{numerical:$l.extend(Ql),categorical:Xl.extend(Ql),boolean:Jl.extend(Ql)}).transform({transform:i=>i,untransform:i=>i});var Zl=r.enum_(["TOPIC","PII"]);var ql=r.enum_(["passed","failed"]);var em=r.object({id:r.string().optional(),entityId:r.property("entity_id",r.string()),secondaryId:r.property("secondary_id",r.string()),projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),name:Zl,result:ql,config:D,details:D});var Sb=r.object({guardrails:r.list(em)});var rm=r.enum_(["openai","anthropic","gemini","openrouter","vertex-ai","custom-llm"]);var st=r.object({id:r.string().optional(),provider:rm,apiKey:r.property("api_key",r.string().optional()),name:r.string().optional(),providerName:r.property("provider_name",r.string().optional()),headers:r.record(r.string(),r.string()).optional(),configuration:r.record(r.string(),r.string()).optional(),baseUrl:r.property("base_url",r.string().optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var om=r.object({size:r.number().optional(),total:r.number().optional(),content:r.list(st).optional(),sortableBy:r.list(r.string()).optional()});var tm=r.enum_(["openai","anthropic","gemini","openrouter","vertex-ai","custom-llm"]);var _b=r.object({id:r.string().optional(),provider:tm,apiKey:r.property("api_key",r.string().optional()),name:r.string().optional(),providerName:r.property("provider_name",r.string().optional()),headers:r.record(r.string(),r.string()).optional(),configuration:r.record(r.string(),r.string()).optional(),baseUrl:r.property("base_url",r.string().optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var Ya=r.object({entitiesQueued:r.property("entities_queued",r.number().optional()),rulesApplied:r.property("rules_applied",r.number().optional())});var am=r.enum_(["trace","thread"]);var Za=r.object({projectId:r.property("project_id",r.string()),entityIds:r.property("entity_ids",r.list(r.string())),ruleIds:r.property("rule_ids",r.list(r.string())),entityType:r.property("entity_type",am)});var Tb=D;var im=r.enum_(["running","completed","cancelled"]);var Ab=r.object({id:r.string().optional(),name:r.string().optional(),datasetName:r.property("dataset_name",r.string()),objectiveName:r.property("objective_name",r.string()),status:im,metadata:N.optional(),datasetId:r.property("dataset_id",r.string().optional()),numTrials:r.property("num_trials",r.number().optional()),feedbackScores:r.property("feedback_scores",r.list(pe).optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var nm=r.enum_(["running","completed","cancelled"]);var qa=r.object({id:r.string().optional(),name:r.string().optional(),datasetName:r.property("dataset_name",r.string()),objectiveName:r.property("objective_name",r.string()),status:nm,metadata:se.optional(),lastUpdatedAt:r.property("last_updated_at",r.date().optional())});var sm=r.enum_(["running","completed","cancelled"]);var pt=r.object({id:r.string().optional(),name:r.string().optional(),datasetName:r.property("dataset_name",r.string()),objectiveName:r.property("objective_name",r.string()),status:sm,metadata:ce.optional(),datasetId:r.property("dataset_id",r.string().optional()),numTrials:r.property("num_trials",r.number().optional()),feedbackScores:r.property("feedback_scores",r.list(Ve).optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var pm=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(pt).optional(),sortableBy:r.list(r.string()).optional()});var ct=r.object({count:r.number().optional(),deviation:r.number().optional(),deviationPercentage:r.property("deviation_percentage",r.number().optional())});var cm=r.enum_(["private","public"]);var Eb=r.object({id:r.string().optional(),name:r.string(),visibility:cm.optional(),description:r.string().optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),lastUpdatedTraceAt:r.property("last_updated_trace_at",r.date().optional()),feedbackScores:r.property("feedback_scores",r.list(pe).optional()),duration:Ae.optional(),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),totalEstimatedCostSum:r.property("total_estimated_cost_sum",r.number().optional()),usage:r.record(r.string(),r.number()).optional(),traceCount:r.property("trace_count",r.number().optional()),guardrailsFailedCount:r.property("guardrails_failed_count",r.number().optional()),errorCount:r.property("error_count",ct.optional())});var lm=r.enum_(["private","public"]);var lt=r.object({id:r.string().optional(),name:r.string(),visibility:lm.optional(),description:r.string().optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),lastUpdatedTraceAt:r.property("last_updated_trace_at",r.date().optional())});var mm=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(lt).optional(),sortableBy:r.list(r.string()).optional()});var dm=r.object({name:r.string().optional()});var um=r.object({scores:r.list(dm).optional()});var gm=r.object({time:r.date(),value:r.number().optional()});var fm=r.enum_(["FEEDBACK_SCORES","TRACE_COUNT","TOKEN_USAGE","DURATION","COST","GUARDRAILS_FAILED_COUNT","THREAD_COUNT","THREAD_DURATION","THREAD_FEEDBACK_SCORES"]);var hm=r.enum_(["HOURLY","DAILY","WEEKLY"]);var wm=r.object({name:r.string().optional(),data:r.list(gm).optional()});var bm=r.object({projectId:r.property("project_id",r.string().optional()),metricType:r.property("metric_type",fm.optional()),interval:hm.optional(),results:r.list(wm).optional()});var xm=r.object({projectId:r.property("project_id",r.string().optional()),feedbackScores:r.property("feedback_scores",r.list(pe).optional()),duration:Ae.optional(),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),totalEstimatedCostSum:r.property("total_estimated_cost_sum",r.number().optional()),usage:r.record(r.string(),r.number()).optional(),traceCount:r.property("trace_count",r.number().optional()),guardrailsFailedCount:r.property("guardrails_failed_count",r.number().optional()),errorCount:r.property("error_count",ct.optional())});var Rm=r.object({content:r.list(xm).optional()});var ym=r.object({count:r.number().optional(),deviation:r.number().optional(),deviationPercentage:r.property("deviation_percentage",r.number().optional())});var km=r.object({name:r.string(),value:r.number()});var vm=r.object({p50:r.number().optional(),p90:r.number().optional(),p99:r.number().optional()});var zm=r.enum_(["private","public"]);var Sm=r.object({id:r.string().optional(),name:r.string(),visibility:zm.optional(),description:r.string().optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),lastUpdatedTraceAt:r.property("last_updated_trace_at",r.date().optional()),feedbackScores:r.property("feedback_scores",r.list(km).optional()),duration:vm.optional(),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),totalEstimatedCostSum:r.property("total_estimated_cost_sum",r.number().optional()),usage:r.record(r.string(),r.number()).optional(),traceCount:r.property("trace_count",r.number().optional()),guardrailsFailedCount:r.property("guardrails_failed_count",r.number().optional()),errorCount:r.property("error_count",ym.optional())});var Pb=r.object({errors:r.list(r.string()).optional()});var _m=r.enum_(["mustache","jinja2"]);var Tm=r.enum_(["mustache","jinja2"]);var Am=r.object({id:r.string().optional(),promptId:r.property("prompt_id",r.string().optional()),commit:r.string().optional(),template:r.string(),metadata:D.optional(),type:Tm.optional(),changeDescription:r.property("change_description",r.string().optional()),variables:r.list(r.string()).optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional())});var Cb=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional(),template:r.string().optional(),metadata:D.optional(),changeDescription:r.property("change_description",r.string().optional()),type:_m.optional(),tags:r.list(r.string()).optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),versionCount:r.property("version_count",r.number().optional()),latestVersion:r.property("latest_version",Am.optional())});var Ib=r.object({code:r.number().optional(),message:r.string().optional(),details:r.string().optional()});var Em=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional(),tags:r.list(r.string()).optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),versionCount:r.property("version_count",r.number().optional()),latestVersion:r.property("latest_version",ke.optional())});var Pm=r.enum_(["mustache","jinja2"]);var Cm=r.object({id:r.string().optional(),promptId:r.property("prompt_id",r.string().optional()),commit:r.string().optional(),template:r.string(),metadata:Te.optional(),type:Pm.optional(),changeDescription:r.property("change_description",r.string().optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional())});var Im=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(Cm).optional()});var jm=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional(),tags:r.list(r.string()).optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),versionCount:r.property("version_count",r.number().optional())});var Um=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(jm).optional(),sortableBy:r.list(r.string()).optional()});var Nm=r.object({pythonEvaluatorEnabled:r.boolean(),traceThreadPythonEvaluatorEnabled:r.boolean(),guardrailsEnabled:r.boolean(),opikAiEnabled:r.property("opikAIEnabled",r.boolean()),alertsEnabled:r.boolean(),welcomeWizardEnabled:r.boolean(),csvUploadEnabled:r.boolean()});var jb=r.object({spans:r.list(ot)});var mt=r.object({name:r.string(),author:r.string().optional()});var dt=r.object({exceptionType:r.property("exception_type",r.string()),message:r.string().optional(),traceback:r.string()});var Dm=r.enum_(["ui","sdk","online_scoring"]);var Mm=r.enum_(["ui","sdk","online_scoring"]);var Fm=r.object({value:r.number().optional(),reason:r.string().optional(),categoryName:r.property("category_name",r.string().optional()),source:Mm.optional(),lastUpdatedAt:r.property("last_updated_at",r.date().optional())});var ut=r.object({name:r.string(),categoryName:r.property("category_name",r.string().optional()),value:r.number(),reason:r.string().optional(),source:Dm,createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),valueByAuthor:r.property("value_by_author",r.record(r.string(),Fm).optional())});var Om=r.enum_(["general","tool","llm","guardrail"]);var gt=r.object({id:r.string().optional(),projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),traceId:r.property("trace_id",r.string().optional()),parentSpanId:r.property("parent_span_id",r.string().optional()),name:r.string().optional(),type:Om.optional(),startTime:r.property("start_time",r.date()),endTime:r.property("end_time",r.date().optional()),input:ce.optional(),output:ce.optional(),metadata:ce.optional(),model:r.string().optional(),provider:r.string().optional(),tags:r.list(r.string()).optional(),usage:r.record(r.string(),r.number()).optional(),errorInfo:r.property("error_info",dt.optional()),createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),feedbackScores:r.property("feedback_scores",r.list(ut).optional()),comments:r.list(Ke).optional(),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),totalEstimatedCostVersion:r.property("total_estimated_cost_version",r.string().optional()),duration:r.number().optional()});var Wm=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(gt).optional(),sortableBy:r.list(r.string()).optional()});var Bm=r.enum_(["ui","sdk","online_scoring"]);var Lm=r.object({projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),name:r.string(),categoryName:r.property("category_name",r.string().optional()),value:r.number(),reason:r.string().optional(),source:Bm,author:r.string().optional(),id:r.string()});var ft=r.object({scores:r.list(Lm)});var Ub=r.object({traces:r.list(rt)});var Nb=r.object({ids:r.list(r.string()),projectId:r.property("project_id",r.string().optional())});var Vm=r.enum_(["TOPIC","PII"]);var Hm=r.enum_(["passed","failed"]);var Jm=r.object({name:Vm.optional(),result:Hm.optional()});var Km=r.object({spanId:r.property("span_id",r.string().optional()),checks:r.list(Jm).optional()});var Xm=r.enum_(["default","hidden"]);var ht=r.object({id:r.string().optional(),projectId:r.property("project_id",r.string().optional()),name:r.string().optional(),startTime:r.property("start_time",r.date()),endTime:r.property("end_time",r.date().optional()),input:ce.optional(),output:ce.optional(),metadata:ce.optional(),tags:r.list(r.string()).optional(),errorInfo:r.property("error_info",dt.optional()),usage:r.record(r.string(),r.number()).optional(),createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),feedbackScores:r.property("feedback_scores",r.list(ut).optional()),comments:r.list(Ke).optional(),guardrailsValidations:r.property("guardrails_validations",r.list(Km).optional()),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),spanCount:r.property("span_count",r.number().optional()),duration:r.number().optional(),threadId:r.property("thread_id",r.string().optional()),visibilityMode:r.property("visibility_mode",Xm.optional()),llmSpanCount:r.property("llm_span_count",r.number().optional()),providers:r.list(r.string()).optional()});var Gm=r.enum_(["active","inactive"]);var wt=r.object({id:r.string().optional(),projectId:r.property("project_id",r.string().optional()),threadModelId:r.property("thread_model_id",r.string().optional()),startTime:r.property("start_time",r.date().optional()),endTime:r.property("end_time",r.date().optional()),duration:r.number().optional(),firstMessage:r.property("first_message",N.optional()),lastMessage:r.property("last_message",N.optional()),feedbackScores:r.property("feedback_scores",r.list(ee).optional()),status:Gm.optional(),numberOfMessages:r.property("number_of_messages",r.number().optional()),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),usage:r.record(r.string(),r.number()).optional(),comments:r.list(H).optional(),tags:r.list(r.string()).optional(),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),createdBy:r.property("created_by",r.string().optional()),createdAt:r.property("created_at",r.date().optional())});var ei=r.object({projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),threadId:r.property("thread_id",r.string()),truncate:r.boolean().optional()});var $m=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(wt).optional(),sortableBy:r.list(r.string()).optional()});var Qm=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(ht).optional(),sortableBy:r.list(r.string()).optional()});var Ym=r.object({completed:r.boolean().optional()});var Xe=r.object({name:r.string().optional(),current:r.number().optional(),previous:r.number().optional()});var pr=r.object({projectIds:r.property("project_ids",r.list(r.string()).optional()),intervalStart:r.property("interval_start",r.date()),intervalEnd:r.property("interval_end",r.date()),startBeforeEnd:r.property("start_before_end",r.boolean().optional())});var Db=r.object({time:r.date(),value:r.number().optional()});var ri=r.object({results:r.list(Xe).optional()});var Mb=r.object({projectIds:r.property("project_ids",r.list(r.string()).optional()),name:r.string().optional(),intervalStart:r.property("interval_start",r.date()),intervalEnd:r.property("interval_end",r.date()),startBeforeEnd:r.property("start_before_end",r.boolean().optional())});var bt=r.object({timeoutToMarkThreadAsInactive:r.property("timeout_to_mark_thread_as_inactive",r.string().optional()),truncationOnTables:r.property("truncation_on_tables",r.boolean().optional())});var Zm=r.object({results:r.list(Xe).optional()});var oi=class{constructor(t={}){this._options=t;}getDatasetBiInfo(t){return h.fromPromise(this.__getDatasetBiInfo(t))}async __getDatasetBiInfo(t){var o,a;let e=await b({url:x((a=(o=await s.get(this._options.baseUrl))!=null?o:await s.get(this._options.environment))!=null?a:w.Default,"v1/internal/usage/bi-datasets"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...t==null?void 0:t.headers},contentType:"application/json",requestType:"json",timeoutMs:(t==null?void 0:t.timeoutInSeconds)!=null?t.timeoutInSeconds*1e3:6e4,maxRetries:t==null?void 0:t.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal});if(e.ok)return {data:ir.parseOrThrow(e.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:e.rawResponse};if(e.error.reason==="status-code")throw new p({statusCode:e.error.statusCode,body:e.error.body,rawResponse:e.rawResponse});switch(e.error.reason){case "non-json":throw new p({statusCode:e.error.statusCode,body:e.error.rawBody,rawResponse:e.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/internal/usage/bi-datasets.");case "unknown":throw new p({message:e.error.errorMessage,rawResponse:e.rawResponse})}}getExperimentBiInfo(t){return h.fromPromise(this.__getExperimentBiInfo(t))}async __getExperimentBiInfo(t){var o,a;let e=await b({url:x((a=(o=await s.get(this._options.baseUrl))!=null?o:await s.get(this._options.environment))!=null?a:w.Default,"v1/internal/usage/bi-experiments"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...t==null?void 0:t.headers},contentType:"application/json",requestType:"json",timeoutMs:(t==null?void 0:t.timeoutInSeconds)!=null?t.timeoutInSeconds*1e3:6e4,maxRetries:t==null?void 0:t.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal});if(e.ok)return {data:ir.parseOrThrow(e.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:e.rawResponse};if(e.error.reason==="status-code")throw new p({statusCode:e.error.statusCode,body:e.error.body,rawResponse:e.rawResponse});switch(e.error.reason){case "non-json":throw new p({statusCode:e.error.statusCode,body:e.error.rawBody,rawResponse:e.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/internal/usage/bi-experiments.");case "unknown":throw new p({message:e.error.errorMessage,rawResponse:e.rawResponse})}}getSpansBiInfo(t){return h.fromPromise(this.__getSpansBiInfo(t))}async __getSpansBiInfo(t){var o,a;let e=await b({url:x((a=(o=await s.get(this._options.baseUrl))!=null?o:await s.get(this._options.environment))!=null?a:w.Default,"v1/internal/usage/bi-spans"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...t==null?void 0:t.headers},contentType:"application/json",requestType:"json",timeoutMs:(t==null?void 0:t.timeoutInSeconds)!=null?t.timeoutInSeconds*1e3:6e4,maxRetries:t==null?void 0:t.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal});if(e.ok)return {data:ir.parseOrThrow(e.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:e.rawResponse};if(e.error.reason==="status-code")throw new p({statusCode:e.error.statusCode,body:e.error.body,rawResponse:e.rawResponse});switch(e.error.reason){case "non-json":throw new p({statusCode:e.error.statusCode,body:e.error.rawBody,rawResponse:e.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/internal/usage/bi-spans.");case "unknown":throw new p({message:e.error.errorMessage,rawResponse:e.rawResponse})}}getSpansCountForWorkspaces(t){return h.fromPromise(this.__getSpansCountForWorkspaces(t))}async __getSpansCountForWorkspaces(t){var o,a;let e=await b({url:x((a=(o=await s.get(this._options.baseUrl))!=null?o:await s.get(this._options.environment))!=null?a:w.Default,"v1/internal/usage/workspace-span-counts"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...t==null?void 0:t.headers},contentType:"application/json",requestType:"json",timeoutMs:(t==null?void 0:t.timeoutInSeconds)!=null?t.timeoutInSeconds*1e3:6e4,maxRetries:t==null?void 0:t.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal});if(e.ok)return {data:Fs.parseOrThrow(e.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:e.rawResponse};if(e.error.reason==="status-code")throw new p({statusCode:e.error.statusCode,body:e.error.body,rawResponse:e.rawResponse});switch(e.error.reason){case "non-json":throw new p({statusCode:e.error.statusCode,body:e.error.rawBody,rawResponse:e.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/internal/usage/workspace-span-counts.");case "unknown":throw new p({message:e.error.errorMessage,rawResponse:e.rawResponse})}}getTracesBiInfo(t){return h.fromPromise(this.__getTracesBiInfo(t))}async __getTracesBiInfo(t){var o,a;let e=await b({url:x((a=(o=await s.get(this._options.baseUrl))!=null?o:await s.get(this._options.environment))!=null?a:w.Default,"v1/internal/usage/bi-traces"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...t==null?void 0:t.headers},contentType:"application/json",requestType:"json",timeoutMs:(t==null?void 0:t.timeoutInSeconds)!=null?t.timeoutInSeconds*1e3:6e4,maxRetries:t==null?void 0:t.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal});if(e.ok)return {data:ir.parseOrThrow(e.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:e.rawResponse};if(e.error.reason==="status-code")throw new p({statusCode:e.error.statusCode,body:e.error.body,rawResponse:e.rawResponse});switch(e.error.reason){case "non-json":throw new p({statusCode:e.error.statusCode,body:e.error.rawBody,rawResponse:e.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/internal/usage/bi-traces.");case "unknown":throw new p({message:e.error.errorMessage,rawResponse:e.rawResponse})}}getTracesCountForWorkspaces(t){return h.fromPromise(this.__getTracesCountForWorkspaces(t))}async __getTracesCountForWorkspaces(t){var o,a;let e=await b({url:x((a=(o=await s.get(this._options.baseUrl))!=null?o:await s.get(this._options.environment))!=null?a:w.Default,"v1/internal/usage/workspace-trace-counts"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...t==null?void 0:t.headers},contentType:"application/json",requestType:"json",timeoutMs:(t==null?void 0:t.timeoutInSeconds)!=null?t.timeoutInSeconds*1e3:6e4,maxRetries:t==null?void 0:t.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal});if(e.ok)return {data:Ws.parseOrThrow(e.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:e.rawResponse};if(e.error.reason==="status-code")throw new p({statusCode:e.error.statusCode,body:e.error.body,rawResponse:e.rawResponse});switch(e.error.reason){case "non-json":throw new p({statusCode:e.error.statusCode,body:e.error.rawBody,rawResponse:e.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/internal/usage/workspace-trace-counts.");case "unknown":throw new p({message:e.error.errorMessage,rawResponse:e.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var ti=class{constructor(t={}){this._options=t;}findAlerts(t={},e){return h.fromPromise(this.__findAlerts(t,e))}async __findAlerts(t={},e){var g,R;let{page:o,size:a,sorting:n,filters:c}=t,m={};o!=null&&(m.page=o.toString()),a!=null&&(m.size=a.toString()),n!=null&&(m.sorting=n),c!=null&&(m.filters=c);let u=await b({url:x((R=(g=await s.get(this._options.baseUrl))!=null?g:await s.get(this._options.environment))!=null?R:w.Default,"v1/private/alerts"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:m,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(u.ok)return {data:ip.parseOrThrow(u.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:u.rawResponse};if(u.error.reason==="status-code")throw new p({statusCode:u.error.statusCode,body:u.error.body,rawResponse:u.rawResponse});switch(u.error.reason){case "non-json":throw new p({statusCode:u.error.statusCode,body:u.error.rawBody,rawResponse:u.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/alerts.");case "unknown":throw new p({message:u.error.errorMessage,rawResponse:u.rawResponse})}}createAlert(t,e){return h.fromPromise(this.__createAlert(t,e))}async __createAlert(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/alerts"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Eo.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);case 409:throw new W(o.error.body,o.rawResponse);case 422:throw new B(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/alerts.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteAlertBatch(t,e){return h.fromPromise(this.__deleteAlertBatch(t,e))}async __deleteAlertBatch(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/alerts/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:L.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/alerts/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getAlertById(t,e){return h.fromPromise(this.__getAlertById(t,e))}async __getAlertById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/alerts/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:Po.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 404:throw new T(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/alerts/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}updateAlert(t,e,o){return h.fromPromise(this.__updateAlert(t,e,o))}async __updateAlert(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/alerts/${encodeURIComponent(t)}`),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:Eo.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new _(a.error.body,a.rawResponse);case 409:throw new W(a.error.body,a.rawResponse);case 422:throw new B(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/alerts/{id}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}getWebhookExamples(t={},e){return h.fromPromise(this.__getWebhookExamples(t,e))}async __getWebhookExamples(t={},e){var c,m;let{alertType:o}=t,a={};o!=null&&(a.alert_type=ea.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}));let n=await b({url:x((m=(c=await s.get(this._options.baseUrl))!=null?c:await s.get(this._options.environment))!=null?m:w.Default,"v1/private/alerts/webhooks/examples"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:a,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(n.ok)return {data:np.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new p({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});switch(n.error.reason){case "non-json":throw new p({statusCode:n.error.statusCode,body:n.error.rawBody,rawResponse:n.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/alerts/webhooks/examples.");case "unknown":throw new p({message:n.error.errorMessage,rawResponse:n.rawResponse})}}testWebhook(t,e){return h.fromPromise(this.__testWebhook(t,e))}async __testWebhook(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/alerts/webhooks/tests"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Eo.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:pp.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 422:throw new B(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/alerts/webhooks/tests.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var ai=class{constructor(t={}){this._options=t;}addItemsToAnnotationQueue(t,e,o){return h.fromPromise(this.__addItemsToAnnotationQueue(t,e,o))}async __addItemsToAnnotationQueue(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/annotation-queues/${encodeURIComponent(t)}/items/add`),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:Ba.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 404:throw new T(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/annotation-queues/{id}/items/add.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}findAnnotationQueues(t={},e){return h.fromPromise(this.__findAnnotationQueues(t,e))}async __findAnnotationQueues(t={},e){var R,y;let{page:o,size:a,name:n,filters:c,sorting:m}=t,u={};o!=null&&(u.page=o.toString()),a!=null&&(u.size=a.toString()),n!=null&&(u.name=n),c!=null&&(u.filters=c),m!=null&&(u.sorting=m);let g=await b({url:x((y=(R=await s.get(this._options.baseUrl))!=null?R:await s.get(this._options.environment))!=null?y:w.Default,"v1/private/annotation-queues"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:u,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(g.ok)return {data:gp.parseOrThrow(g.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:g.rawResponse};if(g.error.reason==="status-code")throw new p({statusCode:g.error.statusCode,body:g.error.body,rawResponse:g.rawResponse});switch(g.error.reason){case "non-json":throw new p({statusCode:g.error.statusCode,body:g.error.rawBody,rawResponse:g.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/annotation-queues.");case "unknown":throw new p({message:g.error.errorMessage,rawResponse:g.rawResponse})}}createAnnotationQueue(t,e){return h.fromPromise(this.__createAnnotationQueue(t,e))}async __createAnnotationQueue(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/annotation-queues"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Ro.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);case 422:throw new B(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/annotation-queues.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}createAnnotationQueueBatch(t,e){return h.fromPromise(this.__createAnnotationQueueBatch(t,e))}async __createAnnotationQueueBatch(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/annotation-queues/batch"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:yo.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);case 409:throw new W(o.error.body,o.rawResponse);case 422:throw new B(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/annotation-queues/batch.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteAnnotationQueueBatch(t,e){return h.fromPromise(this.__deleteAnnotationQueueBatch(t,e))}async __deleteAnnotationQueueBatch(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/annotation-queues/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:L.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/annotation-queues/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getAnnotationQueueById(t,e){return h.fromPromise(this.__getAnnotationQueueById(t,e))}async __getAnnotationQueueById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/annotation-queues/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:Co.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 404:throw new T(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/annotation-queues/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}updateAnnotationQueue(t,e={},o){return h.fromPromise(this.__updateAnnotationQueue(t,e,o))}async __updateAnnotationQueue(t,e={},o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/annotation-queues/${encodeURIComponent(t)}`),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:ko.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new _(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/annotation-queues/{id}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}removeItemsFromAnnotationQueue(t,e,o){return h.fromPromise(this.__removeItemsFromAnnotationQueue(t,e,o))}async __removeItemsFromAnnotationQueue(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/annotation-queues/${encodeURIComponent(t)}/items/delete`),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:Ba.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 404:throw new T(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/annotation-queues/{id}/items/delete.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var ii=class{constructor(t={}){this._options=t;}attachmentList(t,e){return h.fromPromise(this.__attachmentList(t,e))}async __attachmentList(t,e){var y,v;let{page:o,size:a,projectId:n,entityType:c,entityId:m,path:u}=t,g={};o!=null&&(g.page=o.toString()),a!=null&&(g.size=a.toString()),g.project_id=n,g.entity_type=oa.jsonOrThrow(c,{unrecognizedObjectKeys:"strip"}),g.entity_id=m,g.path=u;let R=await b({url:x((v=(y=await s.get(this._options.baseUrl))!=null?y:await s.get(this._options.environment))!=null?v:w.Default,"v1/private/attachment/list"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:g,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(R.ok)return {data:hp.parseOrThrow(R.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:R.rawResponse};if(R.error.reason==="status-code")switch(R.error.statusCode){case 401:throw new $(R.error.body,R.rawResponse);case 403:throw new Z(ae.parseOrThrow(R.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),R.rawResponse);default:throw new p({statusCode:R.error.statusCode,body:R.error.body,rawResponse:R.rawResponse})}switch(R.error.reason){case "non-json":throw new p({statusCode:R.error.statusCode,body:R.error.rawBody,rawResponse:R.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/attachment/list.");case "unknown":throw new p({message:R.error.errorMessage,rawResponse:R.rawResponse})}}completeMultiPartUpload(t,e){return h.fromPromise(this.__completeMultiPartUpload(t,e))}async __completeMultiPartUpload(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/attachment/upload-complete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:La.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 401:throw new $(o.error.body,o.rawResponse);case 403:throw new Z(ae.parseOrThrow(o.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/attachment/upload-complete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteAttachments(t,e){return h.fromPromise(this.__deleteAttachments(t,e))}async __deleteAttachments(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/attachment/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:La.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 401:throw new $(o.error.body,o.rawResponse);case 403:throw new Z(ae.parseOrThrow(o.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/attachment/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}downloadAttachment(t,e){return h.fromPromise(this.__downloadAttachment(t,e))}async __downloadAttachment(t,e){var y,v;let{workspaceName:o,containerId:a,entityType:n,entityId:c,fileName:m,mimeType:u}=t,g={};o!=null&&(g.workspace_name=o),g.container_id=a,g.entity_type=ta.jsonOrThrow(n,{unrecognizedObjectKeys:"strip"}),g.entity_id=c,g.file_name=m,g.mime_type=u;let R=await b({url:x((v=(y=await s.get(this._options.baseUrl))!=null?y:await s.get(this._options.environment))!=null?v:w.Default,"v1/private/attachment/download"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:g,requestType:"json",responseType:"streaming",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(R.ok)return {data:R.body,rawResponse:R.rawResponse};if(R.error.reason==="status-code")switch(R.error.statusCode){case 401:throw new $(R.error.body,R.rawResponse);case 403:throw new Z(ae.parseOrThrow(R.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),R.rawResponse);default:throw new p({statusCode:R.error.statusCode,body:R.error.body,rawResponse:R.rawResponse})}switch(R.error.reason){case "non-json":throw new p({statusCode:R.error.statusCode,body:R.error.rawBody,rawResponse:R.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/attachment/download.");case "unknown":throw new p({message:R.error.errorMessage,rawResponse:R.rawResponse})}}startMultiPartUpload(t,e){return h.fromPromise(this.__startMultiPartUpload(t,e))}async __startMultiPartUpload(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/attachment/upload-start"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:kr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:Rp.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 401:throw new $(o.error.body,o.rawResponse);case 403:throw new Z(ae.parseOrThrow(o.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/attachment/upload-start.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}uploadAttachment(t,e){return h.fromPromise(this.__uploadAttachment(t,e))}async __uploadAttachment(t,e){var y,v;let{fileName:o,projectName:a,mimeType:n,entityType:c,entityId:m,body:u}=t,g={};g.file_name=o,a!=null&&(g.project_name=a),n!=null&&(g.mime_type=n),g.entity_type=ia.jsonOrThrow(c,{unrecognizedObjectKeys:"strip"}),g.entity_id=m;let R=await b({url:x((v=(y=await s.get(this._options.baseUrl))!=null?y:await s.get(this._options.environment))!=null?v:w.Default,"v1/private/attachment/upload"),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:g,requestType:"json",body:or.uploadAttachment.Request.jsonOrThrow(u,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(R.ok)return {data:void 0,rawResponse:R.rawResponse};if(R.error.reason==="status-code")switch(R.error.statusCode){case 401:throw new $(R.error.body,R.rawResponse);case 403:throw new Z(ae.parseOrThrow(R.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),R.rawResponse);default:throw new p({statusCode:R.error.statusCode,body:R.error.body,rawResponse:R.rawResponse})}switch(R.error.reason){case "non-json":throw new p({statusCode:R.error.statusCode,body:R.error.rawBody,rawResponse:R.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/attachment/upload.");case "unknown":throw new p({message:R.error.errorMessage,rawResponse:R.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var ni=class{constructor(t={}){this._options=t;}access(t,e){return h.fromPromise(this.__access(t,e))}async __access(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/auth"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:yp.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 401:throw new $(o.error.body,o.rawResponse);case 403:throw new Z(ae.parseOrThrow(o.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/auth.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getWorkspaceName(t){return h.fromPromise(this.__getWorkspaceName(t))}async __getWorkspaceName(t){var o,a;let e=await b({url:x((a=(o=await s.get(this._options.baseUrl))!=null?o:await s.get(this._options.environment))!=null?a:w.Default,"v1/private/auth/workspace"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...t==null?void 0:t.headers},contentType:"application/json",requestType:"json",timeoutMs:(t==null?void 0:t.timeoutInSeconds)!=null?t.timeoutInSeconds*1e3:6e4,maxRetries:t==null?void 0:t.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal});if(e.ok)return {data:kp.parseOrThrow(e.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:e.rawResponse};if(e.error.reason==="status-code")switch(e.error.statusCode){case 401:throw new $(e.error.body,e.rawResponse);case 403:throw new Z(ae.parseOrThrow(e.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),e.rawResponse);default:throw new p({statusCode:e.error.statusCode,body:e.error.body,rawResponse:e.rawResponse})}switch(e.error.reason){case "non-json":throw new p({statusCode:e.error.statusCode,body:e.error.rawBody,rawResponse:e.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/auth/workspace.");case "unknown":throw new p({message:e.error.errorMessage,rawResponse:e.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var si=class{constructor(t={}){this._options=t;}findEvaluators(t={},e){return h.fromPromise(this.__findEvaluators(t,e))}async __findEvaluators(t={},e){var v,z;let{projectId:o,id:a,name:n,filters:c,sorting:m,page:u,size:g}=t,R={};o!=null&&(R.project_id=o),a!=null&&(R.id=a),n!=null&&(R.name=n),c!=null&&(R.filters=c),m!=null&&(R.sorting=m),u!=null&&(R.page=u.toString()),g!=null&&(R.size=g.toString());let y=await b({url:x((z=(v=await s.get(this._options.baseUrl))!=null?v:await s.get(this._options.environment))!=null?z:w.Default,"v1/private/automations/evaluators"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:R,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(y.ok)return {data:ic.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")throw new p({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse});switch(y.error.reason){case "non-json":throw new p({statusCode:y.error.statusCode,body:y.error.rawBody,rawResponse:y.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/automations/evaluators.");case "unknown":throw new p({message:y.error.errorMessage,rawResponse:y.rawResponse})}}createAutomationRuleEvaluator(t,e){return h.fromPromise(this.__createAutomationRuleEvaluator(t,e))}async __createAutomationRuleEvaluator(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/automations/evaluators"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Gp.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/automations/evaluators.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteAutomationRuleEvaluatorBatch(t,e){return h.fromPromise(this.__deleteAutomationRuleEvaluatorBatch(t,e))}async __deleteAutomationRuleEvaluatorBatch(t,e){var m,u;let{projectId:o,body:a}=t,n={};o!=null&&(n.project_id=o);let c=await b({url:x((u=(m=await s.get(this._options.baseUrl))!=null?m:await s.get(this._options.environment))!=null?u:w.Default,"v1/private/automations/evaluators/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:n,requestType:"json",body:L.jsonOrThrow(a,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(c.ok)return {data:void 0,rawResponse:c.rawResponse};if(c.error.reason==="status-code")throw new p({statusCode:c.error.statusCode,body:c.error.body,rawResponse:c.rawResponse});switch(c.error.reason){case "non-json":throw new p({statusCode:c.error.statusCode,body:c.error.rawBody,rawResponse:c.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/automations/evaluators/delete.");case "unknown":throw new p({message:c.error.errorMessage,rawResponse:c.rawResponse})}}getEvaluatorById(t,e={},o){return h.fromPromise(this.__getEvaluatorById(t,e,o))}async __getEvaluatorById(t,e={},o){var m,u;let{projectId:a}=e,n={};a!=null&&(n.project_id=a);let c=await b({url:x((u=(m=await s.get(this._options.baseUrl))!=null?m:await s.get(this._options.environment))!=null?u:w.Default,`v1/private/automations/evaluators/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",queryParameters:n,requestType:"json",timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(c.ok)return {data:nc.parseOrThrow(c.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:c.rawResponse};if(c.error.reason==="status-code")throw new p({statusCode:c.error.statusCode,body:c.error.body,rawResponse:c.rawResponse});switch(c.error.reason){case "non-json":throw new p({statusCode:c.error.statusCode,body:c.error.rawBody,rawResponse:c.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/automations/evaluators/{id}.");case "unknown":throw new p({message:c.error.errorMessage,rawResponse:c.rawResponse})}}updateAutomationRuleEvaluator(t,e,o){return h.fromPromise(this.__updateAutomationRuleEvaluator(t,e,o))}async __updateAutomationRuleEvaluator(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/automations/evaluators/${encodeURIComponent(t)}`),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:gc.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/automations/evaluators/{id}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}getEvaluatorLogsById(t,e={},o){return h.fromPromise(this.__getEvaluatorLogsById(t,e,o))}async __getEvaluatorLogsById(t,e={},o){var m,u;let{size:a}=e,n={};a!=null&&(n.size=a.toString());let c=await b({url:x((u=(m=await s.get(this._options.baseUrl))!=null?m:await s.get(this._options.environment))!=null?u:w.Default,`v1/private/automations/evaluators/${encodeURIComponent(t)}/logs`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",queryParameters:n,requestType:"json",timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(c.ok)return {data:cc.parseOrThrow(c.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:c.rawResponse};if(c.error.reason==="status-code")throw new p({statusCode:c.error.statusCode,body:c.error.body,rawResponse:c.rawResponse});switch(c.error.reason){case "non-json":throw new p({statusCode:c.error.statusCode,body:c.error.rawBody,rawResponse:c.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/automations/evaluators/{id}/logs.");case "unknown":throw new p({message:c.error.errorMessage,rawResponse:c.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var pi=class{constructor(t={}){this._options=t;}createChatCompletions(t={},e){return h.fromPromise(this.__createChatCompletions(t,e))}async __createChatCompletions(t={},e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/chat/completions"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:zo.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:kc.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/chat/completions.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var ci=class{constructor(t={}){this._options=t;}findDashboards(t={},e){return h.fromPromise(this.__findDashboards(t,e))}async __findDashboards(t={},e){var u,g;let{page:o,size:a,name:n}=t,c={};o!=null&&(c.page=o.toString()),a!=null&&(c.size=a.toString()),n!=null&&(c.name=n);let m=await b({url:x((g=(u=await s.get(this._options.baseUrl))!=null?u:await s.get(this._options.environment))!=null?g:w.Default,"v1/private/dashboards"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:c,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(m.ok)return {data:vc.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")throw new p({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse});switch(m.error.reason){case "non-json":throw new p({statusCode:m.error.statusCode,body:m.error.rawBody,rawResponse:m.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/dashboards.");case "unknown":throw new p({message:m.error.errorMessage,rawResponse:m.rawResponse})}}createDashboard(t,e){return h.fromPromise(this.__createDashboard(t,e))}async __createDashboard(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/dashboards"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:So.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:He.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/dashboards.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getDashboardById(t,e){return h.fromPromise(this.__getDashboardById(t,e))}async __getDashboardById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/dashboards/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:He.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 404:throw new T(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/dashboards/{dashboardId}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteDashboard(t,e){return h.fromPromise(this.__deleteDashboard(t,e))}async __deleteDashboard(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/dashboards/${encodeURIComponent(t)}`),method:"DELETE",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling DELETE /v1/private/dashboards/{dashboardId}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}updateDashboard(t,e={},o){return h.fromPromise(this.__updateDashboard(t,e,o))}async __updateDashboard(t,e={},o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/dashboards/${encodeURIComponent(t)}`),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:_o.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:He.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 404:throw new T(a.error.body,a.rawResponse);case 409:throw new W(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/dashboards/{dashboardId}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var li=class{constructor(t={}){this._options=t;}batchUpdateDatasetItems(t,e){return h.fromPromise(this.__batchUpdateDatasetItems(t,e))}async __batchUpdateDatasetItems(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/datasets/items/batch"),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:vr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/datasets/items/batch.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}findDatasets(t={},e){return h.fromPromise(this.__findDatasets(t,e))}async __findDatasets(t={},e){var z,S;let{page:o,size:a,withExperimentsOnly:n,withOptimizationsOnly:c,promptId:m,name:u,sorting:g,filters:R}=t,y={};o!=null&&(y.page=o.toString()),a!=null&&(y.size=a.toString()),n!=null&&(y.with_experiments_only=n.toString()),c!=null&&(y.with_optimizations_only=c.toString()),m!=null&&(y.prompt_id=m),u!=null&&(y.name=u),g!=null&&(y.sorting=g),R!=null&&(y.filters=R);let v=await b({url:x((S=(z=await s.get(this._options.baseUrl))!=null?z:await s.get(this._options.environment))!=null?S:w.Default,"v1/private/datasets"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:y,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(v.ok)return {data:Wc.parseOrThrow(v.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:v.rawResponse};if(v.error.reason==="status-code")throw new p({statusCode:v.error.statusCode,body:v.error.body,rawResponse:v.rawResponse});switch(v.error.reason){case "non-json":throw new p({statusCode:v.error.statusCode,body:v.error.rawBody,rawResponse:v.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/datasets.");case "unknown":throw new p({message:v.error.errorMessage,rawResponse:v.rawResponse})}}createDataset(t,e){return h.fromPromise(this.__createDataset(t,e))}async __createDataset(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/datasets"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:zr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/datasets.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}createOrUpdateDatasetItems(t,e){return h.fromPromise(this.__createOrUpdateDatasetItems(t,e))}async __createOrUpdateDatasetItems(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/datasets/items"),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:_r.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/datasets/items.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}createDatasetItemsFromCsv(t,e){return h.fromPromise(this.__createDatasetItemsFromCsv(t,e))}async __createDatasetItemsFromCsv(t,e){var c,m;let o=await Xu();o.append("file",Pe(t.file)),o.append("dataset_id",t.datasetId);let a=await o.getRequest(),n=await b({url:x((m=(c=await s.get(this._options.baseUrl))!=null?c:await s.get(this._options.environment))!=null?m:w.Default,"v1/private/datasets/items/from-csv"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...a.headers,...e==null?void 0:e.headers},requestType:"file",duplex:a.duplex,body:a.body,timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")switch(n.error.statusCode){case 400:throw new _(n.error.body,n.rawResponse);case 404:throw new T(n.error.body,n.rawResponse);default:throw new p({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse})}switch(n.error.reason){case "non-json":throw new p({statusCode:n.error.statusCode,body:n.error.rawBody,rawResponse:n.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/datasets/items/from-csv.");case "unknown":throw new p({message:n.error.errorMessage,rawResponse:n.rawResponse})}}createDatasetItemsFromSpans(t,e,o){return h.fromPromise(this.__createDatasetItemsFromSpans(t,e,o))}async __createDatasetItemsFromSpans(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/datasets/${encodeURIComponent(t)}/items/from-spans`),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:Tr.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/datasets/{dataset_id}/items/from-spans.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}createDatasetItemsFromTraces(t,e,o){return h.fromPromise(this.__createDatasetItemsFromTraces(t,e,o))}async __createDatasetItemsFromTraces(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/datasets/${encodeURIComponent(t)}/items/from-traces`),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:Ar.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/datasets/{dataset_id}/items/from-traces.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}getDatasetById(t,e){return h.fromPromise(this.__getDatasetById(t,e))}async __getDatasetById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/datasets/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:nr.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/datasets/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}updateDataset(t,e,o){return h.fromPromise(this.__updateDataset(t,e,o))}async __updateDataset(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/datasets/${encodeURIComponent(t)}`),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:Er.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/datasets/{id}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}deleteDataset(t,e){return h.fromPromise(this.__deleteDataset(t,e))}async __deleteDataset(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/datasets/${encodeURIComponent(t)}`),method:"DELETE",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling DELETE /v1/private/datasets/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteDatasetByName(t,e){return h.fromPromise(this.__deleteDatasetByName(t,e))}async __deleteDatasetByName(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/datasets/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Pr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/datasets/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteDatasetItems(t,e){return h.fromPromise(this.__deleteDatasetItems(t,e))}async __deleteDatasetItems(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/datasets/items/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Cr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/datasets/items/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteDatasetsBatch(t,e){return h.fromPromise(this.__deleteDatasetsBatch(t,e))}async __deleteDatasetsBatch(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/datasets/delete-batch"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:L.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/datasets/delete-batch.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}expandDataset(t,e,o){return h.fromPromise(this.__expandDataset(t,e,o))}async __expandDataset(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/datasets/${encodeURIComponent(t)}/expansions`),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:Ir.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:_c.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/datasets/{id}/expansions.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}findDatasetItemsWithExperimentItems(t,e,o){return h.fromPromise(this.__findDatasetItemsWithExperimentItems(t,e,o))}async __findDatasetItemsWithExperimentItems(t,e,o){var z,S;let{page:a,size:n,experimentIds:c,filters:m,sorting:u,search:g,truncate:R}=e,y={};a!=null&&(y.page=a.toString()),n!=null&&(y.size=n.toString()),y.experiment_ids=c,m!=null&&(y.filters=m),u!=null&&(y.sorting=u),g!=null&&(y.search=g),R!=null&&(y.truncate=R.toString());let v=await b({url:x((S=(z=await s.get(this._options.baseUrl))!=null?z:await s.get(this._options.environment))!=null?S:w.Default,`v1/private/datasets/${encodeURIComponent(t)}/items/experiments/items`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",queryParameters:y,requestType:"json",timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(v.ok)return {data:Fc.parseOrThrow(v.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:v.rawResponse};if(v.error.reason==="status-code")throw new p({statusCode:v.error.statusCode,body:v.error.body,rawResponse:v.rawResponse});switch(v.error.reason){case "non-json":throw new p({statusCode:v.error.statusCode,body:v.error.rawBody,rawResponse:v.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/datasets/{id}/items/experiments/items.");case "unknown":throw new p({message:v.error.errorMessage,rawResponse:v.rawResponse})}}getDatasetByIdentifier(t,e){return h.fromPromise(this.__getDatasetByIdentifier(t,e))}async __getDatasetByIdentifier(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/datasets/retrieve"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:jr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:nr.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/datasets/retrieve.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getDatasetExperimentItemsStats(t,e,o){return h.fromPromise(this.__getDatasetExperimentItemsStats(t,e,o))}async __getDatasetExperimentItemsStats(t,e,o){var u,g;let{experimentIds:a,filters:n}=e,c={};c.experiment_ids=a,n!=null&&(c.filters=n);let m=await b({url:x((g=(u=await s.get(this._options.baseUrl))!=null?u:await s.get(this._options.environment))!=null?g:w.Default,`v1/private/datasets/${encodeURIComponent(t)}/items/experiments/items/stats`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",queryParameters:c,requestType:"json",timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(m.ok)return {data:Je.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")throw new p({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse});switch(m.error.reason){case "non-json":throw new p({statusCode:m.error.statusCode,body:m.error.rawBody,rawResponse:m.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/datasets/{id}/items/experiments/items/stats.");case "unknown":throw new p({message:m.error.errorMessage,rawResponse:m.rawResponse})}}getDatasetItemById(t,e){return h.fromPromise(this.__getDatasetItemById(t,e))}async __getDatasetItemById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/datasets/items/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:et.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/datasets/items/{itemId}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}patchDatasetItem(t,e,o){return h.fromPromise(this.__patchDatasetItem(t,e,o))}async __patchDatasetItem(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/datasets/items/${encodeURIComponent(t)}`),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:Sr.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 404:throw new T(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/datasets/items/{itemId}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}getDatasetItems(t,e={},o){return h.fromPromise(this.__getDatasetItems(t,e,o))}async __getDatasetItems(t,e={},o){var R,y;let{page:a,size:n,filters:c,truncate:m}=e,u={};a!=null&&(u.page=a.toString()),n!=null&&(u.size=n.toString()),c!=null&&(u.filters=c),m!=null&&(u.truncate=m.toString());let g=await b({url:x((y=(R=await s.get(this._options.baseUrl))!=null?R:await s.get(this._options.environment))!=null?y:w.Default,`v1/private/datasets/${encodeURIComponent(t)}/items`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",queryParameters:u,requestType:"json",timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(g.ok)return {data:Qc.parseOrThrow(g.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:g.rawResponse};if(g.error.reason==="status-code")throw new p({statusCode:g.error.statusCode,body:g.error.body,rawResponse:g.rawResponse});switch(g.error.reason){case "non-json":throw new p({statusCode:g.error.statusCode,body:g.error.rawBody,rawResponse:g.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/datasets/{id}/items.");case "unknown":throw new p({message:g.error.errorMessage,rawResponse:g.rawResponse})}}getDatasetItemsOutputColumns(t,e={},o){return h.fromPromise(this.__getDatasetItemsOutputColumns(t,e,o))}async __getDatasetItemsOutputColumns(t,e={},o){var m,u;let{experimentIds:a}=e,n={};a!=null&&(n.experiment_ids=a);let c=await b({url:x((u=(m=await s.get(this._options.baseUrl))!=null?m:await s.get(this._options.environment))!=null?u:w.Default,`v1/private/datasets/${encodeURIComponent(t)}/items/experiments/items/output/columns`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",queryParameters:n,requestType:"json",timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(c.ok)return {data:qc.parseOrThrow(c.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:c.rawResponse};if(c.error.reason==="status-code")throw new p({statusCode:c.error.statusCode,body:c.error.body,rawResponse:c.rawResponse});switch(c.error.reason){case "non-json":throw new p({statusCode:c.error.statusCode,body:c.error.rawBody,rawResponse:c.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/datasets/{id}/items/experiments/items/output/columns.");case "unknown":throw new p({message:c.error.errorMessage,rawResponse:c.rawResponse})}}streamDatasetItems(t,e){return h.fromPromise(this.__streamDatasetItems(t,e))}async __streamDatasetItems(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/datasets/items/stream"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Ur.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),responseType:"streaming",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:o.body,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/datasets/items/stream.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var mi=class{constructor(t={}){this._options=t;}findExperiments(t={},e){return h.fromPromise(this.__findExperiments(t,e))}async __findExperiments(t={},e){var F,M;let{page:o,size:a,datasetId:n,optimizationId:c,types:m,name:u,datasetDeleted:g,promptId:R,sorting:y,filters:v}=t,z={};o!=null&&(z.page=o.toString()),a!=null&&(z.size=a.toString()),n!=null&&(z.datasetId=n),c!=null&&(z.optimization_id=c),m!=null&&(z.types=m),u!=null&&(z.name=u),g!=null&&(z.dataset_deleted=g.toString()),R!=null&&(z.prompt_id=R),y!=null&&(z.sorting=y),v!=null&&(z.filters=v);let S=await b({url:x((M=(F=await s.get(this._options.baseUrl))!=null?F:await s.get(this._options.environment))!=null?M:w.Default,"v1/private/experiments"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:z,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(S.ok)return {data:dl.parseOrThrow(S.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:S.rawResponse};if(S.error.reason==="status-code")switch(S.error.statusCode){case 400:throw new _(S.error.body,S.rawResponse);default:throw new p({statusCode:S.error.statusCode,body:S.error.body,rawResponse:S.rawResponse})}switch(S.error.reason){case "non-json":throw new p({statusCode:S.error.statusCode,body:S.error.rawBody,rawResponse:S.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/experiments.");case "unknown":throw new p({message:S.error.errorMessage,rawResponse:S.rawResponse})}}createExperiment(t,e){return h.fromPromise(this.__createExperiment(t,e))}async __createExperiment(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/experiments"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Nr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/experiments.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}createExperimentItems(t,e){return h.fromPromise(this.__createExperimentItems(t,e))}async __createExperimentItems(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/experiments/items"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Mr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/experiments/items.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteExperimentItems(t,e){return h.fromPromise(this.__deleteExperimentItems(t,e))}async __deleteExperimentItems(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/experiments/items/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Fr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/experiments/items/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteExperimentsById(t,e){return h.fromPromise(this.__deleteExperimentsById(t,e))}async __deleteExperimentsById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/experiments/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:sr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/experiments/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}experimentItemsBulk(t,e){return h.fromPromise(this.__experimentItemsBulk(t,e))}async __experimentItemsBulk(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/experiments/items/bulk"),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Wr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);case 409:throw new W(o.error.body,o.rawResponse);case 422:throw new B(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/experiments/items/bulk.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}findFeedbackScoreNames(t={},e){return h.fromPromise(this.__findFeedbackScoreNames(t,e))}async __findFeedbackScoreNames(t={},e){var c,m;let{experimentIds:o}=t,a={};o!=null&&(a.experiment_ids=o);let n=await b({url:x((m=(c=await s.get(this._options.baseUrl))!=null?c:await s.get(this._options.environment))!=null?m:w.Default,"v1/private/experiments/feedback-scores/names"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:a,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(n.ok)return {data:tr.findFeedbackScoreNames.Response.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new p({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});switch(n.error.reason){case "non-json":throw new p({statusCode:n.error.statusCode,body:n.error.rawBody,rawResponse:n.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/experiments/feedback-scores/names.");case "unknown":throw new p({message:n.error.errorMessage,rawResponse:n.rawResponse})}}findExperimentGroups(t={},e){return h.fromPromise(this.__findExperimentGroups(t,e))}async __findExperimentGroups(t={},e){var g,R;let{groups:o,types:a,name:n,filters:c}=t,m={};o!=null&&(m.groups=o),a!=null&&(m.types=a),n!=null&&(m.name=n),c!=null&&(m.filters=c);let u=await b({url:x((R=(g=await s.get(this._options.baseUrl))!=null?g:await s.get(this._options.environment))!=null?R:w.Default,"v1/private/experiments/groups"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:m,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(u.ok)return {data:hl.parseOrThrow(u.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:u.rawResponse};if(u.error.reason==="status-code")switch(u.error.statusCode){case 400:throw new _(u.error.body,u.rawResponse);default:throw new p({statusCode:u.error.statusCode,body:u.error.body,rawResponse:u.rawResponse})}switch(u.error.reason){case "non-json":throw new p({statusCode:u.error.statusCode,body:u.error.rawBody,rawResponse:u.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/experiments/groups.");case "unknown":throw new p({message:u.error.errorMessage,rawResponse:u.rawResponse})}}findExperimentGroupsAggregations(t={},e){return h.fromPromise(this.__findExperimentGroupsAggregations(t,e))}async __findExperimentGroupsAggregations(t={},e){var g,R;let{groups:o,types:a,name:n,filters:c}=t,m={};o!=null&&(m.groups=o),a!=null&&(m.types=a),n!=null&&(m.name=n),c!=null&&(m.filters=c);let u=await b({url:x((R=(g=await s.get(this._options.baseUrl))!=null?g:await s.get(this._options.environment))!=null?R:w.Default,"v1/private/experiments/groups/aggregations"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:m,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(u.ok)return {data:xl.parseOrThrow(u.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:u.rawResponse};if(u.error.reason==="status-code")switch(u.error.statusCode){case 400:throw new _(u.error.body,u.rawResponse);default:throw new p({statusCode:u.error.statusCode,body:u.error.body,rawResponse:u.rawResponse})}switch(u.error.reason){case "non-json":throw new p({statusCode:u.error.statusCode,body:u.error.rawBody,rawResponse:u.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/experiments/groups/aggregations.");case "unknown":throw new p({message:u.error.errorMessage,rawResponse:u.rawResponse})}}finishExperiments(t,e){return h.fromPromise(this.__finishExperiments(t,e))}async __finishExperiments(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/experiments/finish"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:sr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/experiments/finish.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getExperimentById(t,e){return h.fromPromise(this.__getExperimentById(t,e))}async __getExperimentById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/experiments/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:tt.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 404:throw new T(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/experiments/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}updateExperiment(t,e={},o){return h.fromPromise(this.__updateExperiment(t,e,o))}async __updateExperiment(t,e={},o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/experiments/${encodeURIComponent(t)}`),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:Br.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new _(a.error.body,a.rawResponse);case 404:throw new T(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/experiments/{id}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}getExperimentItemById(t,e){return h.fromPromise(this.__getExperimentItemById(t,e))}async __getExperimentItemById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/experiments/items/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:qo.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 404:throw new T(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/experiments/items/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}streamExperimentItems(t,e){return h.fromPromise(this.__streamExperimentItems(t,e))}async __streamExperimentItems(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/experiments/items/stream"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Lr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),responseType:"streaming",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:o.body,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/experiments/items/stream.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}streamExperiments(t,e){return h.fromPromise(this.__streamExperiments(t,e))}async __streamExperiments(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/experiments/stream"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Vr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),responseType:"streaming",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:o.body,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/experiments/stream.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var di=class{constructor(t={}){this._options=t;}findFeedbackDefinitions(t={},e){return h.fromPromise(this.__findFeedbackDefinitions(t,e))}async __findFeedbackDefinitions(t={},e){var g,R;let{page:o,size:a,name:n,type:c}=t,m={};o!=null&&(m.page=o.toString()),a!=null&&(m.size=a.toString()),n!=null&&(m.name=n),c!=null&&(m.type=ha.jsonOrThrow(c,{unrecognizedObjectKeys:"strip"}));let u=await b({url:x((R=(g=await s.get(this._options.baseUrl))!=null?g:await s.get(this._options.environment))!=null?R:w.Default,"v1/private/feedback-definitions"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:m,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(u.ok)return {data:Bl.parseOrThrow(u.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:u.rawResponse};if(u.error.reason==="status-code")throw new p({statusCode:u.error.statusCode,body:u.error.body,rawResponse:u.rawResponse});switch(u.error.reason){case "non-json":throw new p({statusCode:u.error.statusCode,body:u.error.rawBody,rawResponse:u.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/feedback-definitions.");case "unknown":throw new p({message:u.error.errorMessage,rawResponse:u.rawResponse})}}createFeedbackDefinition(t,e){return h.fromPromise(this.__createFeedbackDefinition(t,e))}async __createFeedbackDefinition(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/feedback-definitions"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Nl.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/feedback-definitions.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getFeedbackDefinitionById(t,e){return h.fromPromise(this.__getFeedbackDefinitionById(t,e))}async __getFeedbackDefinitionById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/feedback-definitions/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:Vl.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/feedback-definitions/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}updateFeedbackDefinition(t,e,o){return h.fromPromise(this.__updateFeedbackDefinition(t,e,o))}async __updateFeedbackDefinition(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/feedback-definitions/${encodeURIComponent(t)}`),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:Yl.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/feedback-definitions/{id}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}deleteFeedbackDefinitionById(t,e){return h.fromPromise(this.__deleteFeedbackDefinitionById(t,e))}async __deleteFeedbackDefinitionById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/feedback-definitions/${encodeURIComponent(t)}`),method:"DELETE",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 409:throw new W(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling DELETE /v1/private/feedback-definitions/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteFeedbackDefinitionsBatch(t,e){return h.fromPromise(this.__deleteFeedbackDefinitionsBatch(t,e))}async __deleteFeedbackDefinitionsBatch(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/feedback-definitions/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:L.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 409:throw new W(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/feedback-definitions/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var ui=class{constructor(t={}){this._options=t;}createGuardrails(t,e){return h.fromPromise(this.__createGuardrails(t,e))}async __createGuardrails(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/guardrails"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:To.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/guardrails.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var gi=class{constructor(t={}){this._options=t;}deleteLlmProviderApiKeysBatch(t,e){return h.fromPromise(this.__deleteLlmProviderApiKeysBatch(t,e))}async __deleteLlmProviderApiKeysBatch(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/llm-provider-key/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:L.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/llm-provider-key/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}findLlmProviderKeys(t){return h.fromPromise(this.__findLlmProviderKeys(t))}async __findLlmProviderKeys(t){var o,a;let e=await b({url:x((a=(o=await s.get(this._options.baseUrl))!=null?o:await s.get(this._options.environment))!=null?a:w.Default,"v1/private/llm-provider-key"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...t==null?void 0:t.headers},contentType:"application/json",requestType:"json",timeoutMs:(t==null?void 0:t.timeoutInSeconds)!=null?t.timeoutInSeconds*1e3:6e4,maxRetries:t==null?void 0:t.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal});if(e.ok)return {data:om.parseOrThrow(e.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:e.rawResponse};if(e.error.reason==="status-code")throw new p({statusCode:e.error.statusCode,body:e.error.body,rawResponse:e.rawResponse});switch(e.error.reason){case "non-json":throw new p({statusCode:e.error.statusCode,body:e.error.rawBody,rawResponse:e.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/llm-provider-key.");case "unknown":throw new p({message:e.error.errorMessage,rawResponse:e.rawResponse})}}storeLlmProviderApiKey(t,e){return h.fromPromise(this.__storeLlmProviderApiKey(t,e))}async __storeLlmProviderApiKey(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/llm-provider-key"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Hr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 401:throw new $(o.error.body,o.rawResponse);case 403:throw new Z(ae.parseOrThrow(o.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/llm-provider-key.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getLlmProviderApiKeyById(t,e){return h.fromPromise(this.__getLlmProviderApiKeyById(t,e))}async __getLlmProviderApiKeyById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/llm-provider-key/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:st.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 404:throw new T(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/llm-provider-key/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}updateLlmProviderApiKey(t,e={},o){return h.fromPromise(this.__updateLlmProviderApiKey(t,e,o))}async __updateLlmProviderApiKey(t,e={},o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/llm-provider-key/${encodeURIComponent(t)}`),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:Jr.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 401:throw new $(a.error.body,a.rawResponse);case 403:throw new Z(ae.parseOrThrow(a.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),a.rawResponse);case 404:throw new T(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/llm-provider-key/{id}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var fi=class{constructor(t={}){this._options=t;}evaluateThreads(t,e){return h.fromPromise(this.__evaluateThreads(t,e))}async __evaluateThreads(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/manual-evaluation/threads"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Za.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:Ya.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);case 404:throw new T(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/manual-evaluation/threads.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}evaluateTraces(t,e){return h.fromPromise(this.__evaluateTraces(t,e))}async __evaluateTraces(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/manual-evaluation/traces"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Za.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:Ya.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);case 404:throw new T(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/manual-evaluation/traces.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var hi=class{constructor(t={}){this._options=t;}receiveProtobufTraces(t){return h.fromPromise(this.__receiveProtobufTraces(t))}async __receiveProtobufTraces(t){var o,a;let e=await b({url:x((a=(o=await s.get(this._options.baseUrl))!=null?o:await s.get(this._options.environment))!=null?a:w.Default,"v1/private/otel/v1/traces"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...t==null?void 0:t.headers},contentType:"application/json",requestType:"json",timeoutMs:(t==null?void 0:t.timeoutInSeconds)!=null?t.timeoutInSeconds*1e3:6e4,maxRetries:t==null?void 0:t.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal});if(e.ok)return {data:e.body,rawResponse:e.rawResponse};if(e.error.reason==="status-code")throw new p({statusCode:e.error.statusCode,body:e.error.body,rawResponse:e.rawResponse});switch(e.error.reason){case "non-json":throw new p({statusCode:e.error.statusCode,body:e.error.rawBody,rawResponse:e.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/otel/v1/traces.");case "unknown":throw new p({message:e.error.errorMessage,rawResponse:e.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var wi=class{constructor(t={}){this._options=t;}findOptimizations(t={},e){return h.fromPromise(this.__findOptimizations(t,e))}async __findOptimizations(t={},e){var R,y;let{page:o,size:a,datasetId:n,name:c,datasetDeleted:m}=t,u={};o!=null&&(u.page=o.toString()),a!=null&&(u.size=a.toString()),n!=null&&(u.dataset_id=n),c!=null&&(u.name=c),m!=null&&(u.dataset_deleted=m.toString());let g=await b({url:x((y=(R=await s.get(this._options.baseUrl))!=null?R:await s.get(this._options.environment))!=null?y:w.Default,"v1/private/optimizations"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:u,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(g.ok)return {data:pm.parseOrThrow(g.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:g.rawResponse};if(g.error.reason==="status-code")switch(g.error.statusCode){case 400:throw new _(g.error.body,g.rawResponse);default:throw new p({statusCode:g.error.statusCode,body:g.error.body,rawResponse:g.rawResponse})}switch(g.error.reason){case "non-json":throw new p({statusCode:g.error.statusCode,body:g.error.rawBody,rawResponse:g.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/optimizations.");case "unknown":throw new p({message:g.error.errorMessage,rawResponse:g.rawResponse})}}createOptimization(t,e){return h.fromPromise(this.__createOptimization(t,e))}async __createOptimization(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/optimizations"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:qa.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/optimizations.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}upsertOptimization(t,e){return h.fromPromise(this.__upsertOptimization(t,e))}async __upsertOptimization(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/optimizations"),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:qa.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/optimizations.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteOptimizationsById(t,e){return h.fromPromise(this.__deleteOptimizationsById(t,e))}async __deleteOptimizationsById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/optimizations/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:sr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/optimizations/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getOptimizationById(t,e){return h.fromPromise(this.__getOptimizationById(t,e))}async __getOptimizationById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/optimizations/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:pt.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 404:throw new T(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/optimizations/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}updateOptimizationsById(t,e={},o){return h.fromPromise(this.__updateOptimizationsById(t,e,o))}async __updateOptimizationsById(t,e={},o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/optimizations/${encodeURIComponent(t)}`),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:Kr.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/optimizations/{id}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var bi=class{constructor(t={}){this._options=t;}findProjects(t={},e){return h.fromPromise(this.__findProjects(t,e))}async __findProjects(t={},e){var g,R;let{page:o,size:a,name:n,sorting:c}=t,m={};o!=null&&(m.page=o.toString()),a!=null&&(m.size=a.toString()),n!=null&&(m.name=n),c!=null&&(m.sorting=c);let u=await b({url:x((R=(g=await s.get(this._options.baseUrl))!=null?g:await s.get(this._options.environment))!=null?R:w.Default,"v1/private/projects"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:m,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(u.ok)return {data:mm.parseOrThrow(u.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:u.rawResponse};if(u.error.reason==="status-code")throw new p({statusCode:u.error.statusCode,body:u.error.body,rawResponse:u.rawResponse});switch(u.error.reason){case "non-json":throw new p({statusCode:u.error.statusCode,body:u.error.rawBody,rawResponse:u.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/projects.");case "unknown":throw new p({message:u.error.errorMessage,rawResponse:u.rawResponse})}}createProject(t,e){return h.fromPromise(this.__createProject(t,e))}async __createProject(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/projects"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Xr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);case 422:throw new B(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/projects.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getProjectById(t,e){return h.fromPromise(this.__getProjectById(t,e))}async __getProjectById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/projects/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:lt.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/projects/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteProjectById(t,e){return h.fromPromise(this.__deleteProjectById(t,e))}async __deleteProjectById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/projects/${encodeURIComponent(t)}`),method:"DELETE",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 409:throw new W(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling DELETE /v1/private/projects/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}updateProject(t,e={},o){return h.fromPromise(this.__updateProject(t,e,o))}async __updateProject(t,e={},o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/projects/${encodeURIComponent(t)}`),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:Gr.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new _(a.error.body,a.rawResponse);case 422:throw new B(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/projects/{id}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}deleteProjectsBatch(t,e){return h.fromPromise(this.__deleteProjectsBatch(t,e))}async __deleteProjectsBatch(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/projects/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:L.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/projects/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}findFeedbackScoreNamesByProjectIds(t={},e){return h.fromPromise(this.__findFeedbackScoreNamesByProjectIds(t,e))}async __findFeedbackScoreNamesByProjectIds(t={},e){var c,m;let{projectIds:o}=t,a={};o!=null&&(a.project_ids=o);let n=await b({url:x((m=(c=await s.get(this._options.baseUrl))!=null?c:await s.get(this._options.environment))!=null?m:w.Default,"v1/private/projects/feedback-scores/names"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:a,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(n.ok)return {data:um.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new p({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});switch(n.error.reason){case "non-json":throw new p({statusCode:n.error.statusCode,body:n.error.rawBody,rawResponse:n.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/projects/feedback-scores/names.");case "unknown":throw new p({message:n.error.errorMessage,rawResponse:n.rawResponse})}}getProjectMetrics(t,e={},o){return h.fromPromise(this.__getProjectMetrics(t,e,o))}async __getProjectMetrics(t,e={},o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/projects/${encodeURIComponent(t)}/metrics`),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:$r.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:bm.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new _(a.error.body,a.rawResponse);case 404:throw new T(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/projects/{id}/metrics.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}getProjectStats(t={},e){return h.fromPromise(this.__getProjectStats(t,e))}async __getProjectStats(t={},e){var g,R;let{page:o,size:a,name:n,sorting:c}=t,m={};o!=null&&(m.page=o.toString()),a!=null&&(m.size=a.toString()),n!=null&&(m.name=n),c!=null&&(m.sorting=c);let u=await b({url:x((R=(g=await s.get(this._options.baseUrl))!=null?g:await s.get(this._options.environment))!=null?R:w.Default,"v1/private/projects/stats"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:m,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(u.ok)return {data:Rm.parseOrThrow(u.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:u.rawResponse};if(u.error.reason==="status-code")throw new p({statusCode:u.error.statusCode,body:u.error.body,rawResponse:u.rawResponse});switch(u.error.reason){case "non-json":throw new p({statusCode:u.error.statusCode,body:u.error.rawBody,rawResponse:u.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/projects/stats.");case "unknown":throw new p({message:u.error.errorMessage,rawResponse:u.rawResponse})}}retrieveProject(t,e){return h.fromPromise(this.__retrieveProject(t,e))}async __retrieveProject(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/projects/retrieve"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Qr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:Sm.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);case 404:throw new T(o.error.body,o.rawResponse);case 422:throw new B(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/projects/retrieve.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var xi=class{constructor(t={}){this._options=t;}getPrompts(t={},e){return h.fromPromise(this.__getPrompts(t,e))}async __getPrompts(t={},e){var R,y;let{page:o,size:a,name:n,sorting:c,filters:m}=t,u={};o!=null&&(u.page=o.toString()),a!=null&&(u.size=a.toString()),n!=null&&(u.name=n),c!=null&&(u.sorting=c),m!=null&&(u.filters=m);let g=await b({url:x((y=(R=await s.get(this._options.baseUrl))!=null?R:await s.get(this._options.environment))!=null?y:w.Default,"v1/private/prompts"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:u,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(g.ok)return {data:Um.parseOrThrow(g.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:g.rawResponse};if(g.error.reason==="status-code")throw new p({statusCode:g.error.statusCode,body:g.error.body,rawResponse:g.rawResponse});switch(g.error.reason){case "non-json":throw new p({statusCode:g.error.statusCode,body:g.error.rawBody,rawResponse:g.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/prompts.");case "unknown":throw new p({message:g.error.errorMessage,rawResponse:g.rawResponse})}}createPrompt(t,e){return h.fromPromise(this.__createPrompt(t,e))}async __createPrompt(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/prompts"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Yr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);case 409:throw new W(o.error.body,o.rawResponse);case 422:throw new B(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/prompts.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}createPromptVersion(t,e){return h.fromPromise(this.__createPromptVersion(t,e))}async __createPromptVersion(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/prompts/versions"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Zr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:ke.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);case 409:throw new W(o.error.body,o.rawResponse);case 422:throw new B(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/prompts/versions.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getPromptById(t,e){return h.fromPromise(this.__getPromptById(t,e))}async __getPromptById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/prompts/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:Em.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 404:throw new T(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/prompts/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}updatePrompt(t,e,o){return h.fromPromise(this.__updatePrompt(t,e,o))}async __updatePrompt(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/prompts/${encodeURIComponent(t)}`),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:qr.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new _(a.error.body,a.rawResponse);case 404:throw new T(a.error.body,a.rawResponse);case 409:throw new W(a.error.body,a.rawResponse);case 422:throw new B(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/prompts/{id}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}deletePrompt(t,e){return h.fromPromise(this.__deletePrompt(t,e))}async __deletePrompt(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/prompts/${encodeURIComponent(t)}`),method:"DELETE",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling DELETE /v1/private/prompts/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deletePromptsBatch(t,e){return h.fromPromise(this.__deletePromptsBatch(t,e))}async __deletePromptsBatch(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/prompts/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:L.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/prompts/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getPromptVersionById(t,e){return h.fromPromise(this.__getPromptVersionById(t,e))}async __getPromptVersionById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/prompts/versions/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:ke.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 404:throw new T(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/prompts/versions/{versionId}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getPromptVersions(t,e={},o){return h.fromPromise(this.__getPromptVersions(t,e,o))}async __getPromptVersions(t,e={},o){var u,g;let{page:a,size:n}=e,c={};a!=null&&(c.page=a.toString()),n!=null&&(c.size=n.toString());let m=await b({url:x((g=(u=await s.get(this._options.baseUrl))!=null?u:await s.get(this._options.environment))!=null?g:w.Default,`v1/private/prompts/${encodeURIComponent(t)}/versions`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",queryParameters:c,requestType:"json",timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(m.ok)return {data:Im.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")throw new p({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse});switch(m.error.reason){case "non-json":throw new p({statusCode:m.error.statusCode,body:m.error.rawBody,rawResponse:m.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/prompts/{id}/versions.");case "unknown":throw new p({message:m.error.errorMessage,rawResponse:m.rawResponse})}}restorePromptVersion(t,e,o){return h.fromPromise(this.__restorePromptVersion(t,e,o))}async __restorePromptVersion(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/prompts/${encodeURIComponent(t)}/versions/${encodeURIComponent(e)}/restore`),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:ke.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new _(a.error.body,a.rawResponse);case 404:throw new T(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/prompts/{promptId}/versions/{versionId}/restore.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}retrievePromptVersion(t,e){return h.fromPromise(this.__retrievePromptVersion(t,e))}async __retrievePromptVersion(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/prompts/versions/retrieve"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:eo.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:ke.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);case 404:throw new T(o.error.body,o.rawResponse);case 422:throw new B(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/prompts/versions/retrieve.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var Ri=class{constructor(t={}){this._options=t;}getServiceToggles(t){return h.fromPromise(this.__getServiceToggles(t))}async __getServiceToggles(t){var o,a;let e=await b({url:x((a=(o=await s.get(this._options.baseUrl))!=null?o:await s.get(this._options.environment))!=null?a:w.Default,"v1/private/toggles"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...t==null?void 0:t.headers},contentType:"application/json",requestType:"json",timeoutMs:(t==null?void 0:t.timeoutInSeconds)!=null?t.timeoutInSeconds*1e3:6e4,maxRetries:t==null?void 0:t.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal});if(e.ok)return {data:Nm.parseOrThrow(e.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:e.rawResponse};if(e.error.reason==="status-code")throw new p({statusCode:e.error.statusCode,body:e.error.body,rawResponse:e.rawResponse});switch(e.error.reason){case "non-json":throw new p({statusCode:e.error.statusCode,body:e.error.rawBody,rawResponse:e.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/toggles.");case "unknown":throw new p({message:e.error.errorMessage,rawResponse:e.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var yi=class{constructor(t={}){this._options=t;}addSpanComment(t,e,o){return h.fromPromise(this.__addSpanComment(t,e,o))}async __addSpanComment(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/spans/${encodeURIComponent(t)}/comments`),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:H.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/spans/{id}/comments.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}addSpanFeedbackScore(t,e,o){return h.fromPromise(this.__addSpanFeedbackScore(t,e,o))}async __addSpanFeedbackScore(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/spans/${encodeURIComponent(t)}/feedback-scores`),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:ee.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/spans/{id}/feedback-scores.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}createSpans(t,e){return h.fromPromise(this.__createSpans(t,e))}async __createSpans(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/spans/batch"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:to.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/spans/batch.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}batchUpdateSpans(t,e){return h.fromPromise(this.__batchUpdateSpans(t,e))}async __batchUpdateSpans(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/spans/batch"),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:io.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/spans/batch.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getSpansByProject(t={},e){return h.fromPromise(this.__getSpansByProject(t,e))}async __getSpansByProject(t={},e){var oe,Ye;let{page:o,size:a,projectName:n,projectId:c,traceId:m,type:u,filters:g,truncate:R,stripAttachments:y,sorting:v,exclude:z,fromTime:S,toTime:F}=t,M={};o!=null&&(M.page=o.toString()),a!=null&&(M.size=a.toString()),n!=null&&(M.project_name=n),c!=null&&(M.project_id=c),m!=null&&(M.trace_id=m),u!=null&&(M.type=Ea.jsonOrThrow(u,{unrecognizedObjectKeys:"strip"})),g!=null&&(M.filters=g),R!=null&&(M.truncate=R.toString()),y!=null&&(M.strip_attachments=y.toString()),v!=null&&(M.sorting=v),z!=null&&(M.exclude=z),S!=null&&(M.from_time=S.toISOString()),F!=null&&(M.to_time=F.toISOString());let G=await b({url:x((Ye=(oe=await s.get(this._options.baseUrl))!=null?oe:await s.get(this._options.environment))!=null?Ye:w.Default,"v1/private/spans"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:M,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(G.ok)return {data:Wm.parseOrThrow(G.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:G.rawResponse};if(G.error.reason==="status-code")throw new p({statusCode:G.error.statusCode,body:G.error.body,rawResponse:G.rawResponse});switch(G.error.reason){case "non-json":throw new p({statusCode:G.error.statusCode,body:G.error.rawBody,rawResponse:G.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/spans.");case "unknown":throw new p({message:G.error.errorMessage,rawResponse:G.rawResponse})}}createSpan(t,e){return h.fromPromise(this.__createSpan(t,e))}async __createSpan(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/spans"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:oo.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 409:throw new W(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/spans.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getSpanById(t,e={},o){return h.fromPromise(this.__getSpanById(t,e,o))}async __getSpanById(t,e={},o){var m,u;let{stripAttachments:a}=e,n={};a!=null&&(n.strip_attachments=a.toString());let c=await b({url:x((u=(m=await s.get(this._options.baseUrl))!=null?m:await s.get(this._options.environment))!=null?u:w.Default,`v1/private/spans/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",queryParameters:n,requestType:"json",timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(c.ok)return {data:gt.parseOrThrow(c.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:c.rawResponse};if(c.error.reason==="status-code")switch(c.error.statusCode){case 404:throw new T(c.error.body,c.rawResponse);default:throw new p({statusCode:c.error.statusCode,body:c.error.body,rawResponse:c.rawResponse})}switch(c.error.reason){case "non-json":throw new p({statusCode:c.error.statusCode,body:c.error.rawBody,rawResponse:c.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/spans/{id}.");case "unknown":throw new p({message:c.error.errorMessage,rawResponse:c.rawResponse})}}deleteSpanById(t,e){return h.fromPromise(this.__deleteSpanById(t,e))}async __deleteSpanById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/spans/${encodeURIComponent(t)}`),method:"DELETE",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 501:throw new wr(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling DELETE /v1/private/spans/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}updateSpan(t,e,o){return h.fromPromise(this.__updateSpan(t,e,o))}async __updateSpan(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/spans/${encodeURIComponent(t)}`),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:ao.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 404:throw new T(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/spans/{id}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}deleteSpanComments(t,e){return h.fromPromise(this.__deleteSpanComments(t,e))}async __deleteSpanComments(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/spans/comments/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:L.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/spans/comments/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteSpanFeedbackScore(t,e,o){return h.fromPromise(this.__deleteSpanFeedbackScore(t,e,o))}async __deleteSpanFeedbackScore(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/spans/${encodeURIComponent(t)}/feedback-scores/delete`),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:mt.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/spans/{id}/feedback-scores/delete.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}findFeedbackScoreNames1(t={},e){return h.fromPromise(this.__findFeedbackScoreNames1(t,e))}async __findFeedbackScoreNames1(t={},e){var m,u;let{projectId:o,type:a}=t,n={};o!=null&&(n.project_id=o),a!=null&&(n.type=Pa.jsonOrThrow(a,{unrecognizedObjectKeys:"strip"}));let c=await b({url:x((u=(m=await s.get(this._options.baseUrl))!=null?m:await s.get(this._options.environment))!=null?u:w.Default,"v1/private/spans/feedback-scores/names"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:n,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(c.ok)return {data:ar.findFeedbackScoreNames1.Response.parseOrThrow(c.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:c.rawResponse};if(c.error.reason==="status-code")throw new p({statusCode:c.error.statusCode,body:c.error.body,rawResponse:c.rawResponse});switch(c.error.reason){case "non-json":throw new p({statusCode:c.error.statusCode,body:c.error.rawBody,rawResponse:c.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/spans/feedback-scores/names.");case "unknown":throw new p({message:c.error.errorMessage,rawResponse:c.rawResponse})}}getSpanComment(t,e,o){return h.fromPromise(this.__getSpanComment(t,e,o))}async __getSpanComment(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/spans/${encodeURIComponent(e)}/comments/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:H.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 404:throw new T(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/spans/{spanId}/comments/{commentId}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}getSpanStats(t={},e){return h.fromPromise(this.__getSpanStats(t,e))}async __getSpanStats(t={},e){var v,z;let{projectId:o,projectName:a,traceId:n,type:c,filters:m,fromTime:u,toTime:g}=t,R={};o!=null&&(R.project_id=o),a!=null&&(R.project_name=a),n!=null&&(R.trace_id=n),c!=null&&(R.type=Ca.jsonOrThrow(c,{unrecognizedObjectKeys:"strip"})),m!=null&&(R.filters=m),u!=null&&(R.from_time=u.toISOString()),g!=null&&(R.to_time=g.toISOString());let y=await b({url:x((z=(v=await s.get(this._options.baseUrl))!=null?v:await s.get(this._options.environment))!=null?z:w.Default,"v1/private/spans/stats"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:R,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(y.ok)return {data:Je.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")throw new p({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse});switch(y.error.reason){case "non-json":throw new p({statusCode:y.error.statusCode,body:y.error.rawBody,rawResponse:y.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/spans/stats.");case "unknown":throw new p({message:y.error.errorMessage,rawResponse:y.rawResponse})}}scoreBatchOfSpans(t,e){return h.fromPromise(this.__scoreBatchOfSpans(t,e))}async __scoreBatchOfSpans(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/spans/feedback-scores"),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:ft.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/spans/feedback-scores.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}searchSpans(t={},e){return h.fromPromise(this.__searchSpans(t,e))}async __searchSpans(t={},e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/spans/search"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:no.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),responseType:"streaming",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:o.body,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/spans/search.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}updateSpanComment(t,e,o){return h.fromPromise(this.__updateSpanComment(t,e,o))}async __updateSpanComment(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/spans/comments/${encodeURIComponent(t)}`),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:H.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 404:throw new T(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/spans/comments/{commentId}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var ki=class{constructor(t={}){this._options=t;}addThreadComment(t,e,o){return h.fromPromise(this.__addThreadComment(t,e,o))}async __addThreadComment(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/traces/threads/${encodeURIComponent(t)}/comments`),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:H.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/traces/threads/{id}/comments.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}addTraceComment(t,e,o){return h.fromPromise(this.__addTraceComment(t,e,o))}async __addTraceComment(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/traces/${encodeURIComponent(t)}/comments`),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:H.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/traces/{id}/comments.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}addTraceFeedbackScore(t,e,o){return h.fromPromise(this.__addTraceFeedbackScore(t,e,o))}async __addTraceFeedbackScore(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/traces/${encodeURIComponent(t)}/feedback-scores`),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:ee.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/traces/{id}/feedback-scores.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}createTraces(t,e){return h.fromPromise(this.__createTraces(t,e))}async __createTraces(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces/batch"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:po.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/traces/batch.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}batchUpdateTraces(t,e){return h.fromPromise(this.__batchUpdateTraces(t,e))}async __batchUpdateTraces(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces/batch"),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:lo.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/traces/batch.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}batchUpdateThreads(t,e){return h.fromPromise(this.__batchUpdateThreads(t,e))}async __batchUpdateThreads(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces/threads/batch"),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:uo.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/traces/threads/batch.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}closeTraceThread(t={},e){return h.fromPromise(this.__closeTraceThread(t,e))}async __closeTraceThread(t={},e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces/threads/close"),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:go.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 404:throw new T(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/traces/threads/close.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getTracesByProject(t={},e){return h.fromPromise(this.__getTracesByProject(t,e))}async __getTracesByProject(t={},e){var M,G;let{page:o,size:a,projectName:n,projectId:c,filters:m,truncate:u,stripAttachments:g,sorting:R,exclude:y,fromTime:v,toTime:z}=t,S={};o!=null&&(S.page=o.toString()),a!=null&&(S.size=a.toString()),n!=null&&(S.project_name=n),c!=null&&(S.project_id=c),m!=null&&(S.filters=m),u!=null&&(S.truncate=u.toString()),g!=null&&(S.strip_attachments=g.toString()),R!=null&&(S.sorting=R),y!=null&&(S.exclude=y),v!=null&&(S.from_time=v.toISOString()),z!=null&&(S.to_time=z.toISOString());let F=await b({url:x((G=(M=await s.get(this._options.baseUrl))!=null?M:await s.get(this._options.environment))!=null?G:w.Default,"v1/private/traces"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:S,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(F.ok)return {data:Qm.parseOrThrow(F.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:F.rawResponse};if(F.error.reason==="status-code")throw new p({statusCode:F.error.statusCode,body:F.error.body,rawResponse:F.rawResponse});switch(F.error.reason){case "non-json":throw new p({statusCode:F.error.statusCode,body:F.error.rawBody,rawResponse:F.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/traces.");case "unknown":throw new p({message:F.error.errorMessage,rawResponse:F.rawResponse})}}createTrace(t,e){return h.fromPromise(this.__createTrace(t,e))}async __createTrace(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:so.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/traces.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getTraceById(t,e={},o){return h.fromPromise(this.__getTraceById(t,e,o))}async __getTraceById(t,e={},o){var m,u;let{stripAttachments:a}=e,n={};a!=null&&(n.strip_attachments=a.toString());let c=await b({url:x((u=(m=await s.get(this._options.baseUrl))!=null?m:await s.get(this._options.environment))!=null?u:w.Default,`v1/private/traces/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",queryParameters:n,requestType:"json",timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(c.ok)return {data:ht.parseOrThrow(c.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:c.rawResponse};if(c.error.reason==="status-code")throw new p({statusCode:c.error.statusCode,body:c.error.body,rawResponse:c.rawResponse});switch(c.error.reason){case "non-json":throw new p({statusCode:c.error.statusCode,body:c.error.rawBody,rawResponse:c.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/traces/{id}.");case "unknown":throw new p({message:c.error.errorMessage,rawResponse:c.rawResponse})}}deleteTraceById(t,e){return h.fromPromise(this.__deleteTraceById(t,e))}async __deleteTraceById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/traces/${encodeURIComponent(t)}`),method:"DELETE",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling DELETE /v1/private/traces/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}updateTrace(t,e,o){return h.fromPromise(this.__updateTrace(t,e,o))}async __updateTrace(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/traces/${encodeURIComponent(t)}`),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:co.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/traces/{id}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}deleteThreadComments(t,e){return h.fromPromise(this.__deleteThreadComments(t,e))}async __deleteThreadComments(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces/threads/comments/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:L.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/traces/threads/comments/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteThreadFeedbackScores(t,e){return h.fromPromise(this.__deleteThreadFeedbackScores(t,e))}async __deleteThreadFeedbackScores(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces/threads/feedback-scores/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:fo.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/traces/threads/feedback-scores/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteTraceComments(t,e){return h.fromPromise(this.__deleteTraceComments(t,e))}async __deleteTraceComments(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces/comments/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:L.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/traces/comments/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteTraceFeedbackScore(t,e,o){return h.fromPromise(this.__deleteTraceFeedbackScore(t,e,o))}async __deleteTraceFeedbackScore(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/traces/${encodeURIComponent(t)}/feedback-scores/delete`),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:mt.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/traces/{id}/feedback-scores/delete.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}deleteTraceThreads(t,e){return h.fromPromise(this.__deleteTraceThreads(t,e))}async __deleteTraceThreads(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces/threads/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:ho.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/traces/threads/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteTraces(t,e){return h.fromPromise(this.__deleteTraces(t,e))}async __deleteTraces(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:L.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/traces/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}findFeedbackScoreNames2(t={},e){return h.fromPromise(this.__findFeedbackScoreNames2(t,e))}async __findFeedbackScoreNames2(t={},e){var c,m;let{projectId:o}=t,a={};o!=null&&(a.project_id=o);let n=await b({url:x((m=(c=await s.get(this._options.baseUrl))!=null?c:await s.get(this._options.environment))!=null?m:w.Default,"v1/private/traces/feedback-scores/names"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:a,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(n.ok)return {data:Le.findFeedbackScoreNames2.Response.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new p({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});switch(n.error.reason){case "non-json":throw new p({statusCode:n.error.statusCode,body:n.error.rawBody,rawResponse:n.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/traces/feedback-scores/names.");case "unknown":throw new p({message:n.error.errorMessage,rawResponse:n.rawResponse})}}findTraceThreadsFeedbackScoreNames(t={},e){return h.fromPromise(this.__findTraceThreadsFeedbackScoreNames(t,e))}async __findTraceThreadsFeedbackScoreNames(t={},e){var c,m;let{projectId:o}=t,a={};o!=null&&(a.project_id=o);let n=await b({url:x((m=(c=await s.get(this._options.baseUrl))!=null?c:await s.get(this._options.environment))!=null?m:w.Default,"v1/private/traces/threads/feedback-scores/names"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:a,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(n.ok)return {data:Le.findTraceThreadsFeedbackScoreNames.Response.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new p({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});switch(n.error.reason){case "non-json":throw new p({statusCode:n.error.statusCode,body:n.error.rawBody,rawResponse:n.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/traces/threads/feedback-scores/names.");case "unknown":throw new p({message:n.error.errorMessage,rawResponse:n.rawResponse})}}getTraceStats(t={},e){return h.fromPromise(this.__getTraceStats(t,e))}async __getTraceStats(t={},e){var R,y;let{projectId:o,projectName:a,filters:n,fromTime:c,toTime:m}=t,u={};o!=null&&(u.project_id=o),a!=null&&(u.project_name=a),n!=null&&(u.filters=n),c!=null&&(u.from_time=c.toISOString()),m!=null&&(u.to_time=m.toISOString());let g=await b({url:x((y=(R=await s.get(this._options.baseUrl))!=null?R:await s.get(this._options.environment))!=null?y:w.Default,"v1/private/traces/stats"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:u,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(g.ok)return {data:Je.parseOrThrow(g.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:g.rawResponse};if(g.error.reason==="status-code")throw new p({statusCode:g.error.statusCode,body:g.error.body,rawResponse:g.rawResponse});switch(g.error.reason){case "non-json":throw new p({statusCode:g.error.statusCode,body:g.error.rawBody,rawResponse:g.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/traces/stats.");case "unknown":throw new p({message:g.error.errorMessage,rawResponse:g.rawResponse})}}getThreadComment(t,e,o){return h.fromPromise(this.__getThreadComment(t,e,o))}async __getThreadComment(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/traces/threads/${encodeURIComponent(e)}/comments/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:H.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 404:throw new T(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/traces/threads/{threadId}/comments/{commentId}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}getTraceComment(t,e,o){return h.fromPromise(this.__getTraceComment(t,e,o))}async __getTraceComment(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/traces/${encodeURIComponent(e)}/comments/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:H.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 404:throw new T(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/traces/{traceId}/comments/{commentId}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}getTraceThread(t,e){return h.fromPromise(this.__getTraceThread(t,e))}async __getTraceThread(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces/threads/retrieve"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:ei.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:wt.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 404:throw new T(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/traces/threads/retrieve.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getTraceThreads(t={},e){return h.fromPromise(this.__getTraceThreads(t,e))}async __getTraceThreads(t={},e){var F,M;let{page:o,size:a,projectName:n,projectId:c,truncate:m,stripAttachments:u,filters:g,sorting:R,fromTime:y,toTime:v}=t,z={};o!=null&&(z.page=o.toString()),a!=null&&(z.size=a.toString()),n!=null&&(z.project_name=n),c!=null&&(z.project_id=c),m!=null&&(z.truncate=m.toString()),u!=null&&(z.strip_attachments=u.toString()),g!=null&&(z.filters=g),R!=null&&(z.sorting=R),y!=null&&(z.from_time=y.toISOString()),v!=null&&(z.to_time=v.toISOString());let S=await b({url:x((M=(F=await s.get(this._options.baseUrl))!=null?F:await s.get(this._options.environment))!=null?M:w.Default,"v1/private/traces/threads"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:z,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(S.ok)return {data:$m.parseOrThrow(S.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:S.rawResponse};if(S.error.reason==="status-code")throw new p({statusCode:S.error.statusCode,body:S.error.body,rawResponse:S.rawResponse});switch(S.error.reason){case "non-json":throw new p({statusCode:S.error.statusCode,body:S.error.rawBody,rawResponse:S.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/traces/threads.");case "unknown":throw new p({message:S.error.errorMessage,rawResponse:S.rawResponse})}}openTraceThread(t,e){return h.fromPromise(this.__openTraceThread(t,e))}async __openTraceThread(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces/threads/open"),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:ei.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/traces/threads/open.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}scoreBatchOfThreads(t,e){return h.fromPromise(this.__scoreBatchOfThreads(t,e))}async __scoreBatchOfThreads(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces/threads/feedback-scores"),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:wo.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/traces/threads/feedback-scores.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}scoreBatchOfTraces(t,e){return h.fromPromise(this.__scoreBatchOfTraces(t,e))}async __scoreBatchOfTraces(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces/feedback-scores"),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:ft.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/traces/feedback-scores.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}searchTraceThreads(t={},e){return h.fromPromise(this.__searchTraceThreads(t,e))}async __searchTraceThreads(t={},e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces/threads/search"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:bo.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),responseType:"streaming",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:o.body,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/traces/threads/search.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}searchTraces(t={},e){return h.fromPromise(this.__searchTraces(t,e))}async __searchTraces(t={},e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces/search"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:xo.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),responseType:"streaming",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:o.body,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);case 401:throw new $(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/traces/search.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}updateThread(t,e,o){return h.fromPromise(this.__updateThread(t,e,o))}async __updateThread(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/traces/threads/${encodeURIComponent(t)}`),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:mo.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 404:throw new T(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/traces/threads/{threadModelId}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}updateThreadComment(t,e,o){return h.fromPromise(this.__updateThreadComment(t,e,o))}async __updateThreadComment(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/traces/threads/comments/${encodeURIComponent(t)}`),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:H.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 404:throw new T(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/traces/threads/comments/{commentId}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}updateTraceComment(t,e,o){return h.fromPromise(this.__updateTraceComment(t,e,o))}async __updateTraceComment(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/traces/comments/${encodeURIComponent(t)}`),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:H.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 404:throw new T(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/traces/comments/{commentId}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var vi=class{constructor(t={}){this._options=t;}getWelcomeWizardStatus(t){return h.fromPromise(this.__getWelcomeWizardStatus(t))}async __getWelcomeWizardStatus(t){var o,a;let e=await b({url:x((a=(o=await s.get(this._options.baseUrl))!=null?o:await s.get(this._options.environment))!=null?a:w.Default,"v1/private/welcome-wizard"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...t==null?void 0:t.headers},contentType:"application/json",requestType:"json",timeoutMs:(t==null?void 0:t.timeoutInSeconds)!=null?t.timeoutInSeconds*1e3:6e4,maxRetries:t==null?void 0:t.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal});if(e.ok)return {data:Ym.parseOrThrow(e.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:e.rawResponse};if(e.error.reason==="status-code")throw new p({statusCode:e.error.statusCode,body:e.error.body,rawResponse:e.rawResponse});switch(e.error.reason){case "non-json":throw new p({statusCode:e.error.statusCode,body:e.error.rawBody,rawResponse:e.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/welcome-wizard.");case "unknown":throw new p({message:e.error.errorMessage,rawResponse:e.rawResponse})}}submitWelcomeWizard(t={},e){return h.fromPromise(this.__submitWelcomeWizard(t,e))}async __submitWelcomeWizard(t={},e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/welcome-wizard"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Ao.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/welcome-wizard.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var zi=class{constructor(t={}){this._options=t;}costsSummary(t,e){return h.fromPromise(this.__costsSummary(t,e))}async __costsSummary(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/workspaces/costs/summaries"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:pr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:Xe.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/workspaces/costs/summaries.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getWorkspaceConfiguration(t){return h.fromPromise(this.__getWorkspaceConfiguration(t))}async __getWorkspaceConfiguration(t){var o,a;let e=await b({url:x((a=(o=await s.get(this._options.baseUrl))!=null?o:await s.get(this._options.environment))!=null?a:w.Default,"v1/private/workspaces/configurations"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...t==null?void 0:t.headers},contentType:"application/json",requestType:"json",timeoutMs:(t==null?void 0:t.timeoutInSeconds)!=null?t.timeoutInSeconds*1e3:6e4,maxRetries:t==null?void 0:t.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal});if(e.ok)return {data:bt.parseOrThrow(e.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:e.rawResponse};if(e.error.reason==="status-code")switch(e.error.statusCode){case 404:throw new T(e.error.body,e.rawResponse);default:throw new p({statusCode:e.error.statusCode,body:e.error.body,rawResponse:e.rawResponse})}switch(e.error.reason){case "non-json":throw new p({statusCode:e.error.statusCode,body:e.error.rawBody,rawResponse:e.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/workspaces/configurations.");case "unknown":throw new p({message:e.error.errorMessage,rawResponse:e.rawResponse})}}upsertWorkspaceConfiguration(t,e){return h.fromPromise(this.__upsertWorkspaceConfiguration(t,e))}async __upsertWorkspaceConfiguration(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/workspaces/configurations"),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:bt.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:bt.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);case 422:throw new B(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/workspaces/configurations.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteWorkspaceConfiguration(t){return h.fromPromise(this.__deleteWorkspaceConfiguration(t))}async __deleteWorkspaceConfiguration(t){var o,a;let e=await b({url:x((a=(o=await s.get(this._options.baseUrl))!=null?o:await s.get(this._options.environment))!=null?a:w.Default,"v1/private/workspaces/configurations"),method:"DELETE",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...t==null?void 0:t.headers},contentType:"application/json",requestType:"json",timeoutMs:(t==null?void 0:t.timeoutInSeconds)!=null?t.timeoutInSeconds*1e3:6e4,maxRetries:t==null?void 0:t.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal});if(e.ok)return {data:void 0,rawResponse:e.rawResponse};if(e.error.reason==="status-code")switch(e.error.statusCode){case 404:throw new T(e.error.body,e.rawResponse);default:throw new p({statusCode:e.error.statusCode,body:e.error.body,rawResponse:e.rawResponse})}switch(e.error.reason){case "non-json":throw new p({statusCode:e.error.statusCode,body:e.error.rawBody,rawResponse:e.rawResponse});case "timeout":throw new f("Timeout exceeded when calling DELETE /v1/private/workspaces/configurations.");case "unknown":throw new p({message:e.error.errorMessage,rawResponse:e.rawResponse})}}getCost(t,e){return h.fromPromise(this.__getCost(t,e))}async __getCost(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/workspaces/costs"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:pr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:ri.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/workspaces/costs.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getMetric(t,e){return h.fromPromise(this.__getMetric(t,e))}async __getMetric(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/workspaces/metrics"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:pr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:ri.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/workspaces/metrics.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}metricsSummary(t,e){return h.fromPromise(this.__metricsSummary(t,e))}async __metricsSummary(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/workspaces/metrics/summaries"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:pr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:Zm.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/workspaces/metrics/summaries.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var Si=class{constructor(t={}){this._options=t;}datasetsRedirect(t,e){return h.fromPromise(this.__datasetsRedirect(t,e))}async __datasetsRedirect(t,e){var u,g;let{datasetId:o,workspaceName:a,path:n}=t,c={};c.dataset_id=o,a!=null&&(c.workspace_name=a),c.path=n;let m=await b({url:x((g=(u=await s.get(this._options.baseUrl))!=null?u:await s.get(this._options.environment))!=null?g:w.Default,"v1/session/redirect/datasets"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:c,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(m.ok)return {data:void 0,rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 400:throw new _(m.error.body,m.rawResponse);case 404:throw new T(m.error.body,m.rawResponse);default:throw new p({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}switch(m.error.reason){case "non-json":throw new p({statusCode:m.error.statusCode,body:m.error.rawBody,rawResponse:m.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/session/redirect/datasets.");case "unknown":throw new p({message:m.error.errorMessage,rawResponse:m.rawResponse})}}experimentsRedirect(t,e){return h.fromPromise(this.__experimentsRedirect(t,e))}async __experimentsRedirect(t,e){var g,R;let{datasetId:o,experimentId:a,workspaceName:n,path:c}=t,m={};m.dataset_id=o,m.experiment_id=a,n!=null&&(m.workspace_name=n),m.path=c;let u=await b({url:x((R=(g=await s.get(this._options.baseUrl))!=null?g:await s.get(this._options.environment))!=null?R:w.Default,"v1/session/redirect/experiments"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:m,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(u.ok)return {data:void 0,rawResponse:u.rawResponse};if(u.error.reason==="status-code")switch(u.error.statusCode){case 400:throw new _(u.error.body,u.rawResponse);case 404:throw new T(u.error.body,u.rawResponse);default:throw new p({statusCode:u.error.statusCode,body:u.error.body,rawResponse:u.rawResponse})}switch(u.error.reason){case "non-json":throw new p({statusCode:u.error.statusCode,body:u.error.rawBody,rawResponse:u.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/session/redirect/experiments.");case "unknown":throw new p({message:u.error.errorMessage,rawResponse:u.rawResponse})}}optimizationsRedirect(t,e){return h.fromPromise(this.__optimizationsRedirect(t,e))}async __optimizationsRedirect(t,e){var g,R;let{datasetId:o,optimizationId:a,workspaceName:n,path:c}=t,m={};m.dataset_id=o,m.optimization_id=a,n!=null&&(m.workspace_name=n),m.path=c;let u=await b({url:x((R=(g=await s.get(this._options.baseUrl))!=null?g:await s.get(this._options.environment))!=null?R:w.Default,"v1/session/redirect/optimizations"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:m,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(u.ok)return {data:void 0,rawResponse:u.rawResponse};if(u.error.reason==="status-code")switch(u.error.statusCode){case 400:throw new _(u.error.body,u.rawResponse);case 404:throw new T(u.error.body,u.rawResponse);default:throw new p({statusCode:u.error.statusCode,body:u.error.body,rawResponse:u.rawResponse})}switch(u.error.reason){case "non-json":throw new p({statusCode:u.error.statusCode,body:u.error.rawBody,rawResponse:u.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/session/redirect/optimizations.");case "unknown":throw new p({message:u.error.errorMessage,rawResponse:u.rawResponse})}}projectsRedirect(t,e){return h.fromPromise(this.__projectsRedirect(t,e))}async __projectsRedirect(t,e){var u,g;let{traceId:o,workspaceName:a,path:n}=t,c={};c.trace_id=o,a!=null&&(c.workspace_name=a),c.path=n;let m=await b({url:x((g=(u=await s.get(this._options.baseUrl))!=null?u:await s.get(this._options.environment))!=null?g:w.Default,"v1/session/redirect/projects"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:c,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(m.ok)return {data:void 0,rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 400:throw new _(m.error.body,m.rawResponse);case 404:throw new T(m.error.body,m.rawResponse);default:throw new p({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}switch(m.error.reason){case "non-json":throw new p({statusCode:m.error.statusCode,body:m.error.rawBody,rawResponse:m.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/session/redirect/projects.");case "unknown":throw new p({message:m.error.errorMessage,rawResponse:m.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var xt=class{constructor(t={}){this._options=t;}get systemUsage(){var t;return (t=this._systemUsage)!=null?t:this._systemUsage=new oi(this._options)}get alerts(){var t;return (t=this._alerts)!=null?t:this._alerts=new ti(this._options)}get annotationQueues(){var t;return (t=this._annotationQueues)!=null?t:this._annotationQueues=new ai(this._options)}get attachments(){var t;return (t=this._attachments)!=null?t:this._attachments=new ii(this._options)}get check(){var t;return (t=this._check)!=null?t:this._check=new ni(this._options)}get automationRuleEvaluators(){var t;return (t=this._automationRuleEvaluators)!=null?t:this._automationRuleEvaluators=new si(this._options)}get chatCompletions(){var t;return (t=this._chatCompletions)!=null?t:this._chatCompletions=new pi(this._options)}get dashboards(){var t;return (t=this._dashboards)!=null?t:this._dashboards=new ci(this._options)}get datasets(){var t;return (t=this._datasets)!=null?t:this._datasets=new li(this._options)}get experiments(){var t;return (t=this._experiments)!=null?t:this._experiments=new mi(this._options)}get feedbackDefinitions(){var t;return (t=this._feedbackDefinitions)!=null?t:this._feedbackDefinitions=new di(this._options)}get guardrails(){var t;return (t=this._guardrails)!=null?t:this._guardrails=new ui(this._options)}get llmProviderKey(){var t;return (t=this._llmProviderKey)!=null?t:this._llmProviderKey=new gi(this._options)}get manualEvaluation(){var t;return (t=this._manualEvaluation)!=null?t:this._manualEvaluation=new fi(this._options)}get openTelemetryIngestion(){var t;return (t=this._openTelemetryIngestion)!=null?t:this._openTelemetryIngestion=new hi(this._options)}get optimizations(){var t;return (t=this._optimizations)!=null?t:this._optimizations=new wi(this._options)}get projects(){var t;return (t=this._projects)!=null?t:this._projects=new bi(this._options)}get prompts(){var t;return (t=this._prompts)!=null?t:this._prompts=new xi(this._options)}get serviceToggles(){var t;return (t=this._serviceToggles)!=null?t:this._serviceToggles=new Ri(this._options)}get spans(){var t;return (t=this._spans)!=null?t:this._spans=new yi(this._options)}get traces(){var t;return (t=this._traces)!=null?t:this._traces=new ki(this._options)}get welcomeWizard(){var t;return (t=this._welcomeWizard)!=null?t:this._welcomeWizard=new vi(this._options)}get workspaces(){var t;return (t=this._workspaces)!=null?t:this._workspaces=new zi(this._options)}get redirect(){var t;return (t=this._redirect)!=null?t:this._redirect=new Si(this._options)}isAlive(t){return h.fromPromise(this.__isAlive(t))}async __isAlive(t){var o,a;let e=await b({url:x((a=(o=await s.get(this._options.baseUrl))!=null?o:await s.get(this._options.environment))!=null?a:w.Default,"is-alive/ping"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...t==null?void 0:t.headers},contentType:"application/json",requestType:"json",timeoutMs:(t==null?void 0:t.timeoutInSeconds)!=null?t.timeoutInSeconds*1e3:6e4,maxRetries:t==null?void 0:t.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal});if(e.ok)return {data:e.body,rawResponse:e.rawResponse};if(e.error.reason==="status-code")throw new p({statusCode:e.error.statusCode,body:e.error.body,rawResponse:e.rawResponse});switch(e.error.reason){case "non-json":throw new p({statusCode:e.error.statusCode,body:e.error.rawBody,rawResponse:e.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /is-alive/ping.");case "unknown":throw new p({message:e.error.errorMessage,rawResponse:e.rawResponse})}}version(t){return h.fromPromise(this.__version(t))}async __version(t){var o,a;let e=await b({url:x((a=(o=await s.get(this._options.baseUrl))!=null?o:await s.get(this._options.environment))!=null?a:w.Default,"is-alive/ver"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...t==null?void 0:t.headers},contentType:"application/json",requestType:"json",timeoutMs:(t==null?void 0:t.timeoutInSeconds)!=null?t.timeoutInSeconds*1e3:6e4,maxRetries:t==null?void 0:t.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal});if(e.ok)return {data:e.body,rawResponse:e.rawResponse};if(e.error.reason==="status-code")throw new p({statusCode:e.error.statusCode,body:e.error.body,rawResponse:e.rawResponse});switch(e.error.reason){case "non-json":throw new p({statusCode:e.error.statusCode,body:e.error.rawBody,rawResponse:e.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /is-alive/ver.");case "unknown":throw new p({message:e.error.errorMessage,rawResponse:e.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var re=()=>uuid.v7();var _i=class i{constructor(t,e){this.data=t;this.opik=e;this.childSpans=[];this.end=()=>this.update({endTime:new Date});this.score=t=>{var e;this.opik.spanFeedbackScoresBatchQueue.create({...t,projectName:(e=this.data.projectName)!=null?e:this.opik.config.projectName,id:this.data.id,source:"sdk"});};this.update=t=>{var o;let e={parentSpanId:this.data.parentSpanId,projectName:(o=this.data.projectName)!=null?o:this.opik.config.projectName,traceId:this.data.traceId,...t};return this.opik.spanBatchQueue.update(this.data.id,e),this.data={...this.data,...t},this};this.span=t=>{var n;let e=(n=this.data.projectName)!=null?n:this.opik.config.projectName,o={id:re(),startTime:new Date,...t,projectName:e,traceId:this.data.traceId,parentSpanId:this.data.id};this.opik.spanBatchQueue.create(o);let a=new i(o,this.opik);return this.childSpans.push(a),a};}};var Ti=class{constructor(t,e){this.data=t;this.opik=e;this.spans=[];this.end=()=>this.update({endTime:new Date});this.score=t=>{var e;this.opik.traceFeedbackScoresBatchQueue.create({...t,projectName:(e=this.data.projectName)!=null?e:this.opik.config.projectName,id:this.data.id,source:"sdk"});};this.span=t=>{var n,c;let e=(c=(n=this.data.projectName)!=null?n:t.projectName)!=null?c:this.opik.config.projectName,o={id:re(),startTime:new Date,...t,projectName:e,traceId:this.data.id};this.opik.spanBatchQueue.create(o);let a=new _i(o,this.opik);return this.spans.push(a),a};this.update=t=>{var o;let e={projectName:(o=this.data.projectName)!=null?o:this.opik.config.projectName,...t};return this.opik.traceBatchQueue.update(this.data.id,e),this.data={...this.data,...e},this};}};var yg={EXPERIMENTS:"api/v1/session/redirect/experiments/",PROJECT_BY_NAME:"redirect/projects"},Ai={EXPERIMENT_ID:"experiment_id",DATASET_ID:"dataset_id",PROJECT_NAME:"name",PATH:"path"},Ob=i=>Object.entries(i).map(([t,e])=>`${t}=${encodeURIComponent(e)}`).join("&").replace(/%3A/g,":").replace(/%2F/g,"/").replace(/%26/g,"&").replace(/%3F/g,"?").replace(/%3D/g,"="),Wb=i=>i.replace(/\/api$/,""),Bb=i=>Buffer.from(i).toString("base64"),kg=(i,t,e)=>{let o=Ob(e),a=`${t}?${o}`;return new URL(a,i).toString()},vg=({datasetId:i,experimentId:t,baseUrl:e})=>kg(e,yg.EXPERIMENTS,{[Ai.EXPERIMENT_ID]:t,[Ai.DATASET_ID]:i,[Ai.PATH]:Bb(e)});var zg=({projectName:i,workspaceName:t,apiUrl:e})=>{let o=Wb(e),a=`${t}/${yg.PROJECT_BY_NAME}`;return kg(o,a,{[Ai.PROJECT_NAME]:i})};var Lb=300,Ei=100,Rt=class{constructor({action:t,batchSize:e=Ei,delay:o,enableBatch:a,name:n="ActionQueue"}){this.timerId=null;this.promise=Promise.resolve();this.queue=new Map;this.debounceFlush=()=>{this.timerId&&clearTimeout(this.timerId),this.timerId=setTimeout(()=>this.flush(),this.delay);};this.add=(t,e)=>{if(this.queue.set(t,e),!this.enableBatch){this.flush();return}if(this.queue.size>=this.batchSize){this.flush();return}this.debounceFlush();};this.update=(t,e)=>{let o=this.queue.get(t);o&&(this.queue.set(t,{...o,...e}),this.debounceFlush());};this.flush=async()=>{if(this.queue.size===0)return this.promise;let t=new Map(this.queue);this.queue.clear(),k.debug(`Adding ${t.size} items to ${this.name} promise:`,t),this.promise=this.promise.finally(()=>(k.debug(`Flushing ${this.name}:`,t),this.action(t))).catch(e=>{k.error(`Failed to flush ${this.name}:`,e,t);}),await this.promise;};this.action=t,this.batchSize=e,this.delay=o,this.enableBatch=a,this.name=n;}},de=class{constructor({delay:t=Lb,enableCreateBatch:e=true,enableUpdateBatch:o=false,enableDeleteBatch:a=true,createBatchSize:n=Ei,updateBatchSize:c=Ei,deleteBatchSize:m=Ei,name:u="BatchQueue"}={}){this.create=t=>{let e=this.getId(t);this.createQueue.add(e,t);};this.get=async t=>{let e=this.createQueue.queue.get(t);return e||this.getEntity(t)};this.update=(t,e)=>{if(this.createQueue.queue.get(t)){this.createQueue.update(t,e);return}this.updateQueue.add(t,e);};this.delete=t=>{if(this.createQueue.queue.has(t)){this.createQueue.queue.delete(t);return}this.deleteQueue.add(t);};this.flush=async()=>{await this.createQueue.flush(),await this.updateQueue.flush(),await this.deleteQueue.flush();};this.name=u,this.createQueue=new Rt({action:async g=>{await this.createEntities(Array.from(g.values()));},delay:t,enableBatch:e,batchSize:n,name:`${u}:createQueue`}),this.updateQueue=new Rt({action:async g=>{await this.createQueue.flush();let R=Array.from(g.entries());for(let[y,v]of R)await this.updateEntity(y,v);},delay:t,enableBatch:o,batchSize:c,name:`${u}:updateQueue`}),this.deleteQueue=new Rt({action:async g=>{await this.createQueue.flush(),await this.updateQueue.flush(),await this.deleteEntities(Array.from(g.keys()));},delay:t,enableBatch:a,batchSize:m,name:`${u}:deleteQueue`});}};var Pi=class extends de{constructor(e,o){super({delay:o,enableCreateBatch:true,enableUpdateBatch:true,enableDeleteBatch:true,name:"SpanBatchQueue"});this.api=e;}getId(e){return e.id}async createEntities(e){await this.api.spans.createSpans({spans:e},this.api.requestOptions);}async getEntity(e){return await this.api.spans.getSpanById(e,{},this.api.requestOptions)}async updateEntity(e,o){await this.api.spans.updateSpan(e,o,this.api.requestOptions);}async deleteEntities(e){for(let o of e)await this.api.spans.deleteSpanById(o,this.api.requestOptions);}};var Ci=class extends de{constructor(e,o){super({delay:o,enableCreateBatch:true,enableUpdateBatch:true,enableDeleteBatch:true,name:"SpanFeedbackScoresBatchQueue"});this.api=e;}getId(e){return {id:e.id,name:e.name}}async createEntities(e){await this.api.spans.scoreBatchOfSpans({scores:e},this.api.requestOptions);}async getEntity(){throw new Error("Not implemented")}async updateEntity(){throw new Error("Not implemented")}async deleteEntities(e){for(let o of e)await this.api.spans.deleteSpanFeedbackScore(o.id,{name:o.name},this.api.requestOptions);}};var Ii=class extends de{constructor(e,o){super({delay:o,enableCreateBatch:true,enableUpdateBatch:true,enableDeleteBatch:true,name:"TraceBatchQueue"});this.api=e;}getId(e){return e.id}async createEntities(e){await this.api.traces.createTraces({traces:e},this.api.requestOptions);}async getEntity(e){return await this.api.traces.getTraceById(e,{},this.api.requestOptions)}async updateEntity(e,o){await this.api.traces.updateTrace(e,o,this.api.requestOptions);}async deleteEntities(e){await this.api.traces.deleteTraces({ids:e},this.api.requestOptions);}};var ji=class extends de{constructor(e,o){super({delay:o,enableCreateBatch:true,enableUpdateBatch:true,enableDeleteBatch:true,name:"TraceFeedbackScoresBatchQueue"});this.api=e;}getId(e){return {id:e.id,name:e.name}}async createEntities(e){await this.api.traces.scoreBatchOfTraces({scores:e},this.api.requestOptions);}async getEntity(){throw new Error("Not implemented")}async updateEntity(){throw new Error("Not implemented")}async deleteEntities(e){for(let o of e)await this.api.traces.deleteTraceFeedbackScore(o.id,{name:o.name},this.api.requestOptions);}};var Ui=class extends xt{constructor(e){super(e);this.setHeaders=e=>{this.requestOptions.headers=e;};this.requestOptions=(e==null?void 0:e.requestOptions)||{};}};var Ni=class extends de{constructor(e,o){super({delay:o,enableCreateBatch:true,enableUpdateBatch:true,enableDeleteBatch:true,name:"DatasetBatchQueue"});this.api=e;}getId(e){return e.id||""}async createEntities(e){for(let o of e)await this.api.datasets.createDataset(o,this.api.requestOptions);}async getEntity(e){try{return await this.api.datasets.getDatasetById(e,this.api.requestOptions)}catch{return}}async updateEntity(e,o){await this.api.datasets.updateDataset(e,{name:o.name||"",visibility:o.visibility,description:o.description},this.api.requestOptions);}async deleteEntities(e){await this.api.datasets.deleteDatasetsBatch({ids:e},this.api.requestOptions);}};var qm=null;async function Sg(){return qm||(qm=await Vb__default.default()),qm}var yt=class i{constructor(t){let{id:e,traceId:o,spanId:a,source:n,...c}=t;this.id=e||re(),this.traceId=o,this.spanId=a,this.source=n||zn.Sdk,this.data={...c};}getContent(t=false){return t?{...this.data,id:this.id}:{...this.data}}async contentHash(){let t=this.getContent(),e=Hb__default.default(t);return (await Sg()).h32(e,43981).toString(16)}toApiModel(){return {id:this.id,traceId:this.traceId,spanId:this.spanId,source:this.source,data:this.getContent()}}static fromApiModel(t){return new i({id:t.id,traceId:t.traceId,spanId:t.spanId,source:t.source,...t.data})}};async function je(i,t,e){var c;if(e===0)return [];let o=new util.TextDecoder("utf-8"),a=[],n="";try{for await(let m of i){n+=o.decode(m,{stream:!0});let u=n.split(`
|
|
4
|
+
`)),{ok:true,value:t}):o}}function Qt(i){return i.path.length===0?i.message:`${i.path.join(" -> ")}: ${i.message}`}var qe=class i extends Error{constructor(e){super(e.map(Qt).join("; "));this.errors=e;Object.setPrototypeOf(this,i.prototype);}};var er=class i extends Error{constructor(e){super(e.map(Qt).join("; "));this.errors=e;Object.setPrototypeOf(this,i.prototype);}};function U(i){return {nullable:()=>rb(i),optional:()=>Jn(i),optionalNullable:()=>ob(i),transform:t=>Kn(i,t),parseOrThrow:(t,e)=>{let o=i.parse(t,e);if(o.ok)return o.value;throw new er(o.errors)},jsonOrThrow:(t,e)=>{let o=i.json(t,e);if(o.ok)return o.value;throw new qe(o.errors)}}}function rb(i){let t={parse:(e,o)=>e==null?{ok:true,value:null}:i.parse(e,o),json:(e,o)=>e==null?{ok:true,value:null}:i.json(e,o),getType:()=>A.NULLABLE};return {...t,...U(t)}}function Jn(i){let t={parse:(e,o)=>e==null?{ok:true,value:void 0}:i.parse(e,o),json:(e,o)=>o!=null&&o.omitUndefined&&e===void 0?{ok:true,value:void 0}:e==null?{ok:true,value:null}:i.json(e,o),getType:()=>A.OPTIONAL};return {...t,...U(t)}}function ob(i){let t={parse:(e,o)=>e===void 0?{ok:true,value:void 0}:e===null?{ok:true,value:null}:i.parse(e,o),json:(e,o)=>e===void 0?{ok:true,value:void 0}:e===null?{ok:true,value:null}:i.json(e,o),getType:()=>A.OPTIONAL_NULLABLE};return {...t,...U(t)}}function Kn(i,t){let e={parse:(o,a)=>{let n=i.parse(o,a);return n.ok?{ok:true,value:t.transform(n.value)}:n},json:(o,a)=>{let n=t.untransform(o);return i.json(n,a)},getType:()=>i.getType()};return {...e,...U(e)}}function $u(){let i={parse:(t,{breadcrumbsPrefix:e=[]}={})=>typeof t=="bigint"?{ok:true,value:t}:typeof t=="number"?{ok:true,value:BigInt(t)}:{ok:false,errors:[{path:e,message:j(t,"bigint | number")}]},json:(t,{breadcrumbsPrefix:e=[]}={})=>typeof t!="bigint"?{ok:false,errors:[{path:e,message:j(t,"bigint")}]}:{ok:true,value:t},getType:()=>A.BIGINT};return {...Q(i),...U(i)}}var tb=/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;function Qu(){let i={parse:(t,{breadcrumbsPrefix:e=[]}={})=>typeof t!="string"?{ok:false,errors:[{path:e,message:j(t,"string")}]}:tb.test(t)?{ok:true,value:new Date(t)}:{ok:false,errors:[{path:e,message:j(t,"ISO 8601 date string")}]},json:(t,{breadcrumbsPrefix:e=[]}={})=>t instanceof Date?{ok:true,value:t.toISOString()}:{ok:false,errors:[{path:e,message:j(t,"Date object")}]},getType:()=>A.DATE};return {...Q(i),...U(i)}}function q(i,t){return ()=>{let e={parse:t,json:t,getType:()=>i};return {...Q(e),...U(e)}}}function Yt(i){let t=new Set(i);return q(A.ENUM,(o,{allowUnrecognizedEnumValues:a,breadcrumbsPrefix:n=[]}={})=>typeof o!="string"?{ok:false,errors:[{path:n,message:j(o,"string")}]}:!t.has(o)&&!a?{ok:false,errors:[{path:n,message:j(o,"enum")}]}:{ok:true,value:o})()}function Yu(i){let t=Xn(i);return {...t,...U(t)}}function Xn(i){return {parse:(t,e)=>rr(i).parse(t,e),json:(t,e)=>rr(i).json(t,e),getType:()=>rr(i).getType()}}function rr(i){let t=i;return t.__zurg_memoized==null&&(t.__zurg_memoized=i()),t.__zurg_memoized}function xr(i){return Object.entries(i)}function Rr(i,t){let e=new Set(t);return Object.entries(i).reduce((o,[a,n])=>(e.has(a)&&(o[a]=n),o),{})}function Ce(i){if(typeof i!="object"||i===null)return false;if(Object.getPrototypeOf(i)===null)return true;let t=i;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(i)===t}function yr(i){return Object.keys(i)}function Zu(i,t){let e=[],o=[];for(let a of i)t(a)?e.push(a):o.push(a);return [e,o]}function he(i){return {withParsedProperties:t=>Gn(i,t)}}function Gn(i,t){let e={parse:(o,a)=>{let n=i.parse(o,a);if(!n.ok)return n;let c=Object.entries(t).reduce((m,[u,g])=>({...m,[u]:typeof g=="function"?g(n.value):g}),{});return {ok:true,value:{...n.value,...c}}},json:(o,a)=>{var m;if(!Ce(o))return {ok:false,errors:[{path:(m=a==null?void 0:a.breadcrumbsPrefix)!=null?m:[],message:j(o,"object")}]};let n=new Set(Object.keys(t)),c=Rr(o,Object.keys(o).filter(u=>!n.has(u)));return i.json(c,a)},getType:()=>i.getType()};return {...e,...U(e),...he(e)}}function qu(i,t){return {rawKey:i,valueSchema:t,isProperty:true}}function Ie(i){return i.isProperty}function Zt(i){let t={_getRawProperties:()=>Object.entries(i).map(([e,o])=>Ie(o)?o.rawKey:e),_getParsedProperties:()=>yr(i),parse:(e,o)=>{let a={},n=[];for(let[c,m]of xr(i)){let u=Ie(m)?m.rawKey:c,g=Ie(m)?m.valueSchema:m,R={rawKey:u,parsedKey:c,valueSchema:g};a[u]=R,og(g)&&n.push(u);}return eg({value:e,requiredKeys:n,getProperty:c=>{let m=a[c];if(m!=null)return {transformedKey:m.parsedKey,transform:u=>{var g;return m.valueSchema.parse(u,{...o,breadcrumbsPrefix:[...(g=o==null?void 0:o.breadcrumbsPrefix)!=null?g:[],c]})}}},unrecognizedObjectKeys:o==null?void 0:o.unrecognizedObjectKeys,skipValidation:o==null?void 0:o.skipValidation,breadcrumbsPrefix:o==null?void 0:o.breadcrumbsPrefix,omitUndefined:o==null?void 0:o.omitUndefined})},json:(e,o)=>{let a=[];for(let[n,c]of xr(i)){let m=Ie(c)?c.valueSchema:c;og(m)&&a.push(n);}return eg({value:e,requiredKeys:a,getProperty:n=>{let c=i[n];if(c!=null)return Ie(c)?{transformedKey:c.rawKey,transform:m=>{var u;return c.valueSchema.json(m,{...o,breadcrumbsPrefix:[...(u=o==null?void 0:o.breadcrumbsPrefix)!=null?u:[],n]})}}:{transformedKey:n,transform:m=>{var u;return c.json(m,{...o,breadcrumbsPrefix:[...(u=o==null?void 0:o.breadcrumbsPrefix)!=null?u:[],n]})}}},unrecognizedObjectKeys:o==null?void 0:o.unrecognizedObjectKeys,skipValidation:o==null?void 0:o.skipValidation,breadcrumbsPrefix:o==null?void 0:o.breadcrumbsPrefix,omitUndefined:o==null?void 0:o.omitUndefined})},getType:()=>A.OBJECT};return {...Q(t),...U(t),...he(t),...We(t)}}function eg({value:i,requiredKeys:t,getProperty:e,unrecognizedObjectKeys:o="fail",skipValidation:a=false,breadcrumbsPrefix:n=[]}){if(!Ce(i))return {ok:false,errors:[{path:n,message:j(i,"object")}]};let c=new Set(t),m=[],u={};for(let[g,R]of Object.entries(i)){let y=e(g);if(y!=null){c.delete(g);let v=y.transform(R);v.ok?u[y.transformedKey]=v.value:(u[g]=R,m.push(...v.errors));}else switch(o){case "fail":m.push({path:[...n,g],message:`Unexpected key "${g}"`});break;case "strip":break;case "passthrough":u[g]=R;break}}return m.push(...t.filter(g=>c.has(g)).map(g=>({path:n,message:`Missing required key "${g}"`}))),m.length===0||a?{ok:true,value:u}:{ok:false,errors:m}}function We(i){return {extend:t=>{let e={_getParsedProperties:()=>[...i._getParsedProperties(),...t._getParsedProperties()],_getRawProperties:()=>[...i._getRawProperties(),...t._getRawProperties()],parse:(o,a)=>rg({extensionKeys:t._getRawProperties(),value:o,transformBase:n=>i.parse(n,a),transformExtension:n=>t.parse(n,a)}),json:(o,a)=>rg({extensionKeys:t._getParsedProperties(),value:o,transformBase:n=>i.json(n,a),transformExtension:n=>t.json(n,a)}),getType:()=>A.OBJECT};return {...e,...U(e),...he(e),...We(e)}},passthrough:()=>{let t={_getParsedProperties:()=>i._getParsedProperties(),_getRawProperties:()=>i._getRawProperties(),parse:(e,o)=>{let a=i.parse(e,{...o,unrecognizedObjectKeys:"passthrough"});return a.ok?{ok:true,value:{...e,...a.value}}:a},json:(e,o)=>{let a=i.json(e,{...o,unrecognizedObjectKeys:"passthrough"});return a.ok?{ok:true,value:{...e,...a.value}}:a},getType:()=>A.OBJECT};return {...t,...U(t),...he(t),...We(t)}}}}function rg({extensionKeys:i,value:t,transformBase:e,transformExtension:o}){let a=new Set(i),[n,c]=Zu(yr(t),g=>a.has(g)),m=e(Rr(t,c)),u=o(Rr(t,n));return m.ok&&u.ok?{ok:true,value:{...m.value,...u.value}}:{ok:false,errors:[...m.ok?[]:m.errors,...u.ok?[]:u.errors]}}function og(i){return !ab(i)}function ab(i){switch(i.getType()){case A.ANY:case A.UNKNOWN:case A.OPTIONAL:case A.OPTIONAL_NULLABLE:return true;default:return false}}function tg(i){return Zt(i)}function ag(i){let t={...Xn(i),_getRawProperties:()=>rr(i)._getRawProperties(),_getParsedProperties:()=>rr(i)._getParsedProperties()};return {...t,...U(t),...he(t),...We(t)}}function qt(i){let t={parse:(e,o)=>ig(e,(a,n)=>{var c;return i.parse(a,{...o,breadcrumbsPrefix:[...(c=o==null?void 0:o.breadcrumbsPrefix)!=null?c:[],`[${n}]`]})}),json:(e,o)=>ig(e,(a,n)=>{var c;return i.json(a,{...o,breadcrumbsPrefix:[...(c=o==null?void 0:o.breadcrumbsPrefix)!=null?c:[],`[${n}]`]})}),getType:()=>A.LIST};return {...Q(t),...U(t)}}function ig(i,t){return Array.isArray(i)?i.map((o,a)=>t(o,a)).reduce((o,a)=>{if(o.ok&&a.ok)return {ok:true,value:[...o.value,a.value]};let n=[];return o.ok||n.push(...o.errors),a.ok||n.push(...a.errors),{ok:false,errors:n}},{ok:true,value:[]}):{ok:false,errors:[{message:j(i,"list"),path:[]}]}}function ng(i){return q(A.STRING_LITERAL,(e,{breadcrumbsPrefix:o=[]}={})=>e===i?{ok:true,value:i}:{ok:false,errors:[{path:o,message:j(e,`"${i}"`)}]})()}function sg(i){return q(A.BOOLEAN_LITERAL,(e,{breadcrumbsPrefix:o=[]}={})=>e===i?{ok:true,value:i}:{ok:false,errors:[{path:o,message:j(e,`${i.toString()}`)}]})()}var pg=q(A.ANY,i=>({ok:true,value:i}));var cg=q(A.BOOLEAN,(i,{breadcrumbsPrefix:t=[]}={})=>typeof i=="boolean"?{ok:true,value:i}:{ok:false,errors:[{path:t,message:j(i,"boolean")}]});var lg=q(A.NUMBER,(i,{breadcrumbsPrefix:t=[]}={})=>typeof i=="number"?{ok:true,value:i}:{ok:false,errors:[{path:t,message:j(i,"number")}]});var mg=q(A.STRING,(i,{breadcrumbsPrefix:t=[]}={})=>typeof i=="string"?{ok:true,value:i}:{ok:false,errors:[{path:t,message:j(i,"string")}]});var dg=q(A.UNKNOWN,i=>({ok:true,value:i}));function gg(i,t){let e={parse:(o,a)=>ug({value:o,isKeyNumeric:i.getType()===A.NUMBER,transformKey:n=>{var c;return i.parse(n,{...a,breadcrumbsPrefix:[...(c=a==null?void 0:a.breadcrumbsPrefix)!=null?c:[],`${n} (key)`]})},transformValue:(n,c)=>{var m;return t.parse(n,{...a,breadcrumbsPrefix:[...(m=a==null?void 0:a.breadcrumbsPrefix)!=null?m:[],`${c}`]})},breadcrumbsPrefix:a==null?void 0:a.breadcrumbsPrefix}),json:(o,a)=>ug({value:o,isKeyNumeric:i.getType()===A.NUMBER,transformKey:n=>{var c;return i.json(n,{...a,breadcrumbsPrefix:[...(c=a==null?void 0:a.breadcrumbsPrefix)!=null?c:[],`${n} (key)`]})},transformValue:(n,c)=>{var m;return t.json(n,{...a,breadcrumbsPrefix:[...(m=a==null?void 0:a.breadcrumbsPrefix)!=null?m:[],`${c}`]})},breadcrumbsPrefix:a==null?void 0:a.breadcrumbsPrefix}),getType:()=>A.RECORD};return {...Q(e),...U(e)}}function ug({value:i,isKeyNumeric:t,transformKey:e,transformValue:o,breadcrumbsPrefix:a=[]}){return Ce(i)?xr(i).reduce((n,[c,m])=>{if(m===void 0)return n;let u=n,g=c;if(t){let z=c.length>0?Number(c):NaN;isNaN(z)||(g=z);}let R=e(g),y=o(m,g);if(u.ok&&R.ok&&y.ok)return {ok:true,value:{...u.value,[R.value]:y.value}};let v=[];return u.ok||v.push(...u.errors),R.ok||v.push(...R.errors),y.ok||v.push(...y.errors),{ok:false,errors:v}},{ok:true,value:{}}):{ok:false,errors:[{path:a,message:j(i,"object")}]}}function fg(i){let t=qt(i),e={parse:(o,a)=>{let n=t.parse(o,a);return n.ok?{ok:true,value:new Set(n.value)}:n},json:(o,a)=>{var c;return o instanceof Set?t.json([...o],a):{ok:false,errors:[{path:(c=a==null?void 0:a.breadcrumbsPrefix)!=null?c:[],message:j(o,"Set")}]}},getType:()=>A.SET};return {...Q(e),...U(e)}}function wg(i){let t={parse:(e,o)=>hg((a,n)=>a.parse(e,n),i,o),json:(e,o)=>hg((a,n)=>a.json(e,n),i,o),getType:()=>A.UNDISCRIMINATED_UNION};return {...Q(t),...U(t)}}function hg(i,t,e){let o=[];for(let[a,n]of t.entries()){let c=i(n,{...e,skipValidation:false});if(c.ok)return c;for(let m of c.errors)o.push({path:m.path,message:`[Variant ${a}] ${m.message}`});}return {ok:false,errors:o}}function bg(i,t){return {parsedDiscriminant:i,rawDiscriminant:t}}function Rg(i,t){let e=typeof i=="string"?i:i.rawDiscriminant,o=typeof i=="string"?i:i.parsedDiscriminant,a=Yt(yr(t)),n={parse:(c,m)=>xg({value:c,discriminant:e,transformedDiscriminant:o,transformDiscriminantValue:u=>{var g;return a.parse(u,{allowUnrecognizedEnumValues:m==null?void 0:m.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...(g=m==null?void 0:m.breadcrumbsPrefix)!=null?g:[],e]})},getAdditionalPropertiesSchema:u=>t[u],allowUnrecognizedUnionMembers:m==null?void 0:m.allowUnrecognizedUnionMembers,transformAdditionalProperties:(u,g)=>g.parse(u,m),breadcrumbsPrefix:m==null?void 0:m.breadcrumbsPrefix}),json:(c,m)=>xg({value:c,discriminant:o,transformedDiscriminant:e,transformDiscriminantValue:u=>{var g;return a.json(u,{allowUnrecognizedEnumValues:m==null?void 0:m.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...(g=m==null?void 0:m.breadcrumbsPrefix)!=null?g:[],o]})},getAdditionalPropertiesSchema:u=>t[u],allowUnrecognizedUnionMembers:m==null?void 0:m.allowUnrecognizedUnionMembers,transformAdditionalProperties:(u,g)=>g.json(u,m),breadcrumbsPrefix:m==null?void 0:m.breadcrumbsPrefix}),getType:()=>A.UNION};return {...Q(n),...U(n),...he(n)}}function xg({value:i,discriminant:t,transformedDiscriminant:e,transformDiscriminantValue:o,getAdditionalPropertiesSchema:a,allowUnrecognizedUnionMembers:n=false,transformAdditionalProperties:c,breadcrumbsPrefix:m=[]}){if(!Ce(i))return {ok:false,errors:[{path:m,message:j(i,"object")}]};let{[t]:u,...g}=i;if(u==null)return {ok:false,errors:[{path:m,message:`Missing discriminant ("${t}")`}]};let R=o(u);if(!R.ok)return {ok:false,errors:R.errors};let y=a(R.value);if(y==null)return n?{ok:true,value:{[e]:R.value,...g}}:{ok:false,errors:[{path:[...m,t],message:"Unexpected discriminant value"}]};let v=c(g,y);return v.ok?{ok:true,value:{[e]:u,...v.value}}:v}function ib(i){var t=[];if(i.length===0)return "";if(typeof i[0]!="string")throw new TypeError("Url must be a string. Received "+i[0]);if(i[0].match(/^[^/:]+:\/*$/)&&i.length>1){var e=i.shift();i[0]=e+i[0];}i[0].match(/^file:\/\/\//)?i[0]=i[0].replace(/^([^/:]+):\/*/,"$1:///"):i[0]=i[0].replace(/^([^/:]+):\/*/,"$1://");for(var o=0;o<i.length;o++){var a=i[o];if(typeof a!="string")throw new TypeError("Url must be a string. Received "+a);a!==""&&(o>0&&(a=a.replace(/^[\/]+/,"")),o<i.length-1?a=a.replace(/[\/]+$/,""):a=a.replace(/[\/]+$/,"/"),t.push(a));}var n=t.join("/");n=n.replace(/\/(\?|&|#[^!])/g,"$1");var c=n.split("?");return n=c.shift()+(c.length>0?"?":"")+c.join("&"),n}function x(){var i;return typeof arguments[0]=="object"?i=arguments[0]:i=[].slice.call(arguments),ib(i)}var C={};E(C,{AggregationData:()=>wl,Alert:()=>mb,AlertAlertType:()=>Bs,AlertPagePublic:()=>ip,AlertPublic:()=>Po,AlertPublicAlertType:()=>qs,AlertTrigger:()=>Ks,AlertTriggerConfig:()=>Js,AlertTriggerConfigPublic:()=>tp,AlertTriggerConfigPublicType:()=>op,AlertTriggerConfigType:()=>Hs,AlertTriggerConfigWrite:()=>Gs,AlertTriggerConfigWriteType:()=>Xs,AlertTriggerEventType:()=>Vs,AlertTriggerPublic:()=>ap,AlertTriggerPublicEventType:()=>rp,AlertTriggerWrite:()=>Qs,AlertTriggerWriteEventType:()=>$s,AlertWrite:()=>Eo,AlertWriteAlertType:()=>Ys,AnnotationQueue:()=>mp,AnnotationQueueBatch:()=>ub,AnnotationQueueBatchWrite:()=>yo,AnnotationQueueItemIds:()=>Ba,AnnotationQueuePagePublic:()=>gp,AnnotationQueuePublic:()=>Co,AnnotationQueuePublicScope:()=>dp,AnnotationQueueReviewer:()=>lp,AnnotationQueueReviewerPublic:()=>up,AnnotationQueueScope:()=>cp,AnnotationQueueUpdate:()=>ko,AnnotationQueueWrite:()=>Ro,AnnotationQueueWriteScope:()=>_s,AssistantMessage:()=>hc,AssistantMessageRole:()=>fc,Attachment:()=>fp,AttachmentListRequestEntityType:()=>oa,AttachmentPage:()=>hp,AuthDetailsHolder:()=>yp,AutomationRuleEvaluator:()=>fb,AutomationRuleEvaluatorLlmAsJudge:()=>Ep,AutomationRuleEvaluatorLlmAsJudgePublic:()=>Ko,AutomationRuleEvaluatorLlmAsJudgeWrite:()=>Op,AutomationRuleEvaluatorObjectPublic:()=>ac,AutomationRuleEvaluatorPagePublic:()=>ic,AutomationRuleEvaluatorPublic:()=>nc,AutomationRuleEvaluatorTraceThreadLlmAsJudge:()=>Cp,AutomationRuleEvaluatorTraceThreadLlmAsJudgePublic:()=>Go,AutomationRuleEvaluatorTraceThreadLlmAsJudgeWrite:()=>Bp,AutomationRuleEvaluatorTraceThreadUserDefinedMetricPython:()=>Ip,AutomationRuleEvaluatorTraceThreadUserDefinedMetricPythonPublic:()=>$o,AutomationRuleEvaluatorTraceThreadUserDefinedMetricPythonWrite:()=>Vp,AutomationRuleEvaluatorUpdate:()=>gc,AutomationRuleEvaluatorUpdateLlmAsJudge:()=>lc,AutomationRuleEvaluatorUpdateTraceThreadLlmAsJudge:()=>dc,AutomationRuleEvaluatorUpdateTraceThreadUserDefinedMetricPython:()=>uc,AutomationRuleEvaluatorUpdateUserDefinedMetricPython:()=>mc,AutomationRuleEvaluatorUserDefinedMetricPython:()=>Pp,AutomationRuleEvaluatorUserDefinedMetricPythonPublic:()=>Xo,AutomationRuleEvaluatorUserDefinedMetricPythonWrite:()=>Jp,AutomationRuleEvaluatorWrite:()=>Gp,AvgValueStatPublic:()=>Bc,BatchDelete:()=>L,BatchDeleteByProject:()=>Nb,BiInformation:()=>Ds,BiInformationResponse:()=>ir,BooleanFeedbackDefinition:()=>kl,BooleanFeedbackDefinitionCreate:()=>El,BooleanFeedbackDefinitionPublic:()=>at,BooleanFeedbackDefinitionUpdate:()=>Jl,BooleanFeedbackDetail:()=>yl,BooleanFeedbackDetailCreate:()=>Al,BooleanFeedbackDetailPublic:()=>Dl,BooleanFeedbackDetailUpdate:()=>Hl,CategoricalFeedbackDefinition:()=>zl,CategoricalFeedbackDefinitionCreate:()=>Cl,CategoricalFeedbackDefinitionPublic:()=>it,CategoricalFeedbackDefinitionUpdate:()=>Xl,CategoricalFeedbackDetail:()=>vl,CategoricalFeedbackDetailCreate:()=>Pl,CategoricalFeedbackDetailPublic:()=>Ml,CategoricalFeedbackDetailUpdate:()=>Kl,ChatCompletionChoice:()=>bc,ChatCompletionRequest:()=>zo,ChatCompletionResponse:()=>kc,Check:()=>il,CheckName:()=>tl,CheckPublic:()=>Jm,CheckPublicName:()=>Vm,CheckPublicResult:()=>Hm,CheckResult:()=>al,ChunkedOutputJsonNode:()=>xb,ChunkedOutputJsonNodePublic:()=>vb,ChunkedOutputJsonNodePublicType:()=>Rl,ChunkedOutputJsonNodeType:()=>el,Column:()=>Zc,ColumnCompare:()=>Ac,ColumnCompareTypesItem:()=>Tc,ColumnPublic:()=>$c,ColumnPublicTypesItem:()=>Gc,ColumnTypesItem:()=>Yc,Comment:()=>H,CommentCompare:()=>Ec,CommentPublic:()=>Ke,CompleteMultipartUploadRequest:()=>La,CompleteMultipartUploadRequestEntityType:()=>wp,CompletionTokensDetails:()=>Rc,CountValueStatPublic:()=>Lc,CreateDatasetItemsFromSpansRequest:()=>Tr,CreateDatasetItemsFromTracesRequest:()=>Ar,CreatePromptVersionDetail:()=>Zr,DashboardPagePublic:()=>vc,DashboardPublic:()=>He,DashboardUpdatePublic:()=>_o,DashboardWrite:()=>So,DataPointDouble:()=>Db,DataPointNumberPublic:()=>gm,Dataset:()=>hb,DatasetExpansion:()=>bb,DatasetExpansionResponse:()=>_c,DatasetExpansionWrite:()=>Ir,DatasetIdentifier:()=>Pr,DatasetIdentifierPublic:()=>jr,DatasetItem:()=>Yo,DatasetItemBatch:()=>wb,DatasetItemBatchUpdate:()=>vr,DatasetItemBatchWrite:()=>_r,DatasetItemCompare:()=>Mc,DatasetItemCompareSource:()=>Pc,DatasetItemFilter:()=>Qn,DatasetItemFilterOperator:()=>$n,DatasetItemPageCompare:()=>Fc,DatasetItemPagePublic:()=>Qc,DatasetItemPublic:()=>et,DatasetItemPublicSource:()=>Kc,DatasetItemSource:()=>Sc,DatasetItemStreamRequest:()=>Ur,DatasetItemUpdate:()=>Yn,DatasetItemWrite:()=>Sr,DatasetItemWriteSource:()=>Zn,DatasetItemsDelete:()=>Cr,DatasetPagePublic:()=>Wc,DatasetPublic:()=>nr,DatasetPublicVisibility:()=>Oc,DatasetUpdate:()=>Er,DatasetUpdateVisibility:()=>pa,DatasetVisibility:()=>zc,DatasetWrite:()=>zr,DatasetWriteVisibility:()=>sa,DeleteAttachmentsRequest:()=>gb,DeleteAttachmentsRequestEntityType:()=>xp,DeleteFeedbackScore:()=>mt,DeleteIdsHolder:()=>sr,DeleteThreadFeedbackScores:()=>fo,DeleteTraceThreads:()=>ho,Delta:()=>wc,DownloadAttachmentRequestEntityType:()=>ta,ErrorCountWithDeviation:()=>ct,ErrorCountWithDeviationDetailed:()=>ym,ErrorInfo:()=>Se,ErrorInfoExperimentItemBulkWriteView:()=>Or,ErrorInfoPublic:()=>dt,ErrorInfoWrite:()=>ro,ErrorMessage:()=>ae,ErrorMessageDetail:()=>Ib,ErrorMessageDetailed:()=>Pb,ErrorMessagePublic:()=>db,Experiment:()=>Rb,ExperimentGroupAggregationsResponse:()=>xl,ExperimentGroupResponse:()=>hl,ExperimentItem:()=>Dr,ExperimentItemBulkRecord:()=>cl,ExperimentItemBulkRecordExperimentItemBulkWriteView:()=>ds,ExperimentItemBulkUpload:()=>yb,ExperimentItemBulkUploadExperimentItemBulkWriteView:()=>Wr,ExperimentItemCompare:()=>Dc,ExperimentItemCompareTraceVisibilityMode:()=>Nc,ExperimentItemPublic:()=>qo,ExperimentItemPublicTraceVisibilityMode:()=>Xc,ExperimentItemStreamRequest:()=>Lr,ExperimentItemTraceVisibilityMode:()=>as,ExperimentItemsBatch:()=>Mr,ExperimentItemsDelete:()=>Fr,ExperimentPagePublic:()=>dl,ExperimentPublic:()=>tt,ExperimentPublicStatus:()=>ml,ExperimentPublicType:()=>ll,ExperimentStatus:()=>ol,ExperimentStreamRequestPublic:()=>Vr,ExperimentType:()=>rl,ExperimentUpdate:()=>Br,ExperimentUpdateStatus:()=>ua,ExperimentUpdateType:()=>da,ExperimentWrite:()=>Nr,ExperimentWriteStatus:()=>ma,ExperimentWriteType:()=>la,ExportTraceServiceRequest:()=>Tb,Feedback:()=>zb,FeedbackCreate:()=>Nl,FeedbackDefinitionPagePublic:()=>Bl,FeedbackObjectPublic:()=>Wl,FeedbackPublic:()=>Vl,FeedbackScore:()=>ee,FeedbackScoreAverage:()=>pe,FeedbackScoreAverageDetailed:()=>km,FeedbackScoreAveragePublic:()=>Ve,FeedbackScoreBatch:()=>ft,FeedbackScoreBatchItem:()=>Lm,FeedbackScoreBatchItemSource:()=>Bm,FeedbackScoreBatchItemThread:()=>vs,FeedbackScoreBatchItemThreadSource:()=>ks,FeedbackScoreBatchThread:()=>wo,FeedbackScoreCompare:()=>Uc,FeedbackScoreCompareSource:()=>Cc,FeedbackScoreExperimentItemBulkWriteView:()=>ms,FeedbackScoreExperimentItemBulkWriteViewSource:()=>ps,FeedbackScoreNames:()=>um,FeedbackScorePublic:()=>ut,FeedbackScorePublicSource:()=>Dm,FeedbackScoreSource:()=>rs,FeedbackUpdate:()=>Yl,FindFeedbackDefinitionsRequestType:()=>ha,FindFeedbackScoreNames1RequestType:()=>Pa,Function:()=>vo,FunctionCall:()=>_e,GetSpanStatsRequestType:()=>Ca,GetSpansByProjectRequestType:()=>Ea,GetWebhookExamplesRequestAlertType:()=>ea,GroupContent:()=>ul,GroupContentWithAggregations:()=>bl,GroupDetail:()=>gl,GroupDetails:()=>fl,Guardrail:()=>em,GuardrailBatch:()=>Sb,GuardrailBatchWrite:()=>To,GuardrailName:()=>Zl,GuardrailResult:()=>ql,GuardrailWrite:()=>Ns,GuardrailWriteName:()=>js,GuardrailWriteResult:()=>Us,GuardrailsValidation:()=>nl,GuardrailsValidationPublic:()=>Km,IdsHolder:()=>kb,ImageUrl:()=>Sp,ImageUrlPublic:()=>Qp,ImageUrlWrite:()=>Up,JsonListString:()=>N,JsonListStringCompare:()=>Ga,JsonListStringExperimentItemBulkWriteView:()=>we,JsonListStringPublic:()=>ce,JsonListStringWrite:()=>se,JsonNode:()=>D,JsonNodeDetail:()=>hs,JsonNodePublic:()=>Te,JsonNodeWrite:()=>Be,JsonSchema:()=>Ps,LlmAsJudgeCode:()=>Do,LlmAsJudgeCodePublic:()=>ec,LlmAsJudgeCodeWrite:()=>Fp,LlmAsJudgeMessage:()=>Uo,LlmAsJudgeMessageContent:()=>Tp,LlmAsJudgeMessageContentPublic:()=>Zp,LlmAsJudgeMessageContentWrite:()=>Dp,LlmAsJudgeMessagePublic:()=>Ho,LlmAsJudgeMessagePublicRole:()=>$p,LlmAsJudgeMessageRole:()=>zp,LlmAsJudgeMessageWrite:()=>Bo,LlmAsJudgeMessageWriteRole:()=>jp,LlmAsJudgeModelParameters:()=>jo,LlmAsJudgeModelParametersPublic:()=>Vo,LlmAsJudgeModelParametersWrite:()=>Wo,LlmAsJudgeOutputSchema:()=>No,LlmAsJudgeOutputSchemaPublic:()=>Jo,LlmAsJudgeOutputSchemaPublicType:()=>qp,LlmAsJudgeOutputSchemaType:()=>Ap,LlmAsJudgeOutputSchemaWrite:()=>Lo,LlmAsJudgeOutputSchemaWriteType:()=>Mp,LogItem:()=>pc,LogItemLevel:()=>sc,LogPage:()=>cc,ManualEvaluationRequest:()=>Za,ManualEvaluationRequestEntityType:()=>am,ManualEvaluationResponse:()=>Ya,Message:()=>Ts,MultipartUploadPart:()=>bp,NumericalFeedbackDefinition:()=>_l,NumericalFeedbackDefinitionCreate:()=>jl,NumericalFeedbackDefinitionPublic:()=>nt,NumericalFeedbackDefinitionUpdate:()=>$l,NumericalFeedbackDetail:()=>Sl,NumericalFeedbackDetailCreate:()=>Il,NumericalFeedbackDetailPublic:()=>Fl,NumericalFeedbackDetailUpdate:()=>Gl,Optimization:()=>Ab,OptimizationPagePublic:()=>pm,OptimizationPublic:()=>pt,OptimizationPublicStatus:()=>sm,OptimizationStatus:()=>im,OptimizationUpdate:()=>Kr,OptimizationUpdateStatus:()=>Ra,OptimizationWrite:()=>qa,OptimizationWriteStatus:()=>nm,PageColumns:()=>qc,PercentageValueStatPublic:()=>Vc,PercentageValues:()=>Ae,PercentageValuesDetailed:()=>vm,PercentageValuesPublic:()=>Zo,Project:()=>Eb,ProjectDetailed:()=>Sm,ProjectDetailedVisibility:()=>zm,ProjectMetricRequestPublic:()=>$r,ProjectMetricRequestPublicInterval:()=>Sa,ProjectMetricRequestPublicMetricType:()=>za,ProjectMetricResponsePublic:()=>bm,ProjectMetricResponsePublicInterval:()=>hm,ProjectMetricResponsePublicMetricType:()=>fm,ProjectPagePublic:()=>mm,ProjectPublic:()=>lt,ProjectPublicVisibility:()=>lm,ProjectRetrieveDetailed:()=>Qr,ProjectStatItemObjectPublic:()=>Jc,ProjectStatsPublic:()=>Je,ProjectStatsSummary:()=>Rm,ProjectStatsSummaryItem:()=>xm,ProjectUpdate:()=>Gr,ProjectUpdateVisibility:()=>va,ProjectVisibility:()=>cm,ProjectWrite:()=>Xr,ProjectWriteVisibility:()=>ka,Prompt:()=>Cb,PromptDetail:()=>Em,PromptPagePublic:()=>Um,PromptPublic:()=>jm,PromptTokensDetails:()=>xc,PromptType:()=>_m,PromptUpdatable:()=>qr,PromptVersion:()=>Am,PromptVersionDetail:()=>ke,PromptVersionDetailType:()=>ws,PromptVersionLink:()=>$a,PromptVersionLinkPublic:()=>Qa,PromptVersionLinkWrite:()=>fa,PromptVersionPagePublic:()=>Im,PromptVersionPublic:()=>Cm,PromptVersionPublicType:()=>Pm,PromptVersionRetrieveDetail:()=>eo,PromptVersionType:()=>Tm,PromptWrite:()=>Yr,PromptWriteType:()=>Ta,ProviderApiKey:()=>_b,ProviderApiKeyPagePublic:()=>om,ProviderApiKeyProvider:()=>tm,ProviderApiKeyPublic:()=>st,ProviderApiKeyPublicProvider:()=>rm,ProviderApiKeyUpdate:()=>Jr,ProviderApiKeyWrite:()=>Hr,ProviderApiKeyWriteProvider:()=>ba,ResponseFormat:()=>Cs,ResponseFormatType:()=>Es,Result:()=>Xe,ResultsNumberPublic:()=>wm,ScoreName:()=>dm,ServiceTogglesConfig:()=>Nm,Span:()=>ot,SpanBatch:()=>jb,SpanBatchUpdate:()=>io,SpanBatchWrite:()=>to,SpanEnrichmentOptions:()=>qn,SpanExperimentItemBulkWriteView:()=>ss,SpanExperimentItemBulkWriteViewType:()=>ns,SpanFilterPublic:()=>ys,SpanFilterPublicOperator:()=>Rs,SpanPagePublic:()=>Wm,SpanPublic:()=>gt,SpanPublicType:()=>Om,SpanSearchStreamRequestPublic:()=>no,SpanSearchStreamRequestPublicType:()=>Ia,SpanType:()=>pl,SpanUpdate:()=>ao,SpanUpdateType:()=>xs,SpanWrite:()=>oo,SpanWriteType:()=>bs,SpansCountResponse:()=>Fs,StartMultipartUploadRequest:()=>kr,StartMultipartUploadRequestEntityType:()=>aa,StartMultipartUploadResponse:()=>Rp,StreamOptions:()=>As,Tool:()=>Is,ToolCall:()=>Qo,Trace:()=>rt,TraceBatch:()=>Ub,TraceBatchUpdate:()=>lo,TraceBatchWrite:()=>po,TraceCountResponse:()=>Ws,TraceEnrichmentOptions:()=>es,TraceExperimentItemBulkWriteView:()=>is,TraceFilter:()=>Io,TraceFilterOperator:()=>vp,TraceFilterPublic:()=>ze,TraceFilterPublicOperator:()=>us,TraceFilterWrite:()=>Xp,TraceFilterWriteOperator:()=>Kp,TracePagePublic:()=>Qm,TracePublic:()=>ht,TracePublicVisibilityMode:()=>Xm,TraceSearchStreamRequestPublic:()=>xo,TraceThread:()=>wt,TraceThreadBatchIdentifier:()=>go,TraceThreadBatchUpdate:()=>uo,TraceThreadFilter:()=>Ss,TraceThreadFilterOperator:()=>zs,TraceThreadFilterPublic:()=>fs,TraceThreadFilterPublicOperator:()=>gs,TraceThreadIdentifier:()=>ei,TraceThreadLlmAsJudgeCode:()=>Fo,TraceThreadLlmAsJudgeCodePublic:()=>oc,TraceThreadLlmAsJudgeCodeWrite:()=>Wp,TraceThreadPage:()=>$m,TraceThreadSearchStreamRequest:()=>bo,TraceThreadStatus:()=>Gm,TraceThreadUpdate:()=>mo,TraceThreadUserDefinedMetricPythonCode:()=>Oo,TraceThreadUserDefinedMetricPythonCodePublic:()=>tc,TraceThreadUserDefinedMetricPythonCodeWrite:()=>Lp,TraceUpdate:()=>co,TraceVisibilityMode:()=>sl,TraceWrite:()=>so,UploadAttachmentRequestEntityType:()=>ia,Usage:()=>yc,UserDefinedMetricPythonCode:()=>Mo,UserDefinedMetricPythonCodePublic:()=>rc,UserDefinedMetricPythonCodeWrite:()=>Hp,ValueEntry:()=>ts,ValueEntryCompare:()=>jc,ValueEntryCompareSource:()=>Ic,ValueEntryExperimentItemBulkWriteView:()=>ls,ValueEntryExperimentItemBulkWriteViewSource:()=>cs,ValueEntryPublic:()=>Fm,ValueEntryPublicSource:()=>Mm,ValueEntrySource:()=>os,VideoUrl:()=>_p,VideoUrlPublic:()=>Yp,VideoUrlWrite:()=>Np,Webhook:()=>Ls,WebhookExamples:()=>np,WebhookPublic:()=>ep,WebhookTestResult:()=>pp,WebhookTestResultStatus:()=>sp,WebhookWrite:()=>Zs,WelcomeWizardSubmission:()=>Ao,WelcomeWizardTracking:()=>Ym,WorkspaceConfiguration:()=>bt,WorkspaceMetricRequest:()=>Mb,WorkspaceMetricResponse:()=>ri,WorkspaceMetricsSummaryRequest:()=>pr,WorkspaceMetricsSummaryResponse:()=>Zm,WorkspaceNameHolder:()=>kp,WorkspaceSpansCount:()=>Ms,WorkspaceTraceCount:()=>Os,alerts:()=>ra,annotationQueues:()=>Da,attachments:()=>or,chatCompletions:()=>Ma,dashboards:()=>Fa,datasets:()=>ca,experiments:()=>tr,feedbackDefinitions:()=>wa,guardrails:()=>Oa,llmProviderKey:()=>xa,optimizations:()=>ya,projects:()=>_a,prompts:()=>Aa,spans:()=>ar,traces:()=>Le,welcomeWizard:()=>Wa});var ra={};E(ra,{GetWebhookExamplesRequestAlertType:()=>ea});var ea=r.enum_(["general","slack","pagerduty"]);var or={};E(or,{AttachmentListRequestEntityType:()=>oa,DownloadAttachmentRequestEntityType:()=>ta,StartMultipartUploadRequest:()=>kr,StartMultipartUploadRequestEntityType:()=>aa,UploadAttachmentRequestEntityType:()=>ia,uploadAttachment:()=>na});var oa=r.enum_(["trace","span"]);var ta=r.enum_(["trace","span"]);var aa=r.enum_(["trace","span"]);var ia=r.enum_(["trace","span"]);var na={};E(na,{Request:()=>nb});var nb=r.record(r.string(),r.unknown());var kr=r.object({fileName:r.property("file_name",r.string()),numOfFileParts:r.property("num_of_file_parts",r.number()),mimeType:r.property("mime_type",r.string().optional()),projectName:r.property("project_name",r.string().optional()),entityType:r.property("entity_type",aa),entityId:r.property("entity_id",r.string()),path:r.string()});var ca={};E(ca,{CreateDatasetItemsFromSpansRequest:()=>Tr,CreateDatasetItemsFromTracesRequest:()=>Ar,DatasetExpansionWrite:()=>Ir,DatasetIdentifier:()=>Pr,DatasetIdentifierPublic:()=>jr,DatasetItemBatchUpdate:()=>vr,DatasetItemBatchWrite:()=>_r,DatasetItemStreamRequest:()=>Ur,DatasetItemsDelete:()=>Cr,DatasetUpdate:()=>Er,DatasetUpdateVisibility:()=>pa,DatasetWrite:()=>zr,DatasetWriteVisibility:()=>sa});var sa=r.enum_(["private","public"]);var pa=r.enum_(["private","public"]);var $n=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Qn=r.object({field:r.string().optional(),operator:$n.optional(),key:r.string().optional(),value:r.string().optional()});var D=r.record(r.string(),r.unknown());var Yn=r.object({input:r.string().optional(),expectedOutput:r.property("expected_output",r.string().optional()),metadata:D.optional(),data:D.optional(),tags:r.list(r.string()).optional()});var vr=r.object({ids:r.list(r.string()).optional(),filters:r.list(Qn).optional(),update:Yn,mergeTags:r.property("merge_tags",r.boolean().optional())});var zr=r.object({id:r.string().optional(),name:r.string(),visibility:sa.optional(),tags:r.list(r.string()).optional(),description:r.string().optional()});var Zn=r.enum_(["manual","trace","span","sdk"]);var Sr=r.object({id:r.string().optional(),traceId:r.property("trace_id",r.string().optional()),spanId:r.property("span_id",r.string().optional()),source:Zn,data:D,tags:r.list(r.string()).optional()});var _r=r.object({datasetName:r.property("dataset_name",r.string().optional()),datasetId:r.property("dataset_id",r.string().optional()),items:r.list(Sr)});var qn=r.object({includeTags:r.boolean().optional(),includeFeedbackScores:r.boolean().optional(),includeComments:r.boolean().optional(),includeUsage:r.boolean().optional(),includeMetadata:r.boolean().optional()});var Tr=r.object({spanIds:r.property("span_ids",r.list(r.string())),enrichmentOptions:r.property("enrichment_options",qn)});var es=r.object({includeSpans:r.boolean().optional(),includeTags:r.boolean().optional(),includeFeedbackScores:r.boolean().optional(),includeComments:r.boolean().optional(),includeUsage:r.boolean().optional(),includeMetadata:r.boolean().optional()});var Ar=r.object({traceIds:r.property("trace_ids",r.list(r.string())),enrichmentOptions:r.property("enrichment_options",es)});var Er=r.object({name:r.string(),description:r.string().optional(),visibility:pa.optional(),tags:r.list(r.string()).optional()});var Pr=r.object({datasetName:r.property("dataset_name",r.string())});var Cr=r.object({itemIds:r.property("item_ids",r.list(r.string()))});var Ir=r.object({model:r.string(),sampleCount:r.property("sample_count",r.number().optional()),preserveFields:r.property("preserve_fields",r.list(r.string()).optional()),variationInstructions:r.property("variation_instructions",r.string().optional()),customPrompt:r.property("custom_prompt",r.string().optional())});var jr=r.object({datasetName:r.property("dataset_name",r.string())});var Ur=r.object({datasetName:r.property("dataset_name",r.string()),lastRetrievedId:r.property("last_retrieved_id",r.string().optional()),steamLimit:r.property("steam_limit",r.number().optional())});var tr={};E(tr,{ExperimentItemBulkUploadExperimentItemBulkWriteView:()=>Wr,ExperimentItemStreamRequest:()=>Lr,ExperimentItemsBatch:()=>Mr,ExperimentItemsDelete:()=>Fr,ExperimentStreamRequestPublic:()=>Vr,ExperimentUpdate:()=>Br,ExperimentUpdateStatus:()=>ua,ExperimentUpdateType:()=>da,ExperimentWrite:()=>Nr,ExperimentWriteStatus:()=>ma,ExperimentWriteType:()=>la,findFeedbackScoreNames:()=>ga});var la=r.enum_(["regular","trial","mini-batch"]);var ma=r.enum_(["running","completed","cancelled"]);var da=r.enum_(["regular","trial","mini-batch"]);var ua=r.enum_(["running","completed","cancelled"]);var ga={};E(ga,{Response:()=>sb});var sb=r.list(r.string());var se=r.undiscriminatedUnion([r.record(r.string(),r.unknown()),r.list(r.record(r.string(),r.unknown())),r.string()]);var fa=r.object({id:r.string()});var Nr=r.object({id:r.string().optional(),datasetName:r.property("dataset_name",r.string()),name:r.string().optional(),metadata:se.optional(),type:la.optional(),optimizationId:r.property("optimization_id",r.string().optional()),status:ma.optional(),promptVersion:r.property("prompt_version",fa.optional()),promptVersions:r.property("prompt_versions",r.list(fa).optional())});var N=r.undiscriminatedUnion([r.record(r.string(),r.unknown()),r.list(r.record(r.string(),r.unknown())),r.string()]);var rs=r.enum_(["ui","sdk","online_scoring"]);var os=r.enum_(["ui","sdk","online_scoring"]);var ts=r.object({value:r.number().optional(),reason:r.string().optional(),categoryName:r.property("category_name",r.string().optional()),source:os.optional(),lastUpdatedAt:r.property("last_updated_at",r.date().optional())});var ee=r.object({name:r.string(),categoryName:r.property("category_name",r.string().optional()),value:r.number(),reason:r.string().optional(),source:rs,createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),valueByAuthor:r.property("value_by_author",r.record(r.string(),ts).optional())});var H=r.object({id:r.string().optional(),text:r.string(),createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var as=r.enum_(["default","hidden"]);var Dr=r.object({id:r.string().optional(),experimentId:r.property("experiment_id",r.string()),datasetItemId:r.property("dataset_item_id",r.string()),traceId:r.property("trace_id",r.string()),input:N.optional(),output:N.optional(),feedbackScores:r.property("feedback_scores",r.list(ee).optional()),comments:r.list(H).optional(),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),duration:r.number().optional(),usage:r.record(r.string(),r.number()).optional(),createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),traceVisibilityMode:r.property("trace_visibility_mode",as.optional())});var Mr=r.object({experimentItems:r.property("experiment_items",r.list(Dr))});var Fr=r.object({ids:r.list(r.string())});var we=r.undiscriminatedUnion([r.record(r.string(),r.unknown()),r.list(r.record(r.string(),r.unknown())),r.string()]);var Or=r.object({exceptionType:r.property("exception_type",r.string()),message:r.string().optional(),traceback:r.string()});var is=r.object({id:r.string().optional(),projectName:r.property("project_name",r.string().optional()),name:r.string().optional(),startTime:r.property("start_time",r.date()),endTime:r.property("end_time",r.date().optional()),input:we.optional(),output:we.optional(),metadata:we.optional(),tags:r.list(r.string()).optional(),errorInfo:r.property("error_info",Or.optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),threadId:r.property("thread_id",r.string().optional())});var ns=r.enum_(["general","tool","llm","guardrail"]);var ss=r.object({id:r.string().optional(),parentSpanId:r.property("parent_span_id",r.string().optional()),name:r.string().optional(),type:ns.optional(),startTime:r.property("start_time",r.date()),endTime:r.property("end_time",r.date().optional()),input:we.optional(),output:we.optional(),metadata:we.optional(),model:r.string().optional(),provider:r.string().optional(),tags:r.list(r.string()).optional(),usage:r.record(r.string(),r.number()).optional(),errorInfo:r.property("error_info",Or.optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),totalEstimatedCostVersion:r.property("total_estimated_cost_version",r.string().optional())});var ps=r.enum_(["ui","sdk","online_scoring"]);var cs=r.enum_(["ui","sdk","online_scoring"]);var ls=r.object({value:r.number().optional(),reason:r.string().optional(),categoryName:r.property("category_name",r.string().optional()),source:cs.optional(),lastUpdatedAt:r.property("last_updated_at",r.date().optional())});var ms=r.object({name:r.string(),categoryName:r.property("category_name",r.string().optional()),value:r.number(),reason:r.string().optional(),source:ps,createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),valueByAuthor:r.property("value_by_author",r.record(r.string(),ls).optional())});var ds=r.object({datasetItemId:r.property("dataset_item_id",r.string()),evaluateTaskResult:r.property("evaluate_task_result",we.optional()),trace:is.optional(),spans:r.list(ss).optional(),feedbackScores:r.property("feedback_scores",r.list(ms).optional())});var Wr=r.object({experimentName:r.property("experiment_name",r.string()),datasetName:r.property("dataset_name",r.string()),experimentId:r.property("experiment_id",r.string().optional()),items:r.list(ds)});var Br=r.object({name:r.string().optional(),metadata:D.optional(),type:da.optional(),status:ua.optional()});var Lr=r.object({experimentName:r.property("experiment_name",r.string()),limit:r.number().optional(),lastRetrievedId:r.property("last_retrieved_id",r.string().optional()),truncate:r.boolean().optional()});var Vr=r.object({name:r.string(),limit:r.number().optional(),lastRetrievedId:r.property("last_retrieved_id",r.string().optional())});var wa={};E(wa,{FindFeedbackDefinitionsRequestType:()=>ha});var ha=r.enum_(["numerical","categorical","boolean"]);var xa={};E(xa,{ProviderApiKeyUpdate:()=>Jr,ProviderApiKeyWrite:()=>Hr,ProviderApiKeyWriteProvider:()=>ba});var ba=r.enum_(["openai","anthropic","gemini","openrouter","vertex-ai","custom-llm"]);var Hr=r.object({provider:ba,apiKey:r.property("api_key",r.string().optional()),name:r.string().optional(),providerName:r.property("provider_name",r.string().optional()),headers:r.record(r.string(),r.string()).optional(),configuration:r.record(r.string(),r.string()).optional(),baseUrl:r.property("base_url",r.string().optional())});var Jr=r.object({apiKey:r.property("api_key",r.string().optional()),name:r.string().optional(),providerName:r.property("provider_name",r.string().optional()),headers:r.record(r.string(),r.string()).optional(),configuration:r.record(r.string(),r.string()).optional(),baseUrl:r.property("base_url",r.string().optional())});var ya={};E(ya,{OptimizationUpdate:()=>Kr,OptimizationUpdateStatus:()=>Ra});var Ra=r.enum_(["running","completed","cancelled"]);var Kr=r.object({name:r.string().optional(),status:Ra.optional()});var _a={};E(_a,{ProjectMetricRequestPublic:()=>$r,ProjectMetricRequestPublicInterval:()=>Sa,ProjectMetricRequestPublicMetricType:()=>za,ProjectRetrieveDetailed:()=>Qr,ProjectUpdate:()=>Gr,ProjectUpdateVisibility:()=>va,ProjectWrite:()=>Xr,ProjectWriteVisibility:()=>ka});var ka=r.enum_(["private","public"]);var va=r.enum_(["private","public"]);var za=r.enum_(["FEEDBACK_SCORES","TRACE_COUNT","TOKEN_USAGE","DURATION","COST","GUARDRAILS_FAILED_COUNT","THREAD_COUNT","THREAD_DURATION","THREAD_FEEDBACK_SCORES"]);var Sa=r.enum_(["HOURLY","DAILY","WEEKLY"]);var Xr=r.object({name:r.string(),visibility:ka.optional(),description:r.string().optional()});var Gr=r.object({name:r.string().optional(),description:r.string().optional(),visibility:va.optional()});var us=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var ze=r.object({field:r.string().optional(),operator:us.optional(),key:r.string().optional(),value:r.string().optional()});var gs=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var fs=r.object({field:r.string().optional(),operator:gs.optional(),key:r.string().optional(),value:r.string().optional()});var $r=r.object({metricType:r.property("metric_type",za.optional()),interval:Sa.optional(),intervalStart:r.property("interval_start",r.date().optional()),intervalEnd:r.property("interval_end",r.date().optional()),traceFilters:r.property("trace_filters",r.list(ze).optional()),threadFilters:r.property("thread_filters",r.list(fs).optional())});var Qr=r.object({name:r.string()});var Aa={};E(Aa,{CreatePromptVersionDetail:()=>Zr,PromptUpdatable:()=>qr,PromptVersionRetrieveDetail:()=>eo,PromptWrite:()=>Yr,PromptWriteType:()=>Ta});var Ta=r.enum_(["mustache","jinja2"]);var Be=r.record(r.string(),r.unknown());var Yr=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional(),template:r.string().optional(),metadata:Be.optional(),changeDescription:r.property("change_description",r.string().optional()),type:Ta.optional(),tags:r.list(r.string()).optional()});var hs=r.record(r.string(),r.unknown());var ws=r.enum_(["mustache","jinja2"]);var ke=r.object({id:r.string().optional(),promptId:r.property("prompt_id",r.string().optional()),commit:r.string().optional(),template:r.string(),metadata:hs.optional(),type:ws.optional(),changeDescription:r.property("change_description",r.string().optional()),variables:r.list(r.string()).optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional())});var Zr=r.object({name:r.string(),version:ke});var qr=r.object({name:r.string(),description:r.string().optional(),tags:r.list(r.string()).optional()});var eo=r.object({name:r.string(),commit:r.string().optional()});var ar={};E(ar,{FindFeedbackScoreNames1RequestType:()=>Pa,GetSpanStatsRequestType:()=>Ca,GetSpansByProjectRequestType:()=>Ea,SpanBatchUpdate:()=>io,SpanBatchWrite:()=>to,SpanSearchStreamRequestPublic:()=>no,SpanSearchStreamRequestPublicType:()=>Ia,findFeedbackScoreNames1:()=>ja});var Ea=r.enum_(["general","tool","llm","guardrail"]);var Pa=r.enum_(["general","tool","llm","guardrail"]);var Ca=r.enum_(["general","tool","llm","guardrail"]);var Ia=r.enum_(["general","tool","llm","guardrail"]);var ja={};E(ja,{Response:()=>pb});var pb=r.list(r.string());var bs=r.enum_(["general","tool","llm","guardrail"]);var ro=r.object({exceptionType:r.property("exception_type",r.string()),message:r.string().optional(),traceback:r.string()});var oo=r.object({id:r.string().optional(),projectName:r.property("project_name",r.string().optional()),traceId:r.property("trace_id",r.string().optional()),parentSpanId:r.property("parent_span_id",r.string().optional()),name:r.string().optional(),type:bs.optional(),startTime:r.property("start_time",r.date()),endTime:r.property("end_time",r.date().optional()),input:se.optional(),output:se.optional(),metadata:se.optional(),model:r.string().optional(),provider:r.string().optional(),tags:r.list(r.string()).optional(),usage:r.record(r.string(),r.number()).optional(),errorInfo:r.property("error_info",ro.optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),totalEstimatedCostVersion:r.property("total_estimated_cost_version",r.string().optional())});var to=r.object({spans:r.list(oo)});var xs=r.enum_(["general","tool","llm","guardrail"]);var Se=r.object({exceptionType:r.property("exception_type",r.string()),message:r.string().optional(),traceback:r.string()});var ao=r.object({projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),traceId:r.property("trace_id",r.string()),parentSpanId:r.property("parent_span_id",r.string().optional()),name:r.string().optional(),type:xs.optional(),endTime:r.property("end_time",r.date().optional()),input:N.optional(),output:N.optional(),metadata:N.optional(),model:r.string().optional(),provider:r.string().optional(),tags:r.list(r.string()).optional(),usage:r.record(r.string(),r.number()).optional(),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),errorInfo:r.property("error_info",Se.optional())});var io=r.object({ids:r.list(r.string()),update:ao,mergeTags:r.property("merge_tags",r.boolean().optional())});var Rs=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var ys=r.object({field:r.string().optional(),operator:Rs.optional(),key:r.string().optional(),value:r.string().optional()});var no=r.object({traceId:r.property("trace_id",r.string().optional()),projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),type:Ia.optional(),filters:r.list(ys).optional(),limit:r.number().optional(),lastRetrievedId:r.property("last_retrieved_id",r.string().optional()),truncate:r.boolean().optional(),fromTime:r.property("from_time",r.date().optional()),toTime:r.property("to_time",r.date().optional())});var Le={};E(Le,{DeleteThreadFeedbackScores:()=>fo,DeleteTraceThreads:()=>ho,FeedbackScoreBatchThread:()=>wo,TraceBatchUpdate:()=>lo,TraceBatchWrite:()=>po,TraceSearchStreamRequestPublic:()=>xo,TraceThreadBatchIdentifier:()=>go,TraceThreadBatchUpdate:()=>uo,TraceThreadSearchStreamRequest:()=>bo,findFeedbackScoreNames2:()=>Ua,findTraceThreadsFeedbackScoreNames:()=>Na});var Ua={};E(Ua,{Response:()=>cb});var cb=r.list(r.string());var Na={};E(Na,{Response:()=>lb});var lb=r.list(r.string());var so=r.object({id:r.string().optional(),projectName:r.property("project_name",r.string().optional()),name:r.string().optional(),startTime:r.property("start_time",r.date()),endTime:r.property("end_time",r.date().optional()),input:se.optional(),output:se.optional(),metadata:se.optional(),tags:r.list(r.string()).optional(),errorInfo:r.property("error_info",ro.optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),threadId:r.property("thread_id",r.string().optional())});var po=r.object({traces:r.list(so)});var co=r.object({projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),name:r.string().optional(),endTime:r.property("end_time",r.date().optional()),input:N.optional(),output:N.optional(),metadata:N.optional(),tags:r.list(r.string()).optional(),errorInfo:r.property("error_info",Se.optional()),threadId:r.property("thread_id",r.string().optional())});var lo=r.object({ids:r.list(r.string()),update:co,mergeTags:r.property("merge_tags",r.boolean().optional())});var mo=r.object({tags:r.list(r.string()).optional()});var uo=r.object({ids:r.list(r.string()),update:mo,mergeTags:r.property("merge_tags",r.boolean().optional())});var go=r.object({projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),threadId:r.property("thread_id",r.string().optional()),threadIds:r.property("thread_ids",r.list(r.string()).optional())});var fo=r.object({projectName:r.property("project_name",r.string()),threadId:r.property("thread_id",r.string()),names:r.list(r.string()),author:r.string().optional()});var ho=r.object({projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),threadIds:r.property("thread_ids",r.list(r.string()))});var ks=r.enum_(["ui","sdk","online_scoring"]);var vs=r.object({projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),name:r.string(),categoryName:r.property("category_name",r.string().optional()),value:r.number(),reason:r.string().optional(),source:ks,author:r.string().optional(),threadId:r.property("thread_id",r.string())});var wo=r.object({scores:r.list(vs)});var zs=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Ss=r.object({field:r.string().optional(),operator:zs.optional(),key:r.string().optional(),value:r.string().optional()});var bo=r.object({projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),filters:r.list(Ss).optional(),lastRetrievedThreadModelId:r.property("last_retrieved_thread_model_id",r.string().optional()),limit:r.number().optional(),truncate:r.boolean().optional(),stripAttachments:r.property("strip_attachments",r.boolean().optional()),fromTime:r.property("from_time",r.date().optional()),toTime:r.property("to_time",r.date().optional())});var xo=r.object({projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),filters:r.list(ze).optional(),lastRetrievedId:r.property("last_retrieved_id",r.string().optional()),limit:r.number().optional(),truncate:r.boolean().optional(),stripAttachments:r.property("strip_attachments",r.boolean().optional()),fromTime:r.property("from_time",r.date().optional()),toTime:r.property("to_time",r.date().optional())});var Da={};E(Da,{AnnotationQueueBatchWrite:()=>yo,AnnotationQueueUpdate:()=>ko});var _s=r.enum_(["trace","thread"]);var Ro=r.object({id:r.string().optional(),projectId:r.property("project_id",r.string()),name:r.string(),description:r.string().optional(),instructions:r.string().optional(),scope:_s,commentsEnabled:r.property("comments_enabled",r.boolean().optional()),feedbackDefinitionNames:r.property("feedback_definition_names",r.list(r.string()).optional())});var yo=r.object({annotationQueues:r.property("annotation_queues",r.list(Ro))});var ko=r.object({name:r.string().optional(),description:r.string().optional(),instructions:r.string().optional(),commentsEnabled:r.property("comments_enabled",r.boolean().optional()),feedbackDefinitionNames:r.property("feedback_definition_names",r.list(r.string()).optional())});var Ma={};E(Ma,{ChatCompletionRequest:()=>zo});var Ts=r.record(r.string(),r.unknown());var As=r.object({includeUsage:r.property("include_usage",r.boolean().optional())});var Es=r.enum_(["text","json_object","json_schema"]);var Ps=r.object({name:r.string().optional(),strict:r.boolean().optional(),schema:r.record(r.string(),r.record(r.string(),r.unknown())).optional()});var Cs=r.object({type:Es.optional(),jsonSchema:r.property("json_schema",Ps.optional())});var vo=r.object({name:r.string().optional(),description:r.string().optional(),strict:r.boolean().optional(),parameters:r.record(r.string(),r.record(r.string(),r.unknown())).optional()});var Is=r.object({type:r.stringLiteral("function").optional(),function:vo.optional()});var _e=r.object({name:r.string().optional(),arguments:r.string().optional()});var zo=r.object({model:r.string().optional(),messages:r.list(Ts).optional(),temperature:r.number().optional(),topP:r.property("top_p",r.number().optional()),n:r.number().optional(),stream:r.boolean().optional(),streamOptions:r.property("stream_options",As.optional()),stop:r.list(r.string()).optional(),maxTokens:r.property("max_tokens",r.number().optional()),maxCompletionTokens:r.property("max_completion_tokens",r.number().optional()),presencePenalty:r.property("presence_penalty",r.number().optional()),frequencyPenalty:r.property("frequency_penalty",r.number().optional()),logitBias:r.property("logit_bias",r.record(r.string(),r.number()).optional()),user:r.string().optional(),responseFormat:r.property("response_format",Cs.optional()),seed:r.number().optional(),tools:r.list(Is).optional(),toolChoice:r.property("tool_choice",r.record(r.string(),r.unknown()).optional()),parallelToolCalls:r.property("parallel_tool_calls",r.boolean().optional()),store:r.boolean().optional(),metadata:r.record(r.string(),r.string()).optional(),reasoningEffort:r.property("reasoning_effort",r.string().optional()),serviceTier:r.property("service_tier",r.string().optional()),functions:r.list(vo).optional(),functionCall:r.property("function_call",_e.optional())});var Fa={};E(Fa,{DashboardUpdatePublic:()=>_o,DashboardWrite:()=>So});var So=r.object({name:r.string(),description:r.string().optional(),config:Be});var Te=r.record(r.string(),r.unknown());var _o=r.object({name:r.string().optional(),description:r.string().optional(),config:Te.optional()});var Oa={};E(Oa,{GuardrailBatchWrite:()=>To});var js=r.enum_(["TOPIC","PII"]);var Us=r.enum_(["passed","failed"]);var Ns=r.object({entityId:r.property("entity_id",r.string()),secondaryId:r.property("secondary_id",r.string()),projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),name:js,result:Us,config:D,details:D});var To=r.object({guardrails:r.list(Ns)});var Wa={};E(Wa,{WelcomeWizardSubmission:()=>Ao});var Ao=r.object({role:r.string().optional(),integrations:r.list(r.string()).optional(),email:r.string().optional(),joinBetaProgram:r.property("join_beta_program",r.boolean().optional())});var Ds=r.object({workspaceId:r.property("workspace_id",r.string().optional()),user:r.string().optional(),count:r.number().optional()});var ir=r.object({biInformation:r.property("bi_information",r.list(Ds).optional())});var Ms=r.object({workspace:r.string().optional(),spanCount:r.property("span_count",r.number().optional())});var Fs=r.object({workspacesSpansCount:r.property("workspaces_spans_count",r.list(Ms).optional())});var Os=r.object({workspace:r.string().optional(),traceCount:r.property("trace_count",r.number().optional())});var Ws=r.object({workspacesTracesCount:r.property("workspaces_traces_count",r.list(Os).optional())});var ae=r.object({code:r.number().optional(),message:r.string().optional(),details:r.string().optional()});var Bs=r.enum_(["general","slack","pagerduty"]);var Ls=r.object({id:r.string().optional(),name:r.string().optional(),url:r.string(),secretToken:r.property("secret_token",r.string().optional()),headers:r.record(r.string(),r.string()).optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var Vs=r.enum_(["trace:errors","trace:feedback_score","trace_thread:feedback_score","prompt:created","prompt:committed","trace:guardrails_triggered","prompt:deleted","experiment:finished","trace:cost","trace:latency"]);var Hs=r.enum_(["scope:project","threshold:feedback_score","threshold:cost","threshold:latency","threshold:errors"]);var Js=r.object({id:r.string().optional(),alertTriggerId:r.property("alert_trigger_id",r.string().optional()),type:Hs,configValue:r.property("config_value",r.record(r.string(),r.string()).optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var Ks=r.object({id:r.string().optional(),alertId:r.property("alert_id",r.string().optional()),eventType:r.property("event_type",Vs),triggerConfigs:r.property("trigger_configs",r.list(Js).optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional())});var mb=r.object({id:r.string().optional(),name:r.string().optional(),enabled:r.boolean().optional(),alertType:r.property("alert_type",Bs.optional()),metadata:r.record(r.string(),r.string()).optional(),webhook:Ls,triggers:r.list(Ks).optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var Xs=r.enum_(["scope:project","threshold:feedback_score","threshold:cost","threshold:latency","threshold:errors"]);var Gs=r.object({id:r.string().optional(),type:Xs,configValue:r.property("config_value",r.record(r.string(),r.string()).optional())});var $s=r.enum_(["trace:errors","trace:feedback_score","trace_thread:feedback_score","prompt:created","prompt:committed","trace:guardrails_triggered","prompt:deleted","experiment:finished","trace:cost","trace:latency"]);var Qs=r.object({id:r.string().optional(),eventType:r.property("event_type",$s),triggerConfigs:r.property("trigger_configs",r.list(Gs).optional())});var Ys=r.enum_(["general","slack","pagerduty"]);var Zs=r.object({id:r.string().optional(),name:r.string().optional(),url:r.string(),secretToken:r.property("secret_token",r.string().optional()),headers:r.record(r.string(),r.string()).optional()});var Eo=r.object({id:r.string().optional(),name:r.string().optional(),enabled:r.boolean().optional(),alertType:r.property("alert_type",Ys.optional()),metadata:r.record(r.string(),r.string()).optional(),webhook:Zs,triggers:r.list(Qs).optional()});var L=r.object({ids:r.list(r.string())});var qs=r.enum_(["general","slack","pagerduty"]);var ep=r.object({id:r.string().optional(),name:r.string().optional(),url:r.string(),secretToken:r.property("secret_token",r.string().optional()),headers:r.record(r.string(),r.string()).optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var rp=r.enum_(["trace:errors","trace:feedback_score","trace_thread:feedback_score","prompt:created","prompt:committed","trace:guardrails_triggered","prompt:deleted","experiment:finished","trace:cost","trace:latency"]);var op=r.enum_(["scope:project","threshold:feedback_score","threshold:cost","threshold:latency","threshold:errors"]);var tp=r.object({id:r.string().optional(),alertTriggerId:r.property("alert_trigger_id",r.string().optional()),type:op,configValue:r.property("config_value",r.record(r.string(),r.string()).optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var ap=r.object({id:r.string().optional(),alertId:r.property("alert_id",r.string().optional()),eventType:r.property("event_type",rp),triggerConfigs:r.property("trigger_configs",r.list(tp).optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional())});var Po=r.object({id:r.string().optional(),name:r.string().optional(),enabled:r.boolean().optional(),alertType:r.property("alert_type",qs.optional()),metadata:r.record(r.string(),r.string()).optional(),webhook:ep,triggers:r.list(ap).optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var ip=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(Po).optional(),sortableBy:r.property("sortable_by",r.list(r.string()).optional())});var db=r.object({code:r.number().optional(),message:r.string().optional(),details:r.string().optional()});var np=r.object({responseExamples:r.property("response_examples",r.record(r.string(),r.record(r.string(),r.unknown())).optional())});var sp=r.enum_(["success","failure"]);var pp=r.object({status:sp.optional(),statusCode:r.property("status_code",r.number().optional()),requestBody:r.property("request_body",r.string().optional()),errorMessage:r.property("error_message",r.string().optional())});var Ba=r.object({ids:r.list(r.string())});var cp=r.enum_(["trace","thread"]);var lp=r.object({username:r.string().optional(),status:r.number().optional()});var pe=r.object({name:r.string(),value:r.number()});var mp=r.object({id:r.string().optional(),projectId:r.property("project_id",r.string()),projectName:r.property("project_name",r.string().optional()),name:r.string(),description:r.string().optional(),instructions:r.string().optional(),scope:cp,commentsEnabled:r.property("comments_enabled",r.boolean().optional()),feedbackDefinitionNames:r.property("feedback_definition_names",r.list(r.string()).optional()),reviewers:r.list(lp).optional(),feedbackScores:r.property("feedback_scores",r.list(pe).optional()),itemsCount:r.property("items_count",r.number().optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var ub=r.object({annotationQueues:r.property("annotation_queues",r.list(mp))});var dp=r.enum_(["trace","thread"]);var up=r.object({username:r.string().optional(),status:r.number().optional()});var Ve=r.object({name:r.string(),value:r.number()});var Co=r.object({id:r.string().optional(),projectId:r.property("project_id",r.string()),projectName:r.property("project_name",r.string().optional()),name:r.string(),description:r.string().optional(),instructions:r.string().optional(),scope:dp,commentsEnabled:r.property("comments_enabled",r.boolean().optional()),feedbackDefinitionNames:r.property("feedback_definition_names",r.list(r.string()).optional()),reviewers:r.list(up).optional(),feedbackScores:r.property("feedback_scores",r.list(Ve).optional()),itemsCount:r.property("items_count",r.number().optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var gp=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(Co).optional(),sortableBy:r.list(r.string()).optional()});var fp=r.object({link:r.string().optional(),fileName:r.property("file_name",r.string()),fileSize:r.property("file_size",r.number()),mimeType:r.property("mime_type",r.string())});var hp=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(fp).optional(),sortableBy:r.list(r.string()).optional()});var wp=r.enum_(["trace","span"]);var bp=r.object({eTag:r.property("e_tag",r.string()),partNumber:r.property("part_number",r.number())});var La=r.object({fileName:r.property("file_name",r.string()),projectName:r.property("project_name",r.string().optional()),entityType:r.property("entity_type",wp),entityId:r.property("entity_id",r.string()),containerId:r.property("container_id",r.string().optional()),fileSize:r.property("file_size",r.number()),mimeType:r.property("mime_type",r.string().optional()),uploadId:r.property("upload_id",r.string()),uploadedFileParts:r.property("uploaded_file_parts",r.list(bp))});var xp=r.enum_(["trace","span"]);var gb=r.object({fileNames:r.property("file_names",r.list(r.string())),entityType:r.property("entity_type",xp),entityId:r.property("entity_id",r.string()),containerId:r.property("container_id",r.string())});var Rp=r.object({uploadId:r.property("upload_id",r.string()),preSignUrls:r.property("pre_sign_urls",r.list(r.string()))});var yp=r.record(r.string(),r.unknown());var kp=r.object({workspaceName:r.property("workspace_name",r.string().optional())});var vp=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Io=r.object({field:r.string().optional(),operator:vp.optional(),key:r.string().optional(),value:r.string().optional()});var jo=r.object({name:r.string(),temperature:r.number(),seed:r.number().optional(),customParameters:r.property("custom_parameters",D.optional())});var zp=r.enum_(["SYSTEM","USER","AI","TOOL_EXECUTION_RESULT","CUSTOM"]);var Sp=r.object({url:r.string(),detail:r.string().optional()});var _p=r.object({url:r.string()});var Tp=r.object({type:r.string(),text:r.string().optional(),imageUrl:r.property("image_url",Sp.optional()),videoUrl:r.property("video_url",_p.optional())});var Uo=r.object({role:zp,content:r.string().optional(),contentArray:r.property("content_array",r.list(Tp).optional()),stringContent:r.property("string_content",r.boolean().optional()),structuredContent:r.property("structured_content",r.boolean().optional())});var Ap=r.enum_(["BOOLEAN","INTEGER","DOUBLE"]);var No=r.object({name:r.string(),type:Ap,description:r.string()});var Do=r.object({model:jo,messages:r.list(Uo),variables:r.record(r.string(),r.string()),schema:r.list(No)});var Ep=r.object({code:Do.optional()});var Mo=r.object({metric:r.string(),arguments:r.record(r.string(),r.string())});var Pp=r.object({code:Mo.optional()});var Fo=r.object({model:jo,messages:r.list(Uo),schema:r.list(No)});var Cp=r.object({code:Fo.optional()});var Oo=r.object({metric:r.string()});var Ip=r.object({code:Oo.optional()});var Va=r.object({id:r.string().optional(),projectId:r.property("project_id",r.string()),projectName:r.property("project_name",r.string().optional()),name:r.string(),samplingRate:r.property("sampling_rate",r.number().optional()),enabled:r.boolean().optional(),filters:r.list(Io).optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),action:r.stringLiteral("evaluator")}),fb=r.union("type",{llm_as_judge:Ep.extend(Va),user_defined_metric_python:Pp.extend(Va),trace_thread_llm_as_judge:Cp.extend(Va),trace_thread_user_defined_metric_python:Ip.extend(Va)}).transform({transform:i=>i,untransform:i=>i});var Wo=r.object({name:r.string(),temperature:r.number(),seed:r.number().optional(),customParameters:r.property("custom_parameters",Be.optional())});var jp=r.enum_(["SYSTEM","USER","AI","TOOL_EXECUTION_RESULT","CUSTOM"]);var Up=r.object({url:r.string(),detail:r.string().optional()});var Np=r.object({url:r.string()});var Dp=r.object({type:r.string(),text:r.string().optional(),imageUrl:r.property("image_url",Up.optional()),videoUrl:r.property("video_url",Np.optional())});var Bo=r.object({role:jp,content:r.string().optional(),contentArray:r.property("content_array",r.list(Dp).optional()),stringContent:r.property("string_content",r.boolean().optional()),structuredContent:r.property("structured_content",r.boolean().optional())});var Mp=r.enum_(["BOOLEAN","INTEGER","DOUBLE"]);var Lo=r.object({name:r.string(),type:Mp,description:r.string()});var Fp=r.object({model:Wo,messages:r.list(Bo),variables:r.record(r.string(),r.string()),schema:r.list(Lo)});var Op=r.object({code:Fp.optional()});var Wp=r.object({model:Wo,messages:r.list(Bo),schema:r.list(Lo)});var Bp=r.object({code:Wp.optional()});var Lp=r.object({metric:r.string()});var Vp=r.object({code:Lp.optional()});var Hp=r.object({metric:r.string(),arguments:r.record(r.string(),r.string())});var Jp=r.object({code:Hp.optional()});var Kp=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Xp=r.object({field:r.string().optional(),operator:Kp.optional(),key:r.string().optional(),value:r.string().optional()});var Ha=r.object({projectId:r.property("project_id",r.string()),name:r.string(),samplingRate:r.property("sampling_rate",r.number().optional()),enabled:r.boolean().optional(),filters:r.list(Xp).optional(),action:r.stringLiteral("evaluator")}),Gp=r.union("type",{llm_as_judge:Op.extend(Ha),user_defined_metric_python:Jp.extend(Ha),trace_thread_llm_as_judge:Bp.extend(Ha),trace_thread_user_defined_metric_python:Vp.extend(Ha)}).transform({transform:i=>i,untransform:i=>i});var Vo=r.object({name:r.string(),temperature:r.number(),seed:r.number().optional(),customParameters:r.property("custom_parameters",Te.optional())});var $p=r.enum_(["SYSTEM","USER","AI","TOOL_EXECUTION_RESULT","CUSTOM"]);var Qp=r.object({url:r.string(),detail:r.string().optional()});var Yp=r.object({url:r.string()});var Zp=r.object({type:r.string(),text:r.string().optional(),imageUrl:r.property("image_url",Qp.optional()),videoUrl:r.property("video_url",Yp.optional())});var Ho=r.object({role:$p,content:r.string().optional(),contentArray:r.property("content_array",r.list(Zp).optional()),stringContent:r.property("string_content",r.boolean().optional()),structuredContent:r.property("structured_content",r.boolean().optional())});var qp=r.enum_(["BOOLEAN","INTEGER","DOUBLE"]);var Jo=r.object({name:r.string(),type:qp,description:r.string()});var ec=r.object({model:Vo,messages:r.list(Ho),variables:r.record(r.string(),r.string()),schema:r.list(Jo)});var Ko=r.object({code:ec.optional()});var rc=r.object({metric:r.string(),arguments:r.record(r.string(),r.string())});var Xo=r.object({code:rc.optional()});var oc=r.object({model:Vo,messages:r.list(Ho),schema:r.list(Jo)});var Go=r.object({code:oc.optional()});var tc=r.object({metric:r.string()});var $o=r.object({code:tc.optional()});var Ja=r.object({id:r.string().optional(),projectId:r.property("project_id",r.string()),projectName:r.property("project_name",r.string().optional()),name:r.string(),samplingRate:r.property("sampling_rate",r.number().optional()),enabled:r.boolean().optional(),filters:r.list(ze).optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),action:r.stringLiteral("evaluator")}),ac=r.union("type",{llm_as_judge:Ko.extend(Ja),user_defined_metric_python:Xo.extend(Ja),trace_thread_llm_as_judge:Go.extend(Ja),trace_thread_user_defined_metric_python:$o.extend(Ja)}).transform({transform:i=>i,untransform:i=>i});var ic=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(ac).optional(),sortableBy:r.property("sortable_by",r.list(r.string()).optional())});var Ka=r.object({id:r.string().optional(),projectId:r.property("project_id",r.string()),projectName:r.property("project_name",r.string().optional()),name:r.string(),samplingRate:r.property("sampling_rate",r.number().optional()),enabled:r.boolean().optional(),filters:r.list(ze).optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),action:r.stringLiteral("evaluator")}),nc=r.union("type",{llm_as_judge:Ko.extend(Ka),user_defined_metric_python:Xo.extend(Ka),trace_thread_llm_as_judge:Go.extend(Ka),trace_thread_user_defined_metric_python:$o.extend(Ka)}).transform({transform:i=>i,untransform:i=>i});var sc=r.enum_(["INFO","WARN","ERROR","DEBUG","TRACE"]);var pc=r.object({timestamp:r.date().optional(),ruleId:r.property("rule_id",r.string().optional()),level:sc.optional(),message:r.string().optional(),markers:r.record(r.string(),r.string()).optional()});var cc=r.object({content:r.list(pc).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional()});var lc=r.object({code:Do.optional()});var mc=r.object({code:Mo.optional()});var dc=r.object({code:Fo.optional()});var uc=r.object({code:Oo.optional()});var Xa=r.object({name:r.string(),samplingRate:r.property("sampling_rate",r.number().optional()),enabled:r.boolean().optional(),filters:r.list(Io).optional(),projectId:r.property("project_id",r.string()),action:r.stringLiteral("evaluator")}),gc=r.union("type",{llm_as_judge:lc.extend(Xa),user_defined_metric_python:mc.extend(Xa),trace_thread_llm_as_judge:dc.extend(Xa),trace_thread_user_defined_metric_python:uc.extend(Xa)}).transform({transform:i=>i,untransform:i=>i});var fc=r.enum_(["system","user","assistant","tool","function"]);var Qo=r.object({id:r.string().optional(),index:r.number().optional(),type:r.stringLiteral("function").optional(),function:_e.optional()});var hc=r.object({role:fc.optional(),content:r.string().optional(),reasoningContent:r.property("reasoning_content",r.string().optional()),name:r.string().optional(),toolCalls:r.property("tool_calls",r.list(Qo).optional()),refusal:r.string().optional(),functionCall:r.property("function_call",_e.optional())});var wc=r.object({role:r.string().optional(),content:r.string().optional(),reasoningContent:r.property("reasoning_content",r.string().optional()),toolCalls:r.property("tool_calls",r.list(Qo).optional()),functionCall:r.property("function_call",_e.optional())});var bc=r.object({index:r.number().optional(),message:hc.optional(),delta:wc.optional(),finishReason:r.property("finish_reason",r.string().optional())});var xc=r.object({cachedTokens:r.property("cached_tokens",r.number().optional())});var Rc=r.object({reasoningTokens:r.property("reasoning_tokens",r.number().optional())});var yc=r.object({totalTokens:r.property("total_tokens",r.number().optional()),promptTokens:r.property("prompt_tokens",r.number().optional()),promptTokensDetails:r.property("prompt_tokens_details",xc.optional()),completionTokens:r.property("completion_tokens",r.number().optional()),completionTokensDetails:r.property("completion_tokens_details",Rc.optional())});var kc=r.object({id:r.string().optional(),created:r.number().optional(),model:r.string().optional(),choices:r.list(bc).optional(),usage:yc.optional(),systemFingerprint:r.property("system_fingerprint",r.string().optional()),serviceTier:r.property("service_tier",r.string().optional())});var He=r.object({id:r.string().optional(),workspaceId:r.property("workspace_id",r.string().optional()),name:r.string(),slug:r.string().optional(),description:r.string().optional(),config:Te,createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional())});var vc=r.object({content:r.list(He).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional()});var zc=r.enum_(["private","public"]);var hb=r.object({id:r.string().optional(),name:r.string(),visibility:zc.optional(),tags:r.list(r.string()).optional(),description:r.string().optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),experimentCount:r.property("experiment_count",r.number().optional()),datasetItemsCount:r.property("dataset_items_count",r.number().optional()),optimizationCount:r.property("optimization_count",r.number().optional()),mostRecentExperimentAt:r.property("most_recent_experiment_at",r.date().optional()),lastCreatedExperimentAt:r.property("last_created_experiment_at",r.date().optional()),mostRecentOptimizationAt:r.property("most_recent_optimization_at",r.date().optional()),lastCreatedOptimizationAt:r.property("last_created_optimization_at",r.date().optional())});var Sc=r.enum_(["manual","trace","span","sdk"]);var Yo=r.object({id:r.string().optional(),traceId:r.property("trace_id",r.string().optional()),spanId:r.property("span_id",r.string().optional()),source:Sc,data:D,tags:r.list(r.string()).optional(),experimentItems:r.property("experiment_items",r.list(Dr).optional()),datasetId:r.property("dataset_id",r.string().optional()),createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var wb=r.object({datasetName:r.property("dataset_name",r.string().optional()),datasetId:r.property("dataset_id",r.string().optional()),items:r.list(Yo)});var _c=r.object({generatedSamples:r.property("generated_samples",r.list(Yo).optional()),model:r.string().optional(),totalGenerated:r.property("total_generated",r.number().optional()),generationTime:r.property("generation_time",r.date().optional())});var bb=r.object({model:r.string(),sampleCount:r.property("sample_count",r.number().optional()),preserveFields:r.property("preserve_fields",r.list(r.string()).optional()),variationInstructions:r.property("variation_instructions",r.string().optional()),customPrompt:r.property("custom_prompt",r.string().optional())});var Tc=r.enum_(["string","number","object","boolean","array","null"]);var Ac=r.object({name:r.string().optional(),types:r.list(Tc).optional(),filterFieldPrefix:r.property("filter_field_prefix",r.string().optional()),filterField:r.string().optional()});var Ec=r.object({id:r.string().optional(),text:r.string(),createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var Pc=r.enum_(["manual","trace","span","sdk"]);var Ga=r.undiscriminatedUnion([r.record(r.string(),r.unknown()),r.list(r.record(r.string(),r.unknown())),r.string()]);var Cc=r.enum_(["ui","sdk","online_scoring"]);var Ic=r.enum_(["ui","sdk","online_scoring"]);var jc=r.object({value:r.number().optional(),reason:r.string().optional(),categoryName:r.property("category_name",r.string().optional()),source:Ic.optional(),lastUpdatedAt:r.property("last_updated_at",r.date().optional())});var Uc=r.object({name:r.string(),categoryName:r.property("category_name",r.string().optional()),value:r.number(),reason:r.string().optional(),source:Cc,createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),valueByAuthor:r.property("value_by_author",r.record(r.string(),jc).optional())});var Nc=r.enum_(["default","hidden"]);var Dc=r.object({id:r.string().optional(),experimentId:r.property("experiment_id",r.string()),datasetItemId:r.property("dataset_item_id",r.string()),traceId:r.property("trace_id",r.string()),input:Ga.optional(),output:Ga.optional(),feedbackScores:r.property("feedback_scores",r.list(Uc).optional()),comments:r.list(Ec).optional(),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),duration:r.number().optional(),usage:r.record(r.string(),r.number()).optional(),createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),traceVisibilityMode:r.property("trace_visibility_mode",Nc.optional())});var Mc=r.object({id:r.string().optional(),traceId:r.property("trace_id",r.string().optional()),spanId:r.property("span_id",r.string().optional()),source:Pc,data:D,tags:r.list(r.string()).optional(),experimentItems:r.property("experiment_items",r.list(Dc).optional()),datasetId:r.property("dataset_id",r.string().optional()),createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var Fc=r.object({content:r.list(Mc).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),columns:r.list(Ac).optional(),sortableBy:r.list(r.string()).optional()});var Oc=r.enum_(["private","public"]);var nr=r.object({id:r.string().optional(),name:r.string(),visibility:Oc.optional(),tags:r.list(r.string()).optional(),description:r.string().optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),experimentCount:r.property("experiment_count",r.number().optional()),datasetItemsCount:r.property("dataset_items_count",r.number().optional()),optimizationCount:r.property("optimization_count",r.number().optional()),mostRecentExperimentAt:r.property("most_recent_experiment_at",r.date().optional()),lastCreatedExperimentAt:r.property("last_created_experiment_at",r.date().optional()),mostRecentOptimizationAt:r.property("most_recent_optimization_at",r.date().optional()),lastCreatedOptimizationAt:r.property("last_created_optimization_at",r.date().optional())});var Wc=r.object({content:r.list(nr).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),sortableBy:r.list(r.string()).optional()});var Bc=r.object({value:r.number().optional()});var Lc=r.object({value:r.number().optional()});var Zo=r.object({p50:r.number().optional(),p90:r.number().optional(),p99:r.number().optional()});var Vc=r.object({value:Zo.optional()});var Hc=r.object({name:r.string().optional()}),Jc=r.union("type",{PERCENTAGE:Vc.extend(Hc),COUNT:Lc.extend(Hc),AVG:Bc.extend(Hc)}).transform({transform:i=>i,untransform:i=>i});var Je=r.object({stats:r.list(Jc).optional()});var Kc=r.enum_(["manual","trace","span","sdk"]);var Xc=r.enum_(["default","hidden"]);var qo=r.object({id:r.string().optional(),experimentId:r.property("experiment_id",r.string()),datasetItemId:r.property("dataset_item_id",r.string()),traceId:r.property("trace_id",r.string()),createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),traceVisibilityMode:r.property("trace_visibility_mode",Xc.optional())});var et=r.object({id:r.string().optional(),traceId:r.property("trace_id",r.string().optional()),spanId:r.property("span_id",r.string().optional()),source:Kc,data:D,tags:r.list(r.string()).optional(),experimentItems:r.property("experiment_items",r.list(qo).optional()),datasetId:r.property("dataset_id",r.string().optional()),createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var Gc=r.enum_(["string","number","object","boolean","array","null"]);var $c=r.object({name:r.string().optional(),types:r.list(Gc).optional(),filterFieldPrefix:r.property("filter_field_prefix",r.string().optional()),filterField:r.string().optional()});var Qc=r.object({content:r.list(et).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),columns:r.list($c).optional(),sortableBy:r.list(r.string()).optional()});var Yc=r.enum_(["string","number","object","boolean","array","null"]);var Zc=r.object({name:r.string().optional(),types:r.list(Yc).optional(),filterFieldPrefix:r.property("filter_field_prefix",r.string().optional()),filterField:r.string().optional()});var qc=r.object({columns:r.list(Zc).optional()});var el=r.object({typeName:r.string().optional()});var xb=r.object({type:el.optional(),closed:r.boolean().optional()});var rl=r.enum_(["regular","trial","mini-batch"]);var ol=r.enum_(["running","completed","cancelled"]);var Ae=r.object({p50:r.number().optional(),p90:r.number().optional(),p99:r.number().optional()});var $a=r.object({id:r.string(),commit:r.string().optional(),promptId:r.property("prompt_id",r.string().optional()),promptName:r.property("prompt_name",r.string().optional())});var Rb=r.object({id:r.string().optional(),datasetName:r.property("dataset_name",r.string()),datasetId:r.property("dataset_id",r.string().optional()),name:r.string().optional(),metadata:N.optional(),type:rl.optional(),optimizationId:r.property("optimization_id",r.string().optional()),feedbackScores:r.property("feedback_scores",r.list(pe).optional()),comments:r.list(H).optional(),traceCount:r.property("trace_count",r.number().optional()),createdAt:r.property("created_at",r.date().optional()),duration:Ae.optional(),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),totalEstimatedCostAvg:r.property("total_estimated_cost_avg",r.number().optional()),usage:r.record(r.string(),r.number()).optional(),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),status:ol.optional(),promptVersion:r.property("prompt_version",$a.optional()),promptVersions:r.property("prompt_versions",r.list($a).optional())});var sr=r.object({ids:r.list(r.string())});var tl=r.enum_(["TOPIC","PII"]);var al=r.enum_(["passed","failed"]);var il=r.object({name:tl.optional(),result:al.optional()});var nl=r.object({spanId:r.property("span_id",r.string().optional()),checks:r.list(il).optional()});var sl=r.enum_(["default","hidden"]);var rt=r.object({id:r.string().optional(),projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),name:r.string().optional(),startTime:r.property("start_time",r.date()),endTime:r.property("end_time",r.date().optional()),input:N.optional(),output:N.optional(),metadata:N.optional(),tags:r.list(r.string()).optional(),errorInfo:r.property("error_info",Se.optional()),usage:r.record(r.string(),r.number()).optional(),createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),feedbackScores:r.property("feedback_scores",r.list(ee).optional()),comments:r.list(H).optional(),guardrailsValidations:r.property("guardrails_validations",r.list(nl).optional()),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),spanCount:r.property("span_count",r.number().optional()),duration:r.number().optional(),threadId:r.property("thread_id",r.string().optional()),visibilityMode:r.property("visibility_mode",sl.optional()),llmSpanCount:r.property("llm_span_count",r.number().optional()),hasToolSpans:r.property("has_tool_spans",r.boolean().optional()),providers:r.list(r.string()).optional()});var pl=r.enum_(["general","tool","llm","guardrail"]);var ot=r.object({id:r.string().optional(),projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),traceId:r.property("trace_id",r.string().optional()),parentSpanId:r.property("parent_span_id",r.string().optional()),name:r.string().optional(),type:pl.optional(),startTime:r.property("start_time",r.date()),endTime:r.property("end_time",r.date().optional()),input:N.optional(),output:N.optional(),metadata:N.optional(),model:r.string().optional(),provider:r.string().optional(),tags:r.list(r.string()).optional(),usage:r.record(r.string(),r.number()).optional(),errorInfo:r.property("error_info",Se.optional()),createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),feedbackScores:r.property("feedback_scores",r.list(ee).optional()),comments:r.list(H).optional(),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),totalEstimatedCostVersion:r.property("total_estimated_cost_version",r.string().optional()),duration:r.number().optional()});var cl=r.object({datasetItemId:r.property("dataset_item_id",r.string()),evaluateTaskResult:r.property("evaluate_task_result",N.optional()),trace:rt.optional(),spans:r.list(ot).optional(),feedbackScores:r.property("feedback_scores",r.list(ee).optional())});var yb=r.object({experimentName:r.property("experiment_name",r.string()),datasetName:r.property("dataset_name",r.string()),experimentId:r.property("experiment_id",r.string().optional()),items:r.list(cl)});var Ke=r.object({id:r.string().optional(),text:r.string(),createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var ce=r.undiscriminatedUnion([r.record(r.string(),r.unknown()),r.list(r.record(r.string(),r.unknown())),r.string()]);var ll=r.enum_(["regular","trial","mini-batch"]);var ml=r.enum_(["running","completed","cancelled"]);var Qa=r.object({id:r.string(),commit:r.string().optional(),promptId:r.property("prompt_id",r.string().optional()),promptName:r.property("prompt_name",r.string().optional())});var tt=r.object({id:r.string().optional(),datasetName:r.property("dataset_name",r.string()),datasetId:r.property("dataset_id",r.string().optional()),name:r.string().optional(),metadata:ce.optional(),type:ll.optional(),optimizationId:r.property("optimization_id",r.string().optional()),feedbackScores:r.property("feedback_scores",r.list(Ve).optional()),comments:r.list(Ke).optional(),traceCount:r.property("trace_count",r.number().optional()),createdAt:r.property("created_at",r.date().optional()),duration:Zo.optional(),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),totalEstimatedCostAvg:r.property("total_estimated_cost_avg",r.number().optional()),usage:r.record(r.string(),r.number()).optional(),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),status:ml.optional(),promptVersion:r.property("prompt_version",Qa.optional()),promptVersions:r.property("prompt_versions",r.list(Qa).optional())});var dl=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(tt).optional(),sortableBy:r.list(r.string()).optional()});var ul=r.object({label:r.string().optional()});var gl=r.object({groupSorting:r.property("group_sorting",r.list(r.string()).optional())});var fl=r.object({groupsDetails:r.property("groups_details",r.list(gl).optional())});var hl=r.object({content:r.record(r.string(),ul).optional(),details:fl.optional()});var wl=r.object({experimentCount:r.property("experiment_count",r.number().optional()),traceCount:r.property("trace_count",r.number().optional()),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),totalEstimatedCostAvg:r.property("total_estimated_cost_avg",r.number().optional()),duration:Ae.optional(),feedbackScores:r.property("feedback_scores",r.list(pe).optional())});var bl=r.object({aggregations:wl.optional()});var xl=r.object({content:r.record(r.string(),bl).optional()});var kb=r.object({ids:r.list(r.string())});var Rl=r.object({typeName:r.string().optional()});var vb=r.object({type:Rl.optional(),closed:r.boolean().optional()});var yl=r.object({trueLabel:r.string(),falseLabel:r.string()});var kl=r.object({details:yl.optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var vl=r.object({categories:r.record(r.string(),r.number())});var zl=r.object({details:vl.optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var Sl=r.object({max:r.number(),min:r.number()});var _l=r.object({details:Sl.optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var Tl=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional(),createdAt:r.date().optional(),createdBy:r.string().optional(),lastUpdatedAt:r.date().optional(),lastUpdatedBy:r.string().optional()}),zb=r.union("type",{numerical:_l.extend(Tl),categorical:zl.extend(Tl),boolean:kl.extend(Tl)}).transform({transform:i=>i,untransform:i=>i});var Al=r.object({trueLabel:r.string(),falseLabel:r.string()});var El=r.object({details:Al.optional()});var Pl=r.object({categories:r.record(r.string(),r.number())});var Cl=r.object({details:Pl.optional()});var Il=r.object({max:r.number(),min:r.number()});var jl=r.object({details:Il.optional()});var Ul=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional()}),Nl=r.union("type",{numerical:jl.extend(Ul),categorical:Cl.extend(Ul),boolean:El.extend(Ul)}).transform({transform:i=>i,untransform:i=>i});var Dl=r.object({trueLabel:r.string(),falseLabel:r.string()});var at=r.object({details:Dl.optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var Ml=r.object({categories:r.record(r.string(),r.number())});var it=r.object({details:Ml.optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var Fl=r.object({max:r.number(),min:r.number()});var nt=r.object({details:Fl.optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var Ol=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional(),createdAt:r.date().optional(),createdBy:r.string().optional(),lastUpdatedAt:r.date().optional(),lastUpdatedBy:r.string().optional()}),Wl=r.union("type",{numerical:nt.extend(Ol),categorical:it.extend(Ol),boolean:at.extend(Ol)}).transform({transform:i=>i,untransform:i=>i});var Bl=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(Wl).optional()});var Ll=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional(),createdAt:r.date().optional(),createdBy:r.string().optional(),lastUpdatedAt:r.date().optional(),lastUpdatedBy:r.string().optional()}),Vl=r.union("type",{numerical:nt.extend(Ll),categorical:it.extend(Ll),boolean:at.extend(Ll)}).transform({transform:i=>i,untransform:i=>i});var Hl=r.object({trueLabel:r.string(),falseLabel:r.string()});var Jl=r.object({details:Hl.optional()});var Kl=r.object({categories:r.record(r.string(),r.number())});var Xl=r.object({details:Kl.optional()});var Gl=r.object({max:r.number(),min:r.number()});var $l=r.object({details:Gl.optional()});var Ql=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional()}),Yl=r.union("type",{numerical:$l.extend(Ql),categorical:Xl.extend(Ql),boolean:Jl.extend(Ql)}).transform({transform:i=>i,untransform:i=>i});var Zl=r.enum_(["TOPIC","PII"]);var ql=r.enum_(["passed","failed"]);var em=r.object({id:r.string().optional(),entityId:r.property("entity_id",r.string()),secondaryId:r.property("secondary_id",r.string()),projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),name:Zl,result:ql,config:D,details:D});var Sb=r.object({guardrails:r.list(em)});var rm=r.enum_(["openai","anthropic","gemini","openrouter","vertex-ai","custom-llm"]);var st=r.object({id:r.string().optional(),provider:rm,apiKey:r.property("api_key",r.string().optional()),name:r.string().optional(),providerName:r.property("provider_name",r.string().optional()),headers:r.record(r.string(),r.string()).optional(),configuration:r.record(r.string(),r.string()).optional(),baseUrl:r.property("base_url",r.string().optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var om=r.object({size:r.number().optional(),total:r.number().optional(),content:r.list(st).optional(),sortableBy:r.list(r.string()).optional()});var tm=r.enum_(["openai","anthropic","gemini","openrouter","vertex-ai","custom-llm"]);var _b=r.object({id:r.string().optional(),provider:tm,apiKey:r.property("api_key",r.string().optional()),name:r.string().optional(),providerName:r.property("provider_name",r.string().optional()),headers:r.record(r.string(),r.string()).optional(),configuration:r.record(r.string(),r.string()).optional(),baseUrl:r.property("base_url",r.string().optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var Ya=r.object({entitiesQueued:r.property("entities_queued",r.number().optional()),rulesApplied:r.property("rules_applied",r.number().optional())});var am=r.enum_(["trace","thread"]);var Za=r.object({projectId:r.property("project_id",r.string()),entityIds:r.property("entity_ids",r.list(r.string())),ruleIds:r.property("rule_ids",r.list(r.string())),entityType:r.property("entity_type",am)});var Tb=D;var im=r.enum_(["running","completed","cancelled"]);var Ab=r.object({id:r.string().optional(),name:r.string().optional(),datasetName:r.property("dataset_name",r.string()),objectiveName:r.property("objective_name",r.string()),status:im,metadata:N.optional(),datasetId:r.property("dataset_id",r.string().optional()),numTrials:r.property("num_trials",r.number().optional()),feedbackScores:r.property("feedback_scores",r.list(pe).optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var nm=r.enum_(["running","completed","cancelled"]);var qa=r.object({id:r.string().optional(),name:r.string().optional(),datasetName:r.property("dataset_name",r.string()),objectiveName:r.property("objective_name",r.string()),status:nm,metadata:se.optional(),lastUpdatedAt:r.property("last_updated_at",r.date().optional())});var sm=r.enum_(["running","completed","cancelled"]);var pt=r.object({id:r.string().optional(),name:r.string().optional(),datasetName:r.property("dataset_name",r.string()),objectiveName:r.property("objective_name",r.string()),status:sm,metadata:ce.optional(),datasetId:r.property("dataset_id",r.string().optional()),numTrials:r.property("num_trials",r.number().optional()),feedbackScores:r.property("feedback_scores",r.list(Ve).optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var pm=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(pt).optional(),sortableBy:r.list(r.string()).optional()});var ct=r.object({count:r.number().optional(),deviation:r.number().optional(),deviationPercentage:r.property("deviation_percentage",r.number().optional())});var cm=r.enum_(["private","public"]);var Eb=r.object({id:r.string().optional(),name:r.string(),visibility:cm.optional(),description:r.string().optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),lastUpdatedTraceAt:r.property("last_updated_trace_at",r.date().optional()),feedbackScores:r.property("feedback_scores",r.list(pe).optional()),duration:Ae.optional(),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),totalEstimatedCostSum:r.property("total_estimated_cost_sum",r.number().optional()),usage:r.record(r.string(),r.number()).optional(),traceCount:r.property("trace_count",r.number().optional()),guardrailsFailedCount:r.property("guardrails_failed_count",r.number().optional()),errorCount:r.property("error_count",ct.optional())});var lm=r.enum_(["private","public"]);var lt=r.object({id:r.string().optional(),name:r.string(),visibility:lm.optional(),description:r.string().optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),lastUpdatedTraceAt:r.property("last_updated_trace_at",r.date().optional())});var mm=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(lt).optional(),sortableBy:r.list(r.string()).optional()});var dm=r.object({name:r.string().optional()});var um=r.object({scores:r.list(dm).optional()});var gm=r.object({time:r.date(),value:r.number().optional()});var fm=r.enum_(["FEEDBACK_SCORES","TRACE_COUNT","TOKEN_USAGE","DURATION","COST","GUARDRAILS_FAILED_COUNT","THREAD_COUNT","THREAD_DURATION","THREAD_FEEDBACK_SCORES"]);var hm=r.enum_(["HOURLY","DAILY","WEEKLY"]);var wm=r.object({name:r.string().optional(),data:r.list(gm).optional()});var bm=r.object({projectId:r.property("project_id",r.string().optional()),metricType:r.property("metric_type",fm.optional()),interval:hm.optional(),results:r.list(wm).optional()});var xm=r.object({projectId:r.property("project_id",r.string().optional()),feedbackScores:r.property("feedback_scores",r.list(pe).optional()),duration:Ae.optional(),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),totalEstimatedCostSum:r.property("total_estimated_cost_sum",r.number().optional()),usage:r.record(r.string(),r.number()).optional(),traceCount:r.property("trace_count",r.number().optional()),guardrailsFailedCount:r.property("guardrails_failed_count",r.number().optional()),errorCount:r.property("error_count",ct.optional())});var Rm=r.object({content:r.list(xm).optional()});var ym=r.object({count:r.number().optional(),deviation:r.number().optional(),deviationPercentage:r.property("deviation_percentage",r.number().optional())});var km=r.object({name:r.string(),value:r.number()});var vm=r.object({p50:r.number().optional(),p90:r.number().optional(),p99:r.number().optional()});var zm=r.enum_(["private","public"]);var Sm=r.object({id:r.string().optional(),name:r.string(),visibility:zm.optional(),description:r.string().optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),lastUpdatedTraceAt:r.property("last_updated_trace_at",r.date().optional()),feedbackScores:r.property("feedback_scores",r.list(km).optional()),duration:vm.optional(),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),totalEstimatedCostSum:r.property("total_estimated_cost_sum",r.number().optional()),usage:r.record(r.string(),r.number()).optional(),traceCount:r.property("trace_count",r.number().optional()),guardrailsFailedCount:r.property("guardrails_failed_count",r.number().optional()),errorCount:r.property("error_count",ym.optional())});var Pb=r.object({errors:r.list(r.string()).optional()});var _m=r.enum_(["mustache","jinja2"]);var Tm=r.enum_(["mustache","jinja2"]);var Am=r.object({id:r.string().optional(),promptId:r.property("prompt_id",r.string().optional()),commit:r.string().optional(),template:r.string(),metadata:D.optional(),type:Tm.optional(),changeDescription:r.property("change_description",r.string().optional()),variables:r.list(r.string()).optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional())});var Cb=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional(),template:r.string().optional(),metadata:D.optional(),changeDescription:r.property("change_description",r.string().optional()),type:_m.optional(),tags:r.list(r.string()).optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),versionCount:r.property("version_count",r.number().optional()),latestVersion:r.property("latest_version",Am.optional())});var Ib=r.object({code:r.number().optional(),message:r.string().optional(),details:r.string().optional()});var Em=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional(),tags:r.list(r.string()).optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),versionCount:r.property("version_count",r.number().optional()),latestVersion:r.property("latest_version",ke.optional())});var Pm=r.enum_(["mustache","jinja2"]);var Cm=r.object({id:r.string().optional(),promptId:r.property("prompt_id",r.string().optional()),commit:r.string().optional(),template:r.string(),metadata:Te.optional(),type:Pm.optional(),changeDescription:r.property("change_description",r.string().optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional())});var Im=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(Cm).optional()});var jm=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional(),tags:r.list(r.string()).optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),versionCount:r.property("version_count",r.number().optional())});var Um=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(jm).optional(),sortableBy:r.list(r.string()).optional()});var Nm=r.object({pythonEvaluatorEnabled:r.boolean(),traceThreadPythonEvaluatorEnabled:r.boolean(),guardrailsEnabled:r.boolean(),opikAiEnabled:r.property("opikAIEnabled",r.boolean()),alertsEnabled:r.boolean(),welcomeWizardEnabled:r.boolean(),csvUploadEnabled:r.boolean(),exportEnabled:r.boolean()});var jb=r.object({spans:r.list(ot)});var mt=r.object({name:r.string(),author:r.string().optional()});var dt=r.object({exceptionType:r.property("exception_type",r.string()),message:r.string().optional(),traceback:r.string()});var Dm=r.enum_(["ui","sdk","online_scoring"]);var Mm=r.enum_(["ui","sdk","online_scoring"]);var Fm=r.object({value:r.number().optional(),reason:r.string().optional(),categoryName:r.property("category_name",r.string().optional()),source:Mm.optional(),lastUpdatedAt:r.property("last_updated_at",r.date().optional())});var ut=r.object({name:r.string(),categoryName:r.property("category_name",r.string().optional()),value:r.number(),reason:r.string().optional(),source:Dm,createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),valueByAuthor:r.property("value_by_author",r.record(r.string(),Fm).optional())});var Om=r.enum_(["general","tool","llm","guardrail"]);var gt=r.object({id:r.string().optional(),projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),traceId:r.property("trace_id",r.string().optional()),parentSpanId:r.property("parent_span_id",r.string().optional()),name:r.string().optional(),type:Om.optional(),startTime:r.property("start_time",r.date()),endTime:r.property("end_time",r.date().optional()),input:ce.optional(),output:ce.optional(),metadata:ce.optional(),model:r.string().optional(),provider:r.string().optional(),tags:r.list(r.string()).optional(),usage:r.record(r.string(),r.number()).optional(),errorInfo:r.property("error_info",dt.optional()),createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),feedbackScores:r.property("feedback_scores",r.list(ut).optional()),comments:r.list(Ke).optional(),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),totalEstimatedCostVersion:r.property("total_estimated_cost_version",r.string().optional()),duration:r.number().optional()});var Wm=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(gt).optional(),sortableBy:r.list(r.string()).optional()});var Bm=r.enum_(["ui","sdk","online_scoring"]);var Lm=r.object({projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),name:r.string(),categoryName:r.property("category_name",r.string().optional()),value:r.number(),reason:r.string().optional(),source:Bm,author:r.string().optional(),id:r.string()});var ft=r.object({scores:r.list(Lm)});var Ub=r.object({traces:r.list(rt)});var Nb=r.object({ids:r.list(r.string()),projectId:r.property("project_id",r.string().optional())});var Vm=r.enum_(["TOPIC","PII"]);var Hm=r.enum_(["passed","failed"]);var Jm=r.object({name:Vm.optional(),result:Hm.optional()});var Km=r.object({spanId:r.property("span_id",r.string().optional()),checks:r.list(Jm).optional()});var Xm=r.enum_(["default","hidden"]);var ht=r.object({id:r.string().optional(),projectId:r.property("project_id",r.string().optional()),name:r.string().optional(),startTime:r.property("start_time",r.date()),endTime:r.property("end_time",r.date().optional()),input:ce.optional(),output:ce.optional(),metadata:ce.optional(),tags:r.list(r.string()).optional(),errorInfo:r.property("error_info",dt.optional()),usage:r.record(r.string(),r.number()).optional(),createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),feedbackScores:r.property("feedback_scores",r.list(ut).optional()),comments:r.list(Ke).optional(),guardrailsValidations:r.property("guardrails_validations",r.list(Km).optional()),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),spanCount:r.property("span_count",r.number().optional()),duration:r.number().optional(),threadId:r.property("thread_id",r.string().optional()),visibilityMode:r.property("visibility_mode",Xm.optional()),llmSpanCount:r.property("llm_span_count",r.number().optional()),hasToolSpans:r.property("has_tool_spans",r.boolean().optional()),providers:r.list(r.string()).optional()});var Gm=r.enum_(["active","inactive"]);var wt=r.object({id:r.string().optional(),projectId:r.property("project_id",r.string().optional()),threadModelId:r.property("thread_model_id",r.string().optional()),startTime:r.property("start_time",r.date().optional()),endTime:r.property("end_time",r.date().optional()),duration:r.number().optional(),firstMessage:r.property("first_message",N.optional()),lastMessage:r.property("last_message",N.optional()),feedbackScores:r.property("feedback_scores",r.list(ee).optional()),status:Gm.optional(),numberOfMessages:r.property("number_of_messages",r.number().optional()),totalEstimatedCost:r.property("total_estimated_cost",r.number().optional()),usage:r.record(r.string(),r.number()).optional(),comments:r.list(H).optional(),tags:r.list(r.string()).optional(),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional()),createdBy:r.property("created_by",r.string().optional()),createdAt:r.property("created_at",r.date().optional())});var ei=r.object({projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),threadId:r.property("thread_id",r.string()),truncate:r.boolean().optional()});var $m=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(wt).optional(),sortableBy:r.list(r.string()).optional()});var Qm=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(ht).optional(),sortableBy:r.list(r.string()).optional()});var Ym=r.object({completed:r.boolean().optional()});var Xe=r.object({name:r.string().optional(),current:r.number().optional(),previous:r.number().optional()});var pr=r.object({projectIds:r.property("project_ids",r.list(r.string()).optional()),intervalStart:r.property("interval_start",r.date()),intervalEnd:r.property("interval_end",r.date()),startBeforeEnd:r.property("start_before_end",r.boolean().optional())});var Db=r.object({time:r.date(),value:r.number().optional()});var ri=r.object({results:r.list(Xe).optional()});var Mb=r.object({projectIds:r.property("project_ids",r.list(r.string()).optional()),name:r.string().optional(),intervalStart:r.property("interval_start",r.date()),intervalEnd:r.property("interval_end",r.date()),startBeforeEnd:r.property("start_before_end",r.boolean().optional())});var bt=r.object({timeoutToMarkThreadAsInactive:r.property("timeout_to_mark_thread_as_inactive",r.string().optional()),truncationOnTables:r.property("truncation_on_tables",r.boolean().optional())});var Zm=r.object({results:r.list(Xe).optional()});var oi=class{constructor(t={}){this._options=t;}getDatasetBiInfo(t){return h.fromPromise(this.__getDatasetBiInfo(t))}async __getDatasetBiInfo(t){var o,a;let e=await b({url:x((a=(o=await s.get(this._options.baseUrl))!=null?o:await s.get(this._options.environment))!=null?a:w.Default,"v1/internal/usage/bi-datasets"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...t==null?void 0:t.headers},contentType:"application/json",requestType:"json",timeoutMs:(t==null?void 0:t.timeoutInSeconds)!=null?t.timeoutInSeconds*1e3:6e4,maxRetries:t==null?void 0:t.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal});if(e.ok)return {data:ir.parseOrThrow(e.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:e.rawResponse};if(e.error.reason==="status-code")throw new p({statusCode:e.error.statusCode,body:e.error.body,rawResponse:e.rawResponse});switch(e.error.reason){case "non-json":throw new p({statusCode:e.error.statusCode,body:e.error.rawBody,rawResponse:e.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/internal/usage/bi-datasets.");case "unknown":throw new p({message:e.error.errorMessage,rawResponse:e.rawResponse})}}getExperimentBiInfo(t){return h.fromPromise(this.__getExperimentBiInfo(t))}async __getExperimentBiInfo(t){var o,a;let e=await b({url:x((a=(o=await s.get(this._options.baseUrl))!=null?o:await s.get(this._options.environment))!=null?a:w.Default,"v1/internal/usage/bi-experiments"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...t==null?void 0:t.headers},contentType:"application/json",requestType:"json",timeoutMs:(t==null?void 0:t.timeoutInSeconds)!=null?t.timeoutInSeconds*1e3:6e4,maxRetries:t==null?void 0:t.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal});if(e.ok)return {data:ir.parseOrThrow(e.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:e.rawResponse};if(e.error.reason==="status-code")throw new p({statusCode:e.error.statusCode,body:e.error.body,rawResponse:e.rawResponse});switch(e.error.reason){case "non-json":throw new p({statusCode:e.error.statusCode,body:e.error.rawBody,rawResponse:e.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/internal/usage/bi-experiments.");case "unknown":throw new p({message:e.error.errorMessage,rawResponse:e.rawResponse})}}getSpansBiInfo(t){return h.fromPromise(this.__getSpansBiInfo(t))}async __getSpansBiInfo(t){var o,a;let e=await b({url:x((a=(o=await s.get(this._options.baseUrl))!=null?o:await s.get(this._options.environment))!=null?a:w.Default,"v1/internal/usage/bi-spans"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...t==null?void 0:t.headers},contentType:"application/json",requestType:"json",timeoutMs:(t==null?void 0:t.timeoutInSeconds)!=null?t.timeoutInSeconds*1e3:6e4,maxRetries:t==null?void 0:t.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal});if(e.ok)return {data:ir.parseOrThrow(e.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:e.rawResponse};if(e.error.reason==="status-code")throw new p({statusCode:e.error.statusCode,body:e.error.body,rawResponse:e.rawResponse});switch(e.error.reason){case "non-json":throw new p({statusCode:e.error.statusCode,body:e.error.rawBody,rawResponse:e.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/internal/usage/bi-spans.");case "unknown":throw new p({message:e.error.errorMessage,rawResponse:e.rawResponse})}}getSpansCountForWorkspaces(t){return h.fromPromise(this.__getSpansCountForWorkspaces(t))}async __getSpansCountForWorkspaces(t){var o,a;let e=await b({url:x((a=(o=await s.get(this._options.baseUrl))!=null?o:await s.get(this._options.environment))!=null?a:w.Default,"v1/internal/usage/workspace-span-counts"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...t==null?void 0:t.headers},contentType:"application/json",requestType:"json",timeoutMs:(t==null?void 0:t.timeoutInSeconds)!=null?t.timeoutInSeconds*1e3:6e4,maxRetries:t==null?void 0:t.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal});if(e.ok)return {data:Fs.parseOrThrow(e.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:e.rawResponse};if(e.error.reason==="status-code")throw new p({statusCode:e.error.statusCode,body:e.error.body,rawResponse:e.rawResponse});switch(e.error.reason){case "non-json":throw new p({statusCode:e.error.statusCode,body:e.error.rawBody,rawResponse:e.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/internal/usage/workspace-span-counts.");case "unknown":throw new p({message:e.error.errorMessage,rawResponse:e.rawResponse})}}getTracesBiInfo(t){return h.fromPromise(this.__getTracesBiInfo(t))}async __getTracesBiInfo(t){var o,a;let e=await b({url:x((a=(o=await s.get(this._options.baseUrl))!=null?o:await s.get(this._options.environment))!=null?a:w.Default,"v1/internal/usage/bi-traces"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...t==null?void 0:t.headers},contentType:"application/json",requestType:"json",timeoutMs:(t==null?void 0:t.timeoutInSeconds)!=null?t.timeoutInSeconds*1e3:6e4,maxRetries:t==null?void 0:t.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal});if(e.ok)return {data:ir.parseOrThrow(e.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:e.rawResponse};if(e.error.reason==="status-code")throw new p({statusCode:e.error.statusCode,body:e.error.body,rawResponse:e.rawResponse});switch(e.error.reason){case "non-json":throw new p({statusCode:e.error.statusCode,body:e.error.rawBody,rawResponse:e.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/internal/usage/bi-traces.");case "unknown":throw new p({message:e.error.errorMessage,rawResponse:e.rawResponse})}}getTracesCountForWorkspaces(t){return h.fromPromise(this.__getTracesCountForWorkspaces(t))}async __getTracesCountForWorkspaces(t){var o,a;let e=await b({url:x((a=(o=await s.get(this._options.baseUrl))!=null?o:await s.get(this._options.environment))!=null?a:w.Default,"v1/internal/usage/workspace-trace-counts"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...t==null?void 0:t.headers},contentType:"application/json",requestType:"json",timeoutMs:(t==null?void 0:t.timeoutInSeconds)!=null?t.timeoutInSeconds*1e3:6e4,maxRetries:t==null?void 0:t.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal});if(e.ok)return {data:Ws.parseOrThrow(e.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:e.rawResponse};if(e.error.reason==="status-code")throw new p({statusCode:e.error.statusCode,body:e.error.body,rawResponse:e.rawResponse});switch(e.error.reason){case "non-json":throw new p({statusCode:e.error.statusCode,body:e.error.rawBody,rawResponse:e.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/internal/usage/workspace-trace-counts.");case "unknown":throw new p({message:e.error.errorMessage,rawResponse:e.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var ti=class{constructor(t={}){this._options=t;}findAlerts(t={},e){return h.fromPromise(this.__findAlerts(t,e))}async __findAlerts(t={},e){var g,R;let{page:o,size:a,sorting:n,filters:c}=t,m={};o!=null&&(m.page=o.toString()),a!=null&&(m.size=a.toString()),n!=null&&(m.sorting=n),c!=null&&(m.filters=c);let u=await b({url:x((R=(g=await s.get(this._options.baseUrl))!=null?g:await s.get(this._options.environment))!=null?R:w.Default,"v1/private/alerts"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:m,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(u.ok)return {data:ip.parseOrThrow(u.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:u.rawResponse};if(u.error.reason==="status-code")throw new p({statusCode:u.error.statusCode,body:u.error.body,rawResponse:u.rawResponse});switch(u.error.reason){case "non-json":throw new p({statusCode:u.error.statusCode,body:u.error.rawBody,rawResponse:u.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/alerts.");case "unknown":throw new p({message:u.error.errorMessage,rawResponse:u.rawResponse})}}createAlert(t,e){return h.fromPromise(this.__createAlert(t,e))}async __createAlert(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/alerts"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Eo.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);case 409:throw new W(o.error.body,o.rawResponse);case 422:throw new B(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/alerts.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteAlertBatch(t,e){return h.fromPromise(this.__deleteAlertBatch(t,e))}async __deleteAlertBatch(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/alerts/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:L.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/alerts/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getAlertById(t,e){return h.fromPromise(this.__getAlertById(t,e))}async __getAlertById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/alerts/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:Po.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 404:throw new T(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/alerts/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}updateAlert(t,e,o){return h.fromPromise(this.__updateAlert(t,e,o))}async __updateAlert(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/alerts/${encodeURIComponent(t)}`),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:Eo.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new _(a.error.body,a.rawResponse);case 409:throw new W(a.error.body,a.rawResponse);case 422:throw new B(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/alerts/{id}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}getWebhookExamples(t={},e){return h.fromPromise(this.__getWebhookExamples(t,e))}async __getWebhookExamples(t={},e){var c,m;let{alertType:o}=t,a={};o!=null&&(a.alert_type=ea.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}));let n=await b({url:x((m=(c=await s.get(this._options.baseUrl))!=null?c:await s.get(this._options.environment))!=null?m:w.Default,"v1/private/alerts/webhooks/examples"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:a,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(n.ok)return {data:np.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new p({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});switch(n.error.reason){case "non-json":throw new p({statusCode:n.error.statusCode,body:n.error.rawBody,rawResponse:n.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/alerts/webhooks/examples.");case "unknown":throw new p({message:n.error.errorMessage,rawResponse:n.rawResponse})}}testWebhook(t,e){return h.fromPromise(this.__testWebhook(t,e))}async __testWebhook(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/alerts/webhooks/tests"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Eo.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:pp.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 422:throw new B(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/alerts/webhooks/tests.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var ai=class{constructor(t={}){this._options=t;}addItemsToAnnotationQueue(t,e,o){return h.fromPromise(this.__addItemsToAnnotationQueue(t,e,o))}async __addItemsToAnnotationQueue(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/annotation-queues/${encodeURIComponent(t)}/items/add`),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:Ba.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 404:throw new T(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/annotation-queues/{id}/items/add.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}findAnnotationQueues(t={},e){return h.fromPromise(this.__findAnnotationQueues(t,e))}async __findAnnotationQueues(t={},e){var R,y;let{page:o,size:a,name:n,filters:c,sorting:m}=t,u={};o!=null&&(u.page=o.toString()),a!=null&&(u.size=a.toString()),n!=null&&(u.name=n),c!=null&&(u.filters=c),m!=null&&(u.sorting=m);let g=await b({url:x((y=(R=await s.get(this._options.baseUrl))!=null?R:await s.get(this._options.environment))!=null?y:w.Default,"v1/private/annotation-queues"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:u,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(g.ok)return {data:gp.parseOrThrow(g.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:g.rawResponse};if(g.error.reason==="status-code")throw new p({statusCode:g.error.statusCode,body:g.error.body,rawResponse:g.rawResponse});switch(g.error.reason){case "non-json":throw new p({statusCode:g.error.statusCode,body:g.error.rawBody,rawResponse:g.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/annotation-queues.");case "unknown":throw new p({message:g.error.errorMessage,rawResponse:g.rawResponse})}}createAnnotationQueue(t,e){return h.fromPromise(this.__createAnnotationQueue(t,e))}async __createAnnotationQueue(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/annotation-queues"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Ro.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);case 422:throw new B(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/annotation-queues.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}createAnnotationQueueBatch(t,e){return h.fromPromise(this.__createAnnotationQueueBatch(t,e))}async __createAnnotationQueueBatch(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/annotation-queues/batch"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:yo.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);case 409:throw new W(o.error.body,o.rawResponse);case 422:throw new B(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/annotation-queues/batch.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteAnnotationQueueBatch(t,e){return h.fromPromise(this.__deleteAnnotationQueueBatch(t,e))}async __deleteAnnotationQueueBatch(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/annotation-queues/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:L.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/annotation-queues/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getAnnotationQueueById(t,e){return h.fromPromise(this.__getAnnotationQueueById(t,e))}async __getAnnotationQueueById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/annotation-queues/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:Co.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 404:throw new T(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/annotation-queues/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}updateAnnotationQueue(t,e={},o){return h.fromPromise(this.__updateAnnotationQueue(t,e,o))}async __updateAnnotationQueue(t,e={},o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/annotation-queues/${encodeURIComponent(t)}`),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:ko.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new _(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/annotation-queues/{id}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}removeItemsFromAnnotationQueue(t,e,o){return h.fromPromise(this.__removeItemsFromAnnotationQueue(t,e,o))}async __removeItemsFromAnnotationQueue(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/annotation-queues/${encodeURIComponent(t)}/items/delete`),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:Ba.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 404:throw new T(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/annotation-queues/{id}/items/delete.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var ii=class{constructor(t={}){this._options=t;}attachmentList(t,e){return h.fromPromise(this.__attachmentList(t,e))}async __attachmentList(t,e){var y,v;let{page:o,size:a,projectId:n,entityType:c,entityId:m,path:u}=t,g={};o!=null&&(g.page=o.toString()),a!=null&&(g.size=a.toString()),g.project_id=n,g.entity_type=oa.jsonOrThrow(c,{unrecognizedObjectKeys:"strip"}),g.entity_id=m,g.path=u;let R=await b({url:x((v=(y=await s.get(this._options.baseUrl))!=null?y:await s.get(this._options.environment))!=null?v:w.Default,"v1/private/attachment/list"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:g,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(R.ok)return {data:hp.parseOrThrow(R.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:R.rawResponse};if(R.error.reason==="status-code")switch(R.error.statusCode){case 401:throw new $(R.error.body,R.rawResponse);case 403:throw new Z(ae.parseOrThrow(R.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),R.rawResponse);default:throw new p({statusCode:R.error.statusCode,body:R.error.body,rawResponse:R.rawResponse})}switch(R.error.reason){case "non-json":throw new p({statusCode:R.error.statusCode,body:R.error.rawBody,rawResponse:R.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/attachment/list.");case "unknown":throw new p({message:R.error.errorMessage,rawResponse:R.rawResponse})}}completeMultiPartUpload(t,e){return h.fromPromise(this.__completeMultiPartUpload(t,e))}async __completeMultiPartUpload(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/attachment/upload-complete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:La.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 401:throw new $(o.error.body,o.rawResponse);case 403:throw new Z(ae.parseOrThrow(o.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/attachment/upload-complete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteAttachments(t,e){return h.fromPromise(this.__deleteAttachments(t,e))}async __deleteAttachments(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/attachment/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:La.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 401:throw new $(o.error.body,o.rawResponse);case 403:throw new Z(ae.parseOrThrow(o.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/attachment/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}downloadAttachment(t,e){return h.fromPromise(this.__downloadAttachment(t,e))}async __downloadAttachment(t,e){var y,v;let{workspaceName:o,containerId:a,entityType:n,entityId:c,fileName:m,mimeType:u}=t,g={};o!=null&&(g.workspace_name=o),g.container_id=a,g.entity_type=ta.jsonOrThrow(n,{unrecognizedObjectKeys:"strip"}),g.entity_id=c,g.file_name=m,g.mime_type=u;let R=await b({url:x((v=(y=await s.get(this._options.baseUrl))!=null?y:await s.get(this._options.environment))!=null?v:w.Default,"v1/private/attachment/download"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:g,requestType:"json",responseType:"streaming",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(R.ok)return {data:R.body,rawResponse:R.rawResponse};if(R.error.reason==="status-code")switch(R.error.statusCode){case 401:throw new $(R.error.body,R.rawResponse);case 403:throw new Z(ae.parseOrThrow(R.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),R.rawResponse);default:throw new p({statusCode:R.error.statusCode,body:R.error.body,rawResponse:R.rawResponse})}switch(R.error.reason){case "non-json":throw new p({statusCode:R.error.statusCode,body:R.error.rawBody,rawResponse:R.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/attachment/download.");case "unknown":throw new p({message:R.error.errorMessage,rawResponse:R.rawResponse})}}startMultiPartUpload(t,e){return h.fromPromise(this.__startMultiPartUpload(t,e))}async __startMultiPartUpload(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/attachment/upload-start"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:kr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:Rp.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 401:throw new $(o.error.body,o.rawResponse);case 403:throw new Z(ae.parseOrThrow(o.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/attachment/upload-start.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}uploadAttachment(t,e){return h.fromPromise(this.__uploadAttachment(t,e))}async __uploadAttachment(t,e){var y,v;let{fileName:o,projectName:a,mimeType:n,entityType:c,entityId:m,body:u}=t,g={};g.file_name=o,a!=null&&(g.project_name=a),n!=null&&(g.mime_type=n),g.entity_type=ia.jsonOrThrow(c,{unrecognizedObjectKeys:"strip"}),g.entity_id=m;let R=await b({url:x((v=(y=await s.get(this._options.baseUrl))!=null?y:await s.get(this._options.environment))!=null?v:w.Default,"v1/private/attachment/upload"),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:g,requestType:"json",body:or.uploadAttachment.Request.jsonOrThrow(u,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(R.ok)return {data:void 0,rawResponse:R.rawResponse};if(R.error.reason==="status-code")switch(R.error.statusCode){case 401:throw new $(R.error.body,R.rawResponse);case 403:throw new Z(ae.parseOrThrow(R.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),R.rawResponse);default:throw new p({statusCode:R.error.statusCode,body:R.error.body,rawResponse:R.rawResponse})}switch(R.error.reason){case "non-json":throw new p({statusCode:R.error.statusCode,body:R.error.rawBody,rawResponse:R.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/attachment/upload.");case "unknown":throw new p({message:R.error.errorMessage,rawResponse:R.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var ni=class{constructor(t={}){this._options=t;}access(t,e){return h.fromPromise(this.__access(t,e))}async __access(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/auth"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:yp.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 401:throw new $(o.error.body,o.rawResponse);case 403:throw new Z(ae.parseOrThrow(o.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/auth.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getWorkspaceName(t){return h.fromPromise(this.__getWorkspaceName(t))}async __getWorkspaceName(t){var o,a;let e=await b({url:x((a=(o=await s.get(this._options.baseUrl))!=null?o:await s.get(this._options.environment))!=null?a:w.Default,"v1/private/auth/workspace"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...t==null?void 0:t.headers},contentType:"application/json",requestType:"json",timeoutMs:(t==null?void 0:t.timeoutInSeconds)!=null?t.timeoutInSeconds*1e3:6e4,maxRetries:t==null?void 0:t.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal});if(e.ok)return {data:kp.parseOrThrow(e.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:e.rawResponse};if(e.error.reason==="status-code")switch(e.error.statusCode){case 401:throw new $(e.error.body,e.rawResponse);case 403:throw new Z(ae.parseOrThrow(e.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),e.rawResponse);default:throw new p({statusCode:e.error.statusCode,body:e.error.body,rawResponse:e.rawResponse})}switch(e.error.reason){case "non-json":throw new p({statusCode:e.error.statusCode,body:e.error.rawBody,rawResponse:e.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/auth/workspace.");case "unknown":throw new p({message:e.error.errorMessage,rawResponse:e.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var si=class{constructor(t={}){this._options=t;}findEvaluators(t={},e){return h.fromPromise(this.__findEvaluators(t,e))}async __findEvaluators(t={},e){var v,z;let{projectId:o,id:a,name:n,filters:c,sorting:m,page:u,size:g}=t,R={};o!=null&&(R.project_id=o),a!=null&&(R.id=a),n!=null&&(R.name=n),c!=null&&(R.filters=c),m!=null&&(R.sorting=m),u!=null&&(R.page=u.toString()),g!=null&&(R.size=g.toString());let y=await b({url:x((z=(v=await s.get(this._options.baseUrl))!=null?v:await s.get(this._options.environment))!=null?z:w.Default,"v1/private/automations/evaluators"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:R,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(y.ok)return {data:ic.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")throw new p({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse});switch(y.error.reason){case "non-json":throw new p({statusCode:y.error.statusCode,body:y.error.rawBody,rawResponse:y.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/automations/evaluators.");case "unknown":throw new p({message:y.error.errorMessage,rawResponse:y.rawResponse})}}createAutomationRuleEvaluator(t,e){return h.fromPromise(this.__createAutomationRuleEvaluator(t,e))}async __createAutomationRuleEvaluator(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/automations/evaluators"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Gp.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/automations/evaluators.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteAutomationRuleEvaluatorBatch(t,e){return h.fromPromise(this.__deleteAutomationRuleEvaluatorBatch(t,e))}async __deleteAutomationRuleEvaluatorBatch(t,e){var m,u;let{projectId:o,body:a}=t,n={};o!=null&&(n.project_id=o);let c=await b({url:x((u=(m=await s.get(this._options.baseUrl))!=null?m:await s.get(this._options.environment))!=null?u:w.Default,"v1/private/automations/evaluators/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:n,requestType:"json",body:L.jsonOrThrow(a,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(c.ok)return {data:void 0,rawResponse:c.rawResponse};if(c.error.reason==="status-code")throw new p({statusCode:c.error.statusCode,body:c.error.body,rawResponse:c.rawResponse});switch(c.error.reason){case "non-json":throw new p({statusCode:c.error.statusCode,body:c.error.rawBody,rawResponse:c.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/automations/evaluators/delete.");case "unknown":throw new p({message:c.error.errorMessage,rawResponse:c.rawResponse})}}getEvaluatorById(t,e={},o){return h.fromPromise(this.__getEvaluatorById(t,e,o))}async __getEvaluatorById(t,e={},o){var m,u;let{projectId:a}=e,n={};a!=null&&(n.project_id=a);let c=await b({url:x((u=(m=await s.get(this._options.baseUrl))!=null?m:await s.get(this._options.environment))!=null?u:w.Default,`v1/private/automations/evaluators/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",queryParameters:n,requestType:"json",timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(c.ok)return {data:nc.parseOrThrow(c.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:c.rawResponse};if(c.error.reason==="status-code")throw new p({statusCode:c.error.statusCode,body:c.error.body,rawResponse:c.rawResponse});switch(c.error.reason){case "non-json":throw new p({statusCode:c.error.statusCode,body:c.error.rawBody,rawResponse:c.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/automations/evaluators/{id}.");case "unknown":throw new p({message:c.error.errorMessage,rawResponse:c.rawResponse})}}updateAutomationRuleEvaluator(t,e,o){return h.fromPromise(this.__updateAutomationRuleEvaluator(t,e,o))}async __updateAutomationRuleEvaluator(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/automations/evaluators/${encodeURIComponent(t)}`),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:gc.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/automations/evaluators/{id}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}getEvaluatorLogsById(t,e={},o){return h.fromPromise(this.__getEvaluatorLogsById(t,e,o))}async __getEvaluatorLogsById(t,e={},o){var m,u;let{size:a}=e,n={};a!=null&&(n.size=a.toString());let c=await b({url:x((u=(m=await s.get(this._options.baseUrl))!=null?m:await s.get(this._options.environment))!=null?u:w.Default,`v1/private/automations/evaluators/${encodeURIComponent(t)}/logs`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",queryParameters:n,requestType:"json",timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(c.ok)return {data:cc.parseOrThrow(c.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:c.rawResponse};if(c.error.reason==="status-code")throw new p({statusCode:c.error.statusCode,body:c.error.body,rawResponse:c.rawResponse});switch(c.error.reason){case "non-json":throw new p({statusCode:c.error.statusCode,body:c.error.rawBody,rawResponse:c.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/automations/evaluators/{id}/logs.");case "unknown":throw new p({message:c.error.errorMessage,rawResponse:c.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var pi=class{constructor(t={}){this._options=t;}createChatCompletions(t={},e){return h.fromPromise(this.__createChatCompletions(t,e))}async __createChatCompletions(t={},e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/chat/completions"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:zo.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:kc.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/chat/completions.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var ci=class{constructor(t={}){this._options=t;}findDashboards(t={},e){return h.fromPromise(this.__findDashboards(t,e))}async __findDashboards(t={},e){var u,g;let{page:o,size:a,name:n}=t,c={};o!=null&&(c.page=o.toString()),a!=null&&(c.size=a.toString()),n!=null&&(c.name=n);let m=await b({url:x((g=(u=await s.get(this._options.baseUrl))!=null?u:await s.get(this._options.environment))!=null?g:w.Default,"v1/private/dashboards"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:c,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(m.ok)return {data:vc.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")throw new p({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse});switch(m.error.reason){case "non-json":throw new p({statusCode:m.error.statusCode,body:m.error.rawBody,rawResponse:m.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/dashboards.");case "unknown":throw new p({message:m.error.errorMessage,rawResponse:m.rawResponse})}}createDashboard(t,e){return h.fromPromise(this.__createDashboard(t,e))}async __createDashboard(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/dashboards"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:So.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:He.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/dashboards.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getDashboardById(t,e){return h.fromPromise(this.__getDashboardById(t,e))}async __getDashboardById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/dashboards/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:He.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 404:throw new T(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/dashboards/{dashboardId}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteDashboard(t,e){return h.fromPromise(this.__deleteDashboard(t,e))}async __deleteDashboard(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/dashboards/${encodeURIComponent(t)}`),method:"DELETE",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling DELETE /v1/private/dashboards/{dashboardId}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}updateDashboard(t,e={},o){return h.fromPromise(this.__updateDashboard(t,e,o))}async __updateDashboard(t,e={},o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/dashboards/${encodeURIComponent(t)}`),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:_o.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:He.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 404:throw new T(a.error.body,a.rawResponse);case 409:throw new W(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/dashboards/{dashboardId}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var li=class{constructor(t={}){this._options=t;}batchUpdateDatasetItems(t,e){return h.fromPromise(this.__batchUpdateDatasetItems(t,e))}async __batchUpdateDatasetItems(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/datasets/items/batch"),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:vr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/datasets/items/batch.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}findDatasets(t={},e){return h.fromPromise(this.__findDatasets(t,e))}async __findDatasets(t={},e){var z,S;let{page:o,size:a,withExperimentsOnly:n,withOptimizationsOnly:c,promptId:m,name:u,sorting:g,filters:R}=t,y={};o!=null&&(y.page=o.toString()),a!=null&&(y.size=a.toString()),n!=null&&(y.with_experiments_only=n.toString()),c!=null&&(y.with_optimizations_only=c.toString()),m!=null&&(y.prompt_id=m),u!=null&&(y.name=u),g!=null&&(y.sorting=g),R!=null&&(y.filters=R);let v=await b({url:x((S=(z=await s.get(this._options.baseUrl))!=null?z:await s.get(this._options.environment))!=null?S:w.Default,"v1/private/datasets"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:y,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(v.ok)return {data:Wc.parseOrThrow(v.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:v.rawResponse};if(v.error.reason==="status-code")throw new p({statusCode:v.error.statusCode,body:v.error.body,rawResponse:v.rawResponse});switch(v.error.reason){case "non-json":throw new p({statusCode:v.error.statusCode,body:v.error.rawBody,rawResponse:v.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/datasets.");case "unknown":throw new p({message:v.error.errorMessage,rawResponse:v.rawResponse})}}createDataset(t,e){return h.fromPromise(this.__createDataset(t,e))}async __createDataset(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/datasets"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:zr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/datasets.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}createOrUpdateDatasetItems(t,e){return h.fromPromise(this.__createOrUpdateDatasetItems(t,e))}async __createOrUpdateDatasetItems(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/datasets/items"),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:_r.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/datasets/items.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}createDatasetItemsFromCsv(t,e){return h.fromPromise(this.__createDatasetItemsFromCsv(t,e))}async __createDatasetItemsFromCsv(t,e){var c,m;let o=await Xu();o.append("file",Pe(t.file)),o.append("dataset_id",t.datasetId);let a=await o.getRequest(),n=await b({url:x((m=(c=await s.get(this._options.baseUrl))!=null?c:await s.get(this._options.environment))!=null?m:w.Default,"v1/private/datasets/items/from-csv"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...a.headers,...e==null?void 0:e.headers},requestType:"file",duplex:a.duplex,body:a.body,timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")switch(n.error.statusCode){case 400:throw new _(n.error.body,n.rawResponse);case 404:throw new T(n.error.body,n.rawResponse);default:throw new p({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse})}switch(n.error.reason){case "non-json":throw new p({statusCode:n.error.statusCode,body:n.error.rawBody,rawResponse:n.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/datasets/items/from-csv.");case "unknown":throw new p({message:n.error.errorMessage,rawResponse:n.rawResponse})}}createDatasetItemsFromSpans(t,e,o){return h.fromPromise(this.__createDatasetItemsFromSpans(t,e,o))}async __createDatasetItemsFromSpans(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/datasets/${encodeURIComponent(t)}/items/from-spans`),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:Tr.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/datasets/{dataset_id}/items/from-spans.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}createDatasetItemsFromTraces(t,e,o){return h.fromPromise(this.__createDatasetItemsFromTraces(t,e,o))}async __createDatasetItemsFromTraces(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/datasets/${encodeURIComponent(t)}/items/from-traces`),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:Ar.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/datasets/{dataset_id}/items/from-traces.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}getDatasetById(t,e){return h.fromPromise(this.__getDatasetById(t,e))}async __getDatasetById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/datasets/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:nr.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/datasets/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}updateDataset(t,e,o){return h.fromPromise(this.__updateDataset(t,e,o))}async __updateDataset(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/datasets/${encodeURIComponent(t)}`),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:Er.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/datasets/{id}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}deleteDataset(t,e){return h.fromPromise(this.__deleteDataset(t,e))}async __deleteDataset(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/datasets/${encodeURIComponent(t)}`),method:"DELETE",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling DELETE /v1/private/datasets/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteDatasetByName(t,e){return h.fromPromise(this.__deleteDatasetByName(t,e))}async __deleteDatasetByName(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/datasets/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Pr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/datasets/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteDatasetItems(t,e){return h.fromPromise(this.__deleteDatasetItems(t,e))}async __deleteDatasetItems(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/datasets/items/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Cr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/datasets/items/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteDatasetsBatch(t,e){return h.fromPromise(this.__deleteDatasetsBatch(t,e))}async __deleteDatasetsBatch(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/datasets/delete-batch"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:L.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/datasets/delete-batch.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}expandDataset(t,e,o){return h.fromPromise(this.__expandDataset(t,e,o))}async __expandDataset(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/datasets/${encodeURIComponent(t)}/expansions`),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:Ir.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:_c.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/datasets/{id}/expansions.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}findDatasetItemsWithExperimentItems(t,e,o){return h.fromPromise(this.__findDatasetItemsWithExperimentItems(t,e,o))}async __findDatasetItemsWithExperimentItems(t,e,o){var z,S;let{page:a,size:n,experimentIds:c,filters:m,sorting:u,search:g,truncate:R}=e,y={};a!=null&&(y.page=a.toString()),n!=null&&(y.size=n.toString()),y.experiment_ids=c,m!=null&&(y.filters=m),u!=null&&(y.sorting=u),g!=null&&(y.search=g),R!=null&&(y.truncate=R.toString());let v=await b({url:x((S=(z=await s.get(this._options.baseUrl))!=null?z:await s.get(this._options.environment))!=null?S:w.Default,`v1/private/datasets/${encodeURIComponent(t)}/items/experiments/items`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",queryParameters:y,requestType:"json",timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(v.ok)return {data:Fc.parseOrThrow(v.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:v.rawResponse};if(v.error.reason==="status-code")throw new p({statusCode:v.error.statusCode,body:v.error.body,rawResponse:v.rawResponse});switch(v.error.reason){case "non-json":throw new p({statusCode:v.error.statusCode,body:v.error.rawBody,rawResponse:v.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/datasets/{id}/items/experiments/items.");case "unknown":throw new p({message:v.error.errorMessage,rawResponse:v.rawResponse})}}getDatasetByIdentifier(t,e){return h.fromPromise(this.__getDatasetByIdentifier(t,e))}async __getDatasetByIdentifier(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/datasets/retrieve"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:jr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:nr.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/datasets/retrieve.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getDatasetExperimentItemsStats(t,e,o){return h.fromPromise(this.__getDatasetExperimentItemsStats(t,e,o))}async __getDatasetExperimentItemsStats(t,e,o){var u,g;let{experimentIds:a,filters:n}=e,c={};c.experiment_ids=a,n!=null&&(c.filters=n);let m=await b({url:x((g=(u=await s.get(this._options.baseUrl))!=null?u:await s.get(this._options.environment))!=null?g:w.Default,`v1/private/datasets/${encodeURIComponent(t)}/items/experiments/items/stats`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",queryParameters:c,requestType:"json",timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(m.ok)return {data:Je.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")throw new p({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse});switch(m.error.reason){case "non-json":throw new p({statusCode:m.error.statusCode,body:m.error.rawBody,rawResponse:m.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/datasets/{id}/items/experiments/items/stats.");case "unknown":throw new p({message:m.error.errorMessage,rawResponse:m.rawResponse})}}getDatasetItemById(t,e){return h.fromPromise(this.__getDatasetItemById(t,e))}async __getDatasetItemById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/datasets/items/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:et.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/datasets/items/{itemId}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}patchDatasetItem(t,e,o){return h.fromPromise(this.__patchDatasetItem(t,e,o))}async __patchDatasetItem(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/datasets/items/${encodeURIComponent(t)}`),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:Sr.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 404:throw new T(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/datasets/items/{itemId}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}getDatasetItems(t,e={},o){return h.fromPromise(this.__getDatasetItems(t,e,o))}async __getDatasetItems(t,e={},o){var R,y;let{page:a,size:n,filters:c,truncate:m}=e,u={};a!=null&&(u.page=a.toString()),n!=null&&(u.size=n.toString()),c!=null&&(u.filters=c),m!=null&&(u.truncate=m.toString());let g=await b({url:x((y=(R=await s.get(this._options.baseUrl))!=null?R:await s.get(this._options.environment))!=null?y:w.Default,`v1/private/datasets/${encodeURIComponent(t)}/items`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",queryParameters:u,requestType:"json",timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(g.ok)return {data:Qc.parseOrThrow(g.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:g.rawResponse};if(g.error.reason==="status-code")throw new p({statusCode:g.error.statusCode,body:g.error.body,rawResponse:g.rawResponse});switch(g.error.reason){case "non-json":throw new p({statusCode:g.error.statusCode,body:g.error.rawBody,rawResponse:g.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/datasets/{id}/items.");case "unknown":throw new p({message:g.error.errorMessage,rawResponse:g.rawResponse})}}getDatasetItemsOutputColumns(t,e={},o){return h.fromPromise(this.__getDatasetItemsOutputColumns(t,e,o))}async __getDatasetItemsOutputColumns(t,e={},o){var m,u;let{experimentIds:a}=e,n={};a!=null&&(n.experiment_ids=a);let c=await b({url:x((u=(m=await s.get(this._options.baseUrl))!=null?m:await s.get(this._options.environment))!=null?u:w.Default,`v1/private/datasets/${encodeURIComponent(t)}/items/experiments/items/output/columns`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",queryParameters:n,requestType:"json",timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(c.ok)return {data:qc.parseOrThrow(c.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:c.rawResponse};if(c.error.reason==="status-code")throw new p({statusCode:c.error.statusCode,body:c.error.body,rawResponse:c.rawResponse});switch(c.error.reason){case "non-json":throw new p({statusCode:c.error.statusCode,body:c.error.rawBody,rawResponse:c.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/datasets/{id}/items/experiments/items/output/columns.");case "unknown":throw new p({message:c.error.errorMessage,rawResponse:c.rawResponse})}}streamDatasetItems(t,e){return h.fromPromise(this.__streamDatasetItems(t,e))}async __streamDatasetItems(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/datasets/items/stream"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Ur.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),responseType:"streaming",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:o.body,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/datasets/items/stream.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var mi=class{constructor(t={}){this._options=t;}findExperiments(t={},e){return h.fromPromise(this.__findExperiments(t,e))}async __findExperiments(t={},e){var F,M;let{page:o,size:a,datasetId:n,optimizationId:c,types:m,name:u,datasetDeleted:g,promptId:R,sorting:y,filters:v}=t,z={};o!=null&&(z.page=o.toString()),a!=null&&(z.size=a.toString()),n!=null&&(z.datasetId=n),c!=null&&(z.optimization_id=c),m!=null&&(z.types=m),u!=null&&(z.name=u),g!=null&&(z.dataset_deleted=g.toString()),R!=null&&(z.prompt_id=R),y!=null&&(z.sorting=y),v!=null&&(z.filters=v);let S=await b({url:x((M=(F=await s.get(this._options.baseUrl))!=null?F:await s.get(this._options.environment))!=null?M:w.Default,"v1/private/experiments"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:z,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(S.ok)return {data:dl.parseOrThrow(S.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:S.rawResponse};if(S.error.reason==="status-code")switch(S.error.statusCode){case 400:throw new _(S.error.body,S.rawResponse);default:throw new p({statusCode:S.error.statusCode,body:S.error.body,rawResponse:S.rawResponse})}switch(S.error.reason){case "non-json":throw new p({statusCode:S.error.statusCode,body:S.error.rawBody,rawResponse:S.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/experiments.");case "unknown":throw new p({message:S.error.errorMessage,rawResponse:S.rawResponse})}}createExperiment(t,e){return h.fromPromise(this.__createExperiment(t,e))}async __createExperiment(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/experiments"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Nr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/experiments.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}createExperimentItems(t,e){return h.fromPromise(this.__createExperimentItems(t,e))}async __createExperimentItems(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/experiments/items"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Mr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/experiments/items.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteExperimentItems(t,e){return h.fromPromise(this.__deleteExperimentItems(t,e))}async __deleteExperimentItems(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/experiments/items/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Fr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/experiments/items/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteExperimentsById(t,e){return h.fromPromise(this.__deleteExperimentsById(t,e))}async __deleteExperimentsById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/experiments/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:sr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/experiments/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}experimentItemsBulk(t,e){return h.fromPromise(this.__experimentItemsBulk(t,e))}async __experimentItemsBulk(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/experiments/items/bulk"),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Wr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);case 409:throw new W(o.error.body,o.rawResponse);case 422:throw new B(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/experiments/items/bulk.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}findFeedbackScoreNames(t={},e){return h.fromPromise(this.__findFeedbackScoreNames(t,e))}async __findFeedbackScoreNames(t={},e){var c,m;let{experimentIds:o}=t,a={};o!=null&&(a.experiment_ids=o);let n=await b({url:x((m=(c=await s.get(this._options.baseUrl))!=null?c:await s.get(this._options.environment))!=null?m:w.Default,"v1/private/experiments/feedback-scores/names"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:a,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(n.ok)return {data:tr.findFeedbackScoreNames.Response.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new p({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});switch(n.error.reason){case "non-json":throw new p({statusCode:n.error.statusCode,body:n.error.rawBody,rawResponse:n.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/experiments/feedback-scores/names.");case "unknown":throw new p({message:n.error.errorMessage,rawResponse:n.rawResponse})}}findExperimentGroups(t={},e){return h.fromPromise(this.__findExperimentGroups(t,e))}async __findExperimentGroups(t={},e){var g,R;let{groups:o,types:a,name:n,filters:c}=t,m={};o!=null&&(m.groups=o),a!=null&&(m.types=a),n!=null&&(m.name=n),c!=null&&(m.filters=c);let u=await b({url:x((R=(g=await s.get(this._options.baseUrl))!=null?g:await s.get(this._options.environment))!=null?R:w.Default,"v1/private/experiments/groups"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:m,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(u.ok)return {data:hl.parseOrThrow(u.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:u.rawResponse};if(u.error.reason==="status-code")switch(u.error.statusCode){case 400:throw new _(u.error.body,u.rawResponse);default:throw new p({statusCode:u.error.statusCode,body:u.error.body,rawResponse:u.rawResponse})}switch(u.error.reason){case "non-json":throw new p({statusCode:u.error.statusCode,body:u.error.rawBody,rawResponse:u.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/experiments/groups.");case "unknown":throw new p({message:u.error.errorMessage,rawResponse:u.rawResponse})}}findExperimentGroupsAggregations(t={},e){return h.fromPromise(this.__findExperimentGroupsAggregations(t,e))}async __findExperimentGroupsAggregations(t={},e){var g,R;let{groups:o,types:a,name:n,filters:c}=t,m={};o!=null&&(m.groups=o),a!=null&&(m.types=a),n!=null&&(m.name=n),c!=null&&(m.filters=c);let u=await b({url:x((R=(g=await s.get(this._options.baseUrl))!=null?g:await s.get(this._options.environment))!=null?R:w.Default,"v1/private/experiments/groups/aggregations"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:m,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(u.ok)return {data:xl.parseOrThrow(u.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:u.rawResponse};if(u.error.reason==="status-code")switch(u.error.statusCode){case 400:throw new _(u.error.body,u.rawResponse);default:throw new p({statusCode:u.error.statusCode,body:u.error.body,rawResponse:u.rawResponse})}switch(u.error.reason){case "non-json":throw new p({statusCode:u.error.statusCode,body:u.error.rawBody,rawResponse:u.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/experiments/groups/aggregations.");case "unknown":throw new p({message:u.error.errorMessage,rawResponse:u.rawResponse})}}finishExperiments(t,e){return h.fromPromise(this.__finishExperiments(t,e))}async __finishExperiments(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/experiments/finish"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:sr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/experiments/finish.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getExperimentById(t,e){return h.fromPromise(this.__getExperimentById(t,e))}async __getExperimentById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/experiments/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:tt.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 404:throw new T(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/experiments/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}updateExperiment(t,e={},o){return h.fromPromise(this.__updateExperiment(t,e,o))}async __updateExperiment(t,e={},o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/experiments/${encodeURIComponent(t)}`),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:Br.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new _(a.error.body,a.rawResponse);case 404:throw new T(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/experiments/{id}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}getExperimentItemById(t,e){return h.fromPromise(this.__getExperimentItemById(t,e))}async __getExperimentItemById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/experiments/items/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:qo.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 404:throw new T(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/experiments/items/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}streamExperimentItems(t,e){return h.fromPromise(this.__streamExperimentItems(t,e))}async __streamExperimentItems(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/experiments/items/stream"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Lr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),responseType:"streaming",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:o.body,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/experiments/items/stream.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}streamExperiments(t,e){return h.fromPromise(this.__streamExperiments(t,e))}async __streamExperiments(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/experiments/stream"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Vr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),responseType:"streaming",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:o.body,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/experiments/stream.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var di=class{constructor(t={}){this._options=t;}findFeedbackDefinitions(t={},e){return h.fromPromise(this.__findFeedbackDefinitions(t,e))}async __findFeedbackDefinitions(t={},e){var g,R;let{page:o,size:a,name:n,type:c}=t,m={};o!=null&&(m.page=o.toString()),a!=null&&(m.size=a.toString()),n!=null&&(m.name=n),c!=null&&(m.type=ha.jsonOrThrow(c,{unrecognizedObjectKeys:"strip"}));let u=await b({url:x((R=(g=await s.get(this._options.baseUrl))!=null?g:await s.get(this._options.environment))!=null?R:w.Default,"v1/private/feedback-definitions"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:m,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(u.ok)return {data:Bl.parseOrThrow(u.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:u.rawResponse};if(u.error.reason==="status-code")throw new p({statusCode:u.error.statusCode,body:u.error.body,rawResponse:u.rawResponse});switch(u.error.reason){case "non-json":throw new p({statusCode:u.error.statusCode,body:u.error.rawBody,rawResponse:u.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/feedback-definitions.");case "unknown":throw new p({message:u.error.errorMessage,rawResponse:u.rawResponse})}}createFeedbackDefinition(t,e){return h.fromPromise(this.__createFeedbackDefinition(t,e))}async __createFeedbackDefinition(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/feedback-definitions"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Nl.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/feedback-definitions.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getFeedbackDefinitionById(t,e){return h.fromPromise(this.__getFeedbackDefinitionById(t,e))}async __getFeedbackDefinitionById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/feedback-definitions/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:Vl.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/feedback-definitions/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}updateFeedbackDefinition(t,e,o){return h.fromPromise(this.__updateFeedbackDefinition(t,e,o))}async __updateFeedbackDefinition(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/feedback-definitions/${encodeURIComponent(t)}`),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:Yl.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/feedback-definitions/{id}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}deleteFeedbackDefinitionById(t,e){return h.fromPromise(this.__deleteFeedbackDefinitionById(t,e))}async __deleteFeedbackDefinitionById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/feedback-definitions/${encodeURIComponent(t)}`),method:"DELETE",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 409:throw new W(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling DELETE /v1/private/feedback-definitions/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteFeedbackDefinitionsBatch(t,e){return h.fromPromise(this.__deleteFeedbackDefinitionsBatch(t,e))}async __deleteFeedbackDefinitionsBatch(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/feedback-definitions/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:L.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 409:throw new W(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/feedback-definitions/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var ui=class{constructor(t={}){this._options=t;}createGuardrails(t,e){return h.fromPromise(this.__createGuardrails(t,e))}async __createGuardrails(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/guardrails"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:To.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/guardrails.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var gi=class{constructor(t={}){this._options=t;}deleteLlmProviderApiKeysBatch(t,e){return h.fromPromise(this.__deleteLlmProviderApiKeysBatch(t,e))}async __deleteLlmProviderApiKeysBatch(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/llm-provider-key/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:L.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/llm-provider-key/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}findLlmProviderKeys(t){return h.fromPromise(this.__findLlmProviderKeys(t))}async __findLlmProviderKeys(t){var o,a;let e=await b({url:x((a=(o=await s.get(this._options.baseUrl))!=null?o:await s.get(this._options.environment))!=null?a:w.Default,"v1/private/llm-provider-key"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...t==null?void 0:t.headers},contentType:"application/json",requestType:"json",timeoutMs:(t==null?void 0:t.timeoutInSeconds)!=null?t.timeoutInSeconds*1e3:6e4,maxRetries:t==null?void 0:t.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal});if(e.ok)return {data:om.parseOrThrow(e.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:e.rawResponse};if(e.error.reason==="status-code")throw new p({statusCode:e.error.statusCode,body:e.error.body,rawResponse:e.rawResponse});switch(e.error.reason){case "non-json":throw new p({statusCode:e.error.statusCode,body:e.error.rawBody,rawResponse:e.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/llm-provider-key.");case "unknown":throw new p({message:e.error.errorMessage,rawResponse:e.rawResponse})}}storeLlmProviderApiKey(t,e){return h.fromPromise(this.__storeLlmProviderApiKey(t,e))}async __storeLlmProviderApiKey(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/llm-provider-key"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Hr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 401:throw new $(o.error.body,o.rawResponse);case 403:throw new Z(ae.parseOrThrow(o.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/llm-provider-key.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getLlmProviderApiKeyById(t,e){return h.fromPromise(this.__getLlmProviderApiKeyById(t,e))}async __getLlmProviderApiKeyById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/llm-provider-key/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:st.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 404:throw new T(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/llm-provider-key/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}updateLlmProviderApiKey(t,e={},o){return h.fromPromise(this.__updateLlmProviderApiKey(t,e,o))}async __updateLlmProviderApiKey(t,e={},o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/llm-provider-key/${encodeURIComponent(t)}`),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:Jr.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 401:throw new $(a.error.body,a.rawResponse);case 403:throw new Z(ae.parseOrThrow(a.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),a.rawResponse);case 404:throw new T(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/llm-provider-key/{id}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var fi=class{constructor(t={}){this._options=t;}evaluateThreads(t,e){return h.fromPromise(this.__evaluateThreads(t,e))}async __evaluateThreads(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/manual-evaluation/threads"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Za.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:Ya.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);case 404:throw new T(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/manual-evaluation/threads.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}evaluateTraces(t,e){return h.fromPromise(this.__evaluateTraces(t,e))}async __evaluateTraces(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/manual-evaluation/traces"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Za.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:Ya.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);case 404:throw new T(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/manual-evaluation/traces.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var hi=class{constructor(t={}){this._options=t;}receiveProtobufTraces(t){return h.fromPromise(this.__receiveProtobufTraces(t))}async __receiveProtobufTraces(t){var o,a;let e=await b({url:x((a=(o=await s.get(this._options.baseUrl))!=null?o:await s.get(this._options.environment))!=null?a:w.Default,"v1/private/otel/v1/traces"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...t==null?void 0:t.headers},contentType:"application/json",requestType:"json",timeoutMs:(t==null?void 0:t.timeoutInSeconds)!=null?t.timeoutInSeconds*1e3:6e4,maxRetries:t==null?void 0:t.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal});if(e.ok)return {data:e.body,rawResponse:e.rawResponse};if(e.error.reason==="status-code")throw new p({statusCode:e.error.statusCode,body:e.error.body,rawResponse:e.rawResponse});switch(e.error.reason){case "non-json":throw new p({statusCode:e.error.statusCode,body:e.error.rawBody,rawResponse:e.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/otel/v1/traces.");case "unknown":throw new p({message:e.error.errorMessage,rawResponse:e.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var wi=class{constructor(t={}){this._options=t;}findOptimizations(t={},e){return h.fromPromise(this.__findOptimizations(t,e))}async __findOptimizations(t={},e){var R,y;let{page:o,size:a,datasetId:n,name:c,datasetDeleted:m}=t,u={};o!=null&&(u.page=o.toString()),a!=null&&(u.size=a.toString()),n!=null&&(u.dataset_id=n),c!=null&&(u.name=c),m!=null&&(u.dataset_deleted=m.toString());let g=await b({url:x((y=(R=await s.get(this._options.baseUrl))!=null?R:await s.get(this._options.environment))!=null?y:w.Default,"v1/private/optimizations"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:u,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(g.ok)return {data:pm.parseOrThrow(g.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:g.rawResponse};if(g.error.reason==="status-code")switch(g.error.statusCode){case 400:throw new _(g.error.body,g.rawResponse);default:throw new p({statusCode:g.error.statusCode,body:g.error.body,rawResponse:g.rawResponse})}switch(g.error.reason){case "non-json":throw new p({statusCode:g.error.statusCode,body:g.error.rawBody,rawResponse:g.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/optimizations.");case "unknown":throw new p({message:g.error.errorMessage,rawResponse:g.rawResponse})}}createOptimization(t,e){return h.fromPromise(this.__createOptimization(t,e))}async __createOptimization(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/optimizations"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:qa.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/optimizations.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}upsertOptimization(t,e){return h.fromPromise(this.__upsertOptimization(t,e))}async __upsertOptimization(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/optimizations"),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:qa.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/optimizations.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteOptimizationsById(t,e){return h.fromPromise(this.__deleteOptimizationsById(t,e))}async __deleteOptimizationsById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/optimizations/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:sr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/optimizations/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getOptimizationById(t,e){return h.fromPromise(this.__getOptimizationById(t,e))}async __getOptimizationById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/optimizations/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:pt.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 404:throw new T(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/optimizations/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}updateOptimizationsById(t,e={},o){return h.fromPromise(this.__updateOptimizationsById(t,e,o))}async __updateOptimizationsById(t,e={},o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/optimizations/${encodeURIComponent(t)}`),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:Kr.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/optimizations/{id}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var bi=class{constructor(t={}){this._options=t;}findProjects(t={},e){return h.fromPromise(this.__findProjects(t,e))}async __findProjects(t={},e){var g,R;let{page:o,size:a,name:n,sorting:c}=t,m={};o!=null&&(m.page=o.toString()),a!=null&&(m.size=a.toString()),n!=null&&(m.name=n),c!=null&&(m.sorting=c);let u=await b({url:x((R=(g=await s.get(this._options.baseUrl))!=null?g:await s.get(this._options.environment))!=null?R:w.Default,"v1/private/projects"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:m,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(u.ok)return {data:mm.parseOrThrow(u.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:u.rawResponse};if(u.error.reason==="status-code")throw new p({statusCode:u.error.statusCode,body:u.error.body,rawResponse:u.rawResponse});switch(u.error.reason){case "non-json":throw new p({statusCode:u.error.statusCode,body:u.error.rawBody,rawResponse:u.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/projects.");case "unknown":throw new p({message:u.error.errorMessage,rawResponse:u.rawResponse})}}createProject(t,e){return h.fromPromise(this.__createProject(t,e))}async __createProject(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/projects"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Xr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);case 422:throw new B(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/projects.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getProjectById(t,e){return h.fromPromise(this.__getProjectById(t,e))}async __getProjectById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/projects/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:lt.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/projects/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteProjectById(t,e){return h.fromPromise(this.__deleteProjectById(t,e))}async __deleteProjectById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/projects/${encodeURIComponent(t)}`),method:"DELETE",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 409:throw new W(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling DELETE /v1/private/projects/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}updateProject(t,e={},o){return h.fromPromise(this.__updateProject(t,e,o))}async __updateProject(t,e={},o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/projects/${encodeURIComponent(t)}`),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:Gr.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new _(a.error.body,a.rawResponse);case 422:throw new B(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/projects/{id}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}deleteProjectsBatch(t,e){return h.fromPromise(this.__deleteProjectsBatch(t,e))}async __deleteProjectsBatch(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/projects/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:L.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/projects/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}findFeedbackScoreNamesByProjectIds(t={},e){return h.fromPromise(this.__findFeedbackScoreNamesByProjectIds(t,e))}async __findFeedbackScoreNamesByProjectIds(t={},e){var c,m;let{projectIds:o}=t,a={};o!=null&&(a.project_ids=o);let n=await b({url:x((m=(c=await s.get(this._options.baseUrl))!=null?c:await s.get(this._options.environment))!=null?m:w.Default,"v1/private/projects/feedback-scores/names"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:a,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(n.ok)return {data:um.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new p({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});switch(n.error.reason){case "non-json":throw new p({statusCode:n.error.statusCode,body:n.error.rawBody,rawResponse:n.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/projects/feedback-scores/names.");case "unknown":throw new p({message:n.error.errorMessage,rawResponse:n.rawResponse})}}getProjectMetrics(t,e={},o){return h.fromPromise(this.__getProjectMetrics(t,e,o))}async __getProjectMetrics(t,e={},o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/projects/${encodeURIComponent(t)}/metrics`),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:$r.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:bm.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new _(a.error.body,a.rawResponse);case 404:throw new T(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/projects/{id}/metrics.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}getProjectStats(t={},e){return h.fromPromise(this.__getProjectStats(t,e))}async __getProjectStats(t={},e){var g,R;let{page:o,size:a,name:n,sorting:c}=t,m={};o!=null&&(m.page=o.toString()),a!=null&&(m.size=a.toString()),n!=null&&(m.name=n),c!=null&&(m.sorting=c);let u=await b({url:x((R=(g=await s.get(this._options.baseUrl))!=null?g:await s.get(this._options.environment))!=null?R:w.Default,"v1/private/projects/stats"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:m,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(u.ok)return {data:Rm.parseOrThrow(u.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:u.rawResponse};if(u.error.reason==="status-code")throw new p({statusCode:u.error.statusCode,body:u.error.body,rawResponse:u.rawResponse});switch(u.error.reason){case "non-json":throw new p({statusCode:u.error.statusCode,body:u.error.rawBody,rawResponse:u.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/projects/stats.");case "unknown":throw new p({message:u.error.errorMessage,rawResponse:u.rawResponse})}}retrieveProject(t,e){return h.fromPromise(this.__retrieveProject(t,e))}async __retrieveProject(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/projects/retrieve"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Qr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:Sm.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);case 404:throw new T(o.error.body,o.rawResponse);case 422:throw new B(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/projects/retrieve.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var xi=class{constructor(t={}){this._options=t;}getPrompts(t={},e){return h.fromPromise(this.__getPrompts(t,e))}async __getPrompts(t={},e){var R,y;let{page:o,size:a,name:n,sorting:c,filters:m}=t,u={};o!=null&&(u.page=o.toString()),a!=null&&(u.size=a.toString()),n!=null&&(u.name=n),c!=null&&(u.sorting=c),m!=null&&(u.filters=m);let g=await b({url:x((y=(R=await s.get(this._options.baseUrl))!=null?R:await s.get(this._options.environment))!=null?y:w.Default,"v1/private/prompts"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:u,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(g.ok)return {data:Um.parseOrThrow(g.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:g.rawResponse};if(g.error.reason==="status-code")throw new p({statusCode:g.error.statusCode,body:g.error.body,rawResponse:g.rawResponse});switch(g.error.reason){case "non-json":throw new p({statusCode:g.error.statusCode,body:g.error.rawBody,rawResponse:g.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/prompts.");case "unknown":throw new p({message:g.error.errorMessage,rawResponse:g.rawResponse})}}createPrompt(t,e){return h.fromPromise(this.__createPrompt(t,e))}async __createPrompt(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/prompts"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Yr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);case 409:throw new W(o.error.body,o.rawResponse);case 422:throw new B(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/prompts.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}createPromptVersion(t,e){return h.fromPromise(this.__createPromptVersion(t,e))}async __createPromptVersion(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/prompts/versions"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Zr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:ke.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);case 409:throw new W(o.error.body,o.rawResponse);case 422:throw new B(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/prompts/versions.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getPromptById(t,e){return h.fromPromise(this.__getPromptById(t,e))}async __getPromptById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/prompts/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:Em.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 404:throw new T(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/prompts/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}updatePrompt(t,e,o){return h.fromPromise(this.__updatePrompt(t,e,o))}async __updatePrompt(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/prompts/${encodeURIComponent(t)}`),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:qr.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new _(a.error.body,a.rawResponse);case 404:throw new T(a.error.body,a.rawResponse);case 409:throw new W(a.error.body,a.rawResponse);case 422:throw new B(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/prompts/{id}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}deletePrompt(t,e){return h.fromPromise(this.__deletePrompt(t,e))}async __deletePrompt(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/prompts/${encodeURIComponent(t)}`),method:"DELETE",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling DELETE /v1/private/prompts/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deletePromptsBatch(t,e){return h.fromPromise(this.__deletePromptsBatch(t,e))}async __deletePromptsBatch(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/prompts/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:L.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/prompts/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getPromptVersionById(t,e){return h.fromPromise(this.__getPromptVersionById(t,e))}async __getPromptVersionById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/prompts/versions/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:ke.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 404:throw new T(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/prompts/versions/{versionId}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getPromptVersions(t,e={},o){return h.fromPromise(this.__getPromptVersions(t,e,o))}async __getPromptVersions(t,e={},o){var u,g;let{page:a,size:n}=e,c={};a!=null&&(c.page=a.toString()),n!=null&&(c.size=n.toString());let m=await b({url:x((g=(u=await s.get(this._options.baseUrl))!=null?u:await s.get(this._options.environment))!=null?g:w.Default,`v1/private/prompts/${encodeURIComponent(t)}/versions`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",queryParameters:c,requestType:"json",timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(m.ok)return {data:Im.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")throw new p({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse});switch(m.error.reason){case "non-json":throw new p({statusCode:m.error.statusCode,body:m.error.rawBody,rawResponse:m.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/prompts/{id}/versions.");case "unknown":throw new p({message:m.error.errorMessage,rawResponse:m.rawResponse})}}restorePromptVersion(t,e,o){return h.fromPromise(this.__restorePromptVersion(t,e,o))}async __restorePromptVersion(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/prompts/${encodeURIComponent(t)}/versions/${encodeURIComponent(e)}/restore`),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:ke.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new _(a.error.body,a.rawResponse);case 404:throw new T(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/prompts/{promptId}/versions/{versionId}/restore.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}retrievePromptVersion(t,e){return h.fromPromise(this.__retrievePromptVersion(t,e))}async __retrievePromptVersion(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/prompts/versions/retrieve"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:eo.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:ke.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);case 404:throw new T(o.error.body,o.rawResponse);case 422:throw new B(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/prompts/versions/retrieve.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var Ri=class{constructor(t={}){this._options=t;}getServiceToggles(t){return h.fromPromise(this.__getServiceToggles(t))}async __getServiceToggles(t){var o,a;let e=await b({url:x((a=(o=await s.get(this._options.baseUrl))!=null?o:await s.get(this._options.environment))!=null?a:w.Default,"v1/private/toggles"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...t==null?void 0:t.headers},contentType:"application/json",requestType:"json",timeoutMs:(t==null?void 0:t.timeoutInSeconds)!=null?t.timeoutInSeconds*1e3:6e4,maxRetries:t==null?void 0:t.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal});if(e.ok)return {data:Nm.parseOrThrow(e.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:e.rawResponse};if(e.error.reason==="status-code")throw new p({statusCode:e.error.statusCode,body:e.error.body,rawResponse:e.rawResponse});switch(e.error.reason){case "non-json":throw new p({statusCode:e.error.statusCode,body:e.error.rawBody,rawResponse:e.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/toggles.");case "unknown":throw new p({message:e.error.errorMessage,rawResponse:e.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var yi=class{constructor(t={}){this._options=t;}addSpanComment(t,e,o){return h.fromPromise(this.__addSpanComment(t,e,o))}async __addSpanComment(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/spans/${encodeURIComponent(t)}/comments`),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:H.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/spans/{id}/comments.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}addSpanFeedbackScore(t,e,o){return h.fromPromise(this.__addSpanFeedbackScore(t,e,o))}async __addSpanFeedbackScore(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/spans/${encodeURIComponent(t)}/feedback-scores`),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:ee.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/spans/{id}/feedback-scores.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}createSpans(t,e){return h.fromPromise(this.__createSpans(t,e))}async __createSpans(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/spans/batch"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:to.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/spans/batch.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}batchUpdateSpans(t,e){return h.fromPromise(this.__batchUpdateSpans(t,e))}async __batchUpdateSpans(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/spans/batch"),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:io.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/spans/batch.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getSpansByProject(t={},e){return h.fromPromise(this.__getSpansByProject(t,e))}async __getSpansByProject(t={},e){var oe,Ye;let{page:o,size:a,projectName:n,projectId:c,traceId:m,type:u,filters:g,truncate:R,stripAttachments:y,sorting:v,exclude:z,fromTime:S,toTime:F}=t,M={};o!=null&&(M.page=o.toString()),a!=null&&(M.size=a.toString()),n!=null&&(M.project_name=n),c!=null&&(M.project_id=c),m!=null&&(M.trace_id=m),u!=null&&(M.type=Ea.jsonOrThrow(u,{unrecognizedObjectKeys:"strip"})),g!=null&&(M.filters=g),R!=null&&(M.truncate=R.toString()),y!=null&&(M.strip_attachments=y.toString()),v!=null&&(M.sorting=v),z!=null&&(M.exclude=z),S!=null&&(M.from_time=S.toISOString()),F!=null&&(M.to_time=F.toISOString());let G=await b({url:x((Ye=(oe=await s.get(this._options.baseUrl))!=null?oe:await s.get(this._options.environment))!=null?Ye:w.Default,"v1/private/spans"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:M,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(G.ok)return {data:Wm.parseOrThrow(G.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:G.rawResponse};if(G.error.reason==="status-code")throw new p({statusCode:G.error.statusCode,body:G.error.body,rawResponse:G.rawResponse});switch(G.error.reason){case "non-json":throw new p({statusCode:G.error.statusCode,body:G.error.rawBody,rawResponse:G.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/spans.");case "unknown":throw new p({message:G.error.errorMessage,rawResponse:G.rawResponse})}}createSpan(t,e){return h.fromPromise(this.__createSpan(t,e))}async __createSpan(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/spans"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:oo.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 409:throw new W(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/spans.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getSpanById(t,e={},o){return h.fromPromise(this.__getSpanById(t,e,o))}async __getSpanById(t,e={},o){var m,u;let{stripAttachments:a}=e,n={};a!=null&&(n.strip_attachments=a.toString());let c=await b({url:x((u=(m=await s.get(this._options.baseUrl))!=null?m:await s.get(this._options.environment))!=null?u:w.Default,`v1/private/spans/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",queryParameters:n,requestType:"json",timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(c.ok)return {data:gt.parseOrThrow(c.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:c.rawResponse};if(c.error.reason==="status-code")switch(c.error.statusCode){case 404:throw new T(c.error.body,c.rawResponse);default:throw new p({statusCode:c.error.statusCode,body:c.error.body,rawResponse:c.rawResponse})}switch(c.error.reason){case "non-json":throw new p({statusCode:c.error.statusCode,body:c.error.rawBody,rawResponse:c.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/spans/{id}.");case "unknown":throw new p({message:c.error.errorMessage,rawResponse:c.rawResponse})}}deleteSpanById(t,e){return h.fromPromise(this.__deleteSpanById(t,e))}async __deleteSpanById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/spans/${encodeURIComponent(t)}`),method:"DELETE",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 501:throw new wr(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling DELETE /v1/private/spans/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}updateSpan(t,e,o){return h.fromPromise(this.__updateSpan(t,e,o))}async __updateSpan(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/spans/${encodeURIComponent(t)}`),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:ao.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 404:throw new T(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/spans/{id}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}deleteSpanComments(t,e){return h.fromPromise(this.__deleteSpanComments(t,e))}async __deleteSpanComments(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/spans/comments/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:L.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/spans/comments/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteSpanFeedbackScore(t,e,o){return h.fromPromise(this.__deleteSpanFeedbackScore(t,e,o))}async __deleteSpanFeedbackScore(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/spans/${encodeURIComponent(t)}/feedback-scores/delete`),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:mt.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/spans/{id}/feedback-scores/delete.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}findFeedbackScoreNames1(t={},e){return h.fromPromise(this.__findFeedbackScoreNames1(t,e))}async __findFeedbackScoreNames1(t={},e){var m,u;let{projectId:o,type:a}=t,n={};o!=null&&(n.project_id=o),a!=null&&(n.type=Pa.jsonOrThrow(a,{unrecognizedObjectKeys:"strip"}));let c=await b({url:x((u=(m=await s.get(this._options.baseUrl))!=null?m:await s.get(this._options.environment))!=null?u:w.Default,"v1/private/spans/feedback-scores/names"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:n,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(c.ok)return {data:ar.findFeedbackScoreNames1.Response.parseOrThrow(c.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:c.rawResponse};if(c.error.reason==="status-code")throw new p({statusCode:c.error.statusCode,body:c.error.body,rawResponse:c.rawResponse});switch(c.error.reason){case "non-json":throw new p({statusCode:c.error.statusCode,body:c.error.rawBody,rawResponse:c.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/spans/feedback-scores/names.");case "unknown":throw new p({message:c.error.errorMessage,rawResponse:c.rawResponse})}}getSpanComment(t,e,o){return h.fromPromise(this.__getSpanComment(t,e,o))}async __getSpanComment(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/spans/${encodeURIComponent(e)}/comments/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:H.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 404:throw new T(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/spans/{spanId}/comments/{commentId}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}getSpanStats(t={},e){return h.fromPromise(this.__getSpanStats(t,e))}async __getSpanStats(t={},e){var v,z;let{projectId:o,projectName:a,traceId:n,type:c,filters:m,fromTime:u,toTime:g}=t,R={};o!=null&&(R.project_id=o),a!=null&&(R.project_name=a),n!=null&&(R.trace_id=n),c!=null&&(R.type=Ca.jsonOrThrow(c,{unrecognizedObjectKeys:"strip"})),m!=null&&(R.filters=m),u!=null&&(R.from_time=u.toISOString()),g!=null&&(R.to_time=g.toISOString());let y=await b({url:x((z=(v=await s.get(this._options.baseUrl))!=null?v:await s.get(this._options.environment))!=null?z:w.Default,"v1/private/spans/stats"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:R,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(y.ok)return {data:Je.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")throw new p({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse});switch(y.error.reason){case "non-json":throw new p({statusCode:y.error.statusCode,body:y.error.rawBody,rawResponse:y.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/spans/stats.");case "unknown":throw new p({message:y.error.errorMessage,rawResponse:y.rawResponse})}}scoreBatchOfSpans(t,e){return h.fromPromise(this.__scoreBatchOfSpans(t,e))}async __scoreBatchOfSpans(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/spans/feedback-scores"),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:ft.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/spans/feedback-scores.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}searchSpans(t={},e){return h.fromPromise(this.__searchSpans(t,e))}async __searchSpans(t={},e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/spans/search"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:no.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),responseType:"streaming",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:o.body,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/spans/search.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}updateSpanComment(t,e,o){return h.fromPromise(this.__updateSpanComment(t,e,o))}async __updateSpanComment(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/spans/comments/${encodeURIComponent(t)}`),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:H.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 404:throw new T(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/spans/comments/{commentId}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var ki=class{constructor(t={}){this._options=t;}addThreadComment(t,e,o){return h.fromPromise(this.__addThreadComment(t,e,o))}async __addThreadComment(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/traces/threads/${encodeURIComponent(t)}/comments`),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:H.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/traces/threads/{id}/comments.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}addTraceComment(t,e,o){return h.fromPromise(this.__addTraceComment(t,e,o))}async __addTraceComment(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/traces/${encodeURIComponent(t)}/comments`),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:H.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/traces/{id}/comments.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}addTraceFeedbackScore(t,e,o){return h.fromPromise(this.__addTraceFeedbackScore(t,e,o))}async __addTraceFeedbackScore(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/traces/${encodeURIComponent(t)}/feedback-scores`),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:ee.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/traces/{id}/feedback-scores.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}createTraces(t,e){return h.fromPromise(this.__createTraces(t,e))}async __createTraces(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces/batch"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:po.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/traces/batch.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}batchUpdateTraces(t,e){return h.fromPromise(this.__batchUpdateTraces(t,e))}async __batchUpdateTraces(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces/batch"),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:lo.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/traces/batch.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}batchUpdateThreads(t,e){return h.fromPromise(this.__batchUpdateThreads(t,e))}async __batchUpdateThreads(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces/threads/batch"),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:uo.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/traces/threads/batch.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}closeTraceThread(t={},e){return h.fromPromise(this.__closeTraceThread(t,e))}async __closeTraceThread(t={},e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces/threads/close"),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:go.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 404:throw new T(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/traces/threads/close.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getTracesByProject(t={},e){return h.fromPromise(this.__getTracesByProject(t,e))}async __getTracesByProject(t={},e){var M,G;let{page:o,size:a,projectName:n,projectId:c,filters:m,truncate:u,stripAttachments:g,sorting:R,exclude:y,fromTime:v,toTime:z}=t,S={};o!=null&&(S.page=o.toString()),a!=null&&(S.size=a.toString()),n!=null&&(S.project_name=n),c!=null&&(S.project_id=c),m!=null&&(S.filters=m),u!=null&&(S.truncate=u.toString()),g!=null&&(S.strip_attachments=g.toString()),R!=null&&(S.sorting=R),y!=null&&(S.exclude=y),v!=null&&(S.from_time=v.toISOString()),z!=null&&(S.to_time=z.toISOString());let F=await b({url:x((G=(M=await s.get(this._options.baseUrl))!=null?M:await s.get(this._options.environment))!=null?G:w.Default,"v1/private/traces"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:S,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(F.ok)return {data:Qm.parseOrThrow(F.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:F.rawResponse};if(F.error.reason==="status-code")throw new p({statusCode:F.error.statusCode,body:F.error.body,rawResponse:F.rawResponse});switch(F.error.reason){case "non-json":throw new p({statusCode:F.error.statusCode,body:F.error.rawBody,rawResponse:F.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/traces.");case "unknown":throw new p({message:F.error.errorMessage,rawResponse:F.rawResponse})}}createTrace(t,e){return h.fromPromise(this.__createTrace(t,e))}async __createTrace(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:so.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/traces.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getTraceById(t,e={},o){return h.fromPromise(this.__getTraceById(t,e,o))}async __getTraceById(t,e={},o){var m,u;let{stripAttachments:a}=e,n={};a!=null&&(n.strip_attachments=a.toString());let c=await b({url:x((u=(m=await s.get(this._options.baseUrl))!=null?m:await s.get(this._options.environment))!=null?u:w.Default,`v1/private/traces/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",queryParameters:n,requestType:"json",timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(c.ok)return {data:ht.parseOrThrow(c.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:c.rawResponse};if(c.error.reason==="status-code")throw new p({statusCode:c.error.statusCode,body:c.error.body,rawResponse:c.rawResponse});switch(c.error.reason){case "non-json":throw new p({statusCode:c.error.statusCode,body:c.error.rawBody,rawResponse:c.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/traces/{id}.");case "unknown":throw new p({message:c.error.errorMessage,rawResponse:c.rawResponse})}}deleteTraceById(t,e){return h.fromPromise(this.__deleteTraceById(t,e))}async __deleteTraceById(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,`v1/private/traces/${encodeURIComponent(t)}`),method:"DELETE",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling DELETE /v1/private/traces/{id}.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}updateTrace(t,e,o){return h.fromPromise(this.__updateTrace(t,e,o))}async __updateTrace(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/traces/${encodeURIComponent(t)}`),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:co.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/traces/{id}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}deleteThreadComments(t,e){return h.fromPromise(this.__deleteThreadComments(t,e))}async __deleteThreadComments(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces/threads/comments/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:L.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/traces/threads/comments/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteThreadFeedbackScores(t,e){return h.fromPromise(this.__deleteThreadFeedbackScores(t,e))}async __deleteThreadFeedbackScores(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces/threads/feedback-scores/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:fo.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/traces/threads/feedback-scores/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteTraceComments(t,e){return h.fromPromise(this.__deleteTraceComments(t,e))}async __deleteTraceComments(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces/comments/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:L.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/traces/comments/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteTraceFeedbackScore(t,e,o){return h.fromPromise(this.__deleteTraceFeedbackScore(t,e,o))}async __deleteTraceFeedbackScore(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/traces/${encodeURIComponent(t)}/feedback-scores/delete`),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:mt.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/traces/{id}/feedback-scores/delete.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}deleteTraceThreads(t,e){return h.fromPromise(this.__deleteTraceThreads(t,e))}async __deleteTraceThreads(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces/threads/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:ho.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/traces/threads/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteTraces(t,e){return h.fromPromise(this.__deleteTraces(t,e))}async __deleteTraces(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces/delete"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:L.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/traces/delete.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}findFeedbackScoreNames2(t={},e){return h.fromPromise(this.__findFeedbackScoreNames2(t,e))}async __findFeedbackScoreNames2(t={},e){var c,m;let{projectId:o}=t,a={};o!=null&&(a.project_id=o);let n=await b({url:x((m=(c=await s.get(this._options.baseUrl))!=null?c:await s.get(this._options.environment))!=null?m:w.Default,"v1/private/traces/feedback-scores/names"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:a,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(n.ok)return {data:Le.findFeedbackScoreNames2.Response.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new p({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});switch(n.error.reason){case "non-json":throw new p({statusCode:n.error.statusCode,body:n.error.rawBody,rawResponse:n.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/traces/feedback-scores/names.");case "unknown":throw new p({message:n.error.errorMessage,rawResponse:n.rawResponse})}}findTraceThreadsFeedbackScoreNames(t={},e){return h.fromPromise(this.__findTraceThreadsFeedbackScoreNames(t,e))}async __findTraceThreadsFeedbackScoreNames(t={},e){var c,m;let{projectId:o}=t,a={};o!=null&&(a.project_id=o);let n=await b({url:x((m=(c=await s.get(this._options.baseUrl))!=null?c:await s.get(this._options.environment))!=null?m:w.Default,"v1/private/traces/threads/feedback-scores/names"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:a,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(n.ok)return {data:Le.findTraceThreadsFeedbackScoreNames.Response.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new p({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});switch(n.error.reason){case "non-json":throw new p({statusCode:n.error.statusCode,body:n.error.rawBody,rawResponse:n.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/traces/threads/feedback-scores/names.");case "unknown":throw new p({message:n.error.errorMessage,rawResponse:n.rawResponse})}}getTraceStats(t={},e){return h.fromPromise(this.__getTraceStats(t,e))}async __getTraceStats(t={},e){var R,y;let{projectId:o,projectName:a,filters:n,fromTime:c,toTime:m}=t,u={};o!=null&&(u.project_id=o),a!=null&&(u.project_name=a),n!=null&&(u.filters=n),c!=null&&(u.from_time=c.toISOString()),m!=null&&(u.to_time=m.toISOString());let g=await b({url:x((y=(R=await s.get(this._options.baseUrl))!=null?R:await s.get(this._options.environment))!=null?y:w.Default,"v1/private/traces/stats"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:u,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(g.ok)return {data:Je.parseOrThrow(g.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:g.rawResponse};if(g.error.reason==="status-code")throw new p({statusCode:g.error.statusCode,body:g.error.body,rawResponse:g.rawResponse});switch(g.error.reason){case "non-json":throw new p({statusCode:g.error.statusCode,body:g.error.rawBody,rawResponse:g.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/traces/stats.");case "unknown":throw new p({message:g.error.errorMessage,rawResponse:g.rawResponse})}}getThreadComment(t,e,o){return h.fromPromise(this.__getThreadComment(t,e,o))}async __getThreadComment(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/traces/threads/${encodeURIComponent(e)}/comments/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:H.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 404:throw new T(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/traces/threads/{threadId}/comments/{commentId}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}getTraceComment(t,e,o){return h.fromPromise(this.__getTraceComment(t,e,o))}async __getTraceComment(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/traces/${encodeURIComponent(e)}/comments/${encodeURIComponent(t)}`),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:H.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 404:throw new T(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/traces/{traceId}/comments/{commentId}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}getTraceThread(t,e){return h.fromPromise(this.__getTraceThread(t,e))}async __getTraceThread(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces/threads/retrieve"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:ei.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:wt.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 404:throw new T(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/traces/threads/retrieve.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getTraceThreads(t={},e){return h.fromPromise(this.__getTraceThreads(t,e))}async __getTraceThreads(t={},e){var F,M;let{page:o,size:a,projectName:n,projectId:c,truncate:m,stripAttachments:u,filters:g,sorting:R,fromTime:y,toTime:v}=t,z={};o!=null&&(z.page=o.toString()),a!=null&&(z.size=a.toString()),n!=null&&(z.project_name=n),c!=null&&(z.project_id=c),m!=null&&(z.truncate=m.toString()),u!=null&&(z.strip_attachments=u.toString()),g!=null&&(z.filters=g),R!=null&&(z.sorting=R),y!=null&&(z.from_time=y.toISOString()),v!=null&&(z.to_time=v.toISOString());let S=await b({url:x((M=(F=await s.get(this._options.baseUrl))!=null?F:await s.get(this._options.environment))!=null?M:w.Default,"v1/private/traces/threads"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:z,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(S.ok)return {data:$m.parseOrThrow(S.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:S.rawResponse};if(S.error.reason==="status-code")throw new p({statusCode:S.error.statusCode,body:S.error.body,rawResponse:S.rawResponse});switch(S.error.reason){case "non-json":throw new p({statusCode:S.error.statusCode,body:S.error.rawBody,rawResponse:S.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/traces/threads.");case "unknown":throw new p({message:S.error.errorMessage,rawResponse:S.rawResponse})}}openTraceThread(t,e){return h.fromPromise(this.__openTraceThread(t,e))}async __openTraceThread(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces/threads/open"),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:ei.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/traces/threads/open.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}scoreBatchOfThreads(t,e){return h.fromPromise(this.__scoreBatchOfThreads(t,e))}async __scoreBatchOfThreads(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces/threads/feedback-scores"),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:wo.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/traces/threads/feedback-scores.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}scoreBatchOfTraces(t,e){return h.fromPromise(this.__scoreBatchOfTraces(t,e))}async __scoreBatchOfTraces(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces/feedback-scores"),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:ft.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/traces/feedback-scores.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}searchTraceThreads(t={},e){return h.fromPromise(this.__searchTraceThreads(t,e))}async __searchTraceThreads(t={},e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces/threads/search"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:bo.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),responseType:"streaming",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:o.body,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/traces/threads/search.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}searchTraces(t={},e){return h.fromPromise(this.__searchTraces(t,e))}async __searchTraces(t={},e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/traces/search"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:xo.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),responseType:"streaming",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:o.body,rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);case 401:throw new $(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/traces/search.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}updateThread(t,e,o){return h.fromPromise(this.__updateThread(t,e,o))}async __updateThread(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/traces/threads/${encodeURIComponent(t)}`),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:mo.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 404:throw new T(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/traces/threads/{threadModelId}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}updateThreadComment(t,e,o){return h.fromPromise(this.__updateThreadComment(t,e,o))}async __updateThreadComment(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/traces/threads/comments/${encodeURIComponent(t)}`),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:H.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 404:throw new T(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/traces/threads/comments/{commentId}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}updateTraceComment(t,e,o){return h.fromPromise(this.__updateTraceComment(t,e,o))}async __updateTraceComment(t,e,o){var n,c;let a=await b({url:x((c=(n=await s.get(this._options.baseUrl))!=null?n:await s.get(this._options.environment))!=null?c:w.Default,`v1/private/traces/comments/${encodeURIComponent(t)}`),method:"PATCH",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...o==null?void 0:o.headers},contentType:"application/json",requestType:"json",body:H.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),timeoutMs:(o==null?void 0:o.timeoutInSeconds)!=null?o.timeoutInSeconds*1e3:6e4,maxRetries:o==null?void 0:o.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 404:throw new T(a.error.body,a.rawResponse);default:throw new p({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case "non-json":throw new p({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PATCH /v1/private/traces/comments/{commentId}.");case "unknown":throw new p({message:a.error.errorMessage,rawResponse:a.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var vi=class{constructor(t={}){this._options=t;}getWelcomeWizardStatus(t){return h.fromPromise(this.__getWelcomeWizardStatus(t))}async __getWelcomeWizardStatus(t){var o,a;let e=await b({url:x((a=(o=await s.get(this._options.baseUrl))!=null?o:await s.get(this._options.environment))!=null?a:w.Default,"v1/private/welcome-wizard"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...t==null?void 0:t.headers},contentType:"application/json",requestType:"json",timeoutMs:(t==null?void 0:t.timeoutInSeconds)!=null?t.timeoutInSeconds*1e3:6e4,maxRetries:t==null?void 0:t.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal});if(e.ok)return {data:Ym.parseOrThrow(e.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:e.rawResponse};if(e.error.reason==="status-code")throw new p({statusCode:e.error.statusCode,body:e.error.body,rawResponse:e.rawResponse});switch(e.error.reason){case "non-json":throw new p({statusCode:e.error.statusCode,body:e.error.rawBody,rawResponse:e.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/welcome-wizard.");case "unknown":throw new p({message:e.error.errorMessage,rawResponse:e.rawResponse})}}submitWelcomeWizard(t={},e){return h.fromPromise(this.__submitWelcomeWizard(t,e))}async __submitWelcomeWizard(t={},e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/welcome-wizard"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:Ao.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:void 0,rawResponse:o.rawResponse};if(o.error.reason==="status-code")throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse});switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/welcome-wizard.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var zi=class{constructor(t={}){this._options=t;}costsSummary(t,e){return h.fromPromise(this.__costsSummary(t,e))}async __costsSummary(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/workspaces/costs/summaries"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:pr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:Xe.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/workspaces/costs/summaries.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getWorkspaceConfiguration(t){return h.fromPromise(this.__getWorkspaceConfiguration(t))}async __getWorkspaceConfiguration(t){var o,a;let e=await b({url:x((a=(o=await s.get(this._options.baseUrl))!=null?o:await s.get(this._options.environment))!=null?a:w.Default,"v1/private/workspaces/configurations"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...t==null?void 0:t.headers},contentType:"application/json",requestType:"json",timeoutMs:(t==null?void 0:t.timeoutInSeconds)!=null?t.timeoutInSeconds*1e3:6e4,maxRetries:t==null?void 0:t.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal});if(e.ok)return {data:bt.parseOrThrow(e.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:e.rawResponse};if(e.error.reason==="status-code")switch(e.error.statusCode){case 404:throw new T(e.error.body,e.rawResponse);default:throw new p({statusCode:e.error.statusCode,body:e.error.body,rawResponse:e.rawResponse})}switch(e.error.reason){case "non-json":throw new p({statusCode:e.error.statusCode,body:e.error.rawBody,rawResponse:e.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/private/workspaces/configurations.");case "unknown":throw new p({message:e.error.errorMessage,rawResponse:e.rawResponse})}}upsertWorkspaceConfiguration(t,e){return h.fromPromise(this.__upsertWorkspaceConfiguration(t,e))}async __upsertWorkspaceConfiguration(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/workspaces/configurations"),method:"PUT",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:bt.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:bt.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);case 422:throw new B(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling PUT /v1/private/workspaces/configurations.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}deleteWorkspaceConfiguration(t){return h.fromPromise(this.__deleteWorkspaceConfiguration(t))}async __deleteWorkspaceConfiguration(t){var o,a;let e=await b({url:x((a=(o=await s.get(this._options.baseUrl))!=null?o:await s.get(this._options.environment))!=null?a:w.Default,"v1/private/workspaces/configurations"),method:"DELETE",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...t==null?void 0:t.headers},contentType:"application/json",requestType:"json",timeoutMs:(t==null?void 0:t.timeoutInSeconds)!=null?t.timeoutInSeconds*1e3:6e4,maxRetries:t==null?void 0:t.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal});if(e.ok)return {data:void 0,rawResponse:e.rawResponse};if(e.error.reason==="status-code")switch(e.error.statusCode){case 404:throw new T(e.error.body,e.rawResponse);default:throw new p({statusCode:e.error.statusCode,body:e.error.body,rawResponse:e.rawResponse})}switch(e.error.reason){case "non-json":throw new p({statusCode:e.error.statusCode,body:e.error.rawBody,rawResponse:e.rawResponse});case "timeout":throw new f("Timeout exceeded when calling DELETE /v1/private/workspaces/configurations.");case "unknown":throw new p({message:e.error.errorMessage,rawResponse:e.rawResponse})}}getCost(t,e){return h.fromPromise(this.__getCost(t,e))}async __getCost(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/workspaces/costs"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:pr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:ri.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/workspaces/costs.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}getMetric(t,e){return h.fromPromise(this.__getMetric(t,e))}async __getMetric(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/workspaces/metrics"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:pr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:ri.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/workspaces/metrics.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}metricsSummary(t,e){return h.fromPromise(this.__metricsSummary(t,e))}async __metricsSummary(t,e){var a,n;let o=await b({url:x((n=(a=await s.get(this._options.baseUrl))!=null?a:await s.get(this._options.environment))!=null?n:w.Default,"v1/private/workspaces/metrics/summaries"),method:"POST",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",requestType:"json",body:pr.jsonOrThrow(t,{unrecognizedObjectKeys:"strip"}),timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(o.ok)return {data:Zm.parseOrThrow(o.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,breadcrumbsPrefix:["response"]}),rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.statusCode){case 400:throw new _(o.error.body,o.rawResponse);default:throw new p({statusCode:o.error.statusCode,body:o.error.body,rawResponse:o.rawResponse})}switch(o.error.reason){case "non-json":throw new p({statusCode:o.error.statusCode,body:o.error.rawBody,rawResponse:o.rawResponse});case "timeout":throw new f("Timeout exceeded when calling POST /v1/private/workspaces/metrics/summaries.");case "unknown":throw new p({message:o.error.errorMessage,rawResponse:o.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var Si=class{constructor(t={}){this._options=t;}datasetsRedirect(t,e){return h.fromPromise(this.__datasetsRedirect(t,e))}async __datasetsRedirect(t,e){var u,g;let{datasetId:o,workspaceName:a,path:n}=t,c={};c.dataset_id=o,a!=null&&(c.workspace_name=a),c.path=n;let m=await b({url:x((g=(u=await s.get(this._options.baseUrl))!=null?u:await s.get(this._options.environment))!=null?g:w.Default,"v1/session/redirect/datasets"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:c,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(m.ok)return {data:void 0,rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 400:throw new _(m.error.body,m.rawResponse);case 404:throw new T(m.error.body,m.rawResponse);default:throw new p({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}switch(m.error.reason){case "non-json":throw new p({statusCode:m.error.statusCode,body:m.error.rawBody,rawResponse:m.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/session/redirect/datasets.");case "unknown":throw new p({message:m.error.errorMessage,rawResponse:m.rawResponse})}}experimentsRedirect(t,e){return h.fromPromise(this.__experimentsRedirect(t,e))}async __experimentsRedirect(t,e){var g,R;let{datasetId:o,experimentId:a,workspaceName:n,path:c}=t,m={};m.dataset_id=o,m.experiment_id=a,n!=null&&(m.workspace_name=n),m.path=c;let u=await b({url:x((R=(g=await s.get(this._options.baseUrl))!=null?g:await s.get(this._options.environment))!=null?R:w.Default,"v1/session/redirect/experiments"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:m,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(u.ok)return {data:void 0,rawResponse:u.rawResponse};if(u.error.reason==="status-code")switch(u.error.statusCode){case 400:throw new _(u.error.body,u.rawResponse);case 404:throw new T(u.error.body,u.rawResponse);default:throw new p({statusCode:u.error.statusCode,body:u.error.body,rawResponse:u.rawResponse})}switch(u.error.reason){case "non-json":throw new p({statusCode:u.error.statusCode,body:u.error.rawBody,rawResponse:u.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/session/redirect/experiments.");case "unknown":throw new p({message:u.error.errorMessage,rawResponse:u.rawResponse})}}optimizationsRedirect(t,e){return h.fromPromise(this.__optimizationsRedirect(t,e))}async __optimizationsRedirect(t,e){var g,R;let{datasetId:o,optimizationId:a,workspaceName:n,path:c}=t,m={};m.dataset_id=o,m.optimization_id=a,n!=null&&(m.workspace_name=n),m.path=c;let u=await b({url:x((R=(g=await s.get(this._options.baseUrl))!=null?g:await s.get(this._options.environment))!=null?R:w.Default,"v1/session/redirect/optimizations"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:m,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(u.ok)return {data:void 0,rawResponse:u.rawResponse};if(u.error.reason==="status-code")switch(u.error.statusCode){case 400:throw new _(u.error.body,u.rawResponse);case 404:throw new T(u.error.body,u.rawResponse);default:throw new p({statusCode:u.error.statusCode,body:u.error.body,rawResponse:u.rawResponse})}switch(u.error.reason){case "non-json":throw new p({statusCode:u.error.statusCode,body:u.error.rawBody,rawResponse:u.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/session/redirect/optimizations.");case "unknown":throw new p({message:u.error.errorMessage,rawResponse:u.rawResponse})}}projectsRedirect(t,e){return h.fromPromise(this.__projectsRedirect(t,e))}async __projectsRedirect(t,e){var u,g;let{traceId:o,workspaceName:a,path:n}=t,c={};c.trace_id=o,a!=null&&(c.workspace_name=a),c.path=n;let m=await b({url:x((g=(u=await s.get(this._options.baseUrl))!=null?u:await s.get(this._options.environment))!=null?g:w.Default,"v1/session/redirect/projects"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...e==null?void 0:e.headers},contentType:"application/json",queryParameters:c,requestType:"json",timeoutMs:(e==null?void 0:e.timeoutInSeconds)!=null?e.timeoutInSeconds*1e3:6e4,maxRetries:e==null?void 0:e.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal});if(m.ok)return {data:void 0,rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 400:throw new _(m.error.body,m.rawResponse);case 404:throw new T(m.error.body,m.rawResponse);default:throw new p({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}switch(m.error.reason){case "non-json":throw new p({statusCode:m.error.statusCode,body:m.error.rawBody,rawResponse:m.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /v1/session/redirect/projects.");case "unknown":throw new p({message:m.error.errorMessage,rawResponse:m.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var xt=class{constructor(t={}){this._options=t;}get systemUsage(){var t;return (t=this._systemUsage)!=null?t:this._systemUsage=new oi(this._options)}get alerts(){var t;return (t=this._alerts)!=null?t:this._alerts=new ti(this._options)}get annotationQueues(){var t;return (t=this._annotationQueues)!=null?t:this._annotationQueues=new ai(this._options)}get attachments(){var t;return (t=this._attachments)!=null?t:this._attachments=new ii(this._options)}get check(){var t;return (t=this._check)!=null?t:this._check=new ni(this._options)}get automationRuleEvaluators(){var t;return (t=this._automationRuleEvaluators)!=null?t:this._automationRuleEvaluators=new si(this._options)}get chatCompletions(){var t;return (t=this._chatCompletions)!=null?t:this._chatCompletions=new pi(this._options)}get dashboards(){var t;return (t=this._dashboards)!=null?t:this._dashboards=new ci(this._options)}get datasets(){var t;return (t=this._datasets)!=null?t:this._datasets=new li(this._options)}get experiments(){var t;return (t=this._experiments)!=null?t:this._experiments=new mi(this._options)}get feedbackDefinitions(){var t;return (t=this._feedbackDefinitions)!=null?t:this._feedbackDefinitions=new di(this._options)}get guardrails(){var t;return (t=this._guardrails)!=null?t:this._guardrails=new ui(this._options)}get llmProviderKey(){var t;return (t=this._llmProviderKey)!=null?t:this._llmProviderKey=new gi(this._options)}get manualEvaluation(){var t;return (t=this._manualEvaluation)!=null?t:this._manualEvaluation=new fi(this._options)}get openTelemetryIngestion(){var t;return (t=this._openTelemetryIngestion)!=null?t:this._openTelemetryIngestion=new hi(this._options)}get optimizations(){var t;return (t=this._optimizations)!=null?t:this._optimizations=new wi(this._options)}get projects(){var t;return (t=this._projects)!=null?t:this._projects=new bi(this._options)}get prompts(){var t;return (t=this._prompts)!=null?t:this._prompts=new xi(this._options)}get serviceToggles(){var t;return (t=this._serviceToggles)!=null?t:this._serviceToggles=new Ri(this._options)}get spans(){var t;return (t=this._spans)!=null?t:this._spans=new yi(this._options)}get traces(){var t;return (t=this._traces)!=null?t:this._traces=new ki(this._options)}get welcomeWizard(){var t;return (t=this._welcomeWizard)!=null?t:this._welcomeWizard=new vi(this._options)}get workspaces(){var t;return (t=this._workspaces)!=null?t:this._workspaces=new zi(this._options)}get redirect(){var t;return (t=this._redirect)!=null?t:this._redirect=new Si(this._options)}isAlive(t){return h.fromPromise(this.__isAlive(t))}async __isAlive(t){var o,a;let e=await b({url:x((a=(o=await s.get(this._options.baseUrl))!=null?o:await s.get(this._options.environment))!=null?a:w.Default,"is-alive/ping"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...t==null?void 0:t.headers},contentType:"application/json",requestType:"json",timeoutMs:(t==null?void 0:t.timeoutInSeconds)!=null?t.timeoutInSeconds*1e3:6e4,maxRetries:t==null?void 0:t.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal});if(e.ok)return {data:e.body,rawResponse:e.rawResponse};if(e.error.reason==="status-code")throw new p({statusCode:e.error.statusCode,body:e.error.body,rawResponse:e.rawResponse});switch(e.error.reason){case "non-json":throw new p({statusCode:e.error.statusCode,body:e.error.rawBody,rawResponse:e.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /is-alive/ping.");case "unknown":throw new p({message:e.error.errorMessage,rawResponse:e.rawResponse})}}version(t){return h.fromPromise(this.__version(t))}async __version(t){var o,a;let e=await b({url:x((a=(o=await s.get(this._options.baseUrl))!=null?o:await s.get(this._options.environment))!=null?a:w.Default,"is-alive/ver"),method:"GET",headers:{"Comet-Workspace":await s.get(this._options.workspaceName)!=null?await s.get(this._options.workspaceName):void 0,"X-Fern-Language":"JavaScript","X-Fern-Runtime":d.type,"X-Fern-Runtime-Version":d.version,...await this._getCustomAuthorizationHeaders(),...t==null?void 0:t.headers},contentType:"application/json",requestType:"json",timeoutMs:(t==null?void 0:t.timeoutInSeconds)!=null?t.timeoutInSeconds*1e3:6e4,maxRetries:t==null?void 0:t.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal});if(e.ok)return {data:e.body,rawResponse:e.rawResponse};if(e.error.reason==="status-code")throw new p({statusCode:e.error.statusCode,body:e.error.body,rawResponse:e.rawResponse});switch(e.error.reason){case "non-json":throw new p({statusCode:e.error.statusCode,body:e.error.rawBody,rawResponse:e.rawResponse});case "timeout":throw new f("Timeout exceeded when calling GET /is-alive/ver.");case "unknown":throw new p({message:e.error.errorMessage,rawResponse:e.rawResponse})}}async _getCustomAuthorizationHeaders(){return {Authorization:await s.get(this._options.apiKey)}}};var re=()=>uuid.v7();var _i=class i{constructor(t,e){this.data=t;this.opik=e;this.childSpans=[];this.end=()=>this.update({endTime:new Date});this.score=t=>{var e;this.opik.spanFeedbackScoresBatchQueue.create({...t,projectName:(e=this.data.projectName)!=null?e:this.opik.config.projectName,id:this.data.id,source:"sdk"});};this.update=t=>{var o;let e={parentSpanId:this.data.parentSpanId,projectName:(o=this.data.projectName)!=null?o:this.opik.config.projectName,traceId:this.data.traceId,...t};return this.opik.spanBatchQueue.update(this.data.id,e),this.data={...this.data,...t},this};this.span=t=>{var n;let e=(n=this.data.projectName)!=null?n:this.opik.config.projectName,o={id:re(),startTime:new Date,...t,projectName:e,traceId:this.data.traceId,parentSpanId:this.data.id};this.opik.spanBatchQueue.create(o);let a=new i(o,this.opik);return this.childSpans.push(a),a};}};var Ti=class{constructor(t,e){this.data=t;this.opik=e;this.spans=[];this.end=()=>this.update({endTime:new Date});this.score=t=>{var e;this.opik.traceFeedbackScoresBatchQueue.create({...t,projectName:(e=this.data.projectName)!=null?e:this.opik.config.projectName,id:this.data.id,source:"sdk"});};this.span=t=>{var n,c;let e=(c=(n=this.data.projectName)!=null?n:t.projectName)!=null?c:this.opik.config.projectName,o={id:re(),startTime:new Date,...t,projectName:e,traceId:this.data.id};this.opik.spanBatchQueue.create(o);let a=new _i(o,this.opik);return this.spans.push(a),a};this.update=t=>{var o;let e={projectName:(o=this.data.projectName)!=null?o:this.opik.config.projectName,...t};return this.opik.traceBatchQueue.update(this.data.id,e),this.data={...this.data,...e},this};}};var yg={EXPERIMENTS:"api/v1/session/redirect/experiments/",PROJECT_BY_NAME:"redirect/projects"},Ai={EXPERIMENT_ID:"experiment_id",DATASET_ID:"dataset_id",PROJECT_NAME:"name",PATH:"path"},Ob=i=>Object.entries(i).map(([t,e])=>`${t}=${encodeURIComponent(e)}`).join("&").replace(/%3A/g,":").replace(/%2F/g,"/").replace(/%26/g,"&").replace(/%3F/g,"?").replace(/%3D/g,"="),Wb=i=>i.replace(/\/api$/,""),Bb=i=>Buffer.from(i).toString("base64"),kg=(i,t,e)=>{let o=Ob(e),a=`${t}?${o}`;return new URL(a,i).toString()},vg=({datasetId:i,experimentId:t,baseUrl:e})=>kg(e,yg.EXPERIMENTS,{[Ai.EXPERIMENT_ID]:t,[Ai.DATASET_ID]:i,[Ai.PATH]:Bb(e)});var zg=({projectName:i,workspaceName:t,apiUrl:e})=>{let o=Wb(e),a=`${t}/${yg.PROJECT_BY_NAME}`;return kg(o,a,{[Ai.PROJECT_NAME]:i})};var Lb=300,Ei=100,Rt=class{constructor({action:t,batchSize:e=Ei,delay:o,enableBatch:a,name:n="ActionQueue"}){this.timerId=null;this.promise=Promise.resolve();this.queue=new Map;this.debounceFlush=()=>{this.timerId&&clearTimeout(this.timerId),this.timerId=setTimeout(()=>this.flush(),this.delay);};this.add=(t,e)=>{if(this.queue.set(t,e),!this.enableBatch){this.flush();return}if(this.queue.size>=this.batchSize){this.flush();return}this.debounceFlush();};this.update=(t,e)=>{let o=this.queue.get(t);o&&(this.queue.set(t,{...o,...e}),this.debounceFlush());};this.flush=async()=>{if(this.queue.size===0)return this.promise;let t=new Map(this.queue);this.queue.clear(),k.debug(`Adding ${t.size} items to ${this.name} promise:`,t),this.promise=this.promise.finally(()=>(k.debug(`Flushing ${this.name}:`,t),this.action(t))).catch(e=>{k.error(`Failed to flush ${this.name}:`,e,t);}),await this.promise;};this.action=t,this.batchSize=e,this.delay=o,this.enableBatch=a,this.name=n;}},de=class{constructor({delay:t=Lb,enableCreateBatch:e=true,enableUpdateBatch:o=false,enableDeleteBatch:a=true,createBatchSize:n=Ei,updateBatchSize:c=Ei,deleteBatchSize:m=Ei,name:u="BatchQueue"}={}){this.create=t=>{let e=this.getId(t);this.createQueue.add(e,t);};this.get=async t=>{let e=this.createQueue.queue.get(t);return e||this.getEntity(t)};this.update=(t,e)=>{if(this.createQueue.queue.get(t)){this.createQueue.update(t,e);return}this.updateQueue.add(t,e);};this.delete=t=>{if(this.createQueue.queue.has(t)){this.createQueue.queue.delete(t);return}this.deleteQueue.add(t);};this.flush=async()=>{await this.createQueue.flush(),await this.updateQueue.flush(),await this.deleteQueue.flush();};this.name=u,this.createQueue=new Rt({action:async g=>{await this.createEntities(Array.from(g.values()));},delay:t,enableBatch:e,batchSize:n,name:`${u}:createQueue`}),this.updateQueue=new Rt({action:async g=>{await this.createQueue.flush();let R=Array.from(g.entries());for(let[y,v]of R)await this.updateEntity(y,v);},delay:t,enableBatch:o,batchSize:c,name:`${u}:updateQueue`}),this.deleteQueue=new Rt({action:async g=>{await this.createQueue.flush(),await this.updateQueue.flush(),await this.deleteEntities(Array.from(g.keys()));},delay:t,enableBatch:a,batchSize:m,name:`${u}:deleteQueue`});}};var Pi=class extends de{constructor(e,o){super({delay:o,enableCreateBatch:true,enableUpdateBatch:true,enableDeleteBatch:true,name:"SpanBatchQueue"});this.api=e;}getId(e){return e.id}async createEntities(e){await this.api.spans.createSpans({spans:e},this.api.requestOptions);}async getEntity(e){return await this.api.spans.getSpanById(e,{},this.api.requestOptions)}async updateEntity(e,o){await this.api.spans.updateSpan(e,o,this.api.requestOptions);}async deleteEntities(e){for(let o of e)await this.api.spans.deleteSpanById(o,this.api.requestOptions);}};var Ci=class extends de{constructor(e,o){super({delay:o,enableCreateBatch:true,enableUpdateBatch:true,enableDeleteBatch:true,name:"SpanFeedbackScoresBatchQueue"});this.api=e;}getId(e){return {id:e.id,name:e.name}}async createEntities(e){await this.api.spans.scoreBatchOfSpans({scores:e},this.api.requestOptions);}async getEntity(){throw new Error("Not implemented")}async updateEntity(){throw new Error("Not implemented")}async deleteEntities(e){for(let o of e)await this.api.spans.deleteSpanFeedbackScore(o.id,{name:o.name},this.api.requestOptions);}};var Ii=class extends de{constructor(e,o){super({delay:o,enableCreateBatch:true,enableUpdateBatch:true,enableDeleteBatch:true,name:"TraceBatchQueue"});this.api=e;}getId(e){return e.id}async createEntities(e){await this.api.traces.createTraces({traces:e},this.api.requestOptions);}async getEntity(e){return await this.api.traces.getTraceById(e,{},this.api.requestOptions)}async updateEntity(e,o){await this.api.traces.updateTrace(e,o,this.api.requestOptions);}async deleteEntities(e){await this.api.traces.deleteTraces({ids:e},this.api.requestOptions);}};var ji=class extends de{constructor(e,o){super({delay:o,enableCreateBatch:true,enableUpdateBatch:true,enableDeleteBatch:true,name:"TraceFeedbackScoresBatchQueue"});this.api=e;}getId(e){return {id:e.id,name:e.name}}async createEntities(e){await this.api.traces.scoreBatchOfTraces({scores:e},this.api.requestOptions);}async getEntity(){throw new Error("Not implemented")}async updateEntity(){throw new Error("Not implemented")}async deleteEntities(e){for(let o of e)await this.api.traces.deleteTraceFeedbackScore(o.id,{name:o.name},this.api.requestOptions);}};var Ui=class extends xt{constructor(e){super(e);this.setHeaders=e=>{this.requestOptions.headers=e;};this.requestOptions=(e==null?void 0:e.requestOptions)||{};}};var Ni=class extends de{constructor(e,o){super({delay:o,enableCreateBatch:true,enableUpdateBatch:true,enableDeleteBatch:true,name:"DatasetBatchQueue"});this.api=e;}getId(e){return e.id||""}async createEntities(e){for(let o of e)await this.api.datasets.createDataset(o,this.api.requestOptions);}async getEntity(e){try{return await this.api.datasets.getDatasetById(e,this.api.requestOptions)}catch{return}}async updateEntity(e,o){await this.api.datasets.updateDataset(e,{name:o.name||"",visibility:o.visibility,description:o.description},this.api.requestOptions);}async deleteEntities(e){await this.api.datasets.deleteDatasetsBatch({ids:e},this.api.requestOptions);}};var qm=null;async function Sg(){return qm||(qm=await Vb__default.default()),qm}var yt=class i{constructor(t){let{id:e,traceId:o,spanId:a,source:n,...c}=t;this.id=e||re(),this.traceId=o,this.spanId=a,this.source=n||zn.Sdk,this.data={...c};}getContent(t=false){return t?{...this.data,id:this.id}:{...this.data}}async contentHash(){let t=this.getContent(),e=Hb__default.default(t);return (await Sg()).h32(e,43981).toString(16)}toApiModel(){return {id:this.id,traceId:this.traceId,spanId:this.spanId,source:this.source,data:this.getContent()}}static fromApiModel(t){return new i({id:t.id,traceId:t.traceId,spanId:t.spanId,source:t.source,...t.data})}};async function je(i,t,e){var c;if(e===0)return [];let o=new util.TextDecoder("utf-8"),a=[],n="";try{for await(let m of i){n+=o.decode(m,{stream:!0});let u=n.split(`
|
|
5
5
|
`);n=(c=u.pop())!=null?c:"";for(let g of u)if(!(!g.trim()||g==="{}"||g==="[]"||g==="null"))try{let R=JSON.parse(g),y=t.parse(R);if(y.ok){if(a.push(y.value),e!==void 0&&a.length>=e)return a}else k.error("Error parsing experiment item:",y.errors);}catch(R){k.error("Error parsing JSON line:",R instanceof Error?R.message:String(R));}}if(n.trim()&&n!=="{}"&&n!=="[]"&&n!=="null")try{let m=JSON.parse(n),u=t.parse(m);u.ok?a.push(u.value):k.error("Error parsing experiment item:",u.errors);}catch(m){k.error("Error parsing remaining buffer:",m instanceof Error?m.message:String(m));}}catch(m){k.error("Error processing stream:",m instanceof Error?m.message:String(m));}return a}function kt(i,t){let e=[];for(let o=0;o<i.length;o+=t.maxBatchSize)e.push(i.slice(o,o+t.maxBatchSize));return e}var le=class extends Error{constructor(t){var e;super(t.message),this.name=this.constructor.name,this.code=t.code,this.statusCode=t.statusCode,this.details=t.details,this.originalError=t.originalError,k.error(this.message),(e=Error.captureStackTrace)==null||e.call(Error,this,this.constructor);}toJSON(){return {name:this.name,message:this.message,code:this.code,statusCode:this.statusCode,details:this.details,originalError:this.originalError,stack:this.stack}}};var _g={DATASET_NOT_FOUND:i=>`Dataset with name '${i}' not found`,DATASET_ITEM_NOT_FOUND:i=>`Dataset item with id '${i}' not found`,DATASET_ITEM_MISSING_ID:i=>`Item at index ${i} is missing an ID required for update`,INVALID_JSON_FORMAT:i=>`Invalid JSON format${i?": "+i:""}`,JSON_NOT_ARRAY:"JSON input must be an array of objects",ITEM_NOT_OBJECT:(i,t)=>`Item at position ${i} is not an object (${t})`,INSERTION_FAILED:i=>`Failed to insert items from JSON: ${i}`,DATASET_JSON_PARSE_ERROR:i=>`Failed to parse JSON input: ${i}`};var Kb={DATASET_ITEM_MISSING_ID:"DATASET_ITEM_MISSING_ID"},Di=class extends le{constructor(t){super({message:_g.DATASET_ITEM_MISSING_ID(t),code:Kb.DATASET_ITEM_MISSING_ID});}};var Xb={SEARCH_TIMEOUT:"SEARCH_TIMEOUT"},Mi=class extends le{constructor(t){super({message:t,code:Xb.SEARCH_TIMEOUT});}};var Fi={JSON_NOT_ARRAY:i=>`JSON input must be an array of objects${i?` (${i})`:""}`,JSON_PARSE_ERROR:"Failed to parse JSON input",JSON_ITEM_NOT_OBJECT:(i,t)=>`Item at position ${i} is not an object (${t})`};var ed={JSON_PARSE_ERROR:"JSON_PARSE_ERROR",JSON_NOT_ARRAY:"JSON_NOT_ARRAY",JSON_ITEM_NOT_OBJECT:"JSON_ITEM_NOT_OBJECT"},Oi=class extends le{constructor(t){let e=t instanceof Error?t:new Error(String(t));super({message:Fi.JSON_PARSE_ERROR,code:ed.JSON_PARSE_ERROR,originalError:e});}},Wi=class extends le{constructor(t){super({message:Fi.JSON_NOT_ARRAY(t),code:ed.JSON_NOT_ARRAY});}},Bi=class extends le{constructor(t,e){super({message:Fi.JSON_ITEM_NOT_OBJECT(t,e),code:ed.JSON_ITEM_NOT_OBJECT});}};var cr=class{constructor({name:t,description:e,id:o},a){this.opik=a;this.idToHash=new Map;this.hashes=new Set;this.id=o||re(),this.name=t,this.description=e;}async insert(t){if(!t||t.length===0)return;await this.opik.datasetBatchQueue.flush(),await this.syncHashes();let e=await this.getDeduplicatedItems(t),o=kt(e,{maxBatchSize:1e3});try{let a=0;for(let n of o)await this.opik.api.datasets.createOrUpdateDatasetItems({datasetId:this.id,items:n}),a+=n.length,k.info(`Inserted ${Math.min(a,e.length)} of ${e.length} items into dataset ${this.id}`);}catch(a){throw k.error(`Error inserting items into dataset: ${a instanceof Error?a.message:String(a)}`),a}}async update(t){if(!(!t||t.length===0)){for(let e=0;e<t.length;e++)if(!t[e].id)throw new Di(e);await this.insert(t);}}async delete(t){if(!t||t.length===0){k.info("No item IDs provided for deletion");return}let e=kt(t,{maxBatchSize:100});for await(let o of e){k.debug("Deleting dataset items batch",{batchSize:o.length,datasetId:this.id}),await this.opik.api.datasets.deleteDatasetItems({itemIds:o});for(let a of o)if(this.idToHash.has(a)){let n=this.idToHash.get(a);this.hashes.delete(n),this.idToHash.delete(a);}}}async clear(){let e=(await this.getItems()).map(o=>o.id).filter(Boolean);e.length!==0&&await this.delete(e);}async getItems(t,e){return (await this.getItemsAsDataclasses(t,e)).map(a=>a.getContent(true))}async getItemsAsDataclasses(t,e){let o=t?Math.min(t,2e3):2e3,a=await this.opik.api.datasets.streamDatasetItems({datasetName:this.name,lastRetrievedId:e,steamLimit:o});return (await je(a,C.DatasetItemPublic,t)).map(c=>yt.fromApiModel(c))}async insertFromJson(t,e={},o=[]){let a;try{a=JSON.parse(t);}catch(c){throw new Oi(c)}if(!Array.isArray(a))throw new Wi(typeof a);if(a.length===0)return;for(let c=0;c<a.length;c++){let m=a[c];if(typeof m!="object"||m===null)throw new Bi(c,typeof m)}let n=a.map(c=>{let m=c,u={};for(let[g,R]of Object.entries(m)){if(o.includes(g))continue;let y=e[g]||g;u[y]=R;}return u});await this.insert(n);}async toJson(t={}){let o=(await this.getItems()).map(a=>{let n={...a};if(Object.keys(t).length>0){for(let[c,m]of Object.entries(t))if(c in n){let u=n[c];delete n[c],n[m]=u;}}return n});return Hb__default.default(o)}async getDeduplicatedItems(t){let e=[];for(let o of t){let a=new yt(o),n=await a.contentHash();if(this.hashes.has(n)){k.debug("Duplicate item found - skipping",{contentHash:n,datasetId:this.id});continue}e.push(a.toApiModel()),this.hashes.add(n),this.idToHash.set(a.id,n);}return e}clearHashState(){this.idToHash.clear(),this.hashes.clear();}async syncHashes(){k.debug("Syncing dataset hashes with backend",{datasetId:this.id});try{let t=await this.getItemsAsDataclasses();this.clearHashState();for(let e of t){let o=await e.contentHash();this.idToHash.set(e.id,o),this.hashes.add(o);}k.debug("Dataset hash sync completed",{datasetId:this.id,itemCount:t.length});}catch(t){if(t instanceof p&&t.statusCode===404){k.debug("Dataset not found - starting with empty hash state",{datasetId:this.id}),this.clearHashState();return}throw t}}};var rd=class extends Error{constructor(t){super(t),this.name="DatasetError";}},vt=class extends rd{constructor(t){super(`Dataset with name '${t}' not found`),this.name="DatasetNotFoundError";}};var Li=class{constructor(t){if(!t.datasetItemId)throw new Error("datasetItemId is required");if(!t.traceId)throw new Error("traceId is required");this.datasetItemId=t.datasetItemId,this.traceId=t.traceId;}},Vi=class i{constructor(t){this.id=t.id,this.datasetItemId=t.datasetItemId,this.traceId=t.traceId,this.datasetItemData=t.datasetItemData,this.evaluationTaskOutput=t.evaluationTaskOutput,this.feedbackScores=[...t.feedbackScores];}static fromRestExperimentItemCompare(t){var o,a;let e=(a=(o=t.feedbackScores)==null?void 0:o.map(n=>({categoryName:n.categoryName,name:n.name,reason:n.reason,value:n.value,source:n.source})))!=null?a:[];return new i({id:t.id,traceId:t.traceId,datasetItemId:t.datasetItemId,datasetItemData:t.input,evaluationTaskOutput:t.output,feedbackScores:e})}};var Ge=class{constructor({id:t,name:e,datasetName:o,prompts:a},n){this.opik=n;this.id=t||re(),this._name=e,this.datasetName=o,this.prompts=a;}get name(){return this._name}async ensureNameLoaded(){if(this._name!==void 0)return this._name;let t=await this.opik.api.experiments.getExperimentById(this.id);if(this._name=t.name,!this._name)throw new Error("Experiment name is not loaded");return this._name}async insert(t){if(t.length===0)return;let e=t.map(a=>({id:re(),experimentId:this.id,datasetItemId:a.datasetItemId,traceId:a.traceId})),o=kt(e,{maxBatchSize:50});try{for(let a of o)await this.opik.api.experiments.createExperimentItems({experimentItems:a});k.debug(`Inserted ${t.length} items into experiment ${this.id}`);}catch(a){throw k.error(`Error inserting items into experiment: ${a instanceof Error?a.message:String(a)}`),a}}async getItems(t){let e=[],{maxResults:a,truncate:n=false}=t||{},c,m=true;try{for(;m&&!(a!==void 0&&e.length>=a);){let u=a?Math.min(a-e.length,2e3):2e3,g=await this.opik.api.experiments.streamExperimentItems({experimentName:this.name,limit:u,lastRetrievedId:c,truncate:n});try{let R=await je(g,C.ExperimentItemCompare,u);if(R.length===0){m=!1;break}for(let y of R){let v=Vi.fromRestExperimentItemCompare(y);if(e.push(v),a!==void 0&&e.length>=a){m=!1;break}}c=R[R.length-1].id;}catch(R){k.error("Error parsing experiment item: "+(R instanceof Error?R.message:String(R))),m=!1;break}}}catch(u){throw k.error("Error retrieving experiment items: "+(u instanceof Error?u.message:String(u))),u}return k.info(`Retrieved ${e.length} items${a?` (limited by maxResults=${a})`:""}`),e}async getUrl(){let t=await this.opik.getDataset(this.datasetName),e=this.opik.config.apiUrl||cn.apiUrl;return vg({datasetId:t.id,experimentId:this.id,baseUrl:e})}};var Hi={EXPERIMENT_NOT_FOUND:i=>`Experiment with name '${i}' not found`,INVALID_CONFIG_TYPE:i=>`experimentConfig must be a plain object, but ${i} was provided. Please provide a valid configuration object like { model: 'gpt-4', temperature: 0.7 }`,CONFIG_PROMPTS_CONFLICT:()=>`Cannot specify both 'prompts' parameter and 'experimentConfig.prompts'. Choose one approach:
|
|
6
6
|
1. Use prompts parameter: buildMetadataAndPromptVersions(config, [prompt1, prompt2])
|
|
7
7
|
2. Use config only: buildMetadataAndPromptVersions({ ...config, prompts: {...} })
|